From ec78f1cebcbf1181d93450bd9c91efe8f6a7688d Mon Sep 17 00:00:00 2001 From: Henrik Kjellander Date: Thu, 29 Jun 2017 07:52:50 +0200 Subject: [PATCH] Revert "Move webrtc/{base => rtc_base}" (https://codereview.webrtc.org/2877023002) Will reland in two different commits to preserve git blame history. BUG=webrtc:7634 NOTRY=True TBR=kwiberg@webrtc.org Change-Id: I550da8525aeb9c5b8f96338fcf1c9714f3dcdab1 Reviewed-on: https://chromium-review.googlesource.com/554610 Reviewed-by: Henrik Kjellander Cr-Commit-Position: refs/heads/master@{#18820} --- PRESUBMIT.py | 1 - webrtc/DEPS | 1 - webrtc/base/BUILD.gn | 986 +++- webrtc/{rtc_base => base}/DEPS | 0 webrtc/base/Dummy.java | 9 - webrtc/{rtc_base => base}/OWNERS | 0 webrtc/{rtc_base => base}/applefilesystem.mm | 0 webrtc/base/array_view.h | 240 +- .../{rtc_base => base}/array_view_unittest.cc | 0 webrtc/base/arraysize.h | 18 +- webrtc/base/asyncinvoker-inl.h | 43 +- webrtc/{rtc_base => base}/asyncinvoker.cc | 0 webrtc/base/asyncinvoker.h | 208 +- .../{rtc_base => base}/asyncpacketsocket.cc | 0 webrtc/base/asyncpacketsocket.h | 130 +- .../asyncresolverinterface.cc | 0 webrtc/base/asyncresolverinterface.h | 34 +- webrtc/{rtc_base => base}/asyncsocket.cc | 0 webrtc/base/asyncsocket.h | 70 +- webrtc/{rtc_base => base}/asynctcpsocket.cc | 0 webrtc/base/asynctcpsocket.h | 95 +- .../asynctcpsocket_unittest.cc | 0 webrtc/{rtc_base => base}/asyncudpsocket.cc | 0 webrtc/base/asyncudpsocket.h | 54 +- .../asyncudpsocket_unittest.cc | 0 webrtc/base/atomicops.h | 74 +- .../{rtc_base => base}/atomicops_unittest.cc | 0 webrtc/{rtc_base => base}/base64.cc | 0 webrtc/base/base64.h | 115 +- webrtc/{rtc_base => base}/base64_unittest.cc | 0 webrtc/base/basictypes.h | 57 +- .../{rtc_base => base}/basictypes_unittest.cc | 0 webrtc/base/bind.h | 221 +- webrtc/{rtc_base => base}/bind_unittest.cc | 0 webrtc/{rtc_base => base}/bitbuffer.cc | 0 webrtc/base/bitbuffer.h | 113 +- .../{rtc_base => base}/bitbuffer_unittest.cc | 0 webrtc/base/buffer.h | 371 +- webrtc/{rtc_base => base}/buffer_unittest.cc | 0 webrtc/{rtc_base => base}/bufferqueue.cc | 0 webrtc/base/bufferqueue.h | 48 +- .../bufferqueue_unittest.cc | 0 webrtc/{rtc_base => base}/bytebuffer.cc | 0 webrtc/base/bytebuffer.h | 126 +- .../{rtc_base => base}/bytebuffer_unittest.cc | 0 webrtc/base/byteorder.h | 165 +- .../{rtc_base => base}/byteorder_unittest.cc | 0 webrtc/base/callback.h | 196 +- webrtc/{rtc_base => base}/callback.h.pump | 6 +- .../{rtc_base => base}/callback_unittest.cc | 0 webrtc/{rtc_base => base}/checks.cc | 0 webrtc/base/checks.h | 276 +- webrtc/base/compile_assert_c.h | 9 +- webrtc/base/constructormagic.h | 21 +- .../{rtc_base => base}/copyonwritebuffer.cc | 0 webrtc/base/copyonwritebuffer.h | 228 +- .../copyonwritebuffer_unittest.cc | 0 webrtc/{rtc_base => base}/cpu_time.cc | 0 webrtc/base/cpu_time.h | 15 +- .../{rtc_base => base}/cpu_time_unittest.cc | 0 webrtc/{rtc_base => base}/crc32.cc | 0 webrtc/base/crc32.h | 21 +- webrtc/{rtc_base => base}/crc32_unittest.cc | 0 webrtc/{rtc_base => base}/criticalsection.cc | 0 webrtc/base/criticalsection.h | 144 +- .../criticalsection_unittest.cc | 0 webrtc/{rtc_base => base}/cryptstring.cc | 0 webrtc/base/cryptstring.h | 160 +- webrtc/base/deprecation.h | 34 +- webrtc/base/dscp.h | 34 +- webrtc/{rtc_base => base}/event.cc | 0 webrtc/base/event.h | 47 +- webrtc/{rtc_base => base}/event_tracer.cc | 0 webrtc/base/event_tracer.h | 57 +- .../event_tracer_unittest.cc | 0 webrtc/{rtc_base => base}/event_unittest.cc | 0 webrtc/{rtc_base => base}/fakeclock.cc | 0 webrtc/base/fakeclock.h | 58 +- webrtc/base/fakenetwork.h | 116 +- webrtc/base/fakesslidentity.h | 107 +- webrtc/{rtc_base => base}/file.cc | 0 webrtc/base/file.h | 69 +- webrtc/{rtc_base => base}/file_posix.cc | 0 webrtc/{rtc_base => base}/file_unittest.cc | 0 webrtc/{rtc_base => base}/file_win.cc | 0 .../{rtc_base => base}/filerotatingstream.cc | 0 webrtc/base/filerotatingstream.h | 160 +- .../filerotatingstream_unittest.cc | 0 webrtc/{rtc_base => base}/fileutils.cc | 0 webrtc/base/fileutils.h | 170 +- .../{rtc_base => base}/fileutils_unittest.cc | 0 .../firewallsocketserver.cc | 0 webrtc/base/firewallsocketserver.h | 112 +- webrtc/{rtc_base => base}/flags.cc | 0 webrtc/base/flags.h | 249 +- webrtc/base/format_macros.h | 83 +- webrtc/base/function_view.h | 117 +- .../function_view_unittest.cc | 0 webrtc/base/gtest_prod_util.h | 25 +- webrtc/base/gunit.h | 137 +- webrtc/base/gunit_prod.h | 12 +- webrtc/{rtc_base => base}/helpers.cc | 0 webrtc/base/helpers.h | 51 +- webrtc/{rtc_base => base}/helpers_unittest.cc | 0 webrtc/{rtc_base => base}/httpbase.cc | 0 webrtc/base/httpbase.h | 179 +- .../{rtc_base => base}/httpbase_unittest.cc | 0 webrtc/base/httpcommon-inl.h | 125 +- webrtc/{rtc_base => base}/httpcommon.cc | 0 webrtc/base/httpcommon.h | 451 +- .../{rtc_base => base}/httpcommon_unittest.cc | 0 webrtc/{rtc_base => base}/httpserver.cc | 0 webrtc/base/httpserver.h | 132 +- .../{rtc_base => base}/httpserver_unittest.cc | 0 webrtc/{rtc_base => base}/ifaddrs-android.cc | 0 webrtc/base/ifaddrs-android.h | 26 +- .../{rtc_base => base}/ifaddrs_converter.cc | 0 webrtc/base/ifaddrs_converter.h | 32 +- webrtc/base/ignore_wundef.h | 20 +- webrtc/{rtc_base => base}/ipaddress.cc | 0 webrtc/base/ipaddress.h | 175 +- .../{rtc_base => base}/ipaddress_unittest.cc | 0 .../java/src/org/webrtc/ContextUtils.java | 0 .../java/src/org/webrtc/Logging.java | 0 .../java/src/org/webrtc/OWNERS | 0 .../java/src/org/webrtc/Size.java | 0 .../java/src/org/webrtc/ThreadUtils.java | 0 webrtc/{rtc_base => base}/json.cc | 0 webrtc/base/json.h | 78 +- webrtc/{rtc_base => base}/json_unittest.cc | 0 webrtc/base/keep_ref_until_done.h | 30 +- webrtc/{rtc_base => base}/location.cc | 0 webrtc/base/location.h | 44 +- webrtc/{rtc_base => base}/logging.cc | 0 webrtc/base/logging.h | 322 +- webrtc/{rtc_base => base}/logging_mac.mm | 0 webrtc/{rtc_base => base}/logging_unittest.cc | 0 webrtc/{rtc_base => base}/logsinks.cc | 0 webrtc/base/logsinks.h | 61 +- .../macifaddrs_converter.cc | 0 webrtc/{rtc_base => base}/macutils.cc | 0 webrtc/base/macutils.h | 43 +- .../{rtc_base => base}/macutils_unittest.cc | 0 webrtc/base/mathutils.h | 26 +- webrtc/{rtc_base => base}/md5.cc | 0 webrtc/base/md5.h | 19 +- webrtc/{rtc_base => base}/md5digest.cc | 0 webrtc/base/md5digest.h | 23 +- .../{rtc_base => base}/md5digest_unittest.cc | 0 webrtc/{rtc_base => base}/memory_usage.cc | 0 webrtc/base/memory_usage.h | 12 +- .../memory_usage_unittest.cc | 0 webrtc/{rtc_base => base}/messagedigest.cc | 0 webrtc/base/messagedigest.h | 96 +- .../messagedigest_unittest.cc | 0 webrtc/{rtc_base => base}/messagehandler.cc | 0 webrtc/base/messagehandler.h | 62 +- webrtc/{rtc_base => base}/messagequeue.cc | 0 webrtc/base/messagequeue.h | 314 +- .../messagequeue_unittest.cc | 0 webrtc/base/mod_ops.h | 122 +- webrtc/{rtc_base => base}/mod_ops_unittest.cc | 0 webrtc/{rtc_base => base}/nat_unittest.cc | 0 webrtc/{rtc_base => base}/natserver.cc | 0 webrtc/base/natserver.h | 111 +- webrtc/{rtc_base => base}/natsocketfactory.cc | 0 webrtc/base/natsocketfactory.h | 155 +- webrtc/{rtc_base => base}/nattypes.cc | 0 webrtc/base/nattypes.h | 40 +- webrtc/{rtc_base => base}/nethelpers.cc | 0 webrtc/base/nethelpers.h | 53 +- webrtc/{rtc_base => base}/network.cc | 0 webrtc/base/network.h | 421 +- webrtc/{rtc_base => base}/network_unittest.cc | 0 webrtc/{rtc_base => base}/networkmonitor.cc | 0 webrtc/base/networkmonitor.h | 115 +- webrtc/base/networkroute.h | 40 +- webrtc/{rtc_base => base}/nullsocketserver.cc | 0 webrtc/base/nullsocketserver.h | 25 +- .../nullsocketserver_unittest.cc | 0 .../{rtc_base => base}/numerics/exp_filter.cc | 0 webrtc/base/numerics/exp_filter.h | 35 +- .../numerics/exp_filter_unittest.cc | 0 webrtc/base/numerics/percentile_filter.h | 102 +- .../numerics/percentile_filter_unittest.cc | 0 webrtc/base/onetimeevent.h | 48 +- .../onetimeevent_unittest.cc | 0 webrtc/base/openssl.h | 7 +- webrtc/{rtc_base => base}/openssladapter.cc | 0 webrtc/base/openssladapter.h | 105 +- webrtc/{rtc_base => base}/openssldigest.cc | 0 webrtc/base/openssldigest.h | 37 +- webrtc/{rtc_base => base}/opensslidentity.cc | 0 webrtc/base/opensslidentity.h | 134 +- .../opensslstreamadapter.cc | 0 webrtc/base/opensslstreamadapter.h | 219 +- webrtc/{rtc_base => base}/optional.cc | 0 webrtc/base/optional.h | 396 +- .../{rtc_base => base}/optional_unittest.cc | 0 webrtc/{rtc_base => base}/optionsfile.cc | 0 webrtc/base/optionsfile.h | 37 +- .../optionsfile_unittest.cc | 0 webrtc/{rtc_base => base}/pathutils.cc | 0 webrtc/base/pathutils.h | 86 +- .../{rtc_base => base}/pathutils_unittest.cc | 0 .../physicalsocketserver.cc | 0 webrtc/base/physicalsocketserver.h | 263 +- .../physicalsocketserver_unittest.cc | 0 webrtc/{rtc_base => base}/platform_file.cc | 0 webrtc/base/platform_file.h | 43 +- webrtc/{rtc_base => base}/platform_thread.cc | 0 webrtc/base/platform_thread.h | 111 +- webrtc/base/platform_thread_types.h | 19 +- .../platform_thread_unittest.cc | 0 webrtc/base/protobuf_utils.h | 21 +- webrtc/{rtc_base => base}/proxy_unittest.cc | 0 webrtc/{rtc_base => base}/proxyinfo.cc | 0 webrtc/base/proxyinfo.h | 36 +- webrtc/{rtc_base => base}/proxyserver.cc | 0 webrtc/base/proxyserver.h | 87 +- webrtc/base/ptr_util.h | 67 +- .../{rtc_base => base}/ptr_util_unittest.cc | 0 webrtc/{rtc_base => base}/race_checker.cc | 0 webrtc/base/race_checker.h | 65 +- webrtc/{rtc_base => base}/random.cc | 0 webrtc/base/random.h | 80 +- webrtc/{rtc_base => base}/random_unittest.cc | 0 webrtc/{rtc_base => base}/rate_limiter.cc | 0 webrtc/base/rate_limiter.h | 43 +- .../rate_limiter_unittest.cc | 0 webrtc/{rtc_base => base}/rate_statistics.cc | 0 webrtc/base/rate_statistics.h | 71 +- .../rate_statistics_unittest.cc | 0 webrtc/{rtc_base => base}/ratelimiter.cc | 0 webrtc/base/ratelimiter.h | 49 +- .../ratelimiter_unittest.cc | 0 webrtc/{rtc_base => base}/ratetracker.cc | 0 webrtc/base/ratetracker.h | 56 +- .../ratetracker_unittest.cc | 0 webrtc/base/refcount.h | 17 +- webrtc/base/refcountedobject.h | 49 +- .../refcountedobject_unittest.cc | 0 webrtc/base/rollingaccumulator.h | 161 +- .../rollingaccumulator_unittest.cc | 0 webrtc/{rtc_base => base}/rtccertificate.cc | 0 webrtc/base/rtccertificate.h | 74 +- .../rtccertificate_unittest.cc | 0 .../rtccertificategenerator.cc | 0 webrtc/base/rtccertificategenerator.h | 73 +- .../rtccertificategenerator_unittest.cc | 0 webrtc/base/safe_compare.h | 143 +- .../safe_compare_unittest.cc | 0 webrtc/base/safe_conversions.h | 61 +- webrtc/base/safe_conversions_impl.h | 173 +- webrtc/base/safe_minmax.h | 323 +- .../safe_minmax_unittest.cc | 0 webrtc/base/sanitizer.h | 103 +- webrtc/base/scoped_ref_ptr.h | 98 +- webrtc/base/sequenced_task_checker.h | 65 +- .../sequenced_task_checker_impl.cc | 0 webrtc/base/sequenced_task_checker_impl.h | 32 +- .../sequenced_task_checker_unittest.cc | 0 webrtc/{rtc_base => base}/sha1.cc | 0 webrtc/base/sha1.h | 21 +- webrtc/{rtc_base => base}/sha1digest.cc | 0 webrtc/base/sha1digest.h | 23 +- .../{rtc_base => base}/sha1digest_unittest.cc | 0 webrtc/{rtc_base => base}/signalthread.cc | 0 webrtc/base/signalthread.h | 148 +- .../signalthread_unittest.cc | 0 webrtc/{rtc_base => base}/sigslot.cc | 0 webrtc/base/sigslot.h | 555 ++- webrtc/{rtc_base => base}/sigslot_unittest.cc | 0 webrtc/base/sigslottester.h | 199 +- .../{rtc_base => base}/sigslottester.h.pump | 6 +- .../sigslottester_unittest.cc | 0 webrtc/base/socket.h | 190 +- webrtc/{rtc_base => base}/socket_unittest.cc | 0 webrtc/base/socket_unittest.h | 87 +- webrtc/{rtc_base => base}/socketadapters.cc | 0 webrtc/base/socketadapters.h | 194 +- webrtc/{rtc_base => base}/socketaddress.cc | 0 webrtc/base/socketaddress.h | 184 +- .../socketaddress_unittest.cc | 0 .../{rtc_base => base}/socketaddresspair.cc | 0 webrtc/base/socketaddresspair.h | 34 +- webrtc/base/socketfactory.h | 31 +- webrtc/base/socketserver.h | 49 +- webrtc/{rtc_base => base}/socketstream.cc | 0 webrtc/base/socketstream.h | 48 +- webrtc/{rtc_base => base}/ssladapter.cc | 0 webrtc/base/ssladapter.h | 52 +- .../{rtc_base => base}/ssladapter_unittest.cc | 0 webrtc/{rtc_base => base}/sslfingerprint.cc | 0 webrtc/base/sslfingerprint.h | 44 +- webrtc/{rtc_base => base}/sslidentity.cc | 0 webrtc/base/sslidentity.h | 259 +- .../sslidentity_unittest.cc | 0 webrtc/base/sslroots.h | 4 - webrtc/{rtc_base => base}/sslstreamadapter.cc | 0 webrtc/base/sslstreamadapter.h | 262 +- .../sslstreamadapter_unittest.cc | 0 webrtc/{rtc_base => base}/stream.cc | 0 webrtc/base/stream.h | 702 ++- webrtc/{rtc_base => base}/stream_unittest.cc | 0 webrtc/{rtc_base => base}/string_to_number.cc | 0 webrtc/base/string_to_number.h | 88 +- .../string_to_number_unittest.cc | 0 webrtc/{rtc_base => base}/stringencode.cc | 0 webrtc/base/stringencode.h | 211 +- .../stringencode_unittest.cc | 0 webrtc/base/stringize_macros.h | 18 +- .../stringize_macros_unittest.cc | 0 webrtc/{rtc_base => base}/stringutils.cc | 0 webrtc/base/stringutils.h | 309 +- .../stringutils_unittest.cc | 0 webrtc/base/swap_queue.h | 198 +- .../{rtc_base => base}/swap_queue_unittest.cc | 0 webrtc/base/task_queue.h | 293 +- webrtc/{rtc_base => base}/task_queue_gcd.cc | 0 .../{rtc_base => base}/task_queue_libevent.cc | 0 webrtc/{rtc_base => base}/task_queue_posix.cc | 0 webrtc/base/task_queue_posix.h | 23 +- .../{rtc_base => base}/task_queue_unittest.cc | 0 webrtc/{rtc_base => base}/task_queue_win.cc | 0 webrtc/base/template_util.h | 112 +- webrtc/base/testbase64.h | 22 +- webrtc/{rtc_base => base}/testclient.cc | 0 webrtc/base/testclient.h | 101 +- .../{rtc_base => base}/testclient_unittest.cc | 0 webrtc/base/testechoserver.h | 62 +- webrtc/base/testutils.h | 559 ++- webrtc/{rtc_base => base}/thread.cc | 0 webrtc/base/thread.h | 319 +- webrtc/base/thread_annotations.h | 79 +- .../thread_annotations_unittest.cc | 0 webrtc/base/thread_checker.h | 163 +- .../{rtc_base => base}/thread_checker_impl.cc | 0 webrtc/base/thread_checker_impl.h | 33 +- .../thread_checker_unittest.cc | 0 webrtc/{rtc_base => base}/thread_darwin.mm | 0 webrtc/{rtc_base => base}/thread_unittest.cc | 0 webrtc/base/timedelta.h | 116 +- webrtc/{rtc_base => base}/timestampaligner.cc | 0 webrtc/base/timestampaligner.h | 61 +- .../timestampaligner_unittest.cc | 0 webrtc/{rtc_base => base}/timeutils.cc | 0 webrtc/base/timeutils.h | 116 +- .../{rtc_base => base}/timeutils_unittest.cc | 0 webrtc/base/trace_event.h | 902 +++- webrtc/{rtc_base => base}/transformadapter.cc | 0 webrtc/base/transformadapter.h | 77 +- webrtc/base/type_traits.h | 127 +- webrtc/{rtc_base => base}/unittest_main.cc | 0 webrtc/{rtc_base => base}/unixfilesystem.cc | 0 webrtc/base/unixfilesystem.h | 76 +- .../virtualsocket_unittest.cc | 0 .../{rtc_base => base}/virtualsocketserver.cc | 0 webrtc/base/virtualsocketserver.h | 387 +- webrtc/{rtc_base => base}/weak_ptr.cc | 0 webrtc/base/weak_ptr.h | 259 +- .../{rtc_base => base}/weak_ptr_unittest.cc | 0 webrtc/{rtc_base => base}/win32.cc | 0 webrtc/base/win32.h | 115 +- webrtc/{rtc_base => base}/win32_unittest.cc | 0 webrtc/{rtc_base => base}/win32filesystem.cc | 0 webrtc/base/win32filesystem.h | 57 +- .../{rtc_base => base}/win32securityerrors.cc | 0 webrtc/{rtc_base => base}/win32socketinit.cc | 0 webrtc/base/win32socketinit.h | 7 +- .../{rtc_base => base}/win32socketserver.cc | 0 webrtc/base/win32socketserver.h | 149 +- .../win32socketserver_unittest.cc | 0 webrtc/{rtc_base => base}/win32window.cc | 0 webrtc/base/win32window.h | 47 +- .../win32window_unittest.cc | 0 webrtc/base/window.h | 65 +- webrtc/examples/BUILD.gn | 4 +- webrtc/modules/audio_device/BUILD.gn | 2 +- webrtc/rtc_base/BUILD.gn | 1027 +--- webrtc/rtc_base/array_view.h | 253 - webrtc/rtc_base/arraysize.h | 31 - webrtc/rtc_base/asyncinvoker-inl.h | 56 - webrtc/rtc_base/asyncinvoker.h | 221 - webrtc/rtc_base/asyncpacketsocket.h | 143 - webrtc/rtc_base/asyncresolverinterface.h | 47 - webrtc/rtc_base/asyncsocket.h | 83 - webrtc/rtc_base/asynctcpsocket.h | 108 - webrtc/rtc_base/asyncudpsocket.h | 67 - webrtc/rtc_base/atomicops.h | 87 - webrtc/rtc_base/base64.h | 123 - webrtc/rtc_base/basictypes.h | 70 - webrtc/rtc_base/bind.h | 284 -- webrtc/rtc_base/bitbuffer.h | 126 - webrtc/rtc_base/buffer.h | 383 -- webrtc/rtc_base/bufferqueue.h | 61 - webrtc/rtc_base/bytebuffer.h | 139 - webrtc/rtc_base/byteorder.h | 178 - webrtc/rtc_base/callback.h | 260 - webrtc/rtc_base/checks.h | 289 -- webrtc/rtc_base/compile_assert_c.h | 21 - webrtc/rtc_base/constructormagic.h | 34 - webrtc/rtc_base/copyonwritebuffer.h | 241 - webrtc/rtc_base/cpu_time.h | 28 - webrtc/rtc_base/crc32.h | 34 - webrtc/rtc_base/criticalsection.h | 156 - webrtc/rtc_base/cryptstring.h | 167 - webrtc/rtc_base/deprecation.h | 45 - webrtc/rtc_base/dscp.h | 45 - webrtc/rtc_base/event.h | 54 - webrtc/rtc_base/event_tracer.h | 85 - webrtc/rtc_base/fakeclock.h | 71 - webrtc/rtc_base/fakenetwork.h | 129 - webrtc/rtc_base/fakesslidentity.h | 120 - webrtc/rtc_base/file.h | 82 - webrtc/rtc_base/filerotatingstream.h | 173 - webrtc/rtc_base/fileutils.h | 182 - webrtc/rtc_base/firewallsocketserver.h | 125 - webrtc/rtc_base/flags.h | 268 -- webrtc/rtc_base/format_macros.h | 96 - webrtc/rtc_base/function_view.h | 130 - webrtc/rtc_base/gtest_prod_util.h | 38 - webrtc/rtc_base/gunit.h | 150 - webrtc/rtc_base/gunit_prod.h | 24 - webrtc/rtc_base/helpers.h | 64 - webrtc/rtc_base/httpbase.h | 187 - webrtc/rtc_base/httpcommon-inl.h | 132 - webrtc/rtc_base/httpcommon.h | 458 -- webrtc/rtc_base/httpserver.h | 139 - webrtc/rtc_base/ifaddrs-android.h | 39 - webrtc/rtc_base/ifaddrs_converter.h | 45 - webrtc/rtc_base/ignore_wundef.h | 33 - webrtc/rtc_base/ipaddress.h | 188 - webrtc/rtc_base/json.h | 91 - webrtc/rtc_base/keep_ref_until_done.h | 43 - webrtc/rtc_base/location.h | 57 - webrtc/rtc_base/logging.h | 370 -- webrtc/rtc_base/logsinks.h | 68 - webrtc/rtc_base/macutils.h | 50 - webrtc/rtc_base/mathutils.h | 39 - webrtc/rtc_base/md5.h | 44 - webrtc/rtc_base/md5digest.h | 36 - webrtc/rtc_base/memory_usage.h | 24 - webrtc/rtc_base/messagedigest.h | 109 - webrtc/rtc_base/messagehandler.h | 75 - webrtc/rtc_base/messagequeue.h | 327 -- webrtc/rtc_base/mod_ops.h | 135 - webrtc/rtc_base/natserver.h | 124 - webrtc/rtc_base/natsocketfactory.h | 168 - webrtc/rtc_base/nattypes.h | 47 - webrtc/rtc_base/nethelpers.h | 66 - webrtc/rtc_base/network.h | 434 -- webrtc/rtc_base/networkmonitor.h | 128 - webrtc/rtc_base/networkroute.h | 53 - webrtc/rtc_base/nullsocketserver.h | 38 - webrtc/rtc_base/numerics/exp_filter.h | 48 - webrtc/rtc_base/numerics/percentile_filter.h | 115 - webrtc/rtc_base/onetimeevent.h | 61 - webrtc/rtc_base/openssl.h | 20 - webrtc/rtc_base/openssladapter.h | 113 - webrtc/rtc_base/openssldigest.h | 50 - webrtc/rtc_base/opensslidentity.h | 147 - webrtc/rtc_base/opensslstreamadapter.h | 226 - webrtc/rtc_base/optional.h | 409 -- webrtc/rtc_base/optionsfile.h | 50 - webrtc/rtc_base/pathutils.h | 93 - webrtc/rtc_base/physicalsocketserver.h | 270 -- webrtc/rtc_base/platform_file.h | 56 - webrtc/rtc_base/platform_thread.h | 124 - webrtc/rtc_base/platform_thread_types.h | 32 - webrtc/rtc_base/protobuf_utils.h | 36 - webrtc/rtc_base/proxyinfo.h | 43 - webrtc/rtc_base/proxyserver.h | 100 - webrtc/rtc_base/ptr_util.h | 82 - webrtc/rtc_base/race_checker.h | 78 - webrtc/rtc_base/random.h | 93 - webrtc/rtc_base/rate_limiter.h | 56 - webrtc/rtc_base/rate_statistics.h | 84 - webrtc/rtc_base/ratelimiter.h | 62 - webrtc/rtc_base/ratetracker.h | 69 - webrtc/rtc_base/refcount.h | 29 - webrtc/rtc_base/refcountedobject.h | 61 - webrtc/rtc_base/rollingaccumulator.h | 174 - webrtc/rtc_base/rtccertificate.h | 87 - webrtc/rtc_base/rtccertificategenerator.h | 86 - webrtc/rtc_base/safe_compare.h | 176 - webrtc/rtc_base/safe_conversions.h | 76 - webrtc/rtc_base/safe_conversions_impl.h | 188 - webrtc/rtc_base/safe_minmax.h | 335 -- webrtc/rtc_base/sanitizer.h | 116 - webrtc/rtc_base/scoped_ref_ptr.h | 163 - webrtc/rtc_base/sequenced_task_checker.h | 78 - webrtc/rtc_base/sequenced_task_checker_impl.h | 45 - webrtc/rtc_base/sha1.h | 33 - webrtc/rtc_base/sha1digest.h | 36 - webrtc/rtc_base/signalthread.h | 161 - webrtc/rtc_base/sigslot.h | 647 --- webrtc/rtc_base/sigslottester.h | 216 - webrtc/rtc_base/socket.h | 197 - webrtc/rtc_base/socket_unittest.h | 100 - webrtc/rtc_base/socketadapters.h | 207 - webrtc/rtc_base/socketaddress.h | 197 - webrtc/rtc_base/socketaddresspair.h | 41 - webrtc/rtc_base/socketfactory.h | 38 - webrtc/rtc_base/socketserver.h | 62 - webrtc/rtc_base/socketstream.h | 61 - webrtc/rtc_base/ssladapter.h | 65 - webrtc/rtc_base/sslfingerprint.h | 57 - webrtc/rtc_base/sslidentity.h | 274 -- webrtc/rtc_base/sslroots.h | 4270 ----------------- webrtc/rtc_base/sslstreamadapter.h | 275 -- webrtc/rtc_base/stream.h | 715 --- webrtc/rtc_base/string_to_number.h | 101 - webrtc/rtc_base/stringencode.h | 224 - webrtc/rtc_base/stringize_macros.h | 38 - webrtc/rtc_base/stringutils.h | 316 -- webrtc/rtc_base/swap_queue.h | 211 - webrtc/rtc_base/task_queue.h | 306 -- webrtc/rtc_base/task_queue_posix.h | 36 - webrtc/rtc_base/template_util.h | 127 - webrtc/rtc_base/testbase64.h | 20 - webrtc/rtc_base/testclient.h | 114 - webrtc/rtc_base/testechoserver.h | 75 - webrtc/rtc_base/testutils.h | 566 --- webrtc/rtc_base/thread.h | 332 -- webrtc/rtc_base/thread_annotations.h | 100 - webrtc/rtc_base/thread_checker.h | 178 - webrtc/rtc_base/thread_checker_impl.h | 48 - webrtc/rtc_base/timedelta.h | 129 - webrtc/rtc_base/timestampaligner.h | 74 - webrtc/rtc_base/timeutils.h | 129 - webrtc/rtc_base/trace_event.h | 910 ---- webrtc/rtc_base/transformadapter.h | 84 - webrtc/rtc_base/type_traits.h | 140 - webrtc/rtc_base/unixfilesystem.h | 89 - webrtc/rtc_base/virtualsocketserver.h | 400 -- webrtc/rtc_base/weak_ptr.h | 272 -- webrtc/rtc_base/win32.h | 128 - webrtc/rtc_base/win32filesystem.h | 64 - webrtc/rtc_base/win32socketinit.h | 20 - webrtc/rtc_base/win32socketserver.h | 162 - webrtc/rtc_base/win32window.h | 60 - webrtc/rtc_base/window.h | 78 - webrtc/sdk/android/BUILD.gn | 8 +- webrtc/test/BUILD.gn | 2 +- webrtc/tools/network_tester/BUILD.gn | 4 +- 546 files changed, 20456 insertions(+), 28300 deletions(-) rename webrtc/{rtc_base => base}/DEPS (100%) delete mode 100644 webrtc/base/Dummy.java rename webrtc/{rtc_base => base}/OWNERS (100%) rename webrtc/{rtc_base => base}/applefilesystem.mm (100%) rename webrtc/{rtc_base => base}/array_view_unittest.cc (100%) rename webrtc/{rtc_base => base}/asyncinvoker.cc (100%) rename webrtc/{rtc_base => base}/asyncpacketsocket.cc (100%) rename webrtc/{rtc_base => base}/asyncresolverinterface.cc (100%) rename webrtc/{rtc_base => base}/asyncsocket.cc (100%) rename webrtc/{rtc_base => base}/asynctcpsocket.cc (100%) rename webrtc/{rtc_base => base}/asynctcpsocket_unittest.cc (100%) rename webrtc/{rtc_base => base}/asyncudpsocket.cc (100%) rename webrtc/{rtc_base => base}/asyncudpsocket_unittest.cc (100%) rename webrtc/{rtc_base => base}/atomicops_unittest.cc (100%) rename webrtc/{rtc_base => base}/base64.cc (100%) rename webrtc/{rtc_base => base}/base64_unittest.cc (100%) rename webrtc/{rtc_base => base}/basictypes_unittest.cc (100%) rename webrtc/{rtc_base => base}/bind_unittest.cc (100%) rename webrtc/{rtc_base => base}/bitbuffer.cc (100%) rename webrtc/{rtc_base => base}/bitbuffer_unittest.cc (100%) rename webrtc/{rtc_base => base}/buffer_unittest.cc (100%) rename webrtc/{rtc_base => base}/bufferqueue.cc (100%) rename webrtc/{rtc_base => base}/bufferqueue_unittest.cc (100%) rename webrtc/{rtc_base => base}/bytebuffer.cc (100%) rename webrtc/{rtc_base => base}/bytebuffer_unittest.cc (100%) rename webrtc/{rtc_base => base}/byteorder_unittest.cc (100%) rename webrtc/{rtc_base => base}/callback.h.pump (96%) rename webrtc/{rtc_base => base}/callback_unittest.cc (100%) rename webrtc/{rtc_base => base}/checks.cc (100%) rename webrtc/{rtc_base => base}/copyonwritebuffer.cc (100%) rename webrtc/{rtc_base => base}/copyonwritebuffer_unittest.cc (100%) rename webrtc/{rtc_base => base}/cpu_time.cc (100%) rename webrtc/{rtc_base => base}/cpu_time_unittest.cc (100%) rename webrtc/{rtc_base => base}/crc32.cc (100%) rename webrtc/{rtc_base => base}/crc32_unittest.cc (100%) rename webrtc/{rtc_base => base}/criticalsection.cc (100%) rename webrtc/{rtc_base => base}/criticalsection_unittest.cc (100%) rename webrtc/{rtc_base => base}/cryptstring.cc (100%) rename webrtc/{rtc_base => base}/event.cc (100%) rename webrtc/{rtc_base => base}/event_tracer.cc (100%) rename webrtc/{rtc_base => base}/event_tracer_unittest.cc (100%) rename webrtc/{rtc_base => base}/event_unittest.cc (100%) rename webrtc/{rtc_base => base}/fakeclock.cc (100%) rename webrtc/{rtc_base => base}/file.cc (100%) rename webrtc/{rtc_base => base}/file_posix.cc (100%) rename webrtc/{rtc_base => base}/file_unittest.cc (100%) rename webrtc/{rtc_base => base}/file_win.cc (100%) rename webrtc/{rtc_base => base}/filerotatingstream.cc (100%) rename webrtc/{rtc_base => base}/filerotatingstream_unittest.cc (100%) rename webrtc/{rtc_base => base}/fileutils.cc (100%) rename webrtc/{rtc_base => base}/fileutils_unittest.cc (100%) rename webrtc/{rtc_base => base}/firewallsocketserver.cc (100%) rename webrtc/{rtc_base => base}/flags.cc (100%) rename webrtc/{rtc_base => base}/function_view_unittest.cc (100%) rename webrtc/{rtc_base => base}/helpers.cc (100%) rename webrtc/{rtc_base => base}/helpers_unittest.cc (100%) rename webrtc/{rtc_base => base}/httpbase.cc (100%) rename webrtc/{rtc_base => base}/httpbase_unittest.cc (100%) rename webrtc/{rtc_base => base}/httpcommon.cc (100%) rename webrtc/{rtc_base => base}/httpcommon_unittest.cc (100%) rename webrtc/{rtc_base => base}/httpserver.cc (100%) rename webrtc/{rtc_base => base}/httpserver_unittest.cc (100%) rename webrtc/{rtc_base => base}/ifaddrs-android.cc (100%) rename webrtc/{rtc_base => base}/ifaddrs_converter.cc (100%) rename webrtc/{rtc_base => base}/ipaddress.cc (100%) rename webrtc/{rtc_base => base}/ipaddress_unittest.cc (100%) rename webrtc/{rtc_base => base}/java/src/org/webrtc/ContextUtils.java (100%) rename webrtc/{rtc_base => base}/java/src/org/webrtc/Logging.java (100%) rename webrtc/{rtc_base => base}/java/src/org/webrtc/OWNERS (100%) rename webrtc/{rtc_base => base}/java/src/org/webrtc/Size.java (100%) rename webrtc/{rtc_base => base}/java/src/org/webrtc/ThreadUtils.java (100%) rename webrtc/{rtc_base => base}/json.cc (100%) rename webrtc/{rtc_base => base}/json_unittest.cc (100%) rename webrtc/{rtc_base => base}/location.cc (100%) rename webrtc/{rtc_base => base}/logging.cc (100%) rename webrtc/{rtc_base => base}/logging_mac.mm (100%) rename webrtc/{rtc_base => base}/logging_unittest.cc (100%) rename webrtc/{rtc_base => base}/logsinks.cc (100%) rename webrtc/{rtc_base => base}/macifaddrs_converter.cc (100%) rename webrtc/{rtc_base => base}/macutils.cc (100%) rename webrtc/{rtc_base => base}/macutils_unittest.cc (100%) rename webrtc/{rtc_base => base}/md5.cc (100%) rename webrtc/{rtc_base => base}/md5digest.cc (100%) rename webrtc/{rtc_base => base}/md5digest_unittest.cc (100%) rename webrtc/{rtc_base => base}/memory_usage.cc (100%) rename webrtc/{rtc_base => base}/memory_usage_unittest.cc (100%) rename webrtc/{rtc_base => base}/messagedigest.cc (100%) rename webrtc/{rtc_base => base}/messagedigest_unittest.cc (100%) rename webrtc/{rtc_base => base}/messagehandler.cc (100%) rename webrtc/{rtc_base => base}/messagequeue.cc (100%) rename webrtc/{rtc_base => base}/messagequeue_unittest.cc (100%) rename webrtc/{rtc_base => base}/mod_ops_unittest.cc (100%) rename webrtc/{rtc_base => base}/nat_unittest.cc (100%) rename webrtc/{rtc_base => base}/natserver.cc (100%) rename webrtc/{rtc_base => base}/natsocketfactory.cc (100%) rename webrtc/{rtc_base => base}/nattypes.cc (100%) rename webrtc/{rtc_base => base}/nethelpers.cc (100%) rename webrtc/{rtc_base => base}/network.cc (100%) rename webrtc/{rtc_base => base}/network_unittest.cc (100%) rename webrtc/{rtc_base => base}/networkmonitor.cc (100%) rename webrtc/{rtc_base => base}/nullsocketserver.cc (100%) rename webrtc/{rtc_base => base}/nullsocketserver_unittest.cc (100%) rename webrtc/{rtc_base => base}/numerics/exp_filter.cc (100%) rename webrtc/{rtc_base => base}/numerics/exp_filter_unittest.cc (100%) rename webrtc/{rtc_base => base}/numerics/percentile_filter_unittest.cc (100%) rename webrtc/{rtc_base => base}/onetimeevent_unittest.cc (100%) rename webrtc/{rtc_base => base}/openssladapter.cc (100%) rename webrtc/{rtc_base => base}/openssldigest.cc (100%) rename webrtc/{rtc_base => base}/opensslidentity.cc (100%) rename webrtc/{rtc_base => base}/opensslstreamadapter.cc (100%) rename webrtc/{rtc_base => base}/optional.cc (100%) rename webrtc/{rtc_base => base}/optional_unittest.cc (100%) rename webrtc/{rtc_base => base}/optionsfile.cc (100%) rename webrtc/{rtc_base => base}/optionsfile_unittest.cc (100%) rename webrtc/{rtc_base => base}/pathutils.cc (100%) rename webrtc/{rtc_base => base}/pathutils_unittest.cc (100%) rename webrtc/{rtc_base => base}/physicalsocketserver.cc (100%) rename webrtc/{rtc_base => base}/physicalsocketserver_unittest.cc (100%) rename webrtc/{rtc_base => base}/platform_file.cc (100%) rename webrtc/{rtc_base => base}/platform_thread.cc (100%) rename webrtc/{rtc_base => base}/platform_thread_unittest.cc (100%) rename webrtc/{rtc_base => base}/proxy_unittest.cc (100%) rename webrtc/{rtc_base => base}/proxyinfo.cc (100%) rename webrtc/{rtc_base => base}/proxyserver.cc (100%) rename webrtc/{rtc_base => base}/ptr_util_unittest.cc (100%) rename webrtc/{rtc_base => base}/race_checker.cc (100%) rename webrtc/{rtc_base => base}/random.cc (100%) rename webrtc/{rtc_base => base}/random_unittest.cc (100%) rename webrtc/{rtc_base => base}/rate_limiter.cc (100%) rename webrtc/{rtc_base => base}/rate_limiter_unittest.cc (100%) rename webrtc/{rtc_base => base}/rate_statistics.cc (100%) rename webrtc/{rtc_base => base}/rate_statistics_unittest.cc (100%) rename webrtc/{rtc_base => base}/ratelimiter.cc (100%) rename webrtc/{rtc_base => base}/ratelimiter_unittest.cc (100%) rename webrtc/{rtc_base => base}/ratetracker.cc (100%) rename webrtc/{rtc_base => base}/ratetracker_unittest.cc (100%) rename webrtc/{rtc_base => base}/refcountedobject_unittest.cc (100%) rename webrtc/{rtc_base => base}/rollingaccumulator_unittest.cc (100%) rename webrtc/{rtc_base => base}/rtccertificate.cc (100%) rename webrtc/{rtc_base => base}/rtccertificate_unittest.cc (100%) rename webrtc/{rtc_base => base}/rtccertificategenerator.cc (100%) rename webrtc/{rtc_base => base}/rtccertificategenerator_unittest.cc (100%) rename webrtc/{rtc_base => base}/safe_compare_unittest.cc (100%) rename webrtc/{rtc_base => base}/safe_minmax_unittest.cc (100%) rename webrtc/{rtc_base => base}/sequenced_task_checker_impl.cc (100%) rename webrtc/{rtc_base => base}/sequenced_task_checker_unittest.cc (100%) rename webrtc/{rtc_base => base}/sha1.cc (100%) rename webrtc/{rtc_base => base}/sha1digest.cc (100%) rename webrtc/{rtc_base => base}/sha1digest_unittest.cc (100%) rename webrtc/{rtc_base => base}/signalthread.cc (100%) rename webrtc/{rtc_base => base}/signalthread_unittest.cc (100%) rename webrtc/{rtc_base => base}/sigslot.cc (100%) rename webrtc/{rtc_base => base}/sigslot_unittest.cc (100%) mode change 100644 => 100755 webrtc/base/sigslottester.h rename webrtc/{rtc_base => base}/sigslottester.h.pump (96%) rename webrtc/{rtc_base => base}/sigslottester_unittest.cc (100%) rename webrtc/{rtc_base => base}/socket_unittest.cc (100%) rename webrtc/{rtc_base => base}/socketadapters.cc (100%) rename webrtc/{rtc_base => base}/socketaddress.cc (100%) rename webrtc/{rtc_base => base}/socketaddress_unittest.cc (100%) rename webrtc/{rtc_base => base}/socketaddresspair.cc (100%) rename webrtc/{rtc_base => base}/socketstream.cc (100%) rename webrtc/{rtc_base => base}/ssladapter.cc (100%) rename webrtc/{rtc_base => base}/ssladapter_unittest.cc (100%) rename webrtc/{rtc_base => base}/sslfingerprint.cc (100%) rename webrtc/{rtc_base => base}/sslidentity.cc (100%) rename webrtc/{rtc_base => base}/sslidentity_unittest.cc (100%) rename webrtc/{rtc_base => base}/sslstreamadapter.cc (100%) rename webrtc/{rtc_base => base}/sslstreamadapter_unittest.cc (100%) rename webrtc/{rtc_base => base}/stream.cc (100%) rename webrtc/{rtc_base => base}/stream_unittest.cc (100%) rename webrtc/{rtc_base => base}/string_to_number.cc (100%) rename webrtc/{rtc_base => base}/string_to_number_unittest.cc (100%) rename webrtc/{rtc_base => base}/stringencode.cc (100%) rename webrtc/{rtc_base => base}/stringencode_unittest.cc (100%) rename webrtc/{rtc_base => base}/stringize_macros_unittest.cc (100%) rename webrtc/{rtc_base => base}/stringutils.cc (100%) rename webrtc/{rtc_base => base}/stringutils_unittest.cc (100%) rename webrtc/{rtc_base => base}/swap_queue_unittest.cc (100%) rename webrtc/{rtc_base => base}/task_queue_gcd.cc (100%) rename webrtc/{rtc_base => base}/task_queue_libevent.cc (100%) rename webrtc/{rtc_base => base}/task_queue_posix.cc (100%) rename webrtc/{rtc_base => base}/task_queue_unittest.cc (100%) rename webrtc/{rtc_base => base}/task_queue_win.cc (100%) rename webrtc/{rtc_base => base}/testclient.cc (100%) rename webrtc/{rtc_base => base}/testclient_unittest.cc (100%) rename webrtc/{rtc_base => base}/thread.cc (100%) rename webrtc/{rtc_base => base}/thread_annotations_unittest.cc (100%) rename webrtc/{rtc_base => base}/thread_checker_impl.cc (100%) rename webrtc/{rtc_base => base}/thread_checker_unittest.cc (100%) rename webrtc/{rtc_base => base}/thread_darwin.mm (100%) rename webrtc/{rtc_base => base}/thread_unittest.cc (100%) rename webrtc/{rtc_base => base}/timestampaligner.cc (100%) rename webrtc/{rtc_base => base}/timestampaligner_unittest.cc (100%) rename webrtc/{rtc_base => base}/timeutils.cc (100%) rename webrtc/{rtc_base => base}/timeutils_unittest.cc (100%) rename webrtc/{rtc_base => base}/transformadapter.cc (100%) rename webrtc/{rtc_base => base}/unittest_main.cc (100%) rename webrtc/{rtc_base => base}/unixfilesystem.cc (100%) rename webrtc/{rtc_base => base}/virtualsocket_unittest.cc (100%) rename webrtc/{rtc_base => base}/virtualsocketserver.cc (100%) rename webrtc/{rtc_base => base}/weak_ptr.cc (100%) rename webrtc/{rtc_base => base}/weak_ptr_unittest.cc (100%) rename webrtc/{rtc_base => base}/win32.cc (100%) rename webrtc/{rtc_base => base}/win32_unittest.cc (100%) rename webrtc/{rtc_base => base}/win32filesystem.cc (100%) rename webrtc/{rtc_base => base}/win32securityerrors.cc (100%) rename webrtc/{rtc_base => base}/win32socketinit.cc (100%) rename webrtc/{rtc_base => base}/win32socketserver.cc (100%) rename webrtc/{rtc_base => base}/win32socketserver_unittest.cc (100%) rename webrtc/{rtc_base => base}/win32window.cc (100%) rename webrtc/{rtc_base => base}/win32window_unittest.cc (100%) delete mode 100644 webrtc/rtc_base/array_view.h delete mode 100644 webrtc/rtc_base/arraysize.h delete mode 100644 webrtc/rtc_base/asyncinvoker-inl.h delete mode 100644 webrtc/rtc_base/asyncinvoker.h delete mode 100644 webrtc/rtc_base/asyncpacketsocket.h delete mode 100644 webrtc/rtc_base/asyncresolverinterface.h delete mode 100644 webrtc/rtc_base/asyncsocket.h delete mode 100644 webrtc/rtc_base/asynctcpsocket.h delete mode 100644 webrtc/rtc_base/asyncudpsocket.h delete mode 100644 webrtc/rtc_base/atomicops.h delete mode 100644 webrtc/rtc_base/base64.h delete mode 100644 webrtc/rtc_base/basictypes.h delete mode 100644 webrtc/rtc_base/bind.h delete mode 100644 webrtc/rtc_base/bitbuffer.h delete mode 100644 webrtc/rtc_base/buffer.h delete mode 100644 webrtc/rtc_base/bufferqueue.h delete mode 100644 webrtc/rtc_base/bytebuffer.h delete mode 100644 webrtc/rtc_base/byteorder.h delete mode 100644 webrtc/rtc_base/callback.h delete mode 100644 webrtc/rtc_base/checks.h delete mode 100644 webrtc/rtc_base/compile_assert_c.h delete mode 100644 webrtc/rtc_base/constructormagic.h delete mode 100644 webrtc/rtc_base/copyonwritebuffer.h delete mode 100644 webrtc/rtc_base/cpu_time.h delete mode 100644 webrtc/rtc_base/crc32.h delete mode 100644 webrtc/rtc_base/criticalsection.h delete mode 100644 webrtc/rtc_base/cryptstring.h delete mode 100644 webrtc/rtc_base/deprecation.h delete mode 100644 webrtc/rtc_base/dscp.h delete mode 100644 webrtc/rtc_base/event.h delete mode 100644 webrtc/rtc_base/event_tracer.h delete mode 100644 webrtc/rtc_base/fakeclock.h delete mode 100644 webrtc/rtc_base/fakenetwork.h delete mode 100644 webrtc/rtc_base/fakesslidentity.h delete mode 100644 webrtc/rtc_base/file.h delete mode 100644 webrtc/rtc_base/filerotatingstream.h delete mode 100644 webrtc/rtc_base/fileutils.h delete mode 100644 webrtc/rtc_base/firewallsocketserver.h delete mode 100644 webrtc/rtc_base/flags.h delete mode 100644 webrtc/rtc_base/format_macros.h delete mode 100644 webrtc/rtc_base/function_view.h delete mode 100644 webrtc/rtc_base/gtest_prod_util.h delete mode 100644 webrtc/rtc_base/gunit.h delete mode 100644 webrtc/rtc_base/gunit_prod.h delete mode 100644 webrtc/rtc_base/helpers.h delete mode 100644 webrtc/rtc_base/httpbase.h delete mode 100644 webrtc/rtc_base/httpcommon-inl.h delete mode 100644 webrtc/rtc_base/httpcommon.h delete mode 100644 webrtc/rtc_base/httpserver.h delete mode 100644 webrtc/rtc_base/ifaddrs-android.h delete mode 100644 webrtc/rtc_base/ifaddrs_converter.h delete mode 100644 webrtc/rtc_base/ignore_wundef.h delete mode 100644 webrtc/rtc_base/ipaddress.h delete mode 100644 webrtc/rtc_base/json.h delete mode 100644 webrtc/rtc_base/keep_ref_until_done.h delete mode 100644 webrtc/rtc_base/location.h delete mode 100644 webrtc/rtc_base/logging.h delete mode 100644 webrtc/rtc_base/logsinks.h delete mode 100644 webrtc/rtc_base/macutils.h delete mode 100644 webrtc/rtc_base/mathutils.h delete mode 100644 webrtc/rtc_base/md5.h delete mode 100644 webrtc/rtc_base/md5digest.h delete mode 100644 webrtc/rtc_base/memory_usage.h delete mode 100644 webrtc/rtc_base/messagedigest.h delete mode 100644 webrtc/rtc_base/messagehandler.h delete mode 100644 webrtc/rtc_base/messagequeue.h delete mode 100644 webrtc/rtc_base/mod_ops.h delete mode 100644 webrtc/rtc_base/natserver.h delete mode 100644 webrtc/rtc_base/natsocketfactory.h delete mode 100644 webrtc/rtc_base/nattypes.h delete mode 100644 webrtc/rtc_base/nethelpers.h delete mode 100644 webrtc/rtc_base/network.h delete mode 100644 webrtc/rtc_base/networkmonitor.h delete mode 100644 webrtc/rtc_base/networkroute.h delete mode 100644 webrtc/rtc_base/nullsocketserver.h delete mode 100644 webrtc/rtc_base/numerics/exp_filter.h delete mode 100644 webrtc/rtc_base/numerics/percentile_filter.h delete mode 100644 webrtc/rtc_base/onetimeevent.h delete mode 100644 webrtc/rtc_base/openssl.h delete mode 100644 webrtc/rtc_base/openssladapter.h delete mode 100644 webrtc/rtc_base/openssldigest.h delete mode 100644 webrtc/rtc_base/opensslidentity.h delete mode 100644 webrtc/rtc_base/opensslstreamadapter.h delete mode 100644 webrtc/rtc_base/optional.h delete mode 100644 webrtc/rtc_base/optionsfile.h delete mode 100644 webrtc/rtc_base/pathutils.h delete mode 100644 webrtc/rtc_base/physicalsocketserver.h delete mode 100644 webrtc/rtc_base/platform_file.h delete mode 100644 webrtc/rtc_base/platform_thread.h delete mode 100644 webrtc/rtc_base/platform_thread_types.h delete mode 100644 webrtc/rtc_base/protobuf_utils.h delete mode 100644 webrtc/rtc_base/proxyinfo.h delete mode 100644 webrtc/rtc_base/proxyserver.h delete mode 100644 webrtc/rtc_base/ptr_util.h delete mode 100644 webrtc/rtc_base/race_checker.h delete mode 100644 webrtc/rtc_base/random.h delete mode 100644 webrtc/rtc_base/rate_limiter.h delete mode 100644 webrtc/rtc_base/rate_statistics.h delete mode 100644 webrtc/rtc_base/ratelimiter.h delete mode 100644 webrtc/rtc_base/ratetracker.h delete mode 100644 webrtc/rtc_base/refcount.h delete mode 100644 webrtc/rtc_base/refcountedobject.h delete mode 100644 webrtc/rtc_base/rollingaccumulator.h delete mode 100644 webrtc/rtc_base/rtccertificate.h delete mode 100644 webrtc/rtc_base/rtccertificategenerator.h delete mode 100644 webrtc/rtc_base/safe_compare.h delete mode 100644 webrtc/rtc_base/safe_conversions.h delete mode 100644 webrtc/rtc_base/safe_conversions_impl.h delete mode 100644 webrtc/rtc_base/safe_minmax.h delete mode 100644 webrtc/rtc_base/sanitizer.h delete mode 100644 webrtc/rtc_base/scoped_ref_ptr.h delete mode 100644 webrtc/rtc_base/sequenced_task_checker.h delete mode 100644 webrtc/rtc_base/sequenced_task_checker_impl.h delete mode 100644 webrtc/rtc_base/sha1.h delete mode 100644 webrtc/rtc_base/sha1digest.h delete mode 100644 webrtc/rtc_base/signalthread.h delete mode 100644 webrtc/rtc_base/sigslot.h delete mode 100755 webrtc/rtc_base/sigslottester.h delete mode 100644 webrtc/rtc_base/socket.h delete mode 100644 webrtc/rtc_base/socket_unittest.h delete mode 100644 webrtc/rtc_base/socketadapters.h delete mode 100644 webrtc/rtc_base/socketaddress.h delete mode 100644 webrtc/rtc_base/socketaddresspair.h delete mode 100644 webrtc/rtc_base/socketfactory.h delete mode 100644 webrtc/rtc_base/socketserver.h delete mode 100644 webrtc/rtc_base/socketstream.h delete mode 100644 webrtc/rtc_base/ssladapter.h delete mode 100644 webrtc/rtc_base/sslfingerprint.h delete mode 100644 webrtc/rtc_base/sslidentity.h delete mode 100644 webrtc/rtc_base/sslroots.h delete mode 100644 webrtc/rtc_base/sslstreamadapter.h delete mode 100644 webrtc/rtc_base/stream.h delete mode 100644 webrtc/rtc_base/string_to_number.h delete mode 100644 webrtc/rtc_base/stringencode.h delete mode 100644 webrtc/rtc_base/stringize_macros.h delete mode 100644 webrtc/rtc_base/stringutils.h delete mode 100644 webrtc/rtc_base/swap_queue.h delete mode 100644 webrtc/rtc_base/task_queue.h delete mode 100644 webrtc/rtc_base/task_queue_posix.h delete mode 100644 webrtc/rtc_base/template_util.h delete mode 100644 webrtc/rtc_base/testbase64.h delete mode 100644 webrtc/rtc_base/testclient.h delete mode 100644 webrtc/rtc_base/testechoserver.h delete mode 100644 webrtc/rtc_base/testutils.h delete mode 100644 webrtc/rtc_base/thread.h delete mode 100644 webrtc/rtc_base/thread_annotations.h delete mode 100644 webrtc/rtc_base/thread_checker.h delete mode 100644 webrtc/rtc_base/thread_checker_impl.h delete mode 100644 webrtc/rtc_base/timedelta.h delete mode 100644 webrtc/rtc_base/timestampaligner.h delete mode 100644 webrtc/rtc_base/timeutils.h delete mode 100644 webrtc/rtc_base/trace_event.h delete mode 100644 webrtc/rtc_base/transformadapter.h delete mode 100644 webrtc/rtc_base/type_traits.h delete mode 100644 webrtc/rtc_base/unixfilesystem.h delete mode 100644 webrtc/rtc_base/virtualsocketserver.h delete mode 100644 webrtc/rtc_base/weak_ptr.h delete mode 100644 webrtc/rtc_base/win32.h delete mode 100644 webrtc/rtc_base/win32filesystem.h delete mode 100644 webrtc/rtc_base/win32socketinit.h delete mode 100644 webrtc/rtc_base/win32socketserver.h delete mode 100644 webrtc/rtc_base/win32window.h delete mode 100644 webrtc/rtc_base/window.h diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 78f42728f0..614df535ff 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -32,7 +32,6 @@ CPPLINT_BLACKLIST = [ 'webrtc/modules/video_capture', 'webrtc/p2p', 'webrtc/pc', - 'webrtc/rtc_base', 'webrtc/sdk/android/src/jni', 'webrtc/sdk/objc', 'webrtc/system_wrappers', diff --git a/webrtc/DEPS b/webrtc/DEPS index 333b48ab11..0a9ade9991 100644 --- a/webrtc/DEPS +++ b/webrtc/DEPS @@ -21,7 +21,6 @@ include_rules = [ "+webrtc/api", "+webrtc/base", "+webrtc/modules/include", - "+webrtc/rtc_base", "+webrtc/test", "+webrtc/tools", ] diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn index c786f15916..1eecc86627 100644 --- a/webrtc/base/BUILD.gn +++ b/webrtc/base/BUILD.gn @@ -26,6 +26,39 @@ group("base") { ":sequenced_task_checker", ":weak_ptr", ] + if (is_android) { + public_deps += [ ":base_java" ] + } +} + +config("rtc_base_approved_all_dependent_config") { + if (is_mac && !build_with_chromium) { + libs = [ "Foundation.framework" ] # needed for logging_mac.mm + } +} + +config("rtc_base_chromium_config") { + defines = [ "NO_MAIN_THREAD_WRAPPING" ] +} + +config("rtc_base_all_dependent_config") { + if (is_ios) { + libs = [ + "CFNetwork.framework", + "Security.framework", + "SystemConfiguration.framework", + "UIKit.framework", + ] + } + if (is_mac) { + libs = [ + "Cocoa.framework", + "Foundation.framework", + "IOKit.framework", + "Security.framework", + "SystemConfiguration.framework", + ] + } } if (!rtc_build_ssl) { @@ -36,100 +69,965 @@ if (!rtc_build_ssl) { } } -# The targets below are deprecated and only exist here temporarily during -# refactoring. See https://bugs.webrtc.org/7634 for more details. - -group("protobuf_utils") { - public_deps = [ "../rtc_base:protobuf_utils" ] +source_set("protobuf_utils") { + sources = [ + "protobuf_utils.h", + ] + if (rtc_enable_protobuf) { + public_deps = [ + "//third_party/protobuf:protobuf_lite", + ] + } } -group("compile_assert_c") { - public_deps = [ "../rtc_base:compile_assert_c" ] +source_set("compile_assert_c") { + sources = [ + "compile_assert_c.h", + ] } -group("rtc_base_approved") { - public_deps = [ "../rtc_base:rtc_base_approved" ] +# The subset of rtc_base approved for use outside of libjingle. +rtc_static_library("rtc_base_approved") { + # TODO(kjellander): Remove (bugs.webrtc.org/7480) + # Enabling GN check triggers a cyclic dependency caused by rate_limiter.cc: + # :rtc_base_approved -> //webrtc/system_wrappers -> :rtc_base_approved + check_includes = false + defines = [] + libs = [] + deps = [] + all_dependent_configs = [ ":rtc_base_approved_all_dependent_config" ] + + sources = [ + "array_view.h", + "arraysize.h", + "atomicops.h", + "base64.cc", + "base64.h", + "basictypes.h", + "bind.h", + "bitbuffer.cc", + "bitbuffer.h", + "buffer.h", + "bufferqueue.cc", + "bufferqueue.h", + "bytebuffer.cc", + "bytebuffer.h", + "byteorder.h", + "checks.cc", + "checks.h", + "constructormagic.h", + "copyonwritebuffer.cc", + "copyonwritebuffer.h", + "criticalsection.cc", + "criticalsection.h", + "deprecation.h", + "event.cc", + "event.h", + "event_tracer.cc", + "event_tracer.h", + "file.cc", + "file.h", + "flags.cc", + "flags.h", + "format_macros.h", + "function_view.h", + "ignore_wundef.h", + "location.cc", + "location.h", + "mod_ops.h", + "onetimeevent.h", + "optional.cc", + "optional.h", + "pathutils.cc", + "pathutils.h", + "platform_file.cc", + "platform_file.h", + "platform_thread.cc", + "platform_thread.h", + "platform_thread_types.h", + "ptr_util.h", + "race_checker.cc", + "race_checker.h", + "random.cc", + "random.h", + "rate_limiter.cc", + "rate_limiter.h", + "rate_statistics.cc", + "rate_statistics.h", + "ratetracker.cc", + "ratetracker.h", + "refcount.h", + "refcountedobject.h", + "safe_compare.h", + "safe_conversions.h", + "safe_conversions_impl.h", + "safe_minmax.h", + "sanitizer.h", + "scoped_ref_ptr.h", + "string_to_number.cc", + "string_to_number.h", + "stringencode.cc", + "stringencode.h", + "stringize_macros.h", + "stringutils.cc", + "stringutils.h", + "swap_queue.h", + "template_util.h", + "thread_annotations.h", + "thread_checker.h", + "thread_checker_impl.cc", + "thread_checker_impl.h", + "timestampaligner.cc", + "timestampaligner.h", + "timeutils.cc", + "timeutils.h", + "trace_event.h", + "type_traits.h", + ] + + deps += [ "..:webrtc_common" ] + + if (is_android) { + libs += [ "log" ] + } + + if (is_posix) { + sources += [ "file_posix.cc" ] + } + + if (is_win) { + sources += [ "file_win.cc" ] + } + + if (build_with_chromium) { + # Dependency on chromium's logging (in //base). + deps += [ "//base:base" ] + sources += [ + "../../webrtc_overrides/webrtc/base/logging.cc", + "../../webrtc_overrides/webrtc/base/logging.h", + ] + } else { + sources += [ + "logging.cc", + "logging.h", + "logging_mac.mm", + ] + } + if (is_component_build && is_win) { + # Copy the VS runtime DLLs into the isolate so that they don't have to be + # preinstalled on the target machine. The debug runtimes have a "d" at + # the end. + # This is a copy of https://codereview.chromium.org/1783973002. + # TODO(ehmaldonado): We'd like Chromium to make this changes easier to use, + # so we don't have to copy their changes and risk breakages. + # See http://crbug.com/653569 + if (is_debug) { + vcrt_suffix = "d" + } else { + vcrt_suffix = "" + } + + # These runtime files are copied to the output directory by the + # vs_toolchain script that runs as part of toolchain configuration. + data = [ + "$root_out_dir/msvcp140${vcrt_suffix}.dll", + "$root_out_dir/vccorlib140${vcrt_suffix}.dll", + "$root_out_dir/vcruntime140${vcrt_suffix}.dll", + + # Universal Windows 10 CRT files + "$root_out_dir/api-ms-win-core-console-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-datetime-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-debug-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-errorhandling-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-file-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-file-l1-2-0.dll", + "$root_out_dir/api-ms-win-core-file-l2-1-0.dll", + "$root_out_dir/api-ms-win-core-handle-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-heap-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-interlocked-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-libraryloader-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-localization-l1-2-0.dll", + "$root_out_dir/api-ms-win-core-memory-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-namedpipe-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-processenvironment-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-processthreads-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-processthreads-l1-1-1.dll", + "$root_out_dir/api-ms-win-core-profile-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-rtlsupport-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-string-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-synch-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-synch-l1-2-0.dll", + "$root_out_dir/api-ms-win-core-sysinfo-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-timezone-l1-1-0.dll", + "$root_out_dir/api-ms-win-core-util-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-conio-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-convert-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-environment-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-filesystem-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-heap-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-locale-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-math-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-multibyte-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-private-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-process-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-runtime-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-stdio-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-string-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-time-l1-1-0.dll", + "$root_out_dir/api-ms-win-crt-utility-l1-1-0.dll", + "$root_out_dir/ucrtbase${vcrt_suffix}.dll", + ] + if (is_asan) { + if (current_cpu == "x64") { + data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-x86_64.dll" ] + } else { + data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-i386.dll" ] + } + } + } + if (is_nacl) { + deps += [ "//native_client_sdk/src/libraries/nacl_io" ] + } } -group("rtc_task_queue") { - public_deps = [ "../rtc_base:rtc_task_queue" ] +config("enable_libevent_config") { + defines = [ "WEBRTC_BUILD_LIBEVENT" ] } -group("sequenced_task_checker") { - public_deps = [ "../rtc_base:sequenced_task_checker" ] +rtc_static_library("rtc_task_queue") { + public_deps = [ + ":rtc_base_approved", + ] + + if (build_with_chromium) { + sources = [ + "../../webrtc_overrides/webrtc/base/task_queue.cc", + "../../webrtc_overrides/webrtc/base/task_queue.h", + ] + } else { + sources = [ + "task_queue.h", + "task_queue_posix.h", + ] + if (rtc_build_libevent) { + deps = [ + "//base/third_party/libevent", + ] + } + + if (rtc_enable_libevent) { + sources += [ + "task_queue_libevent.cc", + "task_queue_posix.cc", + ] + all_dependent_configs = [ ":enable_libevent_config" ] + } else { + if (is_mac || is_ios) { + sources += [ + "task_queue_gcd.cc", + "task_queue_posix.cc", + ] + } + if (is_win) { + sources += [ "task_queue_win.cc" ] + } + } + } } -group("weak_ptr") { - public_deps = [ "../rtc_base:weak_ptr" ] +rtc_static_library("sequenced_task_checker") { + sources = [ + "sequenced_task_checker.h", + "sequenced_task_checker_impl.cc", + "sequenced_task_checker_impl.h", + ] + deps = [ + ":rtc_task_queue", + ] } -group("rtc_numerics") { - public_deps = [ "../rtc_base:rtc_numerics" ] +rtc_static_library("weak_ptr") { + sources = [ + "weak_ptr.cc", + "weak_ptr.h", + ] + deps = [ + ":rtc_base_approved", + ":sequenced_task_checker", + ] } -group("rtc_json") { - public_deps = [ "../rtc_base:rtc_json" ] +rtc_static_library("rtc_numerics") { + sources = [ + "numerics/exp_filter.cc", + "numerics/exp_filter.h", + "numerics/percentile_filter.h", + ] + deps = [ + ":rtc_base_approved", + ] } -group("rtc_base") { - public_deps = [ "../rtc_base:rtc_base" ] +config("rtc_base_warnings_config") { + if (is_win && is_clang) { + cflags = [ + # Disable warnings failing when compiling with Clang on Windows. + # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 + "-Wno-sign-compare", + "-Wno-missing-braces", + ] + } } -group("gtest_prod") { - public_deps = [ "../rtc_base:gtest_prod" ] +rtc_source_set("rtc_json") { + defines = [] + sources = [ + "json.cc", + "json.h", + ] + if (rtc_build_json) { + public_deps = [ + "//third_party/jsoncpp", + ] + } else { + include_dirs = [ "$rtc_jsoncpp_root" ] + + # When defined changes the include path for json.h to where it is + # expected to be when building json outside of the standalone build. + defines += [ "WEBRTC_EXTERNAL_JSON" ] + } } -group("rtc_base_tests_utils") { +rtc_static_library("rtc_base") { + cflags = [] + cflags_cc = [] + libs = [] + defines = [] + deps = [ + "..:webrtc_common", + ] + public_deps = [ + ":rtc_base_approved", + ] + public_configs = [] + + all_dependent_configs = [ ":rtc_base_all_dependent_config" ] + + sources = [ + "applefilesystem.mm", + "asyncinvoker-inl.h", + "asyncinvoker.cc", + "asyncinvoker.h", + "asyncpacketsocket.cc", + "asyncpacketsocket.h", + "asyncresolverinterface.cc", + "asyncresolverinterface.h", + "asyncsocket.cc", + "asyncsocket.h", + "asynctcpsocket.cc", + "asynctcpsocket.h", + "asyncudpsocket.cc", + "asyncudpsocket.h", + "crc32.cc", + "crc32.h", + "cryptstring.cc", + "cryptstring.h", + "filerotatingstream.cc", + "filerotatingstream.h", + "fileutils.cc", + "fileutils.h", + "gunit_prod.h", + "helpers.cc", + "helpers.h", + "httpbase.cc", + "httpbase.h", + "httpcommon-inl.h", + "httpcommon.cc", + "httpcommon.h", + "ipaddress.cc", + "ipaddress.h", + "messagedigest.cc", + "messagedigest.h", + "messagehandler.cc", + "messagehandler.h", + "messagequeue.cc", + "messagequeue.h", + "nethelpers.cc", + "nethelpers.h", + "network.cc", + "network.h", + "networkmonitor.cc", + "networkmonitor.h", + "nullsocketserver.cc", + "nullsocketserver.h", + "openssl.h", + "openssladapter.cc", + "openssladapter.h", + "openssldigest.cc", + "openssldigest.h", + "opensslidentity.cc", + "opensslidentity.h", + "opensslstreamadapter.cc", + "opensslstreamadapter.h", + "physicalsocketserver.cc", + "physicalsocketserver.h", + "proxyinfo.cc", + "proxyinfo.h", + "ratelimiter.cc", + "ratelimiter.h", + "rtccertificate.cc", + "rtccertificate.h", + "rtccertificategenerator.cc", + "rtccertificategenerator.h", + "signalthread.cc", + "signalthread.h", + "sigslot.cc", + "sigslot.h", + "socket.h", + "socketadapters.cc", + "socketadapters.h", + "socketaddress.cc", + "socketaddress.h", + "socketaddresspair.cc", + "socketaddresspair.h", + "socketfactory.h", + "socketserver.h", + "socketstream.cc", + "socketstream.h", + "ssladapter.cc", + "ssladapter.h", + "sslfingerprint.cc", + "sslfingerprint.h", + "sslidentity.cc", + "sslidentity.h", + "sslstreamadapter.cc", + "sslstreamadapter.h", + "stream.cc", + "stream.h", + "thread.cc", + "thread.h", + ] + + # TODO(henrike): issue 3307, make rtc_base build with the Chromium default + # compiler settings. + suppressed_configs += [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + if (!is_win) { + cflags += [ "-Wno-uninitialized" ] + } + + if (build_with_chromium) { + if (is_win) { + sources += [ "../../webrtc_overrides/webrtc/base/win32socketinit.cc" ] + } + include_dirs = [ "../../boringssl/src/include" ] + public_configs += [ ":rtc_base_chromium_config" ] + } else { + configs += [ ":rtc_base_warnings_config" ] + sources += [ + "callback.h", + "logsinks.cc", + "logsinks.h", + "mathutils.h", + "optionsfile.cc", + "optionsfile.h", + "rollingaccumulator.h", + "sslroots.h", + "transformadapter.cc", + "transformadapter.h", + "window.h", + ] + + if (is_win) { + sources += [ + "win32socketinit.cc", + "win32socketinit.h", + "win32socketserver.cc", + "win32socketserver.h", + ] + } + } # !build_with_chromium + + if (rtc_build_ssl) { + deps += [ "//third_party/boringssl" ] + } else { + configs += [ ":external_ssl_library" ] + } + + if (is_android) { + sources += [ + "ifaddrs-android.cc", + "ifaddrs-android.h", + ] + + libs += [ + "log", + "GLESv2", + ] + } + + if (is_ios || is_mac) { + sources += [ + "macifaddrs_converter.cc", + "thread_darwin.mm", + ] + } + + if (use_x11) { + libs += [ + "dl", + "rt", + "Xext", + "X11", + "Xcomposite", + "Xrender", + ] + } + + if (is_linux) { + libs += [ + "dl", + "rt", + ] + } + + if (is_mac) { + sources += [ + "macutils.cc", + "macutils.h", + ] + libs += [ + # For ProcessInformationCopyDictionary in unixfilesystem.cc. + "ApplicationServices.framework", + ] + } + + if (is_win) { + sources += [ + "win32.cc", + "win32.h", + "win32filesystem.cc", + "win32filesystem.h", + "win32securityerrors.cc", + "win32window.cc", + "win32window.h", + ] + + libs += [ + "crypt32.lib", + "iphlpapi.lib", + "secur32.lib", + ] + + cflags += [ + # Suppress warnings about WIN32_LEAN_AND_MEAN. + "/wd4005", + "/wd4703", + ] + + defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ] + } + + if (is_posix) { + sources += [ + "ifaddrs_converter.cc", + "ifaddrs_converter.h", + "unixfilesystem.cc", + "unixfilesystem.h", + ] + } + + if (is_nacl) { + deps += [ "//native_client_sdk/src/libraries/nacl_io" ] + defines += [ "timezone=_timezone" ] + sources -= [ "ifaddrs_converter.cc" ] + } + if (is_win && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } +} + +rtc_source_set("gtest_prod") { + sources = [ + "gtest_prod_util.h", + ] +} + +config("rtc_base_tests_utils_exported_config") { + defines = [ "GTEST_RELATIVE_PATH" ] +} + +config("rtc_base_tests_utils_warnings_config") { + if (is_win && is_clang) { + cflags = [ + # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6270 + "-Wno-reorder", + "-Wno-sign-compare", + ] + } +} + +rtc_source_set("rtc_base_tests_utils") { testonly = true - public_deps = [ "../rtc_base:rtc_base_tests_utils" ] + sources = [ + # Also use this as a convenient dumping ground for misc files that are + # included by multiple targets below. + "cpu_time.cc", + "cpu_time.h", + "fakeclock.cc", + "fakeclock.h", + "fakenetwork.h", + "fakesslidentity.h", + "firewallsocketserver.cc", + "firewallsocketserver.h", + "gunit.h", + "httpserver.cc", + "httpserver.h", + "md5.cc", + "md5.h", + "md5digest.cc", + "md5digest.h", + "memory_usage.cc", + "memory_usage.h", + "natserver.cc", + "natserver.h", + "natsocketfactory.cc", + "natsocketfactory.h", + "nattypes.cc", + "nattypes.h", + "proxyserver.cc", + "proxyserver.h", + "sha1.cc", + "sha1.h", + "sha1digest.cc", + "sha1digest.h", + "sigslottester.h", + "sigslottester.h.pump", + "testbase64.h", + "testclient.cc", + "testclient.h", + "testechoserver.h", + "testutils.h", + "timedelta.h", + "virtualsocketserver.cc", + "virtualsocketserver.h", + ] + configs += [ ":rtc_base_tests_utils_warnings_config" ] + public_configs = [ ":rtc_base_tests_utils_exported_config" ] + deps = [ + ":rtc_base", + "../test:field_trial", + "../test:test_support", + ] + public_deps = [ + "//testing/gmock", + "//testing/gtest", + ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } } if (rtc_include_tests) { - group("rtc_base_tests_main") { + rtc_source_set("rtc_base_tests_main") { testonly = true - public_deps = [ "../rtc_base:rtc_base_tests_main" ] + sources = [ + "unittest_main.cc", + ] + public_configs = [ ":rtc_base_tests_utils_exported_config" ] + deps = [ + ":rtc_base", + ":rtc_base_approved", + ":rtc_base_tests_utils", + "../test:field_trial", + "../test:test_support", + ] + + public_deps = [ + "//testing/gmock", + "//testing/gtest", + ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } } - group("rtc_base_nonparallel_tests") { + rtc_source_set("rtc_base_nonparallel_tests") { testonly = true - public_deps = [ "../rtc_base:rtc_base_nonparallel_tests" ] + + # Skip restricting visibility on mobile platforms since the tests on those + # gets additional generated targets which would require many lines here to + # cover (which would be confusing to read and hard to maintain). + if (!is_android && !is_ios) { + visibility = [ "//webrtc:webrtc_nonparallel_tests" ] + } + sources = [ + "cpu_time_unittest.cc", + "filerotatingstream_unittest.cc", + "nullsocketserver_unittest.cc", + "physicalsocketserver_unittest.cc", + "socket_unittest.cc", + "socket_unittest.h", + "socketaddress_unittest.cc", + ] + deps = [ + ":rtc_base", + ":rtc_base_tests_main", + ":rtc_base_tests_utils", + "../system_wrappers:system_wrappers", + "../test:test_support", + "//testing/gtest", + ] + if (is_win) { + sources += [ "win32socketserver_unittest.cc" ] + } + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } } - group("rtc_base_approved_unittests") { + rtc_source_set("rtc_base_approved_unittests") { testonly = true - public_deps = [ "../rtc_base:rtc_base_approved_unittests" ] + + # Skip restricting visibility on mobile platforms since the tests on those + # gets additional generated targets which would require many lines here to + # cover (which would be confusing to read and hard to maintain). + if (!is_android && !is_ios) { + visibility = [ "//webrtc:rtc_unittests" ] + } + sources = [ + "array_view_unittest.cc", + "atomicops_unittest.cc", + "base64_unittest.cc", + "basictypes_unittest.cc", + "bind_unittest.cc", + "bitbuffer_unittest.cc", + "buffer_unittest.cc", + "bufferqueue_unittest.cc", + "bytebuffer_unittest.cc", + "byteorder_unittest.cc", + "copyonwritebuffer_unittest.cc", + "criticalsection_unittest.cc", + "event_tracer_unittest.cc", + "event_unittest.cc", + "file_unittest.cc", + "function_view_unittest.cc", + "logging_unittest.cc", + "md5digest_unittest.cc", + "mod_ops_unittest.cc", + "onetimeevent_unittest.cc", + "optional_unittest.cc", + "pathutils_unittest.cc", + "platform_thread_unittest.cc", + "random_unittest.cc", + "rate_limiter_unittest.cc", + "rate_statistics_unittest.cc", + "ratetracker_unittest.cc", + "refcountedobject_unittest.cc", + "safe_compare_unittest.cc", + "safe_minmax_unittest.cc", + "string_to_number_unittest.cc", + "stringencode_unittest.cc", + "stringize_macros_unittest.cc", + "stringutils_unittest.cc", + "swap_queue_unittest.cc", + "thread_annotations_unittest.cc", + "thread_checker_unittest.cc", + "timestampaligner_unittest.cc", + "timeutils_unittest.cc", + "virtualsocket_unittest.cc", + ] + deps = [ + ":rtc_base", + ":rtc_base_approved", + ":rtc_base_tests_main", + ":rtc_base_tests_utils", + ":rtc_task_queue", + "../system_wrappers:system_wrappers", + "../test:test_support", + ] + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } } - group("sequenced_task_checker_unittests") { + rtc_source_set("rtc_task_queue_unittests") { testonly = true - public_deps = [ "../rtc_base:sequenced_task_checker_unittests" ] + + # Skip restricting visibility on mobile platforms since the tests on those + # gets additional generated targets which would require many lines here to + # cover (which would be confusing to read and hard to maintain). + if (!is_android && !is_ios) { + visibility = [ "//webrtc:rtc_unittests" ] + } + sources = [ + "task_queue_unittest.cc", + ] + deps = [ + ":rtc_base_tests_main", + ":rtc_base_tests_utils", + ":rtc_task_queue", + "../test:test_support", + ] + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } } - group("weak_ptr_unittests") { + rtc_source_set("sequenced_task_checker_unittests") { testonly = true - public_deps = [ "../rtc_base:weak_ptr_unittests" ] + + # Skip restricting visibility on mobile platforms since the tests on those + # gets additional generated targets which would require many lines here to + # cover (which would be confusing to read and hard to maintain). + if (!is_android && !is_ios) { + visibility = [ "//webrtc:rtc_unittests" ] + } + sources = [ + "sequenced_task_checker_unittest.cc", + ] + deps = [ + ":rtc_base_approved", + ":rtc_base_tests_main", + ":rtc_task_queue", + ":sequenced_task_checker", + "../test:test_support", + ] } - group("rtc_task_queue_unittests") { + rtc_source_set("weak_ptr_unittests") { testonly = true - public_deps = [ "../rtc_base:rtc_task_queue_unittests" ] + + # Skip restricting visibility on mobile platforms since the tests on those + # gets additional generated targets which would require many lines here to + # cover (which would be confusing to read and hard to maintain). + if (!is_android && !is_ios) { + visibility = [ "//webrtc:rtc_unittests" ] + } + sources = [ + "weak_ptr_unittest.cc", + ] + deps = [ + ":rtc_base_tests_main", + ":rtc_base_tests_utils", + ":rtc_task_queue", + ":weak_ptr", + "../test:test_support", + ] } - - group("rtc_numerics_unittests") { + rtc_source_set("rtc_numerics_unittests") { testonly = true - public_deps = [ "../rtc_base:rtc_numerics_unittests" ] + + # Skip restricting visibility on mobile platforms since the tests on those + # gets additional generated targets which would require many lines here to + # cover (which would be confusing to read and hard to maintain). + if (!is_android && !is_ios) { + visibility = [ "//webrtc:rtc_unittests" ] + } + sources = [ + "numerics/exp_filter_unittest.cc", + "numerics/percentile_filter_unittest.cc", + ] + deps = [ + ":rtc_base_approved", + ":rtc_base_tests_main", + ":rtc_numerics", + "../test:test_support", + ] } - group("rtc_base_unittests") { + config("rtc_base_unittests_config") { + if (is_clang) { + cflags = [ "-Wno-unused-const-variable" ] + } + } + rtc_source_set("rtc_base_unittests") { testonly = true - public_deps = [ "../rtc_base:rtc_base_unittests" ] + + # Skip restricting visibility on mobile platforms since the tests on those + # gets additional generated targets which would require many lines here to + # cover (which would be confusing to read and hard to maintain). + if (!is_android && !is_ios) { + visibility = [ "//webrtc:rtc_unittests" ] + } + sources = [ + "callback_unittest.cc", + "crc32_unittest.cc", + "fileutils_unittest.cc", + "helpers_unittest.cc", + "httpbase_unittest.cc", + "httpcommon_unittest.cc", + "httpserver_unittest.cc", + "ipaddress_unittest.cc", + "memory_usage_unittest.cc", + "messagedigest_unittest.cc", + "messagequeue_unittest.cc", + "nat_unittest.cc", + "network_unittest.cc", + "optionsfile_unittest.cc", + "proxy_unittest.cc", + "ptr_util_unittest.cc", + "ratelimiter_unittest.cc", + "rollingaccumulator_unittest.cc", + "rtccertificate_unittest.cc", + "rtccertificategenerator_unittest.cc", + "sha1digest_unittest.cc", + "signalthread_unittest.cc", + "sigslot_unittest.cc", + "sigslottester_unittest.cc", + "stream_unittest.cc", + "testclient_unittest.cc", + "thread_unittest.cc", + ] + if (is_win) { + sources += [ + "win32_unittest.cc", + "win32window_unittest.cc", + ] + } + if (is_mac) { + sources += [ "macutils_unittest.cc" ] + } + if (is_posix) { + sources += [ + "ssladapter_unittest.cc", + "sslidentity_unittest.cc", + "sslstreamadapter_unittest.cc", + ] + } + deps = [ + ":rtc_base_tests_main", + ":rtc_base_tests_utils", + "../test:test_support", + ] + public_deps = [ + ":rtc_base", + ] + configs += [ ":rtc_base_unittests_config" ] + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } } } if (is_android) { android_library("base_java") { - java_files = [ "Dummy.java" ] # Need one file to avoid hitting an assert. - deps = [ "../rtc_base:base_java" ] + java_files = [ + "java/src/org/webrtc/ContextUtils.java", + "java/src/org/webrtc/Logging.java", + "java/src/org/webrtc/Size.java", + "java/src/org/webrtc/ThreadUtils.java", + ] } } diff --git a/webrtc/rtc_base/DEPS b/webrtc/base/DEPS similarity index 100% rename from webrtc/rtc_base/DEPS rename to webrtc/base/DEPS diff --git a/webrtc/base/Dummy.java b/webrtc/base/Dummy.java deleted file mode 100644 index 60cd440fd4..0000000000 --- a/webrtc/base/Dummy.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This class only exists as glue in a transition. - * TODO(kjellander): Remove. - * See https://bugs.webrtc.org/7634 for more details. - */ -class Dummy { - Dummy() { - } -} diff --git a/webrtc/rtc_base/OWNERS b/webrtc/base/OWNERS similarity index 100% rename from webrtc/rtc_base/OWNERS rename to webrtc/base/OWNERS diff --git a/webrtc/rtc_base/applefilesystem.mm b/webrtc/base/applefilesystem.mm similarity index 100% rename from webrtc/rtc_base/applefilesystem.mm rename to webrtc/base/applefilesystem.mm diff --git a/webrtc/base/array_view.h b/webrtc/base/array_view.h index a451b59e2d..7a0bb28954 100644 --- a/webrtc/base/array_view.h +++ b/webrtc/base/array_view.h @@ -11,9 +11,243 @@ #ifndef WEBRTC_BASE_ARRAY_VIEW_H_ #define WEBRTC_BASE_ARRAY_VIEW_H_ +#include "webrtc/base/checks.h" +#include "webrtc/base/type_traits.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/array_view.h" +namespace rtc { + +// Many functions read from or write to arrays. The obvious way to do this is +// to use two arguments, a pointer to the first element and an element count: +// +// bool Contains17(const int* arr, size_t size) { +// for (size_t i = 0; i < size; ++i) { +// if (arr[i] == 17) +// return true; +// } +// return false; +// } +// +// This is flexible, since it doesn't matter how the array is stored (C array, +// std::vector, rtc::Buffer, ...), but it's error-prone because the caller has +// to correctly specify the array length: +// +// Contains17(arr, arraysize(arr)); // C array +// Contains17(arr.data(), arr.size()); // std::vector +// Contains17(arr, size); // pointer + size +// ... +// +// It's also kind of messy to have two separate arguments for what is +// conceptually a single thing. +// +// Enter rtc::ArrayView. It contains a T pointer (to an array it doesn't +// own) and a count, and supports the basic things you'd expect, such as +// indexing and iteration. It allows us to write our function like this: +// +// bool Contains17(rtc::ArrayView arr) { +// for (auto e : arr) { +// if (e == 17) +// return true; +// } +// return false; +// } +// +// And even better, because a bunch of things will implicitly convert to +// ArrayView, we can call it like this: +// +// Contains17(arr); // C array +// Contains17(arr); // std::vector +// Contains17(rtc::ArrayView(arr, size)); // pointer + size +// Contains17(nullptr); // nullptr -> empty ArrayView +// ... +// +// ArrayView stores both a pointer and a size, but you may also use +// ArrayView, which has a size that's fixed at compile time (which means +// it only has to store the pointer). +// +// One important point is that ArrayView and ArrayView are +// different types, which allow and don't allow mutation of the array elements, +// respectively. The implicit conversions work just like you'd hope, so that +// e.g. vector will convert to either ArrayView or ArrayView, but const vector will convert only to ArrayView. +// (ArrayView itself can be the source type in such conversions, so +// ArrayView will convert to ArrayView.) +// +// Note: ArrayView is tiny (just a pointer and a count if variable-sized, just +// a pointer if fix-sized) and trivially copyable, so it's probably cheaper to +// pass it by value than by const reference. + +namespace impl { + +// Magic constant for indicating that the size of an ArrayView is variable +// instead of fixed. +enum : std::ptrdiff_t { kArrayViewVarSize = -4711 }; + +// Base class for ArrayViews of fixed nonzero size. +template +class ArrayViewBase { + static_assert(Size > 0, "ArrayView size must be variable or non-negative"); + + public: + ArrayViewBase(T* data, size_t size) : data_(data) {} + + static constexpr size_t size() { return Size; } + static constexpr bool empty() { return false; } + T* data() const { return data_; } + + protected: + static constexpr bool fixed_size() { return true; } + + private: + T* data_; +}; + +// Specialized base class for ArrayViews of fixed zero size. +template +class ArrayViewBase { + public: + explicit ArrayViewBase(T* data, size_t size) {} + + static constexpr size_t size() { return 0; } + static constexpr bool empty() { return true; } + T* data() const { return nullptr; } + + protected: + static constexpr bool fixed_size() { return true; } +}; + +// Specialized base class for ArrayViews of variable size. +template +class ArrayViewBase { + public: + ArrayViewBase(T* data, size_t size) + : data_(size == 0 ? nullptr : data), size_(size) {} + + size_t size() const { return size_; } + bool empty() const { return size_ == 0; } + T* data() const { return data_; } + + protected: + static constexpr bool fixed_size() { return false; } + + private: + T* data_; + size_t size_; +}; + +} // namespace impl + +template +class ArrayView final : public impl::ArrayViewBase { + public: + using value_type = T; + using const_iterator = const T*; + + // Construct an ArrayView from a pointer and a length. + template + ArrayView(U* data, size_t size) + : impl::ArrayViewBase::ArrayViewBase(data, size) { + RTC_DCHECK_EQ(size == 0 ? nullptr : data, this->data()); + RTC_DCHECK_EQ(size, this->size()); + RTC_DCHECK_EQ(!this->data(), + this->size() == 0); // data is null iff size == 0. + } + + // Construct an empty ArrayView. Note that fixed-size ArrayViews of size > 0 + // cannot be empty. + ArrayView() : ArrayView(nullptr, 0) {} + ArrayView(std::nullptr_t) : ArrayView() {} + ArrayView(std::nullptr_t, size_t size) + : ArrayView(static_cast(nullptr), size) { + static_assert(Size == 0 || Size == impl::kArrayViewVarSize, ""); + RTC_DCHECK_EQ(0, size); + } + + // Construct an ArrayView from an array. + template + ArrayView(U (&array)[N]) : ArrayView(array, N) { + static_assert(Size == N || Size == impl::kArrayViewVarSize, + "Array size must match ArrayView size"); + } + + // (Only if size is fixed.) Construct an ArrayView from any type U that has a + // static constexpr size() method whose return value is equal to Size, and a + // data() method whose return value converts implicitly to T*. In particular, + // this means we allow conversion from ArrayView to ArrayView, but not the other way around. We also don't allow conversion from + // ArrayView to ArrayView, or from ArrayView to ArrayView when M != N. + template ::value>::type* = nullptr> + ArrayView(U& u) : ArrayView(u.data(), u.size()) { + static_assert(U::size() == Size, "Sizes must match exactly"); + } + + // (Only if size is variable.) Construct an ArrayView from any type U that + // has a size() method whose return value converts implicitly to size_t, and + // a data() method whose return value converts implicitly to T*. In + // particular, this means we allow conversion from ArrayView to + // ArrayView, but not the other way around. Other allowed + // conversions include + // ArrayView to ArrayView or ArrayView, + // std::vector to ArrayView or ArrayView, + // const std::vector to ArrayView, + // rtc::Buffer to ArrayView or ArrayView, and + // const rtc::Buffer to ArrayView. + template < + typename U, + typename std::enable_if::value>::type* = nullptr> + ArrayView(U& u) : ArrayView(u.data(), u.size()) {} + + // Indexing and iteration. These allow mutation even if the ArrayView is + // const, because the ArrayView doesn't own the array. (To prevent mutation, + // use a const element type.) + T& operator[](size_t idx) const { + RTC_DCHECK_LT(idx, this->size()); + RTC_DCHECK(this->data()); + return this->data()[idx]; + } + T* begin() const { return this->data(); } + T* end() const { return this->data() + this->size(); } + const T* cbegin() const { return this->data(); } + const T* cend() const { return this->data() + this->size(); } + + ArrayView subview(size_t offset, size_t size) const { + return offset < this->size() + ? ArrayView(this->data() + offset, + std::min(size, this->size() - offset)) + : ArrayView(); + } + ArrayView subview(size_t offset) const { + return subview(offset, this->size()); + } +}; + +// Comparing two ArrayViews compares their (pointer,size) pairs; it does *not* +// dereference the pointers. +template +bool operator==(const ArrayView& a, const ArrayView& b) { + return a.data() == b.data() && a.size() == b.size(); +} +template +bool operator!=(const ArrayView& a, const ArrayView& b) { + return !(a == b); +} + +// Variable-size ArrayViews are the size of two pointers; fixed-size ArrayViews +// are the size of one pointer. (And as a special case, fixed-size ArrayViews +// of size 0 require no storage.) +static_assert(sizeof(ArrayView) == 2 * sizeof(int*), ""); +static_assert(sizeof(ArrayView) == sizeof(int*), ""); +static_assert(std::is_empty>::value, ""); + +template +inline ArrayView MakeArrayView(T* data, size_t size) { + return ArrayView(data, size); +} + +} // namespace rtc #endif // WEBRTC_BASE_ARRAY_VIEW_H_ diff --git a/webrtc/rtc_base/array_view_unittest.cc b/webrtc/base/array_view_unittest.cc similarity index 100% rename from webrtc/rtc_base/array_view_unittest.cc rename to webrtc/base/array_view_unittest.cc diff --git a/webrtc/base/arraysize.h b/webrtc/base/arraysize.h index 8b37efa04b..56a10392af 100644 --- a/webrtc/base/arraysize.h +++ b/webrtc/base/arraysize.h @@ -11,9 +11,21 @@ #ifndef WEBRTC_BASE_ARRAYSIZE_H_ #define WEBRTC_BASE_ARRAYSIZE_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/arraysize.h" +// This file defines the arraysize() macro and is derived from Chromium's +// base/macros.h. + +// The arraysize(arr) macro returns the # of elements in an array arr. +// The expression is a compile-time constant, and therefore can be +// used in defining new arrays, for example. If you use arraysize on +// a pointer by mistake, you will get a compile-time error. + +// This template function declaration is used in defining arraysize. +// Note that the function doesn't need an implementation, as we only +// use its type. +template char (&ArraySizeHelper(T (&array)[N]))[N]; + +#define arraysize(array) (sizeof(ArraySizeHelper(array))) #endif // WEBRTC_BASE_ARRAYSIZE_H_ diff --git a/webrtc/base/asyncinvoker-inl.h b/webrtc/base/asyncinvoker-inl.h index cce42264ab..5f7cd4959a 100644 --- a/webrtc/base/asyncinvoker-inl.h +++ b/webrtc/base/asyncinvoker-inl.h @@ -11,9 +11,46 @@ #ifndef WEBRTC_BASE_ASYNCINVOKER_INL_H_ #define WEBRTC_BASE_ASYNCINVOKER_INL_H_ +#include "webrtc/base/atomicops.h" +#include "webrtc/base/bind.h" +#include "webrtc/base/criticalsection.h" +#include "webrtc/base/messagehandler.h" +#include "webrtc/base/sigslot.h" +#include "webrtc/base/thread.h" +#include "webrtc/base/thread_annotations.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/asyncinvoker-inl.h" +namespace rtc { + +class AsyncInvoker; + +// Helper class for AsyncInvoker. Runs a task and triggers a callback +// on the calling thread if necessary. +class AsyncClosure { + public: + explicit AsyncClosure(AsyncInvoker* invoker) : invoker_(invoker) {} + virtual ~AsyncClosure(); + // Runs the asynchronous task, and triggers a callback to the calling + // thread if needed. Should be called from the target thread. + virtual void Execute() = 0; + + protected: + AsyncInvoker* invoker_; +}; + +// Simple closure that doesn't trigger a callback for the calling thread. +template +class FireAndForgetAsyncClosure : public AsyncClosure { + public: + explicit FireAndForgetAsyncClosure(AsyncInvoker* invoker, + const FunctorT& functor) + : AsyncClosure(invoker), functor_(functor) {} + virtual void Execute() { + functor_(); + } + private: + FunctorT functor_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_ASYNCINVOKER_INL_H_ diff --git a/webrtc/rtc_base/asyncinvoker.cc b/webrtc/base/asyncinvoker.cc similarity index 100% rename from webrtc/rtc_base/asyncinvoker.cc rename to webrtc/base/asyncinvoker.cc diff --git a/webrtc/base/asyncinvoker.h b/webrtc/base/asyncinvoker.h index 0fcfc04947..5414867418 100644 --- a/webrtc/base/asyncinvoker.h +++ b/webrtc/base/asyncinvoker.h @@ -11,9 +11,211 @@ #ifndef WEBRTC_BASE_ASYNCINVOKER_H_ #define WEBRTC_BASE_ASYNCINVOKER_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/asyncinvoker.h" +#include "webrtc/base/asyncinvoker-inl.h" +#include "webrtc/base/bind.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/event.h" +#include "webrtc/base/sigslot.h" +#include "webrtc/base/thread.h" + +namespace rtc { + +// Invokes function objects (aka functors) asynchronously on a Thread, and +// owns the lifetime of calls (ie, when this object is destroyed, calls in +// flight are cancelled). AsyncInvoker can optionally execute a user-specified +// function when the asynchronous call is complete, or operates in +// fire-and-forget mode otherwise. +// +// AsyncInvoker does not own the thread it calls functors on. +// +// A note about async calls and object lifetimes: users should +// be mindful of object lifetimes when calling functions asynchronously and +// ensure objects used by the function _cannot_ be deleted between the +// invocation and execution of the functor. AsyncInvoker is designed to +// help: any calls in flight will be cancelled when the AsyncInvoker used to +// make the call is destructed, and any calls executing will be allowed to +// complete before AsyncInvoker destructs. +// +// The easiest way to ensure lifetimes are handled correctly is to create a +// class that owns the Thread and AsyncInvoker objects, and then call its +// methods asynchronously as needed. +// +// Example: +// class MyClass { +// public: +// void FireAsyncTaskWithResult(Thread* thread, int x) { +// // Specify a callback to get the result upon completion. +// invoker_.AsyncInvoke(RTC_FROM_HERE, +// thread, Bind(&MyClass::AsyncTaskWithResult, this, x), +// &MyClass::OnTaskComplete, this); +// } +// void FireAnotherAsyncTask(Thread* thread) { +// // No callback specified means fire-and-forget. +// invoker_.AsyncInvoke(RTC_FROM_HERE, +// thread, Bind(&MyClass::AnotherAsyncTask, this)); +// +// private: +// int AsyncTaskWithResult(int x) { +// // Some long running process... +// return x * x; +// } +// void AnotherAsyncTask() { +// // Some other long running process... +// } +// void OnTaskComplete(int result) { result_ = result; } +// +// AsyncInvoker invoker_; +// int result_; +// }; +class AsyncInvoker : public MessageHandler { + public: + AsyncInvoker(); + ~AsyncInvoker() override; + + // Call |functor| asynchronously on |thread|, with no callback upon + // completion. Returns immediately. + template + void AsyncInvoke(const Location& posted_from, + Thread* thread, + const FunctorT& functor, + uint32_t id = 0) { + std::unique_ptr closure( + new FireAndForgetAsyncClosure(this, functor)); + DoInvoke(posted_from, thread, std::move(closure), id); + } + + // Call |functor| asynchronously on |thread| with |delay_ms|, with no callback + // upon completion. Returns immediately. + template + void AsyncInvokeDelayed(const Location& posted_from, + Thread* thread, + const FunctorT& functor, + uint32_t delay_ms, + uint32_t id = 0) { + std::unique_ptr closure( + new FireAndForgetAsyncClosure(this, functor)); + DoInvokeDelayed(posted_from, thread, std::move(closure), delay_ms, id); + } + + // Synchronously execute on |thread| all outstanding calls we own + // that are pending on |thread|, and wait for calls to complete + // before returning. Optionally filter by message id. + // The destructor will not wait for outstanding calls, so if that + // behavior is desired, call Flush() before destroying this object. + void Flush(Thread* thread, uint32_t id = MQID_ANY); + + private: + void OnMessage(Message* msg) override; + void DoInvoke(const Location& posted_from, + Thread* thread, + std::unique_ptr closure, + uint32_t id); + void DoInvokeDelayed(const Location& posted_from, + Thread* thread, + std::unique_ptr closure, + uint32_t delay_ms, + uint32_t id); + volatile int pending_invocations_ = 0; + Event invocation_complete_; + bool destroying_ = false; + friend class AsyncClosure; + + RTC_DISALLOW_COPY_AND_ASSIGN(AsyncInvoker); +}; + +// Similar to AsyncInvoker, but guards against the Thread being destroyed while +// there are outstanding dangling pointers to it. It will connect to the current +// thread in the constructor, and will get notified when that thread is +// destroyed. After GuardedAsyncInvoker is constructed, it can be used from +// other threads to post functors to the thread it was constructed on. If that +// thread dies, any further calls to AsyncInvoke() will be safely ignored. +class GuardedAsyncInvoker : public sigslot::has_slots<> { + public: + GuardedAsyncInvoker(); + ~GuardedAsyncInvoker() override; + + // Synchronously execute all outstanding calls we own, and wait for calls to + // complete before returning. Optionally filter by message id. The destructor + // will not wait for outstanding calls, so if that behavior is desired, call + // Flush() first. Returns false if the thread has died. + bool Flush(uint32_t id = MQID_ANY); + + // Call |functor| asynchronously with no callback upon completion. Returns + // immediately. Returns false if the thread has died. + template + bool AsyncInvoke(const Location& posted_from, + const FunctorT& functor, + uint32_t id = 0) { + rtc::CritScope cs(&crit_); + if (thread_ == nullptr) + return false; + invoker_.AsyncInvoke(posted_from, thread_, functor, id); + return true; + } + + // Call |functor| asynchronously with |delay_ms|, with no callback upon + // completion. Returns immediately. Returns false if the thread has died. + template + bool AsyncInvokeDelayed(const Location& posted_from, + const FunctorT& functor, + uint32_t delay_ms, + uint32_t id = 0) { + rtc::CritScope cs(&crit_); + if (thread_ == nullptr) + return false; + invoker_.AsyncInvokeDelayed(posted_from, thread_, + functor, delay_ms, id); + return true; + } + + // Call |functor| asynchronously, calling |callback| when done. Returns false + // if the thread has died. + template + bool AsyncInvoke(const Location& posted_from, + const Location& callback_posted_from, + const FunctorT& functor, + void (HostT::*callback)(ReturnT), + HostT* callback_host, + uint32_t id = 0) { + rtc::CritScope cs(&crit_); + if (thread_ == nullptr) + return false; + invoker_.AsyncInvoke( + posted_from, callback_posted_from, thread_, functor, callback, + callback_host, id); + return true; + } + + // Call |functor| asynchronously calling |callback| when done. Overloaded for + // void return. Returns false if the thread has died. + template + bool AsyncInvoke(const Location& posted_from, + const Location& callback_posted_from, + const FunctorT& functor, + void (HostT::*callback)(), + HostT* callback_host, + uint32_t id = 0) { + rtc::CritScope cs(&crit_); + if (thread_ == nullptr) + return false; + invoker_.AsyncInvoke( + posted_from, callback_posted_from, thread_, functor, callback, + callback_host, id); + return true; + } + + private: + // Callback when |thread_| is destroyed. + void ThreadDestroyed(); + + CriticalSection crit_; + Thread* thread_ GUARDED_BY(crit_); + AsyncInvoker invoker_ GUARDED_BY(crit_); +}; + +} // namespace rtc #endif // WEBRTC_BASE_ASYNCINVOKER_H_ diff --git a/webrtc/rtc_base/asyncpacketsocket.cc b/webrtc/base/asyncpacketsocket.cc similarity index 100% rename from webrtc/rtc_base/asyncpacketsocket.cc rename to webrtc/base/asyncpacketsocket.cc diff --git a/webrtc/base/asyncpacketsocket.h b/webrtc/base/asyncpacketsocket.h index 809f1789af..a540947951 100644 --- a/webrtc/base/asyncpacketsocket.h +++ b/webrtc/base/asyncpacketsocket.h @@ -11,9 +11,133 @@ #ifndef WEBRTC_BASE_ASYNCPACKETSOCKET_H_ #define WEBRTC_BASE_ASYNCPACKETSOCKET_H_ +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/dscp.h" +#include "webrtc/base/sigslot.h" +#include "webrtc/base/socket.h" +#include "webrtc/base/timeutils.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/asyncpacketsocket.h" +namespace rtc { + +// This structure holds the info needed to update the packet send time header +// extension, including the information needed to update the authentication tag +// after changing the value. +struct PacketTimeUpdateParams { + PacketTimeUpdateParams(); + ~PacketTimeUpdateParams(); + + int rtp_sendtime_extension_id; // extension header id present in packet. + std::vector srtp_auth_key; // Authentication key. + int srtp_auth_tag_len; // Authentication tag length. + int64_t srtp_packet_index; // Required for Rtp Packet authentication. +}; + +// This structure holds meta information for the packet which is about to send +// over network. +struct PacketOptions { + PacketOptions() : dscp(DSCP_NO_CHANGE), packet_id(-1) {} + explicit PacketOptions(DiffServCodePoint dscp) : dscp(dscp), packet_id(-1) {} + + DiffServCodePoint dscp; + int packet_id; // 16 bits, -1 represents "not set". + PacketTimeUpdateParams packet_time_params; +}; + +// This structure will have the information about when packet is actually +// received by socket. +struct PacketTime { + PacketTime() : timestamp(-1), not_before(-1) {} + PacketTime(int64_t timestamp, int64_t not_before) + : timestamp(timestamp), not_before(not_before) {} + + int64_t timestamp; // Receive time after socket delivers the data. + + // Earliest possible time the data could have arrived, indicating the + // potential error in the |timestamp| value, in case the system, is busy. For + // example, the time of the last select() call. + // If unknown, this value will be set to zero. + int64_t not_before; +}; + +inline PacketTime CreatePacketTime(int64_t not_before) { + return PacketTime(TimeMicros(), not_before); +} + +// Provides the ability to receive packets asynchronously. Sends are not +// buffered since it is acceptable to drop packets under high load. +class AsyncPacketSocket : public sigslot::has_slots<> { + public: + enum State { + STATE_CLOSED, + STATE_BINDING, + STATE_BOUND, + STATE_CONNECTING, + STATE_CONNECTED + }; + + AsyncPacketSocket(); + ~AsyncPacketSocket() override; + + // Returns current local address. Address may be set to null if the + // socket is not bound yet (GetState() returns STATE_BINDING). + virtual SocketAddress GetLocalAddress() const = 0; + + // Returns remote address. Returns zeroes if this is not a client TCP socket. + virtual SocketAddress GetRemoteAddress() const = 0; + + // Send a packet. + virtual int Send(const void *pv, size_t cb, const PacketOptions& options) = 0; + virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr, + const PacketOptions& options) = 0; + + // Close the socket. + virtual int Close() = 0; + + // Returns current state of the socket. + virtual State GetState() const = 0; + + // Get/set options. + virtual int GetOption(Socket::Option opt, int* value) = 0; + virtual int SetOption(Socket::Option opt, int value) = 0; + + // Get/Set current error. + // TODO: Remove SetError(). + virtual int GetError() const = 0; + virtual void SetError(int error) = 0; + + // Emitted each time a packet is read. Used only for UDP and + // connected TCP sockets. + sigslot::signal5 SignalReadPacket; + + // Emitted each time a packet is sent. + sigslot::signal2 SignalSentPacket; + + // Emitted when the socket is currently able to send. + sigslot::signal1 SignalReadyToSend; + + // Emitted after address for the socket is allocated, i.e. binding + // is finished. State of the socket is changed from BINDING to BOUND + // (for UDP and server TCP sockets) or CONNECTING (for client TCP + // sockets). + sigslot::signal2 SignalAddressReady; + + // Emitted for client TCP sockets when state is changed from + // CONNECTING to CONNECTED. + sigslot::signal1 SignalConnect; + + // Emitted for client TCP sockets when state is changed from + // CONNECTED to CLOSED. + sigslot::signal2 SignalClose; + + // Used only for listening TCP sockets. + sigslot::signal2 SignalNewConnection; + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(AsyncPacketSocket); +}; + +} // namespace rtc #endif // WEBRTC_BASE_ASYNCPACKETSOCKET_H_ diff --git a/webrtc/rtc_base/asyncresolverinterface.cc b/webrtc/base/asyncresolverinterface.cc similarity index 100% rename from webrtc/rtc_base/asyncresolverinterface.cc rename to webrtc/base/asyncresolverinterface.cc diff --git a/webrtc/base/asyncresolverinterface.h b/webrtc/base/asyncresolverinterface.h index b2a172fb17..75c36abbf4 100644 --- a/webrtc/base/asyncresolverinterface.h +++ b/webrtc/base/asyncresolverinterface.h @@ -11,9 +11,37 @@ #ifndef WEBRTC_BASE_ASYNCRESOLVERINTERFACE_H_ #define WEBRTC_BASE_ASYNCRESOLVERINTERFACE_H_ +#include "webrtc/base/sigslot.h" +#include "webrtc/base/socketaddress.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/asyncresolverinterface.h" +namespace rtc { + +// This interface defines the methods to resolve the address asynchronously. +class AsyncResolverInterface { + public: + AsyncResolverInterface(); + virtual ~AsyncResolverInterface(); + + // Start address resolve process. + virtual void Start(const SocketAddress& addr) = 0; + // Returns top most resolved address of |family| + virtual bool GetResolvedAddress(int family, SocketAddress* addr) const = 0; + // Returns error from resolver. + virtual int GetError() const = 0; + // Delete the resolver. + virtual void Destroy(bool wait) = 0; + // Returns top most resolved IPv4 address if address is resolved successfully. + // Otherwise returns address set in SetAddress. + SocketAddress address() const { + SocketAddress addr; + GetResolvedAddress(AF_INET, &addr); + return addr; + } + + // This signal is fired when address resolve process is completed. + sigslot::signal1 SignalDone; +}; + +} // namespace rtc #endif diff --git a/webrtc/rtc_base/asyncsocket.cc b/webrtc/base/asyncsocket.cc similarity index 100% rename from webrtc/rtc_base/asyncsocket.cc rename to webrtc/base/asyncsocket.cc diff --git a/webrtc/base/asyncsocket.h b/webrtc/base/asyncsocket.h index 9c971394d3..6dc41b67f4 100644 --- a/webrtc/base/asyncsocket.h +++ b/webrtc/base/asyncsocket.h @@ -11,9 +11,73 @@ #ifndef WEBRTC_BASE_ASYNCSOCKET_H_ #define WEBRTC_BASE_ASYNCSOCKET_H_ +#include "webrtc/base/sigslot.h" +#include "webrtc/base/socket.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/asyncsocket.h" +namespace rtc { + +// TODO: Remove Socket and rename AsyncSocket to Socket. + +// Provides the ability to perform socket I/O asynchronously. +class AsyncSocket : public Socket { + public: + AsyncSocket(); + ~AsyncSocket() override; + + AsyncSocket* Accept(SocketAddress* paddr) override = 0; + + // SignalReadEvent and SignalWriteEvent use multi_threaded_local to allow + // access concurrently from different thread. + // For example SignalReadEvent::connect will be called in AsyncUDPSocket ctor + // but at the same time the SocketDispatcher maybe signaling the read event. + // ready to read + sigslot::signal1 SignalReadEvent; + // ready to write + sigslot::signal1 SignalWriteEvent; + sigslot::signal1 SignalConnectEvent; // connected + sigslot::signal2 SignalCloseEvent; // closed +}; + +class AsyncSocketAdapter : public AsyncSocket, public sigslot::has_slots<> { + public: + // The adapted socket may explicitly be null, and later assigned using Attach. + // However, subclasses which support detached mode must override any methods + // that will be called during the detached period (usually GetState()), to + // avoid dereferencing a null pointer. + explicit AsyncSocketAdapter(AsyncSocket* socket); + ~AsyncSocketAdapter() override; + void Attach(AsyncSocket* socket); + SocketAddress GetLocalAddress() const override; + SocketAddress GetRemoteAddress() const override; + int Bind(const SocketAddress& addr) override; + int Connect(const SocketAddress& addr) override; + int Send(const void* pv, size_t cb) override; + int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; + int Recv(void* pv, size_t cb, int64_t* timestamp) override; + int RecvFrom(void* pv, + size_t cb, + SocketAddress* paddr, + int64_t* timestamp) override; + int Listen(int backlog) override; + AsyncSocket* Accept(SocketAddress* paddr) override; + int Close() override; + int GetError() const override; + void SetError(int error) override; + ConnState GetState() const override; + int GetOption(Option opt, int* value) override; + int SetOption(Option opt, int value) override; + + protected: + virtual void OnConnectEvent(AsyncSocket* socket); + virtual void OnReadEvent(AsyncSocket* socket); + virtual void OnWriteEvent(AsyncSocket* socket); + virtual void OnCloseEvent(AsyncSocket* socket, int err); + + AsyncSocket* socket_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_ASYNCSOCKET_H_ diff --git a/webrtc/rtc_base/asynctcpsocket.cc b/webrtc/base/asynctcpsocket.cc similarity index 100% rename from webrtc/rtc_base/asynctcpsocket.cc rename to webrtc/base/asynctcpsocket.cc diff --git a/webrtc/base/asynctcpsocket.h b/webrtc/base/asynctcpsocket.h index d64927bcd5..2e4ff9aaa7 100644 --- a/webrtc/base/asynctcpsocket.h +++ b/webrtc/base/asynctcpsocket.h @@ -11,9 +11,98 @@ #ifndef WEBRTC_BASE_ASYNCTCPSOCKET_H_ #define WEBRTC_BASE_ASYNCTCPSOCKET_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/asynctcpsocket.h" +#include "webrtc/base/asyncpacketsocket.h" +#include "webrtc/base/buffer.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/socketfactory.h" + +namespace rtc { + +// Simulates UDP semantics over TCP. Send and Recv packet sizes +// are preserved, and drops packets silently on Send, rather than +// buffer them in user space. +class AsyncTCPSocketBase : public AsyncPacketSocket { + public: + AsyncTCPSocketBase(AsyncSocket* socket, bool listen, size_t max_packet_size); + ~AsyncTCPSocketBase() override; + + // Pure virtual methods to send and recv data. + int Send(const void *pv, size_t cb, + const rtc::PacketOptions& options) override = 0; + virtual void ProcessInput(char* data, size_t* len) = 0; + // Signals incoming connection. + virtual void HandleIncomingConnection(AsyncSocket* socket) = 0; + + SocketAddress GetLocalAddress() const override; + SocketAddress GetRemoteAddress() const override; + int SendTo(const void* pv, + size_t cb, + const SocketAddress& addr, + const rtc::PacketOptions& options) override; + int Close() override; + + State GetState() const override; + int GetOption(Socket::Option opt, int* value) override; + int SetOption(Socket::Option opt, int value) override; + int GetError() const override; + void SetError(int error) override; + + protected: + // Binds and connects |socket| and creates AsyncTCPSocket for + // it. Takes ownership of |socket|. Returns null if bind() or + // connect() fail (|socket| is destroyed in that case). + static AsyncSocket* ConnectSocket(AsyncSocket* socket, + const SocketAddress& bind_address, + const SocketAddress& remote_address); + virtual int SendRaw(const void* pv, size_t cb); + int FlushOutBuffer(); + // Add data to |outbuf_|. + void AppendToOutBuffer(const void* pv, size_t cb); + + // Helper methods for |outpos_|. + bool IsOutBufferEmpty() const { return outbuf_.size() == 0; } + void ClearOutBuffer() { outbuf_.Clear(); } + + private: + // Called by the underlying socket + void OnConnectEvent(AsyncSocket* socket); + void OnReadEvent(AsyncSocket* socket); + void OnWriteEvent(AsyncSocket* socket); + void OnCloseEvent(AsyncSocket* socket, int error); + + std::unique_ptr socket_; + bool listen_; + Buffer inbuf_; + Buffer outbuf_; + size_t max_insize_; + size_t max_outsize_; + + RTC_DISALLOW_COPY_AND_ASSIGN(AsyncTCPSocketBase); +}; + +class AsyncTCPSocket : public AsyncTCPSocketBase { + public: + // Binds and connects |socket| and creates AsyncTCPSocket for + // it. Takes ownership of |socket|. Returns null if bind() or + // connect() fail (|socket| is destroyed in that case). + static AsyncTCPSocket* Create(AsyncSocket* socket, + const SocketAddress& bind_address, + const SocketAddress& remote_address); + AsyncTCPSocket(AsyncSocket* socket, bool listen); + ~AsyncTCPSocket() override {} + + int Send(const void* pv, + size_t cb, + const rtc::PacketOptions& options) override; + void ProcessInput(char* data, size_t* len) override; + void HandleIncomingConnection(AsyncSocket* socket) override; + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(AsyncTCPSocket); +}; + +} // namespace rtc #endif // WEBRTC_BASE_ASYNCTCPSOCKET_H_ diff --git a/webrtc/rtc_base/asynctcpsocket_unittest.cc b/webrtc/base/asynctcpsocket_unittest.cc similarity index 100% rename from webrtc/rtc_base/asynctcpsocket_unittest.cc rename to webrtc/base/asynctcpsocket_unittest.cc diff --git a/webrtc/rtc_base/asyncudpsocket.cc b/webrtc/base/asyncudpsocket.cc similarity index 100% rename from webrtc/rtc_base/asyncudpsocket.cc rename to webrtc/base/asyncudpsocket.cc diff --git a/webrtc/base/asyncudpsocket.h b/webrtc/base/asyncudpsocket.h index c3212c0cc6..e5535e0273 100644 --- a/webrtc/base/asyncudpsocket.h +++ b/webrtc/base/asyncudpsocket.h @@ -11,9 +11,57 @@ #ifndef WEBRTC_BASE_ASYNCUDPSOCKET_H_ #define WEBRTC_BASE_ASYNCUDPSOCKET_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/asyncudpsocket.h" +#include "webrtc/base/asyncpacketsocket.h" +#include "webrtc/base/socketfactory.h" + +namespace rtc { + +// Provides the ability to receive packets asynchronously. Sends are not +// buffered since it is acceptable to drop packets under high load. +class AsyncUDPSocket : public AsyncPacketSocket { + public: + // Binds |socket| and creates AsyncUDPSocket for it. Takes ownership + // of |socket|. Returns null if bind() fails (|socket| is destroyed + // in that case). + static AsyncUDPSocket* Create(AsyncSocket* socket, + const SocketAddress& bind_address); + // Creates a new socket for sending asynchronous UDP packets using an + // asynchronous socket from the given factory. + static AsyncUDPSocket* Create(SocketFactory* factory, + const SocketAddress& bind_address); + explicit AsyncUDPSocket(AsyncSocket* socket); + ~AsyncUDPSocket() override; + + SocketAddress GetLocalAddress() const override; + SocketAddress GetRemoteAddress() const override; + int Send(const void* pv, + size_t cb, + const rtc::PacketOptions& options) override; + int SendTo(const void* pv, + size_t cb, + const SocketAddress& addr, + const rtc::PacketOptions& options) override; + int Close() override; + + State GetState() const override; + int GetOption(Socket::Option opt, int* value) override; + int SetOption(Socket::Option opt, int value) override; + int GetError() const override; + void SetError(int error) override; + + private: + // Called when the underlying socket is ready to be read from. + void OnReadEvent(AsyncSocket* socket); + // Called when the underlying socket is ready to send. + void OnWriteEvent(AsyncSocket* socket); + + std::unique_ptr socket_; + char* buf_; + size_t size_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_ASYNCUDPSOCKET_H_ diff --git a/webrtc/rtc_base/asyncudpsocket_unittest.cc b/webrtc/base/asyncudpsocket_unittest.cc similarity index 100% rename from webrtc/rtc_base/asyncudpsocket_unittest.cc rename to webrtc/base/asyncudpsocket_unittest.cc diff --git a/webrtc/base/atomicops.h b/webrtc/base/atomicops.h index 3c3684814a..a286bf01cc 100644 --- a/webrtc/base/atomicops.h +++ b/webrtc/base/atomicops.h @@ -11,9 +11,77 @@ #ifndef WEBRTC_BASE_ATOMICOPS_H_ #define WEBRTC_BASE_ATOMICOPS_H_ +#if defined(WEBRTC_WIN) +// Include winsock2.h before including to maintain consistency with +// win32.h. We can't include win32.h directly here since it pulls in +// headers such as basictypes.h which causes problems in Chromium where webrtc +// exists as two separate projects, webrtc and libjingle. +#include +#include +#endif // defined(WEBRTC_WIN) -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/atomicops.h" +namespace rtc { +class AtomicOps { + public: +#if defined(WEBRTC_WIN) + // Assumes sizeof(int) == sizeof(LONG), which it is on Win32 and Win64. + static int Increment(volatile int* i) { + return ::InterlockedIncrement(reinterpret_cast(i)); + } + static int Decrement(volatile int* i) { + return ::InterlockedDecrement(reinterpret_cast(i)); + } + static int AcquireLoad(volatile const int* i) { + return *i; + } + static void ReleaseStore(volatile int* i, int value) { + *i = value; + } + static int CompareAndSwap(volatile int* i, int old_value, int new_value) { + return ::InterlockedCompareExchange(reinterpret_cast(i), + new_value, + old_value); + } + // Pointer variants. + template + static T* AcquireLoadPtr(T* volatile* ptr) { + return *ptr; + } + template + static T* CompareAndSwapPtr(T* volatile* ptr, T* old_value, T* new_value) { + return static_cast(::InterlockedCompareExchangePointer( + reinterpret_cast(ptr), new_value, old_value)); + } +#else + static int Increment(volatile int* i) { + return __sync_add_and_fetch(i, 1); + } + static int Decrement(volatile int* i) { + return __sync_sub_and_fetch(i, 1); + } + static int AcquireLoad(volatile const int* i) { + return __atomic_load_n(i, __ATOMIC_ACQUIRE); + } + static void ReleaseStore(volatile int* i, int value) { + __atomic_store_n(i, value, __ATOMIC_RELEASE); + } + static int CompareAndSwap(volatile int* i, int old_value, int new_value) { + return __sync_val_compare_and_swap(i, old_value, new_value); + } + // Pointer variants. + template + static T* AcquireLoadPtr(T* volatile* ptr) { + return __atomic_load_n(ptr, __ATOMIC_ACQUIRE); + } + template + static T* CompareAndSwapPtr(T* volatile* ptr, T* old_value, T* new_value) { + return __sync_val_compare_and_swap(ptr, old_value, new_value); + } +#endif +}; + + + +} #endif // WEBRTC_BASE_ATOMICOPS_H_ diff --git a/webrtc/rtc_base/atomicops_unittest.cc b/webrtc/base/atomicops_unittest.cc similarity index 100% rename from webrtc/rtc_base/atomicops_unittest.cc rename to webrtc/base/atomicops_unittest.cc diff --git a/webrtc/rtc_base/base64.cc b/webrtc/base/base64.cc similarity index 100% rename from webrtc/rtc_base/base64.cc rename to webrtc/base/base64.cc diff --git a/webrtc/base/base64.h b/webrtc/base/base64.h index 1e28357a67..eba3cc0d1d 100644 --- a/webrtc/base/base64.h +++ b/webrtc/base/base64.h @@ -9,12 +9,115 @@ //* intact. //********************************************************************* -#ifndef WEBRTC_BASE_BASE64_H_ -#define WEBRTC_BASE_BASE64_H_ +#ifndef WEBRTC_BASE_BASE64_H__ +#define WEBRTC_BASE_BASE64_H__ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/base64.h" +namespace rtc { -#endif // WEBRTC_BASE_BASE64_H_ +class Base64 { + public: + enum DecodeOption { + DO_PARSE_STRICT = 1, // Parse only base64 characters + DO_PARSE_WHITE = 2, // Parse only base64 and whitespace characters + DO_PARSE_ANY = 3, // Parse all characters + DO_PARSE_MASK = 3, + + DO_PAD_YES = 4, // Padding is required + DO_PAD_ANY = 8, // Padding is optional + DO_PAD_NO = 12, // Padding is disallowed + DO_PAD_MASK = 12, + + DO_TERM_BUFFER = 16, // Must termiante at end of buffer + DO_TERM_CHAR = 32, // May terminate at any character boundary + DO_TERM_ANY = 48, // May terminate at a sub-character bit offset + DO_TERM_MASK = 48, + + // Strictest interpretation + DO_STRICT = DO_PARSE_STRICT | DO_PAD_YES | DO_TERM_BUFFER, + + DO_LAX = DO_PARSE_ANY | DO_PAD_ANY | DO_TERM_CHAR, + }; + typedef int DecodeFlags; + + static bool IsBase64Char(char ch); + + // Get the char next to the |ch| from the Base64Table. + // If the |ch| is the last one in the Base64Table then returns + // the first one from the table. + // Expects the |ch| be a base64 char. + // The result will be saved in |next_ch|. + // Returns true on success. + static bool GetNextBase64Char(char ch, char* next_ch); + + // Determines whether the given string consists entirely of valid base64 + // encoded characters. + static bool IsBase64Encoded(const std::string& str); + + static void EncodeFromArray(const void* data, + size_t len, + std::string* result); + static bool DecodeFromArray(const char* data, + size_t len, + DecodeFlags flags, + std::string* result, + size_t* data_used); + static bool DecodeFromArray(const char* data, + size_t len, + DecodeFlags flags, + std::vector* result, + size_t* data_used); + static bool DecodeFromArray(const char* data, + size_t len, + DecodeFlags flags, + std::vector* result, + size_t* data_used); + + // Convenience Methods + static inline std::string Encode(const std::string& data) { + std::string result; + EncodeFromArray(data.data(), data.size(), &result); + return result; + } + static inline std::string Decode(const std::string& data, DecodeFlags flags) { + std::string result; + DecodeFromArray(data.data(), data.size(), flags, &result, nullptr); + return result; + } + static inline bool Decode(const std::string& data, + DecodeFlags flags, + std::string* result, + size_t* data_used) { + return DecodeFromArray(data.data(), data.size(), flags, result, data_used); + } + static inline bool Decode(const std::string& data, + DecodeFlags flags, + std::vector* result, + size_t* data_used) { + return DecodeFromArray(data.data(), data.size(), flags, result, data_used); + } + + private: + static const char Base64Table[]; + static const unsigned char DecodeTable[]; + + static size_t GetNextQuantum(DecodeFlags parse_flags, + bool illegal_pads, + const char* data, + size_t len, + size_t* dpos, + unsigned char qbuf[4], + bool* padded); + template + static bool DecodeFromArrayTemplate(const char* data, + size_t len, + DecodeFlags flags, + T* result, + size_t* data_used); +}; + +} // namespace rtc + +#endif // WEBRTC_BASE_BASE64_H__ diff --git a/webrtc/rtc_base/base64_unittest.cc b/webrtc/base/base64_unittest.cc similarity index 100% rename from webrtc/rtc_base/base64_unittest.cc rename to webrtc/base/base64_unittest.cc diff --git a/webrtc/base/basictypes.h b/webrtc/base/basictypes.h index 42ffa5a62e..87dcdc6d11 100644 --- a/webrtc/base/basictypes.h +++ b/webrtc/base/basictypes.h @@ -11,9 +11,60 @@ #ifndef WEBRTC_BASE_BASICTYPES_H_ #define WEBRTC_BASE_BASICTYPES_H_ +#include // for NULL, size_t +#include // for uintptr_t and (u)int_t types. -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/basictypes.h" +// Detect compiler is for x86 or x64. +#if defined(__x86_64__) || defined(_M_X64) || \ + defined(__i386__) || defined(_M_IX86) +#define CPU_X86 1 +#endif + +// Detect compiler is for arm. +#if defined(__arm__) || defined(_M_ARM) +#define CPU_ARM 1 +#endif + +#if defined(CPU_X86) && defined(CPU_ARM) +#error CPU_X86 and CPU_ARM both defined. +#endif + +#if !defined(RTC_ARCH_CPU_BIG_ENDIAN) && !defined(RTC_ARCH_CPU_LITTLE_ENDIAN) +// x86, arm or GCC provided __BYTE_ORDER__ macros +#if defined(CPU_X86) || defined(CPU_ARM) || \ + (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) +#define RTC_ARCH_CPU_LITTLE_ENDIAN +#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define RTC_ARCH_CPU_BIG_ENDIAN +#else +#error RTC_ARCH_CPU_BIG_ENDIAN or RTC_ARCH_CPU_LITTLE_ENDIAN should be defined. +#endif +#endif + +#if defined(RTC_ARCH_CPU_BIG_ENDIAN) && defined(RTC_ARCH_CPU_LITTLE_ENDIAN) +#error RTC_ARCH_CPU_BIG_ENDIAN and RTC_ARCH_CPU_LITTLE_ENDIAN both defined. +#endif + +#if defined(WEBRTC_WIN) +typedef int socklen_t; +#endif + +// The following only works for C++ +#ifdef __cplusplus + +#ifndef ALIGNP +#define ALIGNP(p, t) \ + (reinterpret_cast(((reinterpret_cast(p) + \ + ((t) - 1)) & ~((t) - 1)))) +#endif + +#define RTC_IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1))) + +// Use these to declare and define a static local variable that gets leaked so +// that its destructors are not called at exit. +#define RTC_DEFINE_STATIC_LOCAL(type, name, arguments) \ + static type& name = *new type arguments + +#endif // __cplusplus #endif // WEBRTC_BASE_BASICTYPES_H_ diff --git a/webrtc/rtc_base/basictypes_unittest.cc b/webrtc/base/basictypes_unittest.cc similarity index 100% rename from webrtc/rtc_base/basictypes_unittest.cc rename to webrtc/base/basictypes_unittest.cc diff --git a/webrtc/base/bind.h b/webrtc/base/bind.h index 39d441f008..94eb164986 100644 --- a/webrtc/base/bind.h +++ b/webrtc/base/bind.h @@ -61,9 +61,224 @@ #ifndef WEBRTC_BASE_BIND_H_ #define WEBRTC_BASE_BIND_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/bind.h" +#include "webrtc/base/scoped_ref_ptr.h" +#include "webrtc/base/template_util.h" + +#define NONAME + +namespace rtc { +namespace detail { +// This is needed because the template parameters in Bind can't be resolved +// if they're used both as parameters of the function pointer type and as +// parameters to Bind itself: the function pointer parameters are exact +// matches to the function prototype, but the parameters to bind have +// references stripped. This trick allows the compiler to dictate the Bind +// parameter types rather than deduce them. +template struct identity { typedef T type; }; + +// IsRefCounted::value will be true for types that can be used in +// rtc::scoped_refptr, i.e. types that implements nullary functions AddRef() +// and Release(), regardless of their return types. AddRef() and Release() can +// be defined in T or any superclass of T. +template +class IsRefCounted { + // This is a complex implementation detail done with SFINAE. + + // Define types such that sizeof(Yes) != sizeof(No). + struct Yes { char dummy[1]; }; + struct No { char dummy[2]; }; + // Define two overloaded template functions with return types of different + // size. This way, we can use sizeof() on the return type to determine which + // function the compiler would have chosen. One function will be preferred + // over the other if it is possible to create it without compiler errors, + // otherwise the compiler will simply remove it, and default to the less + // preferred function. + template + static Yes test(R* r, decltype(r->AddRef(), r->Release(), 42)); + template static No test(...); + +public: + // Trick the compiler to tell if it's possible to call AddRef() and Release(). + static const bool value = sizeof(test((T*)nullptr, 42)) == sizeof(Yes); +}; + +// TernaryTypeOperator is a helper class to select a type based on a static bool +// value. +template +struct TernaryTypeOperator {}; + +template +struct TernaryTypeOperator { + typedef IfTrueT type; +}; + +template +struct TernaryTypeOperator { + typedef IfFalseT type; +}; + +// PointerType::type will be scoped_refptr for ref counted types, and T* +// otherwise. +template +struct PointerType { + typedef typename TernaryTypeOperator::value, + scoped_refptr, + T*>::type type; +}; + +template +class UnretainedWrapper { + public: + explicit UnretainedWrapper(T* o) : ptr_(o) {} + T* get() const { return ptr_; } + + private: + T* ptr_; +}; + +} // namespace detail + +template +static inline detail::UnretainedWrapper Unretained(T* o) { + return detail::UnretainedWrapper(o); +} + +template +class MethodFunctor { + public: + MethodFunctor(MethodT method, ObjectT* object, Args... args) + : method_(method), object_(object), args_(args...) {} + R operator()() const { + return CallMethod(typename sequence_generator::type()); + } + + private: + // Use sequence_generator (see template_util.h) to expand a MethodFunctor + // with 2 arguments to (std::get<0>(args_), std::get<1>(args_)), for + // instance. + template + R CallMethod(sequence) const { + return (object_->*method_)(std::get(args_)...); + } + + MethodT method_; + typename detail::PointerType::type object_; + typename std::tuple::type...> args_; +}; + +template +class UnretainedMethodFunctor { + public: + UnretainedMethodFunctor(MethodT method, + detail::UnretainedWrapper object, + Args... args) + : method_(method), object_(object.get()), args_(args...) {} + R operator()() const { + return CallMethod(typename sequence_generator::type()); + } + + private: + // Use sequence_generator (see template_util.h) to expand an + // UnretainedMethodFunctor with 2 arguments to (std::get<0>(args_), + // std::get<1>(args_)), for instance. + template + R CallMethod(sequence) const { + return (object_->*method_)(std::get(args_)...); + } + + MethodT method_; + ObjectT* object_; + typename std::tuple::type...> args_; +}; + +template +class Functor { + public: + Functor(const FunctorT& functor, Args... args) + : functor_(functor), args_(args...) {} + R operator()() const { + return CallFunction(typename sequence_generator::type()); + } + + private: + // Use sequence_generator (see template_util.h) to expand a Functor + // with 2 arguments to (std::get<0>(args_), std::get<1>(args_)), for + // instance. + template + R CallFunction(sequence) const { + return functor_(std::get(args_)...); + } + + FunctorT functor_; + typename std::tuple::type...> args_; +}; + +#define FP_T(x) R (ObjectT::*x)(Args...) + +template +MethodFunctor Bind( + FP_T(method), + ObjectT* object, + typename detail::identity::type... args) { + return MethodFunctor(method, object, + args...); +} + +template +MethodFunctor Bind( + FP_T(method), + const scoped_refptr& object, + typename detail::identity::type... args) { + return MethodFunctor(method, object.get(), + args...); +} + +template +UnretainedMethodFunctor Bind( + FP_T(method), + detail::UnretainedWrapper object, + typename detail::identity::type... args) { + return UnretainedMethodFunctor( + method, object, args...); +} + +#undef FP_T +#define FP_T(x) R (ObjectT::*x)(Args...) const + +template +MethodFunctor Bind( + FP_T(method), + const ObjectT* object, + typename detail::identity::type... args) { + return MethodFunctor(method, object, + args...); +} +template +UnretainedMethodFunctor Bind( + FP_T(method), + detail::UnretainedWrapper object, + typename detail::identity::type... args) { + return UnretainedMethodFunctor( + method, object, args...); +} + +#undef FP_T +#define FP_T(x) R (*x)(Args...) + +template +Functor Bind( + FP_T(function), + typename detail::identity::type... args) { + return Functor(function, args...); +} + +#undef FP_T + +} // namespace rtc + +#undef NONAME #endif // WEBRTC_BASE_BIND_H_ diff --git a/webrtc/rtc_base/bind_unittest.cc b/webrtc/base/bind_unittest.cc similarity index 100% rename from webrtc/rtc_base/bind_unittest.cc rename to webrtc/base/bind_unittest.cc diff --git a/webrtc/rtc_base/bitbuffer.cc b/webrtc/base/bitbuffer.cc similarity index 100% rename from webrtc/rtc_base/bitbuffer.cc rename to webrtc/base/bitbuffer.cc diff --git a/webrtc/base/bitbuffer.h b/webrtc/base/bitbuffer.h index 09cba3c10b..b2baaa9095 100644 --- a/webrtc/base/bitbuffer.h +++ b/webrtc/base/bitbuffer.h @@ -11,9 +11,116 @@ #ifndef WEBRTC_BASE_BITBUFFER_H_ #define WEBRTC_BASE_BITBUFFER_H_ +#include // For integer types. +#include // For size_t. -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/bitbuffer.h" +#include "webrtc/base/constructormagic.h" + +namespace rtc { + +// A class, similar to ByteBuffer, that can parse bit-sized data out of a set of +// bytes. Has a similar API to ByteBuffer, plus methods for reading bit-sized +// and exponential golomb encoded data. For a writable version, use +// BitBufferWriter. Unlike ByteBuffer, this class doesn't make a copy of the +// source bytes, so it can be used on read-only data. +// Sizes/counts specify bits/bytes, for clarity. +// Byte order is assumed big-endian/network. +class BitBuffer { + public: + BitBuffer(const uint8_t* bytes, size_t byte_count); + + // Gets the current offset, in bytes/bits, from the start of the buffer. The + // bit offset is the offset into the current byte, in the range [0,7]. + void GetCurrentOffset(size_t* out_byte_offset, size_t* out_bit_offset); + + // The remaining bits in the byte buffer. + uint64_t RemainingBitCount() const; + + // Reads byte-sized values from the buffer. Returns false if there isn't + // enough data left for the specified type. + bool ReadUInt8(uint8_t* val); + bool ReadUInt16(uint16_t* val); + bool ReadUInt32(uint32_t* val); + + // Reads bit-sized values from the buffer. Returns false if there isn't enough + // data left for the specified bit count.. + bool ReadBits(uint32_t* val, size_t bit_count); + + // Peeks bit-sized values from the buffer. Returns false if there isn't enough + // data left for the specified number of bits. Doesn't move the current + // offset. + bool PeekBits(uint32_t* val, size_t bit_count); + + // Reads the exponential golomb encoded value at the current offset. + // Exponential golomb values are encoded as: + // 1) x = source val + 1 + // 2) In binary, write [countbits(x) - 1] 0s, then x + // To decode, we count the number of leading 0 bits, read that many + 1 bits, + // and increment the result by 1. + // Returns false if there isn't enough data left for the specified type, or if + // the value wouldn't fit in a uint32_t. + bool ReadExponentialGolomb(uint32_t* val); + // Reads signed exponential golomb values at the current offset. Signed + // exponential golomb values are just the unsigned values mapped to the + // sequence 0, 1, -1, 2, -2, etc. in order. + bool ReadSignedExponentialGolomb(int32_t* val); + + // Moves current position |byte_count| bytes forward. Returns false if + // there aren't enough bytes left in the buffer. + bool ConsumeBytes(size_t byte_count); + // Moves current position |bit_count| bits forward. Returns false if + // there aren't enough bits left in the buffer. + bool ConsumeBits(size_t bit_count); + + // Sets the current offset to the provied byte/bit offsets. The bit + // offset is from the given byte, in the range [0,7]. + bool Seek(size_t byte_offset, size_t bit_offset); + + protected: + const uint8_t* const bytes_; + // The total size of |bytes_|. + size_t byte_count_; + // The current offset, in bytes, from the start of |bytes_|. + size_t byte_offset_; + // The current offset, in bits, into the current byte. + size_t bit_offset_; + + RTC_DISALLOW_COPY_AND_ASSIGN(BitBuffer); +}; + +// A BitBuffer API for write operations. Supports symmetric write APIs to the +// reading APIs of BitBuffer. Note that the read/write offset is shared with the +// BitBuffer API, so both reading and writing will consume bytes/bits. +class BitBufferWriter : public BitBuffer { + public: + // Constructs a bit buffer for the writable buffer of |bytes|. + BitBufferWriter(uint8_t* bytes, size_t byte_count); + + // Writes byte-sized values from the buffer. Returns false if there isn't + // enough data left for the specified type. + bool WriteUInt8(uint8_t val); + bool WriteUInt16(uint16_t val); + bool WriteUInt32(uint32_t val); + + // Writes bit-sized values to the buffer. Returns false if there isn't enough + // room left for the specified number of bits. + bool WriteBits(uint64_t val, size_t bit_count); + + // Writes the exponential golomb encoded version of the supplied value. + // Returns false if there isn't enough room left for the value. + bool WriteExponentialGolomb(uint32_t val); + // Writes the signed exponential golomb version of the supplied value. + // Signed exponential golomb values are just the unsigned values mapped to the + // sequence 0, 1, -1, 2, -2, etc. in order. + bool WriteSignedExponentialGolomb(int32_t val); + + private: + // The buffer, as a writable array. + uint8_t* const writable_bytes_; + + RTC_DISALLOW_COPY_AND_ASSIGN(BitBufferWriter); +}; + +} // namespace rtc #endif // WEBRTC_BASE_BITBUFFER_H_ diff --git a/webrtc/rtc_base/bitbuffer_unittest.cc b/webrtc/base/bitbuffer_unittest.cc similarity index 100% rename from webrtc/rtc_base/bitbuffer_unittest.cc rename to webrtc/base/bitbuffer_unittest.cc diff --git a/webrtc/base/buffer.h b/webrtc/base/buffer.h index 92c85d9591..ecc4b2321d 100644 --- a/webrtc/base/buffer.h +++ b/webrtc/base/buffer.h @@ -11,8 +11,373 @@ #ifndef WEBRTC_BASE_BUFFER_H_ #define WEBRTC_BASE_BUFFER_H_ -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/buffer.h" +#include +#include +#include +#include +#include + +#include "webrtc/base/array_view.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/type_traits.h" + +namespace rtc { + +namespace internal { + +// (Internal; please don't use outside this file.) Determines if elements of +// type U are compatible with a BufferT. For most types, we just ignore +// top-level const and forbid top-level volatile and require T and U to be +// otherwise equal, but all byte-sized integers (notably char, int8_t, and +// uint8_t) are compatible with each other. (Note: We aim to get rid of this +// behavior, and treat all types the same.) +template +struct BufferCompat { + static constexpr bool value = + !std::is_volatile::value && + ((std::is_integral::value && sizeof(T) == 1) + ? (std::is_integral::value && sizeof(U) == 1) + : (std::is_same::type>::value)); +}; + +} // namespace internal + +// Basic buffer class, can be grown and shrunk dynamically. +// Unlike std::string/vector, does not initialize data when increasing size. +template +class BufferT { + // We want T's destructor and default constructor to be trivial, i.e. perform + // no action, so that we don't have to touch the memory we allocate and + // deallocate. And we want T to be trivially copyable, so that we can copy T + // instances with std::memcpy. This is precisely the definition of a trivial + // type. + static_assert(std::is_trivial::value, "T must be a trivial type."); + + // This class relies heavily on being able to mutate its data. + static_assert(!std::is_const::value, "T may not be const"); + + public: + using value_type = T; + + // An empty BufferT. + BufferT() : size_(0), capacity_(0), data_(nullptr) { + RTC_DCHECK(IsConsistent()); + } + + // Disable copy construction and copy assignment, since copying a buffer is + // expensive enough that we want to force the user to be explicit about it. + BufferT(const BufferT&) = delete; + BufferT& operator=(const BufferT&) = delete; + + BufferT(BufferT&& buf) + : size_(buf.size()), + capacity_(buf.capacity()), + data_(std::move(buf.data_)) { + RTC_DCHECK(IsConsistent()); + buf.OnMovedFrom(); + } + + // Construct a buffer with the specified number of uninitialized elements. + explicit BufferT(size_t size) : BufferT(size, size) {} + + BufferT(size_t size, size_t capacity) + : size_(size), + capacity_(std::max(size, capacity)), + data_(new T[capacity_]) { + RTC_DCHECK(IsConsistent()); + } + + // Construct a buffer and copy the specified number of elements into it. + template ::value>::type* = nullptr> + BufferT(const U* data, size_t size) : BufferT(data, size, size) {} + + template ::value>::type* = nullptr> + BufferT(U* data, size_t size, size_t capacity) : BufferT(size, capacity) { + static_assert(sizeof(T) == sizeof(U), ""); + std::memcpy(data_.get(), data, size * sizeof(U)); + } + + // Construct a buffer from the contents of an array. + template ::value>::type* = nullptr> + BufferT(U (&array)[N]) : BufferT(array, N) {} + + // Get a pointer to the data. Just .data() will give you a (const) T*, but if + // T is a byte-sized integer, you may also use .data() for any other + // byte-sized integer U. + template ::value>::type* = nullptr> + const U* data() const { + RTC_DCHECK(IsConsistent()); + return reinterpret_cast(data_.get()); + } + + template ::value>::type* = nullptr> + U* data() { + RTC_DCHECK(IsConsistent()); + return reinterpret_cast(data_.get()); + } + + bool empty() const { + RTC_DCHECK(IsConsistent()); + return size_ == 0; + } + + size_t size() const { + RTC_DCHECK(IsConsistent()); + return size_; + } + + size_t capacity() const { + RTC_DCHECK(IsConsistent()); + return capacity_; + } + + BufferT& operator=(BufferT&& buf) { + RTC_DCHECK(IsConsistent()); + RTC_DCHECK(buf.IsConsistent()); + size_ = buf.size_; + capacity_ = buf.capacity_; + data_ = std::move(buf.data_); + buf.OnMovedFrom(); + return *this; + } + + bool operator==(const BufferT& buf) const { + RTC_DCHECK(IsConsistent()); + if (size_ != buf.size_) { + return false; + } + if (std::is_integral::value) { + // Optimization. + return std::memcmp(data_.get(), buf.data_.get(), size_ * sizeof(T)) == 0; + } + for (size_t i = 0; i < size_; ++i) { + if (data_[i] != buf.data_[i]) { + return false; + } + } + return true; + } + + bool operator!=(const BufferT& buf) const { return !(*this == buf); } + + T& operator[](size_t index) { + RTC_DCHECK_LT(index, size_); + return data()[index]; + } + + T operator[](size_t index) const { + RTC_DCHECK_LT(index, size_); + return data()[index]; + } + + T* begin() { return data(); } + T* end() { return data() + size(); } + const T* begin() const { return data(); } + const T* end() const { return data() + size(); } + const T* cbegin() const { return data(); } + const T* cend() const { return data() + size(); } + + // The SetData functions replace the contents of the buffer. They accept the + // same input types as the constructors. + template ::value>::type* = nullptr> + void SetData(const U* data, size_t size) { + RTC_DCHECK(IsConsistent()); + size_ = 0; + AppendData(data, size); + } + + template ::value>::type* = nullptr> + void SetData(const U (&array)[N]) { + SetData(array, N); + } + + template ::value>::type* = nullptr> + void SetData(const W& w) { + SetData(w.data(), w.size()); + } + + // Replace the data in the buffer with at most |max_elements| of data, using + // the function |setter|, which should have the following signature: + // size_t setter(ArrayView view) + // |setter| is given an appropriately typed ArrayView of the area in which to + // write the data (i.e. starting at the beginning of the buffer) and should + // return the number of elements actually written. This number must be <= + // |max_elements|. + template ::value>::type* = nullptr> + size_t SetData(size_t max_elements, F&& setter) { + RTC_DCHECK(IsConsistent()); + size_ = 0; + return AppendData(max_elements, std::forward(setter)); + } + + // The AppendData functions add data to the end of the buffer. They accept + // the same input types as the constructors. + template ::value>::type* = nullptr> + void AppendData(const U* data, size_t size) { + RTC_DCHECK(IsConsistent()); + const size_t new_size = size_ + size; + EnsureCapacityWithHeadroom(new_size, true); + static_assert(sizeof(T) == sizeof(U), ""); + std::memcpy(data_.get() + size_, data, size * sizeof(U)); + size_ = new_size; + RTC_DCHECK(IsConsistent()); + } + + template ::value>::type* = nullptr> + void AppendData(const U (&array)[N]) { + AppendData(array, N); + } + + template ::value>::type* = nullptr> + void AppendData(const W& w) { + AppendData(w.data(), w.size()); + } + + template ::value>::type* = nullptr> + void AppendData(const U& item) { + AppendData(&item, 1); + } + + // Append at most |max_elements| to the end of the buffer, using the function + // |setter|, which should have the following signature: + // size_t setter(ArrayView view) + // |setter| is given an appropriately typed ArrayView of the area in which to + // write the data (i.e. starting at the former end of the buffer) and should + // return the number of elements actually written. This number must be <= + // |max_elements|. + template ::value>::type* = nullptr> + size_t AppendData(size_t max_elements, F&& setter) { + RTC_DCHECK(IsConsistent()); + const size_t old_size = size_; + SetSize(old_size + max_elements); + U* base_ptr = data() + old_size; + size_t written_elements = setter(rtc::ArrayView(base_ptr, max_elements)); + + RTC_CHECK_LE(written_elements, max_elements); + size_ = old_size + written_elements; + RTC_DCHECK(IsConsistent()); + return written_elements; + } + + // Sets the size of the buffer. If the new size is smaller than the old, the + // buffer contents will be kept but truncated; if the new size is greater, + // the existing contents will be kept and the new space will be + // uninitialized. + void SetSize(size_t size) { + EnsureCapacityWithHeadroom(size, true); + size_ = size; + } + + // Ensure that the buffer size can be increased to at least capacity without + // further reallocation. (Of course, this operation might need to reallocate + // the buffer.) + void EnsureCapacity(size_t capacity) { + // Don't allocate extra headroom, since the user is asking for a specific + // capacity. + EnsureCapacityWithHeadroom(capacity, false); + } + + // Resets the buffer to zero size without altering capacity. Works even if the + // buffer has been moved from. + void Clear() { + size_ = 0; + RTC_DCHECK(IsConsistent()); + } + + // Swaps two buffers. Also works for buffers that have been moved from. + friend void swap(BufferT& a, BufferT& b) { + using std::swap; + swap(a.size_, b.size_); + swap(a.capacity_, b.capacity_); + swap(a.data_, b.data_); + } + + private: + void EnsureCapacityWithHeadroom(size_t capacity, bool extra_headroom) { + RTC_DCHECK(IsConsistent()); + if (capacity <= capacity_) + return; + + // If the caller asks for extra headroom, ensure that the new capacity is + // >= 1.5 times the old capacity. Any constant > 1 is sufficient to prevent + // quadratic behavior; as to why we pick 1.5 in particular, see + // https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md and + // http://www.gahcep.com/cpp-internals-stl-vector-part-1/. + const size_t new_capacity = + extra_headroom ? std::max(capacity, capacity_ + capacity_ / 2) + : capacity; + + std::unique_ptr new_data(new T[new_capacity]); + std::memcpy(new_data.get(), data_.get(), size_ * sizeof(T)); + data_ = std::move(new_data); + capacity_ = new_capacity; + RTC_DCHECK(IsConsistent()); + } + + // Precondition for all methods except Clear and the destructor. + // Postcondition for all methods except move construction and move + // assignment, which leave the moved-from object in a possibly inconsistent + // state. + bool IsConsistent() const { + return (data_ || capacity_ == 0) && capacity_ >= size_; + } + + // Called when *this has been moved from. Conceptually it's a no-op, but we + // can mutate the state slightly to help subsequent sanity checks catch bugs. + void OnMovedFrom() { +#if RTC_DCHECK_IS_ON + // Make *this consistent and empty. Shouldn't be necessary, but better safe + // than sorry. + size_ = 0; + capacity_ = 0; +#else + // Ensure that *this is always inconsistent, to provoke bugs. + size_ = 1; + capacity_ = 0; +#endif + } + + size_t size_; + size_t capacity_; + std::unique_ptr data_; +}; + +// By far the most common sort of buffer. +using Buffer = BufferT; + +} // namespace rtc #endif // WEBRTC_BASE_BUFFER_H_ diff --git a/webrtc/rtc_base/buffer_unittest.cc b/webrtc/base/buffer_unittest.cc similarity index 100% rename from webrtc/rtc_base/buffer_unittest.cc rename to webrtc/base/buffer_unittest.cc diff --git a/webrtc/rtc_base/bufferqueue.cc b/webrtc/base/bufferqueue.cc similarity index 100% rename from webrtc/rtc_base/bufferqueue.cc rename to webrtc/base/bufferqueue.cc diff --git a/webrtc/base/bufferqueue.h b/webrtc/base/bufferqueue.h index 3142ae3703..bc9fc842db 100644 --- a/webrtc/base/bufferqueue.h +++ b/webrtc/base/bufferqueue.h @@ -11,9 +11,51 @@ #ifndef WEBRTC_BASE_BUFFERQUEUE_H_ #define WEBRTC_BASE_BUFFERQUEUE_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/bufferqueue.h" +#include "webrtc/base/buffer.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/criticalsection.h" + +namespace rtc { + +class BufferQueue { + public: + // Creates a buffer queue with a given capacity and default buffer size. + BufferQueue(size_t capacity, size_t default_size); + virtual ~BufferQueue(); + + // Return number of queued buffers. + size_t size() const; + + // Clear the BufferQueue by moving all Buffers from |queue_| to |free_list_|. + void Clear(); + + // ReadFront will only read one buffer at a time and will truncate buffers + // that don't fit in the passed memory. + // Returns true unless no data could be returned. + bool ReadFront(void* data, size_t bytes, size_t* bytes_read); + + // WriteBack always writes either the complete memory or nothing. + // Returns true unless no data could be written. + bool WriteBack(const void* data, size_t bytes, size_t* bytes_written); + + protected: + // These methods are called when the state of the queue changes. + virtual void NotifyReadableForTest() {} + virtual void NotifyWritableForTest() {} + + private: + size_t capacity_; + size_t default_size_; + CriticalSection crit_; + std::deque queue_ GUARDED_BY(crit_); + std::vector free_list_ GUARDED_BY(crit_); + + RTC_DISALLOW_COPY_AND_ASSIGN(BufferQueue); +}; + +} // namespace rtc #endif // WEBRTC_BASE_BUFFERQUEUE_H_ diff --git a/webrtc/rtc_base/bufferqueue_unittest.cc b/webrtc/base/bufferqueue_unittest.cc similarity index 100% rename from webrtc/rtc_base/bufferqueue_unittest.cc rename to webrtc/base/bufferqueue_unittest.cc diff --git a/webrtc/rtc_base/bytebuffer.cc b/webrtc/base/bytebuffer.cc similarity index 100% rename from webrtc/rtc_base/bytebuffer.cc rename to webrtc/base/bytebuffer.cc diff --git a/webrtc/base/bytebuffer.h b/webrtc/base/bytebuffer.h index 0cc9a12d1c..546c447815 100644 --- a/webrtc/base/bytebuffer.h +++ b/webrtc/base/bytebuffer.h @@ -11,9 +11,129 @@ #ifndef WEBRTC_BASE_BYTEBUFFER_H_ #define WEBRTC_BASE_BYTEBUFFER_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/bytebuffer.h" +#include "webrtc/base/basictypes.h" +#include "webrtc/base/buffer.h" +#include "webrtc/base/constructormagic.h" + +namespace rtc { + +class ByteBuffer { + public: + enum ByteOrder { + ORDER_NETWORK = 0, // Default, use network byte order (big endian). + ORDER_HOST, // Use the native order of the host. + }; + + explicit ByteBuffer(ByteOrder byte_order) : byte_order_(byte_order) {} + + ByteOrder Order() const { return byte_order_; } + + private: + ByteOrder byte_order_; + + RTC_DISALLOW_COPY_AND_ASSIGN(ByteBuffer); +}; + +class ByteBufferWriter : public ByteBuffer { + public: + // |byte_order| defines order of bytes in the buffer. + ByteBufferWriter(); + explicit ByteBufferWriter(ByteOrder byte_order); + ByteBufferWriter(const char* bytes, size_t len); + ByteBufferWriter(const char* bytes, size_t len, ByteOrder byte_order); + + ~ByteBufferWriter(); + + const char* Data() const { return bytes_; } + size_t Length() const { return end_; } + size_t Capacity() const { return size_; } + + // Write value to the buffer. Resizes the buffer when it is + // neccessary. + void WriteUInt8(uint8_t val); + void WriteUInt16(uint16_t val); + void WriteUInt24(uint32_t val); + void WriteUInt32(uint32_t val); + void WriteUInt64(uint64_t val); + void WriteUVarint(uint64_t val); + void WriteString(const std::string& val); + void WriteBytes(const char* val, size_t len); + + // Reserves the given number of bytes and returns a char* that can be written + // into. Useful for functions that require a char* buffer and not a + // ByteBufferWriter. + char* ReserveWriteBuffer(size_t len); + + // Resize the buffer to the specified |size|. + void Resize(size_t size); + + // Clears the contents of the buffer. After this, Length() will be 0. + void Clear(); + + private: + void Construct(const char* bytes, size_t size); + + char* bytes_; + size_t size_; + size_t end_; + + // There are sensible ways to define these, but they aren't needed in our code + // base. + RTC_DISALLOW_COPY_AND_ASSIGN(ByteBufferWriter); +}; + +// The ByteBufferReader references the passed data, i.e. the pointer must be +// valid during the lifetime of the reader. +class ByteBufferReader : public ByteBuffer { + public: + ByteBufferReader(const char* bytes, size_t len); + ByteBufferReader(const char* bytes, size_t len, ByteOrder byte_order); + + // Initializes buffer from a zero-terminated string. + explicit ByteBufferReader(const char* bytes); + + explicit ByteBufferReader(const Buffer& buf); + + explicit ByteBufferReader(const ByteBufferWriter& buf); + + // Returns start of unprocessed data. + const char* Data() const { return bytes_ + start_; } + // Returns number of unprocessed bytes. + size_t Length() const { return end_ - start_; } + + // Read a next value from the buffer. Return false if there isn't + // enough data left for the specified type. + bool ReadUInt8(uint8_t* val); + bool ReadUInt16(uint16_t* val); + bool ReadUInt24(uint32_t* val); + bool ReadUInt32(uint32_t* val); + bool ReadUInt64(uint64_t* val); + bool ReadUVarint(uint64_t* val); + bool ReadBytes(char* val, size_t len); + + // Appends next |len| bytes from the buffer to |val|. Returns false + // if there is less than |len| bytes left. + bool ReadString(std::string* val, size_t len); + + // Moves current position |size| bytes forward. Returns false if + // there is less than |size| bytes left in the buffer. Consume doesn't + // permanently remove data, so remembered read positions are still valid + // after this call. + bool Consume(size_t size); + + private: + void Construct(const char* bytes, size_t size); + + const char* bytes_; + size_t size_; + size_t start_; + size_t end_; + + RTC_DISALLOW_COPY_AND_ASSIGN(ByteBufferReader); +}; + +} // namespace rtc #endif // WEBRTC_BASE_BYTEBUFFER_H_ diff --git a/webrtc/rtc_base/bytebuffer_unittest.cc b/webrtc/base/bytebuffer_unittest.cc similarity index 100% rename from webrtc/rtc_base/bytebuffer_unittest.cc rename to webrtc/base/bytebuffer_unittest.cc diff --git a/webrtc/base/byteorder.h b/webrtc/base/byteorder.h index 28cbaa577b..d0cfa5e48e 100644 --- a/webrtc/base/byteorder.h +++ b/webrtc/base/byteorder.h @@ -11,9 +11,168 @@ #ifndef WEBRTC_BASE_BYTEORDER_H_ #define WEBRTC_BASE_BYTEORDER_H_ +#if defined(WEBRTC_POSIX) && !defined(__native_client__) +#include +#endif -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/byteorder.h" +#include "webrtc/base/basictypes.h" + +#if defined(WEBRTC_MAC) +#include + +#define htobe16(v) OSSwapHostToBigInt16(v) +#define htobe32(v) OSSwapHostToBigInt32(v) +#define htobe64(v) OSSwapHostToBigInt64(v) +#define be16toh(v) OSSwapBigToHostInt16(v) +#define be32toh(v) OSSwapBigToHostInt32(v) +#define be64toh(v) OSSwapBigToHostInt64(v) + +#define htole16(v) OSSwapHostToLittleInt16(v) +#define htole32(v) OSSwapHostToLittleInt32(v) +#define htole64(v) OSSwapHostToLittleInt64(v) +#define le16toh(v) OSSwapLittleToHostInt16(v) +#define le32toh(v) OSSwapLittleToHostInt32(v) +#define le64toh(v) OSSwapLittleToHostInt64(v) +#elif defined(WEBRTC_WIN) || defined(__native_client__) + +#if defined(WEBRTC_WIN) +#include +#include +#else +#include +#endif + +#define htobe16(v) htons(v) +#define htobe32(v) htonl(v) +#define be16toh(v) ntohs(v) +#define be32toh(v) ntohl(v) +#if defined(WEBRTC_WIN) +#define htobe64(v) htonll(v) +#define be64toh(v) ntohll(v) +#endif + +#if defined(RTC_ARCH_CPU_LITTLE_ENDIAN) +#define htole16(v) (v) +#define htole32(v) (v) +#define htole64(v) (v) +#define le16toh(v) (v) +#define le32toh(v) (v) +#define le64toh(v) (v) +#if defined(__native_client__) +#define htobe64(v) __builtin_bswap64(v) +#define be64toh(v) __builtin_bswap64(v) +#endif +#elif defined(RTC_ARCH_CPU_BIG_ENDIAN) +#define htole16(v) __builtin_bswap16(v) +#define htole32(v) __builtin_bswap32(v) +#define htole64(v) __builtin_bswap64(v) +#define le16toh(v) __builtin_bswap16(v) +#define le32toh(v) __builtin_bswap32(v) +#define le64toh(v) __builtin_bswap64(v) +#if defined(__native_client__) +#define htobe64(v) (v) +#define be64toh(v) (v) +#endif +#else +#error RTC_ARCH_CPU_BIG_ENDIAN or RTC_ARCH_CPU_LITTLE_ENDIAN must be defined. +#endif // defined(RTC_ARCH_CPU_LITTLE_ENDIAN) +#elif defined(WEBRTC_POSIX) +#include +#endif + +namespace rtc { + +// Reading and writing of little and big-endian numbers from memory + +inline void Set8(void* memory, size_t offset, uint8_t v) { + static_cast(memory)[offset] = v; +} + +inline uint8_t Get8(const void* memory, size_t offset) { + return static_cast(memory)[offset]; +} + +inline void SetBE16(void* memory, uint16_t v) { + *static_cast(memory) = htobe16(v); +} + +inline void SetBE32(void* memory, uint32_t v) { + *static_cast(memory) = htobe32(v); +} + +inline void SetBE64(void* memory, uint64_t v) { + *static_cast(memory) = htobe64(v); +} + +inline uint16_t GetBE16(const void* memory) { + return be16toh(*static_cast(memory)); +} + +inline uint32_t GetBE32(const void* memory) { + return be32toh(*static_cast(memory)); +} + +inline uint64_t GetBE64(const void* memory) { + return be64toh(*static_cast(memory)); +} + +inline void SetLE16(void* memory, uint16_t v) { + *static_cast(memory) = htole16(v); +} + +inline void SetLE32(void* memory, uint32_t v) { + *static_cast(memory) = htole32(v); +} + +inline void SetLE64(void* memory, uint64_t v) { + *static_cast(memory) = htole64(v); +} + +inline uint16_t GetLE16(const void* memory) { + return le16toh(*static_cast(memory)); +} + +inline uint32_t GetLE32(const void* memory) { + return le32toh(*static_cast(memory)); +} + +inline uint64_t GetLE64(const void* memory) { + return le64toh(*static_cast(memory)); +} + +// Check if the current host is big endian. +inline bool IsHostBigEndian() { +#if defined(RTC_ARCH_CPU_BIG_ENDIAN) + return true; +#else + return false; +#endif +} + +inline uint16_t HostToNetwork16(uint16_t n) { + return htobe16(n); +} + +inline uint32_t HostToNetwork32(uint32_t n) { + return htobe32(n); +} + +inline uint64_t HostToNetwork64(uint64_t n) { + return htobe64(n); +} + +inline uint16_t NetworkToHost16(uint16_t n) { + return be16toh(n); +} + +inline uint32_t NetworkToHost32(uint32_t n) { + return be32toh(n); +} + +inline uint64_t NetworkToHost64(uint64_t n) { + return be64toh(n); +} + +} // namespace rtc #endif // WEBRTC_BASE_BYTEORDER_H_ diff --git a/webrtc/rtc_base/byteorder_unittest.cc b/webrtc/base/byteorder_unittest.cc similarity index 100% rename from webrtc/rtc_base/byteorder_unittest.cc rename to webrtc/base/byteorder_unittest.cc diff --git a/webrtc/base/callback.h b/webrtc/base/callback.h index 4da1e6dfab..7ffdcd7373 100644 --- a/webrtc/base/callback.h +++ b/webrtc/base/callback.h @@ -62,9 +62,199 @@ #ifndef WEBRTC_BASE_CALLBACK_H_ #define WEBRTC_BASE_CALLBACK_H_ +#include "webrtc/base/refcount.h" +#include "webrtc/base/scoped_ref_ptr.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/callback.h" +namespace rtc { + +template +class Callback0 { + public: + // Default copy operations are appropriate for this class. + Callback0() {} + template Callback0(const T& functor) + : helper_(new RefCountedObject< HelperImpl >(functor)) {} + R operator()() { + if (empty()) + return R(); + return helper_->Run(); + } + bool empty() const { return !helper_; } + + private: + struct Helper : RefCountInterface { + virtual ~Helper() {} + virtual R Run() = 0; + }; + template struct HelperImpl : Helper { + explicit HelperImpl(const T& functor) : functor_(functor) {} + virtual R Run() { + return functor_(); + } + T functor_; + }; + scoped_refptr helper_; +}; + +template +class Callback1 { + public: + // Default copy operations are appropriate for this class. + Callback1() {} + template Callback1(const T& functor) + : helper_(new RefCountedObject< HelperImpl >(functor)) {} + R operator()(P1 p1) { + if (empty()) + return R(); + return helper_->Run(p1); + } + bool empty() const { return !helper_; } + + private: + struct Helper : RefCountInterface { + virtual ~Helper() {} + virtual R Run(P1 p1) = 0; + }; + template struct HelperImpl : Helper { + explicit HelperImpl(const T& functor) : functor_(functor) {} + virtual R Run(P1 p1) { + return functor_(p1); + } + T functor_; + }; + scoped_refptr helper_; +}; + +template +class Callback2 { + public: + // Default copy operations are appropriate for this class. + Callback2() {} + template Callback2(const T& functor) + : helper_(new RefCountedObject< HelperImpl >(functor)) {} + R operator()(P1 p1, P2 p2) { + if (empty()) + return R(); + return helper_->Run(p1, p2); + } + bool empty() const { return !helper_; } + + private: + struct Helper : RefCountInterface { + virtual ~Helper() {} + virtual R Run(P1 p1, P2 p2) = 0; + }; + template struct HelperImpl : Helper { + explicit HelperImpl(const T& functor) : functor_(functor) {} + virtual R Run(P1 p1, P2 p2) { + return functor_(p1, p2); + } + T functor_; + }; + scoped_refptr helper_; +}; + +template +class Callback3 { + public: + // Default copy operations are appropriate for this class. + Callback3() {} + template Callback3(const T& functor) + : helper_(new RefCountedObject< HelperImpl >(functor)) {} + R operator()(P1 p1, P2 p2, P3 p3) { + if (empty()) + return R(); + return helper_->Run(p1, p2, p3); + } + bool empty() const { return !helper_; } + + private: + struct Helper : RefCountInterface { + virtual ~Helper() {} + virtual R Run(P1 p1, P2 p2, P3 p3) = 0; + }; + template struct HelperImpl : Helper { + explicit HelperImpl(const T& functor) : functor_(functor) {} + virtual R Run(P1 p1, P2 p2, P3 p3) { + return functor_(p1, p2, p3); + } + T functor_; + }; + scoped_refptr helper_; +}; + +template +class Callback4 { + public: + // Default copy operations are appropriate for this class. + Callback4() {} + template Callback4(const T& functor) + : helper_(new RefCountedObject< HelperImpl >(functor)) {} + R operator()(P1 p1, P2 p2, P3 p3, P4 p4) { + if (empty()) + return R(); + return helper_->Run(p1, p2, p3, p4); + } + bool empty() const { return !helper_; } + + private: + struct Helper : RefCountInterface { + virtual ~Helper() {} + virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4) = 0; + }; + template struct HelperImpl : Helper { + explicit HelperImpl(const T& functor) : functor_(functor) {} + virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4) { + return functor_(p1, p2, p3, p4); + } + T functor_; + }; + scoped_refptr helper_; +}; + +template +class Callback5 { + public: + // Default copy operations are appropriate for this class. + Callback5() {} + template Callback5(const T& functor) + : helper_(new RefCountedObject< HelperImpl >(functor)) {} + R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { + if (empty()) + return R(); + return helper_->Run(p1, p2, p3, p4, p5); + } + bool empty() const { return !helper_; } + + private: + struct Helper : RefCountInterface { + virtual ~Helper() {} + virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) = 0; + }; + template struct HelperImpl : Helper { + explicit HelperImpl(const T& functor) : functor_(functor) {} + virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { + return functor_(p1, p2, p3, p4, p5); + } + T functor_; + }; + scoped_refptr helper_; +}; +} // namespace rtc #endif // WEBRTC_BASE_CALLBACK_H_ diff --git a/webrtc/rtc_base/callback.h.pump b/webrtc/base/callback.h.pump similarity index 96% rename from webrtc/rtc_base/callback.h.pump rename to webrtc/base/callback.h.pump index 23899526b9..86957df526 100644 --- a/webrtc/rtc_base/callback.h.pump +++ b/webrtc/base/callback.h.pump @@ -54,8 +54,8 @@ // my_callback = Callback1(); // cout << my_callback.empty() << endl; // true -#ifndef WEBRTC_RTC_BASE_CALLBACK_H_ -#define WEBRTC_RTC_BASE_CALLBACK_H_ +#ifndef WEBRTC_BASE_CALLBACK_H_ +#define WEBRTC_BASE_CALLBACK_H_ #include "webrtc/base/refcount.h" #include "webrtc/base/scoped_ref_ptr.h" @@ -100,4 +100,4 @@ class Callback$i { ]] } // namespace rtc -#endif // WEBRTC_RTC_BASE_CALLBACK_H_ +#endif // WEBRTC_BASE_CALLBACK_H_ diff --git a/webrtc/rtc_base/callback_unittest.cc b/webrtc/base/callback_unittest.cc similarity index 100% rename from webrtc/rtc_base/callback_unittest.cc rename to webrtc/base/callback_unittest.cc diff --git a/webrtc/rtc_base/checks.cc b/webrtc/base/checks.cc similarity index 100% rename from webrtc/rtc_base/checks.cc rename to webrtc/base/checks.cc diff --git a/webrtc/base/checks.h b/webrtc/base/checks.h index f56f157224..b86fb15919 100644 --- a/webrtc/base/checks.h +++ b/webrtc/base/checks.h @@ -11,9 +11,279 @@ #ifndef WEBRTC_BASE_CHECKS_H_ #define WEBRTC_BASE_CHECKS_H_ +#include "webrtc/typedefs.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/checks.h" +// If you for some reson need to know if DCHECKs are on, test the value of +// RTC_DCHECK_IS_ON. (Test its value, not if it's defined; it'll always be +// defined, to either a true or a false value.) +#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) +#define RTC_DCHECK_IS_ON 1 +#else +#define RTC_DCHECK_IS_ON 0 +#endif + +#ifdef __cplusplus +extern "C" { +#endif +NO_RETURN void rtc_FatalMessage(const char* file, int line, const char* msg); +#ifdef __cplusplus +} // extern "C" +#endif + +#ifdef __cplusplus +// C++ version. + +#include +#include + +#include "webrtc/base/safe_compare.h" + +// The macros here print a message to stderr and abort under various +// conditions. All will accept additional stream messages. For example: +// RTC_DCHECK_EQ(foo, bar) << "I'm printed when foo != bar."; +// +// - RTC_CHECK(x) is an assertion that x is always true, and that if it isn't, +// it's better to terminate the process than to continue. During development, +// the reason that it's better to terminate might simply be that the error +// handling code isn't in place yet; in production, the reason might be that +// the author of the code truly believes that x will always be true, but that +// she recognizes that if she is wrong, abrupt and unpleasant process +// termination is still better than carrying on with the assumption violated. +// +// RTC_CHECK always evaluates its argument, so it's OK for x to have side +// effects. +// +// - RTC_DCHECK(x) is the same as RTC_CHECK(x)---an assertion that x is always +// true---except that x will only be evaluated in debug builds; in production +// builds, x is simply assumed to be true. This is useful if evaluating x is +// expensive and the expected cost of failing to detect the violated +// assumption is acceptable. You should not handle cases where a production +// build fails to spot a violated condition, even those that would result in +// crashes. If the code needs to cope with the error, make it cope, but don't +// call RTC_DCHECK; if the condition really can't occur, but you'd sleep +// better at night knowing that the process will suicide instead of carrying +// on in case you were wrong, use RTC_CHECK instead of RTC_DCHECK. +// +// RTC_DCHECK only evaluates its argument in debug builds, so if x has visible +// side effects, you need to write e.g. +// bool w = x; RTC_DCHECK(w); +// +// - RTC_CHECK_EQ, _NE, _GT, ..., and RTC_DCHECK_EQ, _NE, _GT, ... are +// specialized variants of RTC_CHECK and RTC_DCHECK that print prettier +// messages if the condition doesn't hold. Prefer them to raw RTC_CHECK and +// RTC_DCHECK. +// +// - FATAL() aborts unconditionally. +// +// TODO(ajm): Ideally, checks.h would be combined with logging.h, but +// consolidation with system_wrappers/logging.h should happen first. + +namespace rtc { + +// Helper macro which avoids evaluating the arguments to a stream if +// the condition doesn't hold. +#define RTC_LAZY_STREAM(stream, condition) \ + !(condition) ? static_cast(0) : rtc::FatalMessageVoidify() & (stream) + +// The actual stream used isn't important. We reference |ignored| in the code +// but don't evaluate it; this is to avoid "unused variable" warnings (we do so +// in a particularly convoluted way with an extra ?: because that appears to be +// the simplest construct that keeps Visual Studio from complaining about +// condition being unused). +#define RTC_EAT_STREAM_PARAMETERS(ignored) \ + (true ? true : ((void)(ignored), true)) \ + ? static_cast(0) \ + : rtc::FatalMessageVoidify() & rtc::FatalMessage("", 0).stream() + +// Call RTC_EAT_STREAM_PARAMETERS with an argument that fails to compile if +// values of the same types as |a| and |b| can't be compared with the given +// operation, and that would evaluate |a| and |b| if evaluated. +#define RTC_EAT_STREAM_PARAMETERS_OP(op, a, b) \ + RTC_EAT_STREAM_PARAMETERS(((void)rtc::Safe##op(a, b))) + +// RTC_CHECK dies with a fatal error if condition is not true. It is *not* +// controlled by NDEBUG or anything else, so the check will be executed +// regardless of compilation mode. +// +// We make sure RTC_CHECK et al. always evaluates their arguments, as +// doing RTC_CHECK(FunctionWithSideEffect()) is a common idiom. +#define RTC_CHECK(condition) \ + RTC_LAZY_STREAM(rtc::FatalMessage(__FILE__, __LINE__).stream(), \ + !(condition)) \ + << "Check failed: " #condition << std::endl << "# " + +// Helper macro for binary operators. +// Don't use this macro directly in your code, use RTC_CHECK_EQ et al below. +// +// TODO(akalin): Rewrite this so that constructs like if (...) +// RTC_CHECK_EQ(...) else { ... } work properly. +#define RTC_CHECK_OP(name, op, val1, val2) \ + if (std::string* _result = \ + rtc::Check##name##Impl((val1), (val2), #val1 " " #op " " #val2)) \ + rtc::FatalMessage(__FILE__, __LINE__, _result).stream() + +// Build the error message string. This is separate from the "Impl" +// function template because it is not performance critical and so can +// be out of line, while the "Impl" code should be inline. Caller +// takes ownership of the returned string. +template +std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { + std::ostringstream ss; + ss << names << " (" << v1 << " vs. " << v2 << ")"; + std::string* msg = new std::string(ss.str()); + return msg; +} + +// MSVC doesn't like complex extern templates and DLLs. +#if !defined(COMPILER_MSVC) +// Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated +// in logging.cc. +extern template std::string* MakeCheckOpString( + const int&, const int&, const char* names); +extern template +std::string* MakeCheckOpString( + const unsigned long&, const unsigned long&, const char* names); +extern template +std::string* MakeCheckOpString( + const unsigned long&, const unsigned int&, const char* names); +extern template +std::string* MakeCheckOpString( + const unsigned int&, const unsigned long&, const char* names); +extern template +std::string* MakeCheckOpString( + const std::string&, const std::string&, const char* name); +#endif + +// Helper functions for RTC_CHECK_OP macro. +// The (int, int) specialization works around the issue that the compiler +// will not instantiate the template version of the function on values of +// unnamed enum type - see comment below. +#define DEFINE_RTC_CHECK_OP_IMPL(name) \ + template \ + inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ + const char* names) { \ + if (rtc::Safe##name(v1, v2)) \ + return nullptr; \ + else \ + return rtc::MakeCheckOpString(v1, v2, names); \ + } \ + inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \ + if (rtc::Safe##name(v1, v2)) \ + return nullptr; \ + else \ + return rtc::MakeCheckOpString(v1, v2, names); \ + } +DEFINE_RTC_CHECK_OP_IMPL(Eq) +DEFINE_RTC_CHECK_OP_IMPL(Ne) +DEFINE_RTC_CHECK_OP_IMPL(Le) +DEFINE_RTC_CHECK_OP_IMPL(Lt) +DEFINE_RTC_CHECK_OP_IMPL(Ge) +DEFINE_RTC_CHECK_OP_IMPL(Gt) +#undef DEFINE_RTC_CHECK_OP_IMPL + +#define RTC_CHECK_EQ(val1, val2) RTC_CHECK_OP(Eq, ==, val1, val2) +#define RTC_CHECK_NE(val1, val2) RTC_CHECK_OP(Ne, !=, val1, val2) +#define RTC_CHECK_LE(val1, val2) RTC_CHECK_OP(Le, <=, val1, val2) +#define RTC_CHECK_LT(val1, val2) RTC_CHECK_OP(Lt, <, val1, val2) +#define RTC_CHECK_GE(val1, val2) RTC_CHECK_OP(Ge, >=, val1, val2) +#define RTC_CHECK_GT(val1, val2) RTC_CHECK_OP(Gt, >, val1, val2) + +// The RTC_DCHECK macro is equivalent to RTC_CHECK except that it only generates +// code in debug builds. It does reference the condition parameter in all cases, +// though, so callers won't risk getting warnings about unused variables. +#if RTC_DCHECK_IS_ON +#define RTC_DCHECK(condition) RTC_CHECK(condition) +#define RTC_DCHECK_EQ(v1, v2) RTC_CHECK_EQ(v1, v2) +#define RTC_DCHECK_NE(v1, v2) RTC_CHECK_NE(v1, v2) +#define RTC_DCHECK_LE(v1, v2) RTC_CHECK_LE(v1, v2) +#define RTC_DCHECK_LT(v1, v2) RTC_CHECK_LT(v1, v2) +#define RTC_DCHECK_GE(v1, v2) RTC_CHECK_GE(v1, v2) +#define RTC_DCHECK_GT(v1, v2) RTC_CHECK_GT(v1, v2) +#else +#define RTC_DCHECK(condition) RTC_EAT_STREAM_PARAMETERS(condition) +#define RTC_DCHECK_EQ(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Eq, v1, v2) +#define RTC_DCHECK_NE(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Ne, v1, v2) +#define RTC_DCHECK_LE(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Le, v1, v2) +#define RTC_DCHECK_LT(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Lt, v1, v2) +#define RTC_DCHECK_GE(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Ge, v1, v2) +#define RTC_DCHECK_GT(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Gt, v1, v2) +#endif + +// This is identical to LogMessageVoidify but in name. +class FatalMessageVoidify { + public: + FatalMessageVoidify() { } + // This has to be an operator with a precedence lower than << but + // higher than ?: + void operator&(std::ostream&) { } +}; + +#define RTC_UNREACHABLE_CODE_HIT false +#define RTC_NOTREACHED() RTC_DCHECK(RTC_UNREACHABLE_CODE_HIT) + +#define FATAL() rtc::FatalMessage(__FILE__, __LINE__).stream() +// TODO(ajm): Consider adding RTC_NOTIMPLEMENTED macro when +// base/logging.h and system_wrappers/logging.h are consolidated such that we +// can match the Chromium behavior. + +// Like a stripped-down LogMessage from logging.h, except that it aborts. +class FatalMessage { + public: + FatalMessage(const char* file, int line); + // Used for RTC_CHECK_EQ(), etc. Takes ownership of the given string. + FatalMessage(const char* file, int line, std::string* result); + NO_RETURN ~FatalMessage(); + + std::ostream& stream() { return stream_; } + + private: + void Init(const char* file, int line); + + std::ostringstream stream_; +}; + +// Performs the integer division a/b and returns the result. CHECKs that the +// remainder is zero. +template +inline T CheckedDivExact(T a, T b) { + RTC_CHECK_EQ(a % b, 0) << a << " is not evenly divisible by " << b; + return a / b; +} + +} // namespace rtc + +#else // __cplusplus not defined +// C version. Lacks many features compared to the C++ version, but usage +// guidelines are the same. + +#define RTC_CHECK(condition) \ + do { \ + if (!(condition)) { \ + rtc_FatalMessage(__FILE__, __LINE__, "CHECK failed: " #condition); \ + } \ + } while (0) + +#define RTC_CHECK_EQ(a, b) RTC_CHECK((a) == (b)) +#define RTC_CHECK_NE(a, b) RTC_CHECK((a) != (b)) +#define RTC_CHECK_LE(a, b) RTC_CHECK((a) <= (b)) +#define RTC_CHECK_LT(a, b) RTC_CHECK((a) < (b)) +#define RTC_CHECK_GE(a, b) RTC_CHECK((a) >= (b)) +#define RTC_CHECK_GT(a, b) RTC_CHECK((a) > (b)) + +#define RTC_DCHECK(condition) \ + do { \ + if (RTC_DCHECK_IS_ON && !(condition)) { \ + rtc_FatalMessage(__FILE__, __LINE__, "DCHECK failed: " #condition); \ + } \ + } while (0) + +#define RTC_DCHECK_EQ(a, b) RTC_DCHECK((a) == (b)) +#define RTC_DCHECK_NE(a, b) RTC_DCHECK((a) != (b)) +#define RTC_DCHECK_LE(a, b) RTC_DCHECK((a) <= (b)) +#define RTC_DCHECK_LT(a, b) RTC_DCHECK((a) < (b)) +#define RTC_DCHECK_GE(a, b) RTC_DCHECK((a) >= (b)) +#define RTC_DCHECK_GT(a, b) RTC_DCHECK((a) > (b)) + +#endif // __cplusplus #endif // WEBRTC_BASE_CHECKS_H_ diff --git a/webrtc/base/compile_assert_c.h b/webrtc/base/compile_assert_c.h index 934cc9be7c..4d51de3ff2 100644 --- a/webrtc/base/compile_assert_c.h +++ b/webrtc/base/compile_assert_c.h @@ -11,8 +11,11 @@ #ifndef WEBRTC_BASE_COMPILE_ASSERT_C_H_ #define WEBRTC_BASE_COMPILE_ASSERT_C_H_ -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/compile_assert_c.h" +// Use this macro to verify at compile time that certain restrictions are met. +// The argument is the boolean expression to evaluate. +// Example: +// RTC_COMPILE_ASSERT(sizeof(foo) < 128); +// Note: In C++, use static_assert instead! +#define RTC_COMPILE_ASSERT(expression) switch (0) {case 0: case expression:;} #endif // WEBRTC_BASE_COMPILE_ASSERT_C_H_ diff --git a/webrtc/base/constructormagic.h b/webrtc/base/constructormagic.h index 21652c2d3d..6ef7826505 100644 --- a/webrtc/base/constructormagic.h +++ b/webrtc/base/constructormagic.h @@ -11,9 +11,24 @@ #ifndef WEBRTC_BASE_CONSTRUCTORMAGIC_H_ #define WEBRTC_BASE_CONSTRUCTORMAGIC_H_ +// Put this in the declarations for a class to be unassignable. +#define RTC_DISALLOW_ASSIGN(TypeName) \ + void operator=(const TypeName&) = delete -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/constructormagic.h" +// A macro to disallow the copy constructor and operator= functions. This should +// be used in the declarations for a class. +#define RTC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&) = delete; \ + RTC_DISALLOW_ASSIGN(TypeName) + +// A macro to disallow all the implicit constructors, namely the default +// constructor, copy constructor and operator= functions. +// +// This should be used in the declarations for a class that wants to prevent +// anyone from instantiating it. This is especially useful for classes +// containing only static methods. +#define RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ + TypeName() = delete; \ + RTC_DISALLOW_COPY_AND_ASSIGN(TypeName) #endif // WEBRTC_BASE_CONSTRUCTORMAGIC_H_ diff --git a/webrtc/rtc_base/copyonwritebuffer.cc b/webrtc/base/copyonwritebuffer.cc similarity index 100% rename from webrtc/rtc_base/copyonwritebuffer.cc rename to webrtc/base/copyonwritebuffer.cc diff --git a/webrtc/base/copyonwritebuffer.h b/webrtc/base/copyonwritebuffer.h index 6a95b31ced..fe3f5619d1 100644 --- a/webrtc/base/copyonwritebuffer.h +++ b/webrtc/base/copyonwritebuffer.h @@ -11,9 +11,231 @@ #ifndef WEBRTC_BASE_COPYONWRITEBUFFER_H_ #define WEBRTC_BASE_COPYONWRITEBUFFER_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/copyonwritebuffer.h" +#include "webrtc/base/buffer.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/refcount.h" +#include "webrtc/base/scoped_ref_ptr.h" + +namespace rtc { + +class CopyOnWriteBuffer { + public: + // An empty buffer. + CopyOnWriteBuffer(); + // Copy size and contents of an existing buffer. + CopyOnWriteBuffer(const CopyOnWriteBuffer& buf); + // Move contents from an existing buffer. + CopyOnWriteBuffer(CopyOnWriteBuffer&& buf); + + // Construct a buffer with the specified number of uninitialized bytes. + explicit CopyOnWriteBuffer(size_t size); + CopyOnWriteBuffer(size_t size, size_t capacity); + + // Construct a buffer and copy the specified number of bytes into it. The + // source array may be (const) uint8_t*, int8_t*, or char*. + template ::value>::type* = nullptr> + CopyOnWriteBuffer(const T* data, size_t size) + : CopyOnWriteBuffer(data, size, size) {} + template ::value>::type* = nullptr> + CopyOnWriteBuffer(const T* data, size_t size, size_t capacity) + : CopyOnWriteBuffer(size, capacity) { + if (buffer_) { + std::memcpy(buffer_->data(), data, size); + } + } + + // Construct a buffer from the contents of an array. + template ::value>::type* = nullptr> + CopyOnWriteBuffer(const T (&array)[N]) // NOLINT: runtime/explicit + : CopyOnWriteBuffer(array, N) {} + + ~CopyOnWriteBuffer(); + + // Get a pointer to the data. Just .data() will give you a (const) uint8_t*, + // but you may also use .data() and .data(). + template ::value>::type* = nullptr> + const T* data() const { + return cdata(); + } + + // Get writable pointer to the data. This will create a copy of the underlying + // data if it is shared with other buffers. + template ::value>::type* = nullptr> + T* data() { + RTC_DCHECK(IsConsistent()); + if (!buffer_) { + return nullptr; + } + CloneDataIfReferenced(buffer_->capacity()); + return buffer_->data(); + } + + // Get const pointer to the data. This will not create a copy of the + // underlying data if it is shared with other buffers. + template ::value>::type* = nullptr> + const T* cdata() const { + RTC_DCHECK(IsConsistent()); + if (!buffer_) { + return nullptr; + } + return buffer_->data(); + } + + size_t size() const { + RTC_DCHECK(IsConsistent()); + return buffer_ ? buffer_->size() : 0; + } + + size_t capacity() const { + RTC_DCHECK(IsConsistent()); + return buffer_ ? buffer_->capacity() : 0; + } + + CopyOnWriteBuffer& operator=(const CopyOnWriteBuffer& buf) { + RTC_DCHECK(IsConsistent()); + RTC_DCHECK(buf.IsConsistent()); + if (&buf != this) { + buffer_ = buf.buffer_; + } + return *this; + } + + CopyOnWriteBuffer& operator=(CopyOnWriteBuffer&& buf) { + RTC_DCHECK(IsConsistent()); + RTC_DCHECK(buf.IsConsistent()); + buffer_ = std::move(buf.buffer_); + return *this; + } + + bool operator==(const CopyOnWriteBuffer& buf) const; + + bool operator!=(const CopyOnWriteBuffer& buf) const { + return !(*this == buf); + } + + uint8_t& operator[](size_t index) { + RTC_DCHECK_LT(index, size()); + return data()[index]; + } + + uint8_t operator[](size_t index) const { + RTC_DCHECK_LT(index, size()); + return cdata()[index]; + } + + // Replace the contents of the buffer. Accepts the same types as the + // constructors. + template ::value>::type* = nullptr> + void SetData(const T* data, size_t size) { + RTC_DCHECK(IsConsistent()); + if (!buffer_) { + buffer_ = size > 0 ? new RefCountedObject(data, size) : nullptr; + } else if (!buffer_->HasOneRef()) { + buffer_ = new RefCountedObject(data, size, buffer_->capacity()); + } else { + buffer_->SetData(data, size); + } + RTC_DCHECK(IsConsistent()); + } + + template ::value>::type* = nullptr> + void SetData(const T (&array)[N]) { + SetData(array, N); + } + + void SetData(const CopyOnWriteBuffer& buf) { + RTC_DCHECK(IsConsistent()); + RTC_DCHECK(buf.IsConsistent()); + if (&buf != this) { + buffer_ = buf.buffer_; + } + } + + // Append data to the buffer. Accepts the same types as the constructors. + template ::value>::type* = nullptr> + void AppendData(const T* data, size_t size) { + RTC_DCHECK(IsConsistent()); + if (!buffer_) { + buffer_ = new RefCountedObject(data, size); + RTC_DCHECK(IsConsistent()); + return; + } + + CloneDataIfReferenced(std::max(buffer_->capacity(), + buffer_->size() + size)); + buffer_->AppendData(data, size); + RTC_DCHECK(IsConsistent()); + } + + template ::value>::type* = nullptr> + void AppendData(const T (&array)[N]) { + AppendData(array, N); + } + + void AppendData(const CopyOnWriteBuffer& buf) { + AppendData(buf.data(), buf.size()); + } + + // Sets the size of the buffer. If the new size is smaller than the old, the + // buffer contents will be kept but truncated; if the new size is greater, + // the existing contents will be kept and the new space will be + // uninitialized. + void SetSize(size_t size); + + // Ensure that the buffer size can be increased to at least capacity without + // further reallocation. (Of course, this operation might need to reallocate + // the buffer.) + void EnsureCapacity(size_t capacity); + + // Resets the buffer to zero size without altering capacity. Works even if the + // buffer has been moved from. + void Clear(); + + // Swaps two buffers. + friend void swap(CopyOnWriteBuffer& a, CopyOnWriteBuffer& b) { + std::swap(a.buffer_, b.buffer_); + } + + private: + // Create a copy of the underlying data if it is referenced from other Buffer + // objects. + void CloneDataIfReferenced(size_t new_capacity); + + // Pre- and postcondition of all methods. + bool IsConsistent() const { + return (!buffer_ || buffer_->capacity() > 0); + } + + // buffer_ is either null, or points to an rtc::Buffer with capacity > 0. + scoped_refptr> buffer_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_COPYONWRITEBUFFER_H_ diff --git a/webrtc/rtc_base/copyonwritebuffer_unittest.cc b/webrtc/base/copyonwritebuffer_unittest.cc similarity index 100% rename from webrtc/rtc_base/copyonwritebuffer_unittest.cc rename to webrtc/base/copyonwritebuffer_unittest.cc diff --git a/webrtc/rtc_base/cpu_time.cc b/webrtc/base/cpu_time.cc similarity index 100% rename from webrtc/rtc_base/cpu_time.cc rename to webrtc/base/cpu_time.cc diff --git a/webrtc/base/cpu_time.h b/webrtc/base/cpu_time.h index f627790822..87e941801b 100644 --- a/webrtc/base/cpu_time.h +++ b/webrtc/base/cpu_time.h @@ -11,9 +11,18 @@ #ifndef WEBRTC_BASE_CPU_TIME_H_ #define WEBRTC_BASE_CPU_TIME_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/cpu_time.h" +namespace rtc { + +// Returns total CPU time of a current process in nanoseconds. +// Time base is unknown, therefore use only to calculate deltas. +int64_t GetProcessCpuTimeNanos(); + +// Returns total CPU time of a current thread in nanoseconds. +// Time base is unknown, therefore use only to calculate deltas. +int64_t GetThreadCpuTimeNanos(); + +} // namespace rtc #endif // WEBRTC_BASE_CPU_TIME_H_ diff --git a/webrtc/rtc_base/cpu_time_unittest.cc b/webrtc/base/cpu_time_unittest.cc similarity index 100% rename from webrtc/rtc_base/cpu_time_unittest.cc rename to webrtc/base/cpu_time_unittest.cc diff --git a/webrtc/rtc_base/crc32.cc b/webrtc/base/crc32.cc similarity index 100% rename from webrtc/rtc_base/crc32.cc rename to webrtc/base/crc32.cc diff --git a/webrtc/base/crc32.h b/webrtc/base/crc32.h index 6854567cc6..9661876298 100644 --- a/webrtc/base/crc32.h +++ b/webrtc/base/crc32.h @@ -11,9 +11,24 @@ #ifndef WEBRTC_BASE_CRC32_H_ #define WEBRTC_BASE_CRC32_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/crc32.h" +#include "webrtc/base/basictypes.h" + +namespace rtc { + +// Updates a CRC32 checksum with |len| bytes from |buf|. |initial| holds the +// checksum result from the previous update; for the first call, it should be 0. +uint32_t UpdateCrc32(uint32_t initial, const void* buf, size_t len); + +// Computes a CRC32 checksum using |len| bytes from |buf|. +inline uint32_t ComputeCrc32(const void* buf, size_t len) { + return UpdateCrc32(0, buf, len); +} +inline uint32_t ComputeCrc32(const std::string& str) { + return ComputeCrc32(str.c_str(), str.size()); +} + +} // namespace rtc #endif // WEBRTC_BASE_CRC32_H_ diff --git a/webrtc/rtc_base/crc32_unittest.cc b/webrtc/base/crc32_unittest.cc similarity index 100% rename from webrtc/rtc_base/crc32_unittest.cc rename to webrtc/base/crc32_unittest.cc diff --git a/webrtc/rtc_base/criticalsection.cc b/webrtc/base/criticalsection.cc similarity index 100% rename from webrtc/rtc_base/criticalsection.cc rename to webrtc/base/criticalsection.cc diff --git a/webrtc/base/criticalsection.h b/webrtc/base/criticalsection.h index ab3f542244..d18f24f29a 100644 --- a/webrtc/base/criticalsection.h +++ b/webrtc/base/criticalsection.h @@ -11,8 +11,146 @@ #ifndef WEBRTC_BASE_CRITICALSECTION_H_ #define WEBRTC_BASE_CRITICALSECTION_H_ -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/criticalsection.h" +#include "webrtc/base/atomicops.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/platform_thread_types.h" +#include "webrtc/base/thread_annotations.h" +#include "webrtc/typedefs.h" + +#if defined(WEBRTC_WIN) +// Include winsock2.h before including to maintain consistency with +// win32.h. We can't include win32.h directly here since it pulls in +// headers such as basictypes.h which causes problems in Chromium where webrtc +// exists as two separate projects, webrtc and libjingle. +#include +#include +#include // must come after windows headers. +#endif // defined(WEBRTC_WIN) + +#if defined(WEBRTC_POSIX) +#include +#endif + +// See notes in the 'Performance' unit test for the effects of this flag. +#define USE_NATIVE_MUTEX_ON_MAC 0 + +#if defined(WEBRTC_MAC) && !USE_NATIVE_MUTEX_ON_MAC +#include +#endif + +#define CS_DEBUG_CHECKS RTC_DCHECK_IS_ON + +#if CS_DEBUG_CHECKS +#define CS_DEBUG_CODE(x) x +#else // !CS_DEBUG_CHECKS +#define CS_DEBUG_CODE(x) +#endif // !CS_DEBUG_CHECKS + +namespace rtc { + +// Locking methods (Enter, TryEnter, Leave)are const to permit protecting +// members inside a const context without requiring mutable CriticalSections +// everywhere. +class LOCKABLE CriticalSection { + public: + CriticalSection(); + ~CriticalSection(); + + void Enter() const EXCLUSIVE_LOCK_FUNCTION(); + bool TryEnter() const EXCLUSIVE_TRYLOCK_FUNCTION(true); + void Leave() const UNLOCK_FUNCTION(); + + private: + // Use only for RTC_DCHECKing. + bool CurrentThreadIsOwner() const; + +#if defined(WEBRTC_WIN) + mutable CRITICAL_SECTION crit_; +#elif defined(WEBRTC_POSIX) +# if defined(WEBRTC_MAC) && !USE_NATIVE_MUTEX_ON_MAC + // Number of times the lock has been locked + number of threads waiting. + // TODO(tommi): We could use this number and subtract the recursion count + // to find places where we have multiple threads contending on the same lock. + mutable volatile int lock_queue_; + // |recursion_| represents the recursion count + 1 for the thread that owns + // the lock. Only modified by the thread that owns the lock. + mutable int recursion_; + // Used to signal a single waiting thread when the lock becomes available. + mutable dispatch_semaphore_t semaphore_; + // The thread that currently holds the lock. Required to handle recursion. + mutable PlatformThreadRef owning_thread_; +# else + mutable pthread_mutex_t mutex_; +# endif + mutable PlatformThreadRef thread_; // Only used by RTC_DCHECKs. + mutable int recursion_count_; // Only used by RTC_DCHECKs. +#else // !defined(WEBRTC_WIN) && !defined(WEBRTC_POSIX) +# error Unsupported platform. +#endif +}; + +// CritScope, for serializing execution through a scope. +class SCOPED_LOCKABLE CritScope { + public: + explicit CritScope(const CriticalSection* cs) EXCLUSIVE_LOCK_FUNCTION(cs); + ~CritScope() UNLOCK_FUNCTION(); + private: + const CriticalSection* const cs_; + RTC_DISALLOW_COPY_AND_ASSIGN(CritScope); +}; + +// Tries to lock a critical section on construction via +// CriticalSection::TryEnter, and unlocks on destruction if the +// lock was taken. Never blocks. +// +// IMPORTANT: Unlike CritScope, the lock may not be owned by this thread in +// subsequent code. Users *must* check locked() to determine if the +// lock was taken. If you're not calling locked(), you're doing it wrong! +class TryCritScope { + public: + explicit TryCritScope(const CriticalSection* cs); + ~TryCritScope(); +#if defined(WEBRTC_WIN) + _Check_return_ bool locked() const; +#elif defined(WEBRTC_POSIX) + bool locked() const __attribute__ ((__warn_unused_result__)); +#else // !defined(WEBRTC_WIN) && !defined(WEBRTC_POSIX) +# error Unsupported platform. +#endif + private: + const CriticalSection* const cs_; + const bool locked_; + mutable bool lock_was_called_; // Only used by RTC_DCHECKs. + RTC_DISALLOW_COPY_AND_ASSIGN(TryCritScope); +}; + +// A POD lock used to protect global variables. Do NOT use for other purposes. +// No custom constructor or private data member should be added. +class LOCKABLE GlobalLockPod { + public: + void Lock() EXCLUSIVE_LOCK_FUNCTION(); + + void Unlock() UNLOCK_FUNCTION(); + + volatile int lock_acquired; +}; + +class GlobalLock : public GlobalLockPod { + public: + GlobalLock(); +}; + +// GlobalLockScope, for serializing execution through a scope. +class SCOPED_LOCKABLE GlobalLockScope { + public: + explicit GlobalLockScope(GlobalLockPod* lock) EXCLUSIVE_LOCK_FUNCTION(lock); + ~GlobalLockScope() UNLOCK_FUNCTION(); + private: + GlobalLockPod* const lock_; + RTC_DISALLOW_COPY_AND_ASSIGN(GlobalLockScope); +}; + +} // namespace rtc #endif // WEBRTC_BASE_CRITICALSECTION_H_ diff --git a/webrtc/rtc_base/criticalsection_unittest.cc b/webrtc/base/criticalsection_unittest.cc similarity index 100% rename from webrtc/rtc_base/criticalsection_unittest.cc rename to webrtc/base/criticalsection_unittest.cc diff --git a/webrtc/rtc_base/cryptstring.cc b/webrtc/base/cryptstring.cc similarity index 100% rename from webrtc/rtc_base/cryptstring.cc rename to webrtc/base/cryptstring.cc diff --git a/webrtc/base/cryptstring.h b/webrtc/base/cryptstring.h index 1a474b43f6..e1ee309f65 100644 --- a/webrtc/base/cryptstring.h +++ b/webrtc/base/cryptstring.h @@ -8,12 +8,160 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_CRYPTSTRING_H_ -#define WEBRTC_BASE_CRYPTSTRING_H_ +#ifndef _WEBRTC_BASE_CRYPTSTRING_H_ +#define _WEBRTC_BASE_CRYPTSTRING_H_ + +#include + +#include +#include +#include + +namespace rtc { + +class CryptStringImpl { +public: + virtual ~CryptStringImpl() {} + virtual size_t GetLength() const = 0; + virtual void CopyTo(char * dest, bool nullterminate) const = 0; + virtual std::string UrlEncode() const = 0; + virtual CryptStringImpl * Copy() const = 0; + virtual void CopyRawTo(std::vector * dest) const = 0; +}; + +class EmptyCryptStringImpl : public CryptStringImpl { +public: + ~EmptyCryptStringImpl() override {} + size_t GetLength() const override; + void CopyTo(char* dest, bool nullterminate) const override; + std::string UrlEncode() const override; + CryptStringImpl* Copy() const override; + void CopyRawTo(std::vector* dest) const override; +}; + +class CryptString { + public: + CryptString(); + size_t GetLength() const { return impl_->GetLength(); } + void CopyTo(char * dest, bool nullterminate) const { impl_->CopyTo(dest, nullterminate); } + CryptString(const CryptString& other); + explicit CryptString(const CryptStringImpl& impl); + ~CryptString(); + CryptString & operator=(const CryptString & other) { + if (this != &other) { + impl_.reset(other.impl_->Copy()); + } + return *this; + } + void Clear() { impl_.reset(new EmptyCryptStringImpl()); } + std::string UrlEncode() const { return impl_->UrlEncode(); } + void CopyRawTo(std::vector * dest) const { + return impl_->CopyRawTo(dest); + } + + private: + std::unique_ptr impl_; +}; -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/cryptstring.h" +// Used for constructing strings where a password is involved and we +// need to ensure that we zero memory afterwards +class FormatCryptString { +public: + FormatCryptString() { + storage_ = new char[32]; + capacity_ = 32; + length_ = 0; + storage_[0] = 0; + } + + void Append(const std::string & text) { + Append(text.data(), text.length()); + } -#endif // WEBRTC_BASE_CRYPTSTRING_H_ + void Append(const char * data, size_t length) { + EnsureStorage(length_ + length + 1); + memcpy(storage_ + length_, data, length); + length_ += length; + storage_[length_] = '\0'; + } + + void Append(const CryptString * password) { + size_t len = password->GetLength(); + EnsureStorage(length_ + len + 1); + password->CopyTo(storage_ + length_, true); + length_ += len; + } + + size_t GetLength() { + return length_; + } + + const char * GetData() { + return storage_; + } + + + // Ensures storage of at least n bytes + void EnsureStorage(size_t n) { + if (capacity_ >= n) { + return; + } + + size_t old_capacity = capacity_; + char * old_storage = storage_; + + for (;;) { + capacity_ *= 2; + if (capacity_ >= n) + break; + } + + storage_ = new char[capacity_]; + + if (old_capacity) { + memcpy(storage_, old_storage, length_); + + // zero memory in a way that an optimizer won't optimize it out + old_storage[0] = 0; + for (size_t i = 1; i < old_capacity; i++) { + old_storage[i] = old_storage[i - 1]; + } + delete[] old_storage; + } + } + + ~FormatCryptString() { + if (capacity_) { + storage_[0] = 0; + for (size_t i = 1; i < capacity_; i++) { + storage_[i] = storage_[i - 1]; + } + } + delete[] storage_; + } +private: + char * storage_; + size_t capacity_; + size_t length_; +}; + +class InsecureCryptStringImpl : public CryptStringImpl { + public: + std::string& password() { return password_; } + const std::string& password() const { return password_; } + + ~InsecureCryptStringImpl() override = default; + size_t GetLength() const override; + void CopyTo(char* dest, bool nullterminate) const override; + std::string UrlEncode() const override; + CryptStringImpl* Copy() const override; + void CopyRawTo(std::vector* dest) const override; + + private: + std::string password_; +}; + +} + +#endif // _WEBRTC_BASE_CRYPTSTRING_H_ diff --git a/webrtc/base/deprecation.h b/webrtc/base/deprecation.h index d6c5124c39..ce950f9b52 100644 --- a/webrtc/base/deprecation.h +++ b/webrtc/base/deprecation.h @@ -11,9 +11,35 @@ #ifndef WEBRTC_BASE_DEPRECATION_H_ #define WEBRTC_BASE_DEPRECATION_H_ - -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/deprecation.h" +// Annotate the declarations of deprecated functions with this to cause a +// compiler warning when they're used. Like so: +// +// RTC_DEPRECATED std::pony PonyPlz(const std::pony_spec& ps); +// +// NOTE 1: The annotation goes on the declaration in the .h file, not the +// definition in the .cc file! +// +// NOTE 2: In order to keep unit testing the deprecated function without +// getting warnings, do something like this: +// +// std::pony DEPRECATED_PonyPlz(const std::pony_spec& ps); +// RTC_DEPRECATED inline std::pony PonyPlz(const std::pony_spec& ps) { +// return DEPRECATED_PonyPlz(ps); +// } +// +// In other words, rename the existing function, and provide an inline wrapper +// using the original name that calls it. That way, callers who are willing to +// call it using the DEPRECATED_-prefixed name don't get the warning. +// +// TODO(kwiberg): Remove this when we can use [[deprecated]] from C++14. +#if defined(_MSC_VER) +// Note: Deprecation warnings seem to fail to trigger on Windows +// (https://bugs.chromium.org/p/webrtc/issues/detail?id=5368). +#define RTC_DEPRECATED __declspec(deprecated) +#elif defined(__GNUC__) +#define RTC_DEPRECATED __attribute__ ((__deprecated__)) +#else +#define RTC_DEPRECATED +#endif #endif // WEBRTC_BASE_DEPRECATION_H_ diff --git a/webrtc/base/dscp.h b/webrtc/base/dscp.h index 1cf2756cdc..970ff93b9b 100644 --- a/webrtc/base/dscp.h +++ b/webrtc/base/dscp.h @@ -11,9 +11,35 @@ #ifndef WEBRTC_BASE_DSCP_H_ #define WEBRTC_BASE_DSCP_H_ +namespace rtc { +// Differentiated Services Code Point. +// See http://tools.ietf.org/html/rfc2474 for details. +enum DiffServCodePoint { + DSCP_NO_CHANGE = -1, + DSCP_DEFAULT = 0, // Same as DSCP_CS0 + DSCP_CS0 = 0, // The default + DSCP_CS1 = 8, // Bulk/background traffic + DSCP_AF11 = 10, + DSCP_AF12 = 12, + DSCP_AF13 = 14, + DSCP_CS2 = 16, + DSCP_AF21 = 18, + DSCP_AF22 = 20, + DSCP_AF23 = 22, + DSCP_CS3 = 24, + DSCP_AF31 = 26, + DSCP_AF32 = 28, + DSCP_AF33 = 30, + DSCP_CS4 = 32, + DSCP_AF41 = 34, // Video + DSCP_AF42 = 36, // Video + DSCP_AF43 = 38, // Video + DSCP_CS5 = 40, // Video + DSCP_EF = 46, // Voice + DSCP_CS6 = 48, // Voice + DSCP_CS7 = 56, // Control messages +}; -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/dscp.h" +} // namespace rtc -#endif // WEBRTC_BASE_DSCP_H_ + #endif // WEBRTC_BASE_DSCP_H_ diff --git a/webrtc/rtc_base/event.cc b/webrtc/base/event.cc similarity index 100% rename from webrtc/rtc_base/event.cc rename to webrtc/base/event.cc diff --git a/webrtc/base/event.h b/webrtc/base/event.h index 28ff7315e4..d4b58724f0 100644 --- a/webrtc/base/event.h +++ b/webrtc/base/event.h @@ -8,12 +8,47 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_EVENT_H_ -#define WEBRTC_BASE_EVENT_H_ +#ifndef WEBRTC_BASE_EVENT_H__ +#define WEBRTC_BASE_EVENT_H__ +#include "webrtc/base/constructormagic.h" +#if defined(WEBRTC_WIN) +#include "webrtc/base/win32.h" // NOLINT: consider this a system header. +#elif defined(WEBRTC_POSIX) +#include +#else +#error "Must define either WEBRTC_WIN or WEBRTC_POSIX." +#endif -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/event.h" +namespace rtc { -#endif // WEBRTC_BASE_EVENT_H_ +class Event { + public: + static const int kForever = -1; + + Event(bool manual_reset, bool initially_signaled); + ~Event(); + + void Set(); + void Reset(); + + // Wait for the event to become signaled, for the specified number of + // |milliseconds|. To wait indefinetly, pass kForever. + bool Wait(int milliseconds); + + private: +#if defined(WEBRTC_WIN) + HANDLE event_handle_; +#elif defined(WEBRTC_POSIX) + pthread_mutex_t event_mutex_; + pthread_cond_t event_cond_; + const bool is_manual_reset_; + bool event_status_; +#endif + + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Event); +}; + +} // namespace rtc + +#endif // WEBRTC_BASE_EVENT_H__ diff --git a/webrtc/rtc_base/event_tracer.cc b/webrtc/base/event_tracer.cc similarity index 100% rename from webrtc/rtc_base/event_tracer.cc rename to webrtc/base/event_tracer.cc diff --git a/webrtc/base/event_tracer.h b/webrtc/base/event_tracer.h index b6da14a47b..51c8cfdc49 100644 --- a/webrtc/base/event_tracer.h +++ b/webrtc/base/event_tracer.h @@ -26,9 +26,60 @@ #ifndef WEBRTC_BASE_EVENT_TRACER_H_ #define WEBRTC_BASE_EVENT_TRACER_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/event_tracer.h" +namespace webrtc { + +typedef const unsigned char* (*GetCategoryEnabledPtr)(const char* name); +typedef void (*AddTraceEventPtr)(char phase, + const unsigned char* category_enabled, + const char* name, + unsigned long long id, + int num_args, + const char** arg_names, + const unsigned char* arg_types, + const unsigned long long* arg_values, + unsigned char flags); + +// User of WebRTC can call this method to setup event tracing. +// +// This method must be called before any WebRTC methods. Functions +// provided should be thread-safe. +void SetupEventTracer( + GetCategoryEnabledPtr get_category_enabled_ptr, + AddTraceEventPtr add_trace_event_ptr); + +// This class defines interface for the event tracing system to call +// internally. Do not call these methods directly. +class EventTracer { + public: + static const unsigned char* GetCategoryEnabled( + const char* name); + + static void AddTraceEvent( + char phase, + const unsigned char* category_enabled, + const char* name, + unsigned long long id, + int num_args, + const char** arg_names, + const unsigned char* arg_types, + const unsigned long long* arg_values, + unsigned char flags); +}; + +} // namespace webrtc + +namespace rtc { +namespace tracing { +// Set up internal event tracer. +void SetupInternalTracer(); +bool StartInternalCapture(const char* filename); +void StartInternalCaptureToFile(FILE* file); +void StopInternalCapture(); +// Make sure we run this, this will tear down the internal tracing. +void ShutdownInternalTracer(); +} // namespace tracing +} // namespace rtc #endif // WEBRTC_BASE_EVENT_TRACER_H_ diff --git a/webrtc/rtc_base/event_tracer_unittest.cc b/webrtc/base/event_tracer_unittest.cc similarity index 100% rename from webrtc/rtc_base/event_tracer_unittest.cc rename to webrtc/base/event_tracer_unittest.cc diff --git a/webrtc/rtc_base/event_unittest.cc b/webrtc/base/event_unittest.cc similarity index 100% rename from webrtc/rtc_base/event_unittest.cc rename to webrtc/base/event_unittest.cc diff --git a/webrtc/rtc_base/fakeclock.cc b/webrtc/base/fakeclock.cc similarity index 100% rename from webrtc/rtc_base/fakeclock.cc rename to webrtc/base/fakeclock.cc diff --git a/webrtc/base/fakeclock.h b/webrtc/base/fakeclock.h index 22d640dbe5..fcdfc0bc25 100644 --- a/webrtc/base/fakeclock.h +++ b/webrtc/base/fakeclock.h @@ -11,9 +11,61 @@ #ifndef WEBRTC_BASE_FAKECLOCK_H_ #define WEBRTC_BASE_FAKECLOCK_H_ +#include "webrtc/base/criticalsection.h" +#include "webrtc/base/timedelta.h" +#include "webrtc/base/timeutils.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/fakeclock.h" +namespace rtc { + +// Fake clock for use with unit tests, which does not tick on its own. +// Starts at time 0. +// +// TODO(deadbeef): Unify with webrtc::SimulatedClock. +class FakeClock : public ClockInterface { + public: + ~FakeClock() override {} + + // ClockInterface implementation. + int64_t TimeNanos() const override; + + // Methods that can be used by the test to control the time. + + // Should only be used to set a time in the future. + void SetTimeNanos(int64_t nanos); + void SetTimeMicros(int64_t micros) { + SetTimeNanos(kNumNanosecsPerMicrosec * micros); + } + + void AdvanceTime(TimeDelta delta); + void AdvanceTimeMicros(int64_t micros) { + AdvanceTime(rtc::TimeDelta::FromMicroseconds(micros)); + } + private: + CriticalSection lock_; + int64_t time_ GUARDED_BY(lock_) = 0; +}; + +// Helper class that sets itself as the global clock in its constructor and +// unsets it in its destructor. +class ScopedFakeClock : public FakeClock { + public: + ScopedFakeClock(); + ~ScopedFakeClock() override; + + private: + ClockInterface* prev_clock_; +}; + +// Helper class to "undo" the fake clock temporarily. +class ScopedRealClock { + public: + ScopedRealClock(); + ~ScopedRealClock(); + + private: + ClockInterface* prev_clock_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_FAKECLOCK_H_ diff --git a/webrtc/base/fakenetwork.h b/webrtc/base/fakenetwork.h index c2c8e6dc40..108e738468 100644 --- a/webrtc/base/fakenetwork.h +++ b/webrtc/base/fakenetwork.h @@ -11,9 +11,119 @@ #ifndef WEBRTC_BASE_FAKENETWORK_H_ #define WEBRTC_BASE_FAKENETWORK_H_ +#include +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/fakenetwork.h" +#include "webrtc/base/network.h" +#include "webrtc/base/messagehandler.h" +#include "webrtc/base/socketaddress.h" +#include "webrtc/base/stringencode.h" +#include "webrtc/base/thread.h" + +namespace rtc { + +const int kFakeIPv4NetworkPrefixLength = 24; +const int kFakeIPv6NetworkPrefixLength = 64; + +// Fake network manager that allows us to manually specify the IPs to use. +class FakeNetworkManager : public NetworkManagerBase, + public MessageHandler { + public: + FakeNetworkManager() {} + + typedef std::vector> IfaceList; + + void AddInterface(const SocketAddress& iface) { + // Ensure a unique name for the interface if its name is not given. + AddInterface(iface, "test" + rtc::ToString(next_index_++)); + } + + void AddInterface(const SocketAddress& iface, const std::string& if_name) { + AddInterface(iface, if_name, ADAPTER_TYPE_UNKNOWN); + } + + void AddInterface(const SocketAddress& iface, + const std::string& if_name, + AdapterType type) { + SocketAddress address(if_name, 0); + address.SetResolvedIP(iface.ipaddr()); + ifaces_.push_back(std::make_pair(address, type)); + DoUpdateNetworks(); + } + + void RemoveInterface(const SocketAddress& iface) { + for (IfaceList::iterator it = ifaces_.begin(); + it != ifaces_.end(); ++it) { + if (it->first.EqualIPs(iface)) { + ifaces_.erase(it); + break; + } + } + DoUpdateNetworks(); + } + + virtual void StartUpdating() { + ++start_count_; + if (start_count_ == 1) { + sent_first_update_ = false; + rtc::Thread::Current()->Post(RTC_FROM_HERE, this); + } else { + if (sent_first_update_) { + SignalNetworksChanged(); + } + } + } + + virtual void StopUpdating() { --start_count_; } + + // MessageHandler interface. + virtual void OnMessage(Message* msg) { + DoUpdateNetworks(); + } + + using NetworkManagerBase::set_enumeration_permission; + using NetworkManagerBase::set_default_local_addresses; + + private: + void DoUpdateNetworks() { + if (start_count_ == 0) + return; + std::vector networks; + for (IfaceList::iterator it = ifaces_.begin(); + it != ifaces_.end(); ++it) { + int prefix_length = 0; + if (it->first.ipaddr().family() == AF_INET) { + prefix_length = kFakeIPv4NetworkPrefixLength; + } else if (it->first.ipaddr().family() == AF_INET6) { + prefix_length = kFakeIPv6NetworkPrefixLength; + } + IPAddress prefix = TruncateIP(it->first.ipaddr(), prefix_length); + std::unique_ptr net(new Network(it->first.hostname(), + it->first.hostname(), prefix, + prefix_length, it->second)); + net->set_default_local_address_provider(this); + net->AddIP(it->first.ipaddr()); + networks.push_back(net.release()); + } + bool changed; + MergeNetworkList(networks, &changed); + if (changed || !sent_first_update_) { + SignalNetworksChanged(); + sent_first_update_ = true; + } + } + + IfaceList ifaces_; + int next_index_ = 0; + int start_count_ = 0; + bool sent_first_update_ = false; + + IPAddress default_local_ipv4_address_; + IPAddress default_local_ipv6_address_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_FAKENETWORK_H_ diff --git a/webrtc/base/fakesslidentity.h b/webrtc/base/fakesslidentity.h index da204b2ae6..7065fc09ef 100644 --- a/webrtc/base/fakesslidentity.h +++ b/webrtc/base/fakesslidentity.h @@ -11,9 +11,110 @@ #ifndef WEBRTC_BASE_FAKESSLIDENTITY_H_ #define WEBRTC_BASE_FAKESSLIDENTITY_H_ +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/fakesslidentity.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/messagedigest.h" +#include "webrtc/base/sslidentity.h" + +namespace rtc { + +class FakeSSLCertificate : public rtc::SSLCertificate { + public: + // SHA-1 is the default digest algorithm because it is available in all build + // configurations used for unit testing. + explicit FakeSSLCertificate(const std::string& data) + : data_(data), digest_algorithm_(DIGEST_SHA_1), expiration_time_(-1) {} + explicit FakeSSLCertificate(const std::vector& certs) + : data_(certs.front()), + digest_algorithm_(DIGEST_SHA_1), + expiration_time_(-1) { + std::vector::const_iterator it; + // Skip certs[0]. + for (it = certs.begin() + 1; it != certs.end(); ++it) { + certs_.push_back(FakeSSLCertificate(*it)); + } + } + FakeSSLCertificate* GetReference() const override { + return new FakeSSLCertificate(*this); + } + std::string ToPEMString() const override { + return data_; + } + void ToDER(Buffer* der_buffer) const override { + std::string der_string; + RTC_CHECK(SSLIdentity::PemToDer(kPemTypeCertificate, data_, &der_string)); + der_buffer->SetData(der_string.c_str(), der_string.size()); + } + int64_t CertificateExpirationTime() const override { + return expiration_time_; + } + void SetCertificateExpirationTime(int64_t expiration_time) { + expiration_time_ = expiration_time; + } + void set_digest_algorithm(const std::string& algorithm) { + digest_algorithm_ = algorithm; + } + bool GetSignatureDigestAlgorithm(std::string* algorithm) const override { + *algorithm = digest_algorithm_; + return true; + } + bool ComputeDigest(const std::string& algorithm, + unsigned char* digest, + size_t size, + size_t* length) const override { + *length = rtc::ComputeDigest(algorithm, data_.c_str(), data_.size(), + digest, size); + return (*length != 0); + } + std::unique_ptr GetChain() const override { + if (certs_.empty()) + return nullptr; + std::vector new_certs(certs_.size()); + std::transform(certs_.begin(), certs_.end(), new_certs.begin(), DupCert); + std::unique_ptr chain(new SSLCertChain(new_certs)); + std::for_each(new_certs.begin(), new_certs.end(), DeleteCert); + return chain; + } + + private: + static FakeSSLCertificate* DupCert(FakeSSLCertificate cert) { + return cert.GetReference(); + } + static void DeleteCert(SSLCertificate* cert) { delete cert; } + std::string data_; + std::vector certs_; + std::string digest_algorithm_; + // Expiration time in seconds relative to epoch, 1970-01-01T00:00:00Z (UTC). + int64_t expiration_time_; +}; + +class FakeSSLIdentity : public rtc::SSLIdentity { + public: + explicit FakeSSLIdentity(const std::string& data) : cert_(data) {} + explicit FakeSSLIdentity(const FakeSSLCertificate& cert) : cert_(cert) {} + virtual FakeSSLIdentity* GetReference() const { + return new FakeSSLIdentity(*this); + } + virtual const FakeSSLCertificate& certificate() const { return cert_; } + virtual std::string PrivateKeyToPEMString() const { + RTC_NOTREACHED(); // Not implemented. + return ""; + } + virtual std::string PublicKeyToPEMString() const { + RTC_NOTREACHED(); // Not implemented. + return ""; + } + virtual bool operator==(const SSLIdentity& other) const { + RTC_NOTREACHED(); // Not implemented. + return false; + } + private: + FakeSSLCertificate cert_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_FAKESSLIDENTITY_H_ diff --git a/webrtc/rtc_base/file.cc b/webrtc/base/file.cc similarity index 100% rename from webrtc/rtc_base/file.cc rename to webrtc/base/file.cc diff --git a/webrtc/base/file.h b/webrtc/base/file.h index 5a4465f6ac..f4806d1a02 100644 --- a/webrtc/base/file.h +++ b/webrtc/base/file.h @@ -11,9 +11,72 @@ #ifndef WEBRTC_BASE_FILE_H_ #define WEBRTC_BASE_FILE_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/file.h" +#include + +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/pathutils.h" +#include "webrtc/base/platform_file.h" + +namespace rtc { + +// This class wraps the platform specific APIs for simple file interactions. +// +// The various read and write methods are best effort, i.e. if an underlying +// call does not manage to read/write all the data more calls will be performed, +// until an error is detected or all data is read/written. +class File { + public: + // Wraps the given PlatformFile. This class is then responsible for closing + // the file, which will be done in the destructor if Close is never called. + explicit File(PlatformFile); + // The default constructor produces a closed file. + File(); + ~File(); + + File(File&& other); + File& operator=(File&& other); + + // Open and Create give files with both reading and writing enabled. + static File Open(const std::string& path); + static File Open(Pathname&& path); + static File Open(const Pathname& path); + // If the file already exists it will be overwritten. + static File Create(const std::string& path); + static File Create(Pathname&& path); + static File Create(const Pathname& path); + + // Remove a file in the file system. + static bool Remove(const std::string& path); + static bool Remove(Pathname&& path); + static bool Remove(const Pathname& path); + + size_t Write(const uint8_t* data, size_t length); + size_t Read(uint8_t* buffer, size_t length); + + // The current position in the file after a call to these methods is platform + // dependent (MSVC gives position offset+length, most other + // compilers/platforms do not alter the position), i.e. do not depend on it, + // do a Seek before any subsequent Read/Write. + size_t WriteAt(const uint8_t* data, size_t length, size_t offset); + size_t ReadAt(uint8_t* buffer, size_t length, size_t offset); + + // Attempt to position the file at the given offset from the start. + // Returns true if successful, false otherwise. + bool Seek(size_t offset); + + // Attempt to close the file. Returns true if successful, false otherwise, + // most notably when the file is already closed. + bool Close(); + + bool IsOpen(); + + private: + PlatformFile file_; + RTC_DISALLOW_COPY_AND_ASSIGN(File); +}; + +} // namespace rtc #endif // WEBRTC_BASE_FILE_H_ diff --git a/webrtc/rtc_base/file_posix.cc b/webrtc/base/file_posix.cc similarity index 100% rename from webrtc/rtc_base/file_posix.cc rename to webrtc/base/file_posix.cc diff --git a/webrtc/rtc_base/file_unittest.cc b/webrtc/base/file_unittest.cc similarity index 100% rename from webrtc/rtc_base/file_unittest.cc rename to webrtc/base/file_unittest.cc diff --git a/webrtc/rtc_base/file_win.cc b/webrtc/base/file_win.cc similarity index 100% rename from webrtc/rtc_base/file_win.cc rename to webrtc/base/file_win.cc diff --git a/webrtc/rtc_base/filerotatingstream.cc b/webrtc/base/filerotatingstream.cc similarity index 100% rename from webrtc/rtc_base/filerotatingstream.cc rename to webrtc/base/filerotatingstream.cc diff --git a/webrtc/base/filerotatingstream.h b/webrtc/base/filerotatingstream.h index 26306db6e0..a3e808cda5 100644 --- a/webrtc/base/filerotatingstream.h +++ b/webrtc/base/filerotatingstream.h @@ -11,9 +11,163 @@ #ifndef WEBRTC_BASE_FILEROTATINGSTREAM_H_ #define WEBRTC_BASE_FILEROTATINGSTREAM_H_ +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/filerotatingstream.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/stream.h" + +namespace rtc { + +// FileRotatingStream writes to a file in the directory specified in the +// constructor. It rotates the files once the current file is full. The +// individual file size and the number of files used is configurable in the +// constructor. Open() must be called before using this stream. +class FileRotatingStream : public StreamInterface { + public: + // Use this constructor for reading a directory previously written to with + // this stream. + FileRotatingStream(const std::string& dir_path, + const std::string& file_prefix); + + // Use this constructor for writing to a directory. Files in the directory + // matching the prefix will be deleted on open. + FileRotatingStream(const std::string& dir_path, + const std::string& file_prefix, + size_t max_file_size, + size_t num_files); + + ~FileRotatingStream() override; + + // StreamInterface methods. + StreamState GetState() const override; + StreamResult Read(void* buffer, + size_t buffer_len, + size_t* read, + int* error) override; + StreamResult Write(const void* data, + size_t data_len, + size_t* written, + int* error) override; + bool Flush() override; + // Returns the total file size currently used on disk. + bool GetSize(size_t* size) const override; + void Close() override; + + // Opens the appropriate file(s). Call this before using the stream. + bool Open(); + + // Disabling buffering causes writes to block until disk is updated. This is + // enabled by default for performance. + bool DisableBuffering(); + + // Returns the path used for the i-th newest file, where the 0th file is the + // newest file. The file may or may not exist, this is just used for + // formatting. Index must be less than GetNumFiles(). + std::string GetFilePath(size_t index) const; + + // Returns the number of files that will used by this stream. + size_t GetNumFiles() const { return file_names_.size(); } + + protected: + size_t GetMaxFileSize() const { return max_file_size_; } + + void SetMaxFileSize(size_t size) { max_file_size_ = size; } + + size_t GetRotationIndex() const { return rotation_index_; } + + void SetRotationIndex(size_t index) { rotation_index_ = index; } + + virtual void OnRotation() {} + + private: + enum Mode { kRead, kWrite }; + + FileRotatingStream(const std::string& dir_path, + const std::string& file_prefix, + size_t max_file_size, + size_t num_files, + Mode mode); + + bool OpenCurrentFile(); + void CloseCurrentFile(); + + // Rotates the files by creating a new current file, renaming the + // existing files, and deleting the oldest one. e.g. + // file_0 -> file_1 + // file_1 -> file_2 + // file_2 -> delete + // create new file_0 + void RotateFiles(); + + // Returns a list of file names in the directory beginning with the prefix. + std::vector GetFilesWithPrefix() const; + // Private version of GetFilePath. + std::string GetFilePath(size_t index, size_t num_files) const; + + const std::string dir_path_; + const std::string file_prefix_; + const Mode mode_; + + // FileStream is used to write to the current file. + std::unique_ptr file_stream_; + // Convenience storage for file names so we don't generate them over and over. + std::vector file_names_; + size_t max_file_size_; + size_t current_file_index_; + // The rotation index indicates the index of the file that will be + // deleted first on rotation. Indices lower than this index will be rotated. + size_t rotation_index_; + // Number of bytes written to current file. We need this because with + // buffering the file size read from disk might not be accurate. + size_t current_bytes_written_; + bool disable_buffering_; + + RTC_DISALLOW_COPY_AND_ASSIGN(FileRotatingStream); +}; + +// CallSessionFileRotatingStream is meant to be used in situations where we will +// have limited disk space. Its purpose is to read and write logs up to a +// maximum size. Once the maximum size is exceeded, logs from the middle are +// deleted whereas logs from the beginning and end are preserved. The reason for +// this is because we anticipate that in WebRTC the beginning and end of the +// logs are most useful for call diagnostics. +// +// This implementation simply writes to a single file until +// |max_total_log_size| / 2 bytes are written to it, and subsequently writes to +// a set of rotating files. We do this by inheriting FileRotatingStream and +// setting the appropriate internal variables so that we don't delete the last +// (earliest) file on rotate, and that that file's size is bigger. +// +// Open() must be called before using this stream. +class CallSessionFileRotatingStream : public FileRotatingStream { + public: + // Use this constructor for reading a directory previously written to with + // this stream. + explicit CallSessionFileRotatingStream(const std::string& dir_path); + // Use this constructor for writing to a directory. Files in the directory + // matching what's used by the stream will be deleted. |max_total_log_size| + // must be at least 4. + CallSessionFileRotatingStream(const std::string& dir_path, + size_t max_total_log_size); + ~CallSessionFileRotatingStream() override {} + + protected: + void OnRotation() override; + + private: + static size_t GetRotatingLogSize(size_t max_total_log_size); + static size_t GetNumRotatingLogFiles(size_t max_total_log_size); + static const char* kLogPrefix; + static const size_t kRotatingLogFileDefaultSize; + + const size_t max_total_log_size_; + size_t num_rotations_; + + RTC_DISALLOW_COPY_AND_ASSIGN(CallSessionFileRotatingStream); +}; + +} // namespace rtc #endif // WEBRTC_BASE_FILEROTATINGSTREAM_H_ diff --git a/webrtc/rtc_base/filerotatingstream_unittest.cc b/webrtc/base/filerotatingstream_unittest.cc similarity index 100% rename from webrtc/rtc_base/filerotatingstream_unittest.cc rename to webrtc/base/filerotatingstream_unittest.cc diff --git a/webrtc/rtc_base/fileutils.cc b/webrtc/base/fileutils.cc similarity index 100% rename from webrtc/rtc_base/fileutils.cc rename to webrtc/base/fileutils.cc diff --git a/webrtc/base/fileutils.h b/webrtc/base/fileutils.h index 18de30cf4d..00b4d8d263 100644 --- a/webrtc/base/fileutils.h +++ b/webrtc/base/fileutils.h @@ -1,4 +1,3 @@ - /* * Copyright 2004 The WebRTC Project Authors. All rights reserved. * @@ -12,9 +11,172 @@ #ifndef WEBRTC_BASE_FILEUTILS_H_ #define WEBRTC_BASE_FILEUTILS_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/fileutils.h" +#if !defined(WEBRTC_WIN) +#include +#include +#include +#include +#include +#endif + +#include "webrtc/base/checks.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/platform_file.h" + +namespace rtc { + +class FileStream; +class Pathname; + +////////////////////////// +// Directory Iterator // +////////////////////////// + +// A DirectoryIterator is created with a given directory. It originally points +// to the first file in the directory, and can be advanecd with Next(). This +// allows you to get information about each file. + +class DirectoryIterator { + friend class Filesystem; + public: + // Constructor + DirectoryIterator(); + // Destructor + virtual ~DirectoryIterator(); + + // Starts traversing a directory + // dir is the directory to traverse + // returns true if the directory exists and is valid + // The iterator will point to the first entry in the directory + virtual bool Iterate(const Pathname &path); + + // Advances to the next file + // returns true if there were more files in the directory. + virtual bool Next(); + + // returns true if the file currently pointed to is a directory + virtual bool IsDirectory() const; + + // returns the name of the file currently pointed to + virtual std::string Name() const; + + private: + std::string directory_; +#if defined(WEBRTC_WIN) + WIN32_FIND_DATA data_; + HANDLE handle_; +#else + DIR *dir_; + struct dirent *dirent_; + struct stat stat_; +#endif +}; + +class FilesystemInterface { + public: + virtual ~FilesystemInterface() {} + + // This will attempt to delete the path located at filename. + // It DCHECKs and returns false if the path points to a folder or a + // non-existent file. + virtual bool DeleteFile(const Pathname &filename) = 0; + + // Creates a directory. This will call itself recursively to create /foo/bar + // even if /foo does not exist. Returns true if the function succeeds. + virtual bool CreateFolder(const Pathname &pathname) = 0; + + // This moves a file from old_path to new_path, where "old_path" is a + // plain file. This DCHECKs and returns false if old_path points to a + // directory, and returns true if the function succeeds. + virtual bool MoveFile(const Pathname &old_path, const Pathname &new_path) = 0; + + // Returns true if pathname refers to a directory + virtual bool IsFolder(const Pathname& pathname) = 0; + + // Returns true if pathname refers to a file + virtual bool IsFile(const Pathname& pathname) = 0; + + // Returns true if pathname refers to no filesystem object, every parent + // directory either exists, or is also absent. + virtual bool IsAbsent(const Pathname& pathname) = 0; + + // A folder appropriate for storing temporary files (Contents are + // automatically deleted when the program exits) + virtual bool GetTemporaryFolder(Pathname &path, bool create, + const std::string *append) = 0; + + virtual std::string TempFilename(const Pathname &dir, + const std::string &prefix) = 0; + + // Determines the size of the file indicated by path. + virtual bool GetFileSize(const Pathname& path, size_t* size) = 0; +}; + +class Filesystem { + public: + static FilesystemInterface *default_filesystem() { + RTC_DCHECK(default_filesystem_); + return default_filesystem_; + } + + static void set_default_filesystem(FilesystemInterface *filesystem) { + default_filesystem_ = filesystem; + } + + static FilesystemInterface *swap_default_filesystem( + FilesystemInterface *filesystem) { + FilesystemInterface *cur = default_filesystem_; + default_filesystem_ = filesystem; + return cur; + } + + static bool CreateFolder(const Pathname &pathname) { + return EnsureDefaultFilesystem()->CreateFolder(pathname); + } + + static bool DeleteFile(const Pathname &filename) { + return EnsureDefaultFilesystem()->DeleteFile(filename); + } + + static bool MoveFile(const Pathname &old_path, const Pathname &new_path) { + return EnsureDefaultFilesystem()->MoveFile(old_path, new_path); + } + + static bool IsFolder(const Pathname& pathname) { + return EnsureDefaultFilesystem()->IsFolder(pathname); + } + + static bool IsFile(const Pathname &pathname) { + return EnsureDefaultFilesystem()->IsFile(pathname); + } + + static bool IsAbsent(const Pathname &pathname) { + return EnsureDefaultFilesystem()->IsAbsent(pathname); + } + + static bool GetTemporaryFolder(Pathname &path, bool create, + const std::string *append) { + return EnsureDefaultFilesystem()->GetTemporaryFolder(path, create, append); + } + + static std::string TempFilename(const Pathname &dir, + const std::string &prefix) { + return EnsureDefaultFilesystem()->TempFilename(dir, prefix); + } + + static bool GetFileSize(const Pathname& path, size_t* size) { + return EnsureDefaultFilesystem()->GetFileSize(path, size); + } + + private: + static FilesystemInterface* default_filesystem_; + + static FilesystemInterface *EnsureDefaultFilesystem(); + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); +}; + +} // namespace rtc #endif // WEBRTC_BASE_FILEUTILS_H_ diff --git a/webrtc/rtc_base/fileutils_unittest.cc b/webrtc/base/fileutils_unittest.cc similarity index 100% rename from webrtc/rtc_base/fileutils_unittest.cc rename to webrtc/base/fileutils_unittest.cc diff --git a/webrtc/rtc_base/firewallsocketserver.cc b/webrtc/base/firewallsocketserver.cc similarity index 100% rename from webrtc/rtc_base/firewallsocketserver.cc rename to webrtc/base/firewallsocketserver.cc diff --git a/webrtc/base/firewallsocketserver.h b/webrtc/base/firewallsocketserver.h index 18ad9bcdf3..21a476b10b 100644 --- a/webrtc/base/firewallsocketserver.h +++ b/webrtc/base/firewallsocketserver.h @@ -11,9 +11,115 @@ #ifndef WEBRTC_BASE_FIREWALLSOCKETSERVER_H_ #define WEBRTC_BASE_FIREWALLSOCKETSERVER_H_ +#include +#include "webrtc/base/socketserver.h" +#include "webrtc/base/criticalsection.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/firewallsocketserver.h" +namespace rtc { + +class FirewallManager; + +// This SocketServer shim simulates a rule-based firewall server. + +enum FirewallProtocol { FP_UDP, FP_TCP, FP_ANY }; +enum FirewallDirection { FD_IN, FD_OUT, FD_ANY }; + +class FirewallSocketServer : public SocketServer { + public: + FirewallSocketServer(SocketServer* server, + FirewallManager* manager = nullptr, + bool should_delete_server = false); + ~FirewallSocketServer() override; + + SocketServer* socketserver() const { return server_; } + void set_socketserver(SocketServer* server) { + if (server_ && should_delete_server_) { + delete server_; + server_ = nullptr; + should_delete_server_ = false; + } + server_ = server; + } + + // Settings to control whether CreateSocket or Socket::Listen succeed. + void set_udp_sockets_enabled(bool enabled) { udp_sockets_enabled_ = enabled; } + void set_tcp_sockets_enabled(bool enabled) { tcp_sockets_enabled_ = enabled; } + bool tcp_listen_enabled() const { return tcp_listen_enabled_; } + void set_tcp_listen_enabled(bool enabled) { tcp_listen_enabled_ = enabled; } + + // Rules govern the behavior of Connect/Accept/Send/Recv attempts. + void AddRule(bool allow, FirewallProtocol p = FP_ANY, + FirewallDirection d = FD_ANY, + const SocketAddress& addr = SocketAddress()); + void AddRule(bool allow, FirewallProtocol p, + const SocketAddress& src, const SocketAddress& dst); + void ClearRules(); + + bool Check(FirewallProtocol p, + const SocketAddress& src, const SocketAddress& dst); + + // Set the IP addresses for which Bind will fail. By default this list is + // empty. This can be used to simulate a real OS that refuses to bind to + // addresses under various circumstances. + // + // No matter how many addresses are added (including INADDR_ANY), the server + // will still allow creating outgoing TCP connections, since they don't + // require explicitly binding a socket. + void SetUnbindableIps(const std::vector& unbindable_ips); + bool IsBindableIp(const rtc::IPAddress& ip); + + Socket* CreateSocket(int type) override; + Socket* CreateSocket(int family, int type) override; + + AsyncSocket* CreateAsyncSocket(int type) override; + AsyncSocket* CreateAsyncSocket(int family, int type) override; + + void SetMessageQueue(MessageQueue* queue) override; + bool Wait(int cms, bool process_io) override; + void WakeUp() override; + + Socket * WrapSocket(Socket * sock, int type); + AsyncSocket * WrapSocket(AsyncSocket * sock, int type); + + private: + SocketServer * server_; + FirewallManager * manager_; + CriticalSection crit_; + struct Rule { + bool allow; + FirewallProtocol p; + FirewallDirection d; + SocketAddress src; + SocketAddress dst; + }; + std::vector rules_; + std::vector unbindable_ips_; + bool should_delete_server_; + bool udp_sockets_enabled_; + bool tcp_sockets_enabled_; + bool tcp_listen_enabled_; +}; + +// FirewallManager allows you to manage firewalls in multiple threads together + +class FirewallManager { + public: + FirewallManager(); + ~FirewallManager(); + + void AddServer(FirewallSocketServer * server); + void RemoveServer(FirewallSocketServer * server); + + void AddRule(bool allow, FirewallProtocol p = FP_ANY, + FirewallDirection d = FD_ANY, + const SocketAddress& addr = SocketAddress()); + void ClearRules(); + + private: + CriticalSection crit_; + std::vector servers_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_FIREWALLSOCKETSERVER_H_ diff --git a/webrtc/rtc_base/flags.cc b/webrtc/base/flags.cc similarity index 100% rename from webrtc/rtc_base/flags.cc rename to webrtc/base/flags.cc diff --git a/webrtc/base/flags.h b/webrtc/base/flags.h index 9094466403..d6a871ed52 100644 --- a/webrtc/base/flags.h +++ b/webrtc/base/flags.h @@ -20,12 +20,249 @@ // The implementation only relies and basic C++ functionality // and needs no special library or STL support. -#ifndef WEBRTC_BASE_FLAGS_H_ -#define WEBRTC_BASE_FLAGS_H_ +#ifndef WEBRTC_BASE_FLAGS_H__ +#define WEBRTC_BASE_FLAGS_H__ + +#include "webrtc/base/checks.h" +#include "webrtc/base/constructormagic.h" + +namespace rtc { + +// Internal use only. +union FlagValue { + // Note: Because in C++ non-bool values are silently converted into + // bool values ('bool b = "false";' results in b == true!), we pass + // and int argument to New_BOOL as this appears to be safer - sigh. + // In particular, it prevents the (not uncommon!) bug where a bool + // flag is defined via: DEFINE_bool(flag, "false", "some comment");. + static FlagValue New_BOOL(int b) { + FlagValue v; + v.b = (b != 0); + return v; + } + + static FlagValue New_INT(int i) { + FlagValue v; + v.i = i; + return v; + } + + static FlagValue New_FLOAT(float f) { + FlagValue v; + v.f = f; + return v; + } + + static FlagValue New_STRING(const char* s) { + FlagValue v; + v.s = s; + return v; + } + + bool b; + int i; + double f; + const char* s; +}; -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/flags.h" +// Each flag can be accessed programmatically via a Flag object. +class Flag { + public: + enum Type { BOOL, INT, FLOAT, STRING }; -#endif // SHARED_COMMANDLINEFLAGS_FLAGS_H_ + // Internal use only. + Flag(const char* file, const char* name, const char* comment, + Type type, void* variable, FlagValue default_); + + // General flag information + const char* file() const { return file_; } + const char* name() const { return name_; } + const char* comment() const { return comment_; } + + // Flag type + Type type() const { return type_; } + + // Flag variables + bool* bool_variable() const { + RTC_DCHECK_EQ(BOOL, type_); + return &variable_->b; + } + + int* int_variable() const { + RTC_DCHECK_EQ(INT, type_); + return &variable_->i; + } + + double* float_variable() const { + RTC_DCHECK_EQ(FLOAT, type_); + return &variable_->f; + } + + const char** string_variable() const { + RTC_DCHECK_EQ(STRING, type_); + return &variable_->s; + } + + // Default values + bool bool_default() const { + RTC_DCHECK_EQ(BOOL, type_); + return default_.b; + } + + int int_default() const { + RTC_DCHECK_EQ(INT, type_); + return default_.i; + } + + double float_default() const { + RTC_DCHECK_EQ(FLOAT, type_); + return default_.f; + } + + const char* string_default() const { + RTC_DCHECK_EQ(STRING, type_); + return default_.s; + } + + // Resets a flag to its default value + void SetToDefault(); + + // Iteration support + Flag* next() const { return next_; } + + // Prints flag information. The current flag value is only printed + // if print_current_value is set. + void Print(bool print_current_value); + + private: + const char* file_; + const char* name_; + const char* comment_; + + Type type_; + FlagValue* variable_; + FlagValue default_; + + Flag* next_; + + friend class FlagList; // accesses next_ +}; + + +// Internal use only. +#define DEFINE_FLAG(type, c_type, name, default, comment) \ + /* define and initialize the flag */ \ + c_type FLAG_##name = (default); \ + /* register the flag */ \ + static rtc::Flag Flag_##name(__FILE__, #name, (comment), \ + rtc::Flag::type, &FLAG_##name, \ + rtc::FlagValue::New_##type(default)) + + +// Internal use only. +#define DECLARE_FLAG(c_type, name) \ + /* declare the external flag */ \ + extern c_type FLAG_##name + + +// Use the following macros to define a new flag: +#define DEFINE_bool(name, default, comment) \ + DEFINE_FLAG(BOOL, bool, name, default, comment) +#define DEFINE_int(name, default, comment) \ + DEFINE_FLAG(INT, int, name, default, comment) +#define DEFINE_float(name, default, comment) \ + DEFINE_FLAG(FLOAT, double, name, default, comment) +#define DEFINE_string(name, default, comment) \ + DEFINE_FLAG(STRING, const char*, name, default, comment) + + +// Use the following macros to declare a flag defined elsewhere: +#define DECLARE_bool(name) DECLARE_FLAG(bool, name) +#define DECLARE_int(name) DECLARE_FLAG(int, name) +#define DECLARE_float(name) DECLARE_FLAG(double, name) +#define DECLARE_string(name) DECLARE_FLAG(const char*, name) + + +// The global list of all flags. +class FlagList { + public: + FlagList(); + + // The null-terminated list of all flags. Traverse with Flag::next(). + static Flag* list() { return list_; } + + // If file != nullptr, prints information for all flags defined in file; + // otherwise prints information for all flags in all files. The current flag + // value is only printed if print_current_value is set. + static void Print(const char* file, bool print_current_value); + + // Lookup a flag by name. Returns the matching flag or null. + static Flag* Lookup(const char* name); + + // Helper function to parse flags: Takes an argument arg and splits it into + // a flag name and flag value (or null if they are missing). is_bool is set + // if the arg started with "-no" or "--no". The buffer may be used to NUL- + // terminate the name, it must be large enough to hold any possible name. + static void SplitArgument(const char* arg, + char* buffer, int buffer_size, + const char** name, const char** value, + bool* is_bool); + + // Set the flag values by parsing the command line. If remove_flags + // is set, the flags and associated values are removed from (argc, + // argv). Returns 0 if no error occurred. Otherwise, returns the + // argv index > 0 for the argument where an error occurred. In that + // case, (argc, argv) will remain unchanged indepdendent of the + // remove_flags value, and no assumptions about flag settings should + // be made. + // + // The following syntax for flags is accepted (both '-' and '--' are ok): + // + // --flag (bool flags only) + // --noflag (bool flags only) + // --flag=value (non-bool flags only, no spaces around '=') + // --flag value (non-bool flags only) + static int SetFlagsFromCommandLine(int* argc, + const char** argv, + bool remove_flags); + static inline int SetFlagsFromCommandLine(int* argc, + char** argv, + bool remove_flags) { + return SetFlagsFromCommandLine(argc, const_cast(argv), + remove_flags); + } + + // Registers a new flag. Called during program initialization. Not + // thread-safe. + static void Register(Flag* flag); + + private: + static Flag* list_; +}; + +#if defined(WEBRTC_WIN) +// A helper class to translate Windows command line arguments into UTF8, +// which then allows us to just pass them to the flags system. +// This encapsulates all the work of getting the command line and translating +// it to an array of 8-bit strings; all you have to do is create one of these, +// and then call argc() and argv(). +class WindowsCommandLineArguments { + public: + WindowsCommandLineArguments(); + ~WindowsCommandLineArguments(); + + int argc() { return argc_; } + char **argv() { return argv_; } + private: + int argc_; + char **argv_; + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(WindowsCommandLineArguments); +}; +#endif // WEBRTC_WIN + +} // namespace rtc + +#endif // SHARED_COMMANDLINEFLAGS_FLAGS_H__ diff --git a/webrtc/base/format_macros.h b/webrtc/base/format_macros.h index 844e71ebbb..90f86a686c 100644 --- a/webrtc/base/format_macros.h +++ b/webrtc/base/format_macros.h @@ -11,9 +11,86 @@ #ifndef WEBRTC_BASE_FORMAT_MACROS_H_ #define WEBRTC_BASE_FORMAT_MACROS_H_ +// This file defines the format macros for some integer types and is derived +// from Chromium's base/format_macros.h. -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/format_macros.h" +// To print a 64-bit value in a portable way: +// int64_t value; +// printf("xyz:%" PRId64, value); +// The "d" in the macro corresponds to %d; you can also use PRIu64 etc. +// +// To print a size_t value in a portable way: +// size_t size; +// printf("xyz: %" PRIuS, size); +// The "u" in the macro corresponds to %u, and S is for "size". + +#include "webrtc/typedefs.h" + +#if defined(WEBRTC_POSIX) + +#if (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && !defined(PRId64) +#error "inttypes.h has already been included before this header file, but " +#error "without __STDC_FORMAT_MACROS defined." +#endif + +#if !defined(__STDC_FORMAT_MACROS) +#define __STDC_FORMAT_MACROS +#endif + +#include + +#if !defined(PRIuS) +#define PRIuS "zu" +#endif + +// The size of NSInteger and NSUInteger varies between 32-bit and 64-bit +// architectures and Apple does not provides standard format macros and +// recommends casting. This has many drawbacks, so instead define macros +// for formatting those types. +#if defined(WEBRTC_MAC) +#if defined(WEBRTC_ARCH_64_BITS) +#if !defined(PRIdNS) +#define PRIdNS "ld" +#endif +#if !defined(PRIuNS) +#define PRIuNS "lu" +#endif +#if !defined(PRIxNS) +#define PRIxNS "lx" +#endif +#else // defined(WEBRTC_ARCH_64_BITS) +#if !defined(PRIdNS) +#define PRIdNS "d" +#endif +#if !defined(PRIuNS) +#define PRIuNS "u" +#endif +#if !defined(PRIxNS) +#define PRIxNS "x" +#endif +#endif +#endif // defined(WEBRTC_MAC) + +#else // WEBRTC_WIN + +#include + +#if !defined(PRId64) +#define PRId64 "I64d" +#endif + +#if !defined(PRIu64) +#define PRIu64 "I64u" +#endif + +#if !defined(PRIx64) +#define PRIx64 "I64x" +#endif + +#if !defined(PRIuS) +#define PRIuS "Iu" +#endif + +#endif #endif // WEBRTC_BASE_FORMAT_MACROS_H_ diff --git a/webrtc/base/function_view.h b/webrtc/base/function_view.h index 12300268ef..861bccff3e 100644 --- a/webrtc/base/function_view.h +++ b/webrtc/base/function_view.h @@ -11,9 +11,120 @@ #ifndef WEBRTC_BASE_FUNCTION_VIEW_H_ #define WEBRTC_BASE_FUNCTION_VIEW_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/function_view.h" +#include "webrtc/base/checks.h" + +// Just like std::function, FunctionView will wrap any callable and hide its +// actual type, exposing only its signature. But unlike std::function, +// FunctionView doesn't own its callable---it just points to it. Thus, it's a +// good choice mainly as a function argument when the callable argument will +// not be called again once the function has returned. +// +// Its constructors are implicit, so that callers won't have to convert lambdas +// and other callables to FunctionView explicitly. This is +// safe because FunctionView is only a reference to the real callable. +// +// Example use: +// +// void SomeFunction(rtc::FunctionView index_transform); +// ... +// SomeFunction([](int i) { return 2 * i + 1; }); +// +// Note: FunctionView is tiny (essentially just two pointers) and trivially +// copyable, so it's probably cheaper to pass it by value than by const +// reference. + +namespace rtc { + +template +class FunctionView; // Undefined. + +template +class FunctionView final { + public: + // Constructor for lambdas and other callables; it accepts every type of + // argument except those noted in its enable_if call. + template < + typename F, + typename std::enable_if< + // Not for function pointers; we have another constructor for that + // below. + !std::is_function::type>::type>::value && + + // Not for nullptr; we have another constructor for that below. + !std::is_same::type>::value && + + // Not for FunctionView objects; we have another constructor for that + // (the implicitly declared copy constructor). + !std::is_same::type>::type>::value>::type* = nullptr> + FunctionView(F&& f) + : call_(CallVoidPtr::type>) { + f_.void_ptr = &f; + } + + // Constructor that accepts function pointers. If the argument is null, the + // result is an empty FunctionView. + template < + typename F, + typename std::enable_if::type>::type>::value>::type* = + nullptr> + FunctionView(F&& f) + : call_(f ? CallFunPtr::type> : nullptr) { + f_.fun_ptr = reinterpret_cast(f); + } + + // Constructor that accepts nullptr. It creates an empty FunctionView. + template ::type>::value>::type* = nullptr> + FunctionView(F&& f) : call_(nullptr) {} + + // Default constructor. Creates an empty FunctionView. + FunctionView() : call_(nullptr) {} + + RetT operator()(ArgT... args) const { + RTC_DCHECK(call_); + return call_(f_, std::forward(args)...); + } + + // Returns true if we have a function, false if we don't (i.e., we're null). + explicit operator bool() const { return !!call_; } + + private: + union VoidUnion { + void* void_ptr; + void (*fun_ptr)(); + }; + + template + static RetT CallVoidPtr(VoidUnion vu, ArgT... args) { + return (*static_cast(vu.void_ptr))(std::forward(args)...); + } + template + static RetT CallFunPtr(VoidUnion vu, ArgT... args) { + return (reinterpret_cast::type>(vu.fun_ptr))( + std::forward(args)...); + } + + // A pointer to the callable thing, with type information erased. It's a + // union because we have to use separate types depending on if the callable + // thing is a function pointer or something else. + VoidUnion f_; + + // Pointer to a dispatch function that knows the type of the callable thing + // that's stored in f_, and how to call it. A FunctionView object is empty + // (null) iff call_ is null. + RetT (*call_)(VoidUnion, ArgT...); +}; + +} // namespace rtc #endif // WEBRTC_BASE_FUNCTION_VIEW_H_ diff --git a/webrtc/rtc_base/function_view_unittest.cc b/webrtc/base/function_view_unittest.cc similarity index 100% rename from webrtc/rtc_base/function_view_unittest.cc rename to webrtc/base/function_view_unittest.cc diff --git a/webrtc/base/gtest_prod_util.h b/webrtc/base/gtest_prod_util.h index 0c25943f2c..f0cb1145f9 100644 --- a/webrtc/base/gtest_prod_util.h +++ b/webrtc/base/gtest_prod_util.h @@ -11,9 +11,28 @@ #ifndef WEBRTC_BASE_GTEST_PROD_UTIL_H_ #define WEBRTC_BASE_GTEST_PROD_UTIL_H_ +// Define our own version of FRIEND_TEST here rather than including +// gtest_prod.h to avoid depending on any part of GTest in production code. +#define FRIEND_TEST_WEBRTC(test_case_name, test_name)\ +friend class test_case_name##_##test_name##_Test -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/gtest_prod_util.h" +// This file is a plain copy of Chromium's base/gtest_prod_util.h. +// +// This is a wrapper for gtest's FRIEND_TEST macro that friends +// test with all possible prefixes. This is very helpful when changing the test +// prefix, because the friend declarations don't need to be updated. +// +// Example usage: +// +// class MyClass { +// private: +// void MyMethod(); +// FRIEND_TEST_ALL_PREFIXES(MyClassTest, MyMethod); +// }; +#define FRIEND_TEST_ALL_PREFIXES(test_case_name, test_name) \ + FRIEND_TEST_WEBRTC(test_case_name, test_name); \ + FRIEND_TEST_WEBRTC(test_case_name, DISABLED_##test_name); \ + FRIEND_TEST_WEBRTC(test_case_name, FLAKY_##test_name); \ + FRIEND_TEST_WEBRTC(test_case_name, FAILS_##test_name) #endif // WEBRTC_BASE_GTEST_PROD_UTIL_H_ diff --git a/webrtc/base/gunit.h b/webrtc/base/gunit.h index d6c092e029..10258c7a57 100644 --- a/webrtc/base/gunit.h +++ b/webrtc/base/gunit.h @@ -11,9 +11,140 @@ #ifndef WEBRTC_BASE_GUNIT_H_ #define WEBRTC_BASE_GUNIT_H_ +#include "webrtc/base/fakeclock.h" +#include "webrtc/base/logging.h" +#include "webrtc/base/thread.h" +#if defined(GTEST_RELATIVE_PATH) +#include "webrtc/test/gtest.h" +#else +#include "testing/base/public/gunit.h" +#endif -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/gunit.h" +// Wait until "ex" is true, or "timeout" expires. +#define WAIT(ex, timeout) \ + for (int64_t start = rtc::SystemTimeMillis(); \ + !(ex) && rtc::SystemTimeMillis() < start + (timeout);) { \ + rtc::Thread::Current()->ProcessMessages(0); \ + rtc::Thread::Current()->SleepMs(1); \ + } + +// This returns the result of the test in res, so that we don't re-evaluate +// the expression in the XXXX_WAIT macros below, since that causes problems +// when the expression is only true the first time you check it. +#define WAIT_(ex, timeout, res) \ + do { \ + int64_t start = rtc::SystemTimeMillis(); \ + res = (ex); \ + while (!res && rtc::SystemTimeMillis() < start + (timeout)) { \ + rtc::Thread::Current()->ProcessMessages(0); \ + rtc::Thread::Current()->SleepMs(1); \ + res = (ex); \ + } \ + } while (0) + +// The typical EXPECT_XXXX and ASSERT_XXXXs, but done until true or a timeout. +#define EXPECT_TRUE_WAIT(ex, timeout) \ + do { \ + bool res; \ + WAIT_(ex, timeout, res); \ + if (!res) EXPECT_TRUE(ex); \ + } while (0) + +#define EXPECT_EQ_WAIT(v1, v2, timeout) \ + do { \ + bool res; \ + WAIT_(v1 == v2, timeout, res); \ + if (!res) EXPECT_EQ(v1, v2); \ + } while (0) + +#define ASSERT_TRUE_WAIT(ex, timeout) \ + do { \ + bool res; \ + WAIT_(ex, timeout, res); \ + if (!res) ASSERT_TRUE(ex); \ + } while (0) + +#define ASSERT_EQ_WAIT(v1, v2, timeout) \ + do { \ + bool res; \ + WAIT_(v1 == v2, timeout, res); \ + if (!res) ASSERT_EQ(v1, v2); \ + } while (0) + +// Version with a "soft" timeout and a margin. This logs if the timeout is +// exceeded, but it only fails if the expression still isn't true after the +// margin time passes. +#define EXPECT_TRUE_WAIT_MARGIN(ex, timeout, margin) \ + do { \ + bool res; \ + WAIT_(ex, timeout, res); \ + if (res) { \ + break; \ + } \ + LOG(LS_WARNING) << "Expression " << #ex << " still not true after " \ + << (timeout) << "ms; waiting an additional " << margin \ + << "ms"; \ + WAIT_(ex, margin, res); \ + if (!res) { \ + EXPECT_TRUE(ex); \ + } \ + } while (0) + +// Wait until "ex" is true, or "timeout" expires, using fake clock where +// messages are processed every millisecond. +// TODO(pthatcher): Allow tests to control how many milliseconds to advance. +#define SIMULATED_WAIT(ex, timeout, clock) \ + for (int64_t start = rtc::TimeMillis(); \ + !(ex) && rtc::TimeMillis() < start + (timeout);) { \ + (clock).AdvanceTime(rtc::TimeDelta::FromMilliseconds(1)); \ + } + +// This returns the result of the test in res, so that we don't re-evaluate +// the expression in the XXXX_WAIT macros below, since that causes problems +// when the expression is only true the first time you check it. +#define SIMULATED_WAIT_(ex, timeout, res, clock) \ + do { \ + int64_t start = rtc::TimeMillis(); \ + res = (ex); \ + while (!res && rtc::TimeMillis() < start + (timeout)) { \ + (clock).AdvanceTime(rtc::TimeDelta::FromMilliseconds(1)); \ + res = (ex); \ + } \ + } while (0) + +// The typical EXPECT_XXXX, but done until true or a timeout with a fake clock. +#define EXPECT_TRUE_SIMULATED_WAIT(ex, timeout, clock) \ + do { \ + bool res; \ + SIMULATED_WAIT_(ex, timeout, res, clock); \ + if (!res) { \ + EXPECT_TRUE(ex); \ + } \ + } while (0) + +#define EXPECT_EQ_SIMULATED_WAIT(v1, v2, timeout, clock) \ + do { \ + bool res; \ + SIMULATED_WAIT_(v1 == v2, timeout, res, clock); \ + if (!res) { \ + EXPECT_EQ(v1, v2); \ + } \ + } while (0) + +#define ASSERT_TRUE_SIMULATED_WAIT(ex, timeout, clock) \ + do { \ + bool res; \ + SIMULATED_WAIT_(ex, timeout, res, clock); \ + if (!res) \ + ASSERT_TRUE(ex); \ + } while (0) + +#define ASSERT_EQ_SIMULATED_WAIT(v1, v2, timeout, clock) \ + do { \ + bool res; \ + SIMULATED_WAIT_(v1 == v2, timeout, res, clock); \ + if (!res) \ + ASSERT_EQ(v1, v2); \ + } while (0) #endif // WEBRTC_BASE_GUNIT_H_ diff --git a/webrtc/base/gunit_prod.h b/webrtc/base/gunit_prod.h index 436abee92a..dc39bbd0eb 100644 --- a/webrtc/base/gunit_prod.h +++ b/webrtc/base/gunit_prod.h @@ -11,8 +11,14 @@ #ifndef WEBRTC_BASE_GUNIT_PROD_H_ #define WEBRTC_BASE_GUNIT_PROD_H_ -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/gunit_prod.h" +#if defined(WEBRTC_ANDROID) +// Android doesn't use gtest at all, so anything that relies on gtest should +// check this define first. +#define NO_GTEST +#elif defined (GTEST_RELATIVE_PATH) +#include "gtest/gtest_prod.h" +#else +#include "testing/base/gunit_prod.h" +#endif #endif // WEBRTC_BASE_GUNIT_PROD_H_ diff --git a/webrtc/rtc_base/helpers.cc b/webrtc/base/helpers.cc similarity index 100% rename from webrtc/rtc_base/helpers.cc rename to webrtc/base/helpers.cc diff --git a/webrtc/base/helpers.h b/webrtc/base/helpers.h index 86a388e8b0..fcf77afd7f 100644 --- a/webrtc/base/helpers.h +++ b/webrtc/base/helpers.h @@ -11,9 +11,54 @@ #ifndef WEBRTC_BASE_HELPERS_H_ #define WEBRTC_BASE_HELPERS_H_ +#include +#include "webrtc/base/basictypes.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/helpers.h" +namespace rtc { + +// For testing, we can return predictable data. +void SetRandomTestMode(bool test); + +// Initializes the RNG, and seeds it with the specified entropy. +bool InitRandom(int seed); +bool InitRandom(const char* seed, size_t len); + +// Generates a (cryptographically) random string of the given length. +// We generate base64 values so that they will be printable. +std::string CreateRandomString(size_t length); + +// Generates a (cryptographically) random string of the given length. +// We generate base64 values so that they will be printable. +// Return false if the random number generator failed. +bool CreateRandomString(size_t length, std::string* str); + +// Generates a (cryptographically) random string of the given length, +// with characters from the given table. Return false if the random +// number generator failed. +// For ease of implementation, the function requires that the table +// size evenly divide 256; otherwise, it returns false. +bool CreateRandomString(size_t length, const std::string& table, + std::string* str); + +// Generates (cryptographically) random data of the given length. +// Return false if the random number generator failed. +bool CreateRandomData(size_t length, std::string* data); + +// Generates a (cryptographically) random UUID version 4 string. +std::string CreateRandomUuid(); + +// Generates a random id. +uint32_t CreateRandomId(); + +// Generates a 64 bit random id. +uint64_t CreateRandomId64(); + +// Generates a random id > 0. +uint32_t CreateRandomNonZeroId(); + +// Generates a random double between 0.0 (inclusive) and 1.0 (exclusive). +double CreateRandomDouble(); + +} // namespace rtc #endif // WEBRTC_BASE_HELPERS_H_ diff --git a/webrtc/rtc_base/helpers_unittest.cc b/webrtc/base/helpers_unittest.cc similarity index 100% rename from webrtc/rtc_base/helpers_unittest.cc rename to webrtc/base/helpers_unittest.cc diff --git a/webrtc/rtc_base/httpbase.cc b/webrtc/base/httpbase.cc similarity index 100% rename from webrtc/rtc_base/httpbase.cc rename to webrtc/base/httpbase.cc diff --git a/webrtc/base/httpbase.h b/webrtc/base/httpbase.h index a66ce15a7f..4b834a4e5b 100644 --- a/webrtc/base/httpbase.h +++ b/webrtc/base/httpbase.h @@ -9,12 +9,179 @@ */ -#ifndef WEBRTC_BASE_HTTPBASE_H_ -#define WEBRTC_BASE_HTTPBASE_H_ +#ifndef WEBRTC_BASE_HTTPBASE_H__ +#define WEBRTC_BASE_HTTPBASE_H__ +#include "webrtc/base/httpcommon.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/httpbase.h" +namespace rtc { -#endif // WEBRTC_BASE_HTTPBASE_H_ +class StreamInterface; + +/////////////////////////////////////////////////////////////////////////////// +// HttpParser - Parses an HTTP stream provided via Process and end_of_input, and +// generates events for: +// Structural Elements: Leader, Headers, Document Data +// Events: End of Headers, End of Document, Errors +/////////////////////////////////////////////////////////////////////////////// + +class HttpParser { +public: + enum ProcessResult { PR_CONTINUE, PR_BLOCK, PR_COMPLETE }; + HttpParser(); + virtual ~HttpParser(); + + void reset(); + ProcessResult Process(const char* buffer, size_t len, size_t* processed, + HttpError* error); + bool is_valid_end_of_input() const; + void complete(HttpError err); + + size_t GetDataRemaining() const { return data_size_; } + +protected: + ProcessResult ProcessLine(const char* line, size_t len, HttpError* error); + + // HttpParser Interface + virtual ProcessResult ProcessLeader(const char* line, size_t len, + HttpError* error) = 0; + virtual ProcessResult ProcessHeader(const char* name, size_t nlen, + const char* value, size_t vlen, + HttpError* error) = 0; + virtual ProcessResult ProcessHeaderComplete(bool chunked, size_t& data_size, + HttpError* error) = 0; + virtual ProcessResult ProcessData(const char* data, size_t len, size_t& read, + HttpError* error) = 0; + virtual void OnComplete(HttpError err) = 0; + +private: + enum State { + ST_LEADER, ST_HEADERS, + ST_CHUNKSIZE, ST_CHUNKTERM, ST_TRAILERS, + ST_DATA, ST_COMPLETE + } state_; + bool chunked_; + size_t data_size_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// IHttpNotify +/////////////////////////////////////////////////////////////////////////////// + +enum HttpMode { HM_NONE, HM_CONNECT, HM_RECV, HM_SEND }; + +class IHttpNotify { +public: + virtual ~IHttpNotify() {} + virtual HttpError onHttpHeaderComplete(bool chunked, size_t& data_size) = 0; + virtual void onHttpComplete(HttpMode mode, HttpError err) = 0; + virtual void onHttpClosed(HttpError err) = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// +// HttpBase - Provides a state machine for implementing HTTP-based components. +// Attach HttpBase to a StreamInterface which represents a bidirectional HTTP +// stream, and then call send() or recv() to initiate sending or receiving one +// side of an HTTP transaction. By default, HttpBase operates as an I/O pump, +// moving data from the HTTP stream to the HttpData object and vice versa. +// However, it can also operate in stream mode, in which case the user of the +// stream interface drives I/O via calls to Read(). +/////////////////////////////////////////////////////////////////////////////// + +class HttpBase +: private HttpParser, + public sigslot::has_slots<> +{ +public: + HttpBase(); + ~HttpBase() override; + + void notify(IHttpNotify* notify) { notify_ = notify; } + bool attach(StreamInterface* stream); + StreamInterface* stream() { return http_stream_; } + StreamInterface* detach(); + bool isConnected() const; + + void send(HttpData* data); + void recv(HttpData* data); + void abort(HttpError err); + + HttpMode mode() const { return mode_; } + + void set_ignore_data(bool ignore) { ignore_data_ = ignore; } + bool ignore_data() const { return ignore_data_; } + + // Obtaining this stream puts HttpBase into stream mode until the stream + // is closed. HttpBase can only expose one open stream interface at a time. + // Further calls will return null. + StreamInterface* GetDocumentStream(); + +protected: + // Do cleanup when the http stream closes (error may be 0 for a clean + // shutdown), and return the error code to signal. + HttpError HandleStreamClose(int error); + + // DoReceiveLoop acts as a data pump, pulling data from the http stream, + // pushing it through the HttpParser, and then populating the HttpData object + // based on the callbacks from the parser. One of the most interesting + // callbacks is ProcessData, which provides the actual http document body. + // This data is then written to the HttpData::document. As a result, data + // flows from the network to the document, with some incidental protocol + // parsing in between. + // Ideally, we would pass in the document* to DoReceiveLoop, to more easily + // support GetDocumentStream(). However, since the HttpParser is callback + // driven, we are forced to store the pointer somewhere until the callback + // is triggered. + // Returns true if the received document has finished, and + // HttpParser::complete should be called. + bool DoReceiveLoop(HttpError* err); + + void read_and_process_data(); + void flush_data(); + bool queue_headers(); + void do_complete(HttpError err = HE_NONE); + + void OnHttpStreamEvent(StreamInterface* stream, int events, int error); + void OnDocumentEvent(StreamInterface* stream, int events, int error); + + // HttpParser Interface + ProcessResult ProcessLeader(const char* line, + size_t len, + HttpError* error) override; + ProcessResult ProcessHeader(const char* name, + size_t nlen, + const char* value, + size_t vlen, + HttpError* error) override; + ProcessResult ProcessHeaderComplete(bool chunked, + size_t& data_size, + HttpError* error) override; + ProcessResult ProcessData(const char* data, + size_t len, + size_t& read, + HttpError* error) override; + void OnComplete(HttpError err) override; + +private: + class DocumentStream; + friend class DocumentStream; + + enum { kBufferSize = 32 * 1024 }; + + HttpMode mode_; + HttpData* data_; + IHttpNotify* notify_; + StreamInterface* http_stream_; + DocumentStream* doc_stream_; + char buffer_[kBufferSize]; + size_t len_; + + bool ignore_data_, chunk_data_; + HttpData::const_iterator header_; +}; + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace rtc + +#endif // WEBRTC_BASE_HTTPBASE_H__ diff --git a/webrtc/rtc_base/httpbase_unittest.cc b/webrtc/base/httpbase_unittest.cc similarity index 100% rename from webrtc/rtc_base/httpbase_unittest.cc rename to webrtc/base/httpbase_unittest.cc diff --git a/webrtc/base/httpcommon-inl.h b/webrtc/base/httpcommon-inl.h index 7dfe18242d..f29f075998 100644 --- a/webrtc/base/httpcommon-inl.h +++ b/webrtc/base/httpcommon-inl.h @@ -8,12 +8,125 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_HTTPCOMMON_INL_H_ -#define WEBRTC_BASE_HTTPCOMMON_INL_H_ +#ifndef WEBRTC_BASE_HTTPCOMMON_INL_H__ +#define WEBRTC_BASE_HTTPCOMMON_INL_H__ +#include "webrtc/base/arraysize.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/httpcommon.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/httpcommon-inl.h" +namespace rtc { -#endif // WEBRTC_BASE_HTTPCOMMON_INL_H_ +/////////////////////////////////////////////////////////////////////////////// +// Url +/////////////////////////////////////////////////////////////////////////////// + +template +void Url::do_set_url(const CTYPE* val, size_t len) { + if (ascnicmp(val, "http://", 7) == 0) { + val += 7; len -= 7; + secure_ = false; + } else if (ascnicmp(val, "https://", 8) == 0) { + val += 8; len -= 8; + secure_ = true; + } else { + clear(); + return; + } + const CTYPE* path = strchrn(val, len, static_cast('/')); + if (!path) { + path = val + len; + } + size_t address_length = (path - val); + do_set_address(val, address_length); + do_set_full_path(path, len - address_length); +} + +template +void Url::do_set_address(const CTYPE* val, size_t len) { + if (const CTYPE* at = strchrn(val, len, static_cast('@'))) { + // Everything before the @ is a user:password combo, so skip it. + len -= at - val + 1; + val = at + 1; + } + if (const CTYPE* colon = strchrn(val, len, static_cast(':'))) { + host_.assign(val, colon - val); + // Note: In every case, we're guaranteed that colon is followed by a null, + // or non-numeric character. + port_ = static_cast(::strtoul(colon + 1, nullptr, 10)); + // TODO: Consider checking for invalid data following port number. + } else { + host_.assign(val, len); + port_ = HttpDefaultPort(secure_); + } +} + +template +void Url::do_set_full_path(const CTYPE* val, size_t len) { + const CTYPE* query = strchrn(val, len, static_cast('?')); + if (!query) { + query = val + len; + } + size_t path_length = (query - val); + if (0 == path_length) { + // TODO: consider failing in this case. + path_.assign(1, static_cast('/')); + } else { + RTC_DCHECK(val[0] == static_cast('/')); + path_.assign(val, path_length); + } + query_.assign(query, len - path_length); +} + +template +void Url::do_get_url(string* val) const { + CTYPE protocol[9]; + asccpyn(protocol, arraysize(protocol), secure_ ? "https://" : "http://"); + val->append(protocol); + do_get_address(val); + do_get_full_path(val); +} + +template +void Url::do_get_address(string* val) const { + val->append(host_); + if (port_ != HttpDefaultPort(secure_)) { + CTYPE format[5], port[32]; + asccpyn(format, arraysize(format), ":%hu"); + sprintfn(port, arraysize(port), format, port_); + val->append(port); + } +} + +template +void Url::do_get_full_path(string* val) const { + val->append(path_); + val->append(query_); +} + +template +bool Url::get_attribute(const string& name, string* value) const { + if (query_.empty()) + return false; + + std::string::size_type pos = query_.find(name, 1); + if (std::string::npos == pos) + return false; + + pos += name.length() + 1; + if ((pos > query_.length()) || (static_cast('=') != query_[pos-1])) + return false; + + std::string::size_type end = query_.find(static_cast('&'), pos); + if (std::string::npos == end) { + end = query_.length(); + } + value->assign(query_.substr(pos, end - pos)); + return true; +} + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace rtc + +#endif // WEBRTC_BASE_HTTPCOMMON_INL_H__ diff --git a/webrtc/rtc_base/httpcommon.cc b/webrtc/base/httpcommon.cc similarity index 100% rename from webrtc/rtc_base/httpcommon.cc rename to webrtc/base/httpcommon.cc diff --git a/webrtc/base/httpcommon.h b/webrtc/base/httpcommon.h index 3946dfcd77..7182aa2f85 100644 --- a/webrtc/base/httpcommon.h +++ b/webrtc/base/httpcommon.h @@ -8,12 +8,451 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_HTTPCOMMON_H_ -#define WEBRTC_BASE_HTTPCOMMON_H_ +#ifndef WEBRTC_BASE_HTTPCOMMON_H__ +#define WEBRTC_BASE_HTTPCOMMON_H__ +#include +#include +#include +#include +#include "webrtc/base/basictypes.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/stringutils.h" +#include "webrtc/base/stream.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/httpcommon.h" +namespace rtc { -#endif // WEBRTC_BASE_HTTPCOMMON_H_ +class CryptString; +class SocketAddress; + +////////////////////////////////////////////////////////////////////// +// Constants +////////////////////////////////////////////////////////////////////// + +enum HttpCode { + HC_OK = 200, + HC_NON_AUTHORITATIVE = 203, + HC_NO_CONTENT = 204, + HC_PARTIAL_CONTENT = 206, + + HC_MULTIPLE_CHOICES = 300, + HC_MOVED_PERMANENTLY = 301, + HC_FOUND = 302, + HC_SEE_OTHER = 303, + HC_NOT_MODIFIED = 304, + HC_MOVED_TEMPORARILY = 307, + + HC_BAD_REQUEST = 400, + HC_UNAUTHORIZED = 401, + HC_FORBIDDEN = 403, + HC_NOT_FOUND = 404, + HC_PROXY_AUTHENTICATION_REQUIRED = 407, + HC_GONE = 410, + + HC_INTERNAL_SERVER_ERROR = 500, + HC_NOT_IMPLEMENTED = 501, + HC_SERVICE_UNAVAILABLE = 503, +}; + +enum HttpVersion { + HVER_1_0, HVER_1_1, HVER_UNKNOWN, + HVER_LAST = HVER_UNKNOWN +}; + +enum HttpVerb { + HV_GET, HV_POST, HV_PUT, HV_DELETE, HV_CONNECT, HV_HEAD, + HV_LAST = HV_HEAD +}; + +enum HttpError { + HE_NONE, + HE_PROTOCOL, // Received non-valid HTTP data + HE_DISCONNECTED, // Connection closed unexpectedly + HE_OVERFLOW, // Received too much data for internal buffers + HE_CONNECT_FAILED, // The socket failed to connect. + HE_SOCKET_ERROR, // An error occurred on a connected socket + HE_SHUTDOWN, // Http object is being destroyed + HE_OPERATION_CANCELLED, // Connection aborted locally + HE_AUTH, // Proxy Authentication Required + HE_CERTIFICATE_EXPIRED, // During SSL negotiation + HE_STREAM, // Problem reading or writing to the document + HE_CACHE, // Problem reading from cache + HE_DEFAULT +}; + +enum HttpHeader { + HH_AGE, + HH_CACHE_CONTROL, + HH_CONNECTION, + HH_CONTENT_DISPOSITION, + HH_CONTENT_LENGTH, + HH_CONTENT_RANGE, + HH_CONTENT_TYPE, + HH_COOKIE, + HH_DATE, + HH_ETAG, + HH_EXPIRES, + HH_HOST, + HH_IF_MODIFIED_SINCE, + HH_IF_NONE_MATCH, + HH_KEEP_ALIVE, + HH_LAST_MODIFIED, + HH_LOCATION, + HH_PROXY_AUTHENTICATE, + HH_PROXY_AUTHORIZATION, + HH_PROXY_CONNECTION, + HH_RANGE, + HH_SET_COOKIE, + HH_TE, + HH_TRAILERS, + HH_TRANSFER_ENCODING, + HH_UPGRADE, + HH_USER_AGENT, + HH_WWW_AUTHENTICATE, + HH_LAST = HH_WWW_AUTHENTICATE +}; + +const uint16_t HTTP_DEFAULT_PORT = 80; +const uint16_t HTTP_SECURE_PORT = 443; + +////////////////////////////////////////////////////////////////////// +// Utility Functions +////////////////////////////////////////////////////////////////////// + +inline HttpError mkerr(HttpError err, HttpError def_err = HE_DEFAULT) { + return (err != HE_NONE) ? err : def_err; +} + +const char* ToString(HttpVersion version); +bool FromString(HttpVersion& version, const std::string& str); + +const char* ToString(HttpVerb verb); +bool FromString(HttpVerb& verb, const std::string& str); + +const char* ToString(HttpHeader header); +bool FromString(HttpHeader& header, const std::string& str); + +inline bool HttpCodeIsInformational(uint32_t code) { + return ((code / 100) == 1); +} +inline bool HttpCodeIsSuccessful(uint32_t code) { + return ((code / 100) == 2); +} +inline bool HttpCodeIsRedirection(uint32_t code) { + return ((code / 100) == 3); +} +inline bool HttpCodeIsClientError(uint32_t code) { + return ((code / 100) == 4); +} +inline bool HttpCodeIsServerError(uint32_t code) { + return ((code / 100) == 5); +} + +bool HttpCodeHasBody(uint32_t code); +bool HttpCodeIsCacheable(uint32_t code); +bool HttpHeaderIsEndToEnd(HttpHeader header); +bool HttpHeaderIsCollapsible(HttpHeader header); + +struct HttpData; +bool HttpShouldKeepAlive(const HttpData& data); + +typedef std::pair HttpAttribute; +typedef std::vector HttpAttributeList; +void HttpComposeAttributes(const HttpAttributeList& attributes, char separator, + std::string* composed); +void HttpParseAttributes(const char * data, size_t len, + HttpAttributeList& attributes); +bool HttpHasAttribute(const HttpAttributeList& attributes, + const std::string& name, + std::string* value); +bool HttpHasNthAttribute(HttpAttributeList& attributes, + size_t index, + std::string* name, + std::string* value); + +// Convert RFC1123 date (DoW, DD Mon YYYY HH:MM:SS TZ) to unix timestamp +bool HttpDateToSeconds(const std::string& date, time_t* seconds); + +inline uint16_t HttpDefaultPort(bool secure) { + return secure ? HTTP_SECURE_PORT : HTTP_DEFAULT_PORT; +} + +// Returns the http server notation for a given address +std::string HttpAddress(const SocketAddress& address, bool secure); + +// functional for insensitive std::string compare +struct iless { + bool operator()(const std::string& lhs, const std::string& rhs) const { + return (::_stricmp(lhs.c_str(), rhs.c_str()) < 0); + } +}; + +// put quotes around a string and escape any quotes inside it +std::string quote(const std::string& str); + +////////////////////////////////////////////////////////////////////// +// Url +////////////////////////////////////////////////////////////////////// + +template +class Url { +public: + typedef typename Traits::string string; + + // TODO: Implement Encode/Decode + static int Encode(const CTYPE* source, CTYPE* destination, size_t len); + static int Encode(const string& source, string& destination); + static int Decode(const CTYPE* source, CTYPE* destination, size_t len); + static int Decode(const string& source, string& destination); + + Url(const string& url) { do_set_url(url.c_str(), url.size()); } + Url(const string& path, const string& host, uint16_t port = HTTP_DEFAULT_PORT) + : host_(host), port_(port), secure_(HTTP_SECURE_PORT == port) { + set_full_path(path); + } + + bool valid() const { return !host_.empty(); } + void clear() { + host_.clear(); + port_ = HTTP_DEFAULT_PORT; + secure_ = false; + path_.assign(1, static_cast('/')); + query_.clear(); + } + + void set_url(const string& val) { + do_set_url(val.c_str(), val.size()); + } + string url() const { + string val; do_get_url(&val); return val; + } + + void set_address(const string& val) { + do_set_address(val.c_str(), val.size()); + } + string address() const { + string val; do_get_address(&val); return val; + } + + void set_full_path(const string& val) { + do_set_full_path(val.c_str(), val.size()); + } + string full_path() const { + string val; do_get_full_path(&val); return val; + } + + void set_host(const string& val) { host_ = val; } + const string& host() const { return host_; } + + void set_port(uint16_t val) { port_ = val; } + uint16_t port() const { return port_; } + + void set_secure(bool val) { secure_ = val; } + bool secure() const { return secure_; } + + void set_path(const string& val) { + if (val.empty()) { + path_.assign(1, static_cast('/')); + } else { + RTC_DCHECK(val[0] == static_cast('/')); + path_ = val; + } + } + const string& path() const { return path_; } + + void set_query(const string& val) { + RTC_DCHECK(val.empty() || (val[0] == static_cast('?'))); + query_ = val; + } + const string& query() const { return query_; } + + bool get_attribute(const string& name, string* value) const; + +private: + void do_set_url(const CTYPE* val, size_t len); + void do_set_address(const CTYPE* val, size_t len); + void do_set_full_path(const CTYPE* val, size_t len); + + void do_get_url(string* val) const; + void do_get_address(string* val) const; + void do_get_full_path(string* val) const; + + string host_, path_, query_; + uint16_t port_; + bool secure_; +}; + +////////////////////////////////////////////////////////////////////// +// HttpData +////////////////////////////////////////////////////////////////////// + +struct HttpData { + typedef std::multimap HeaderMap; + typedef HeaderMap::const_iterator const_iterator; + typedef HeaderMap::iterator iterator; + + HttpVersion version; + std::unique_ptr document; + + HttpData(); + + enum HeaderCombine { HC_YES, HC_NO, HC_AUTO, HC_REPLACE, HC_NEW }; + void changeHeader(const std::string& name, const std::string& value, + HeaderCombine combine); + inline void addHeader(const std::string& name, const std::string& value, + bool append = true) { + changeHeader(name, value, append ? HC_AUTO : HC_NO); + } + inline void setHeader(const std::string& name, const std::string& value, + bool overwrite = true) { + changeHeader(name, value, overwrite ? HC_REPLACE : HC_NEW); + } + // Returns count of erased headers + size_t clearHeader(const std::string& name); + // Returns iterator to next header + iterator clearHeader(iterator header); + + // keep in mind, this may not do what you want in the face of multiple headers + bool hasHeader(const std::string& name, std::string* value) const; + + inline const_iterator begin() const { + return headers_.begin(); + } + inline const_iterator end() const { + return headers_.end(); + } + inline iterator begin() { + return headers_.begin(); + } + inline iterator end() { + return headers_.end(); + } + inline const_iterator begin(const std::string& name) const { + return headers_.lower_bound(name); + } + inline const_iterator end(const std::string& name) const { + return headers_.upper_bound(name); + } + inline iterator begin(const std::string& name) { + return headers_.lower_bound(name); + } + inline iterator end(const std::string& name) { + return headers_.upper_bound(name); + } + + // Convenience methods using HttpHeader + inline void changeHeader(HttpHeader header, const std::string& value, + HeaderCombine combine) { + changeHeader(ToString(header), value, combine); + } + inline void addHeader(HttpHeader header, const std::string& value, + bool append = true) { + addHeader(ToString(header), value, append); + } + inline void setHeader(HttpHeader header, const std::string& value, + bool overwrite = true) { + setHeader(ToString(header), value, overwrite); + } + inline void clearHeader(HttpHeader header) { + clearHeader(ToString(header)); + } + inline bool hasHeader(HttpHeader header, std::string* value) const { + return hasHeader(ToString(header), value); + } + inline const_iterator begin(HttpHeader header) const { + return headers_.lower_bound(ToString(header)); + } + inline const_iterator end(HttpHeader header) const { + return headers_.upper_bound(ToString(header)); + } + inline iterator begin(HttpHeader header) { + return headers_.lower_bound(ToString(header)); + } + inline iterator end(HttpHeader header) { + return headers_.upper_bound(ToString(header)); + } + + void setContent(const std::string& content_type, StreamInterface* document); + void setDocumentAndLength(StreamInterface* document); + + virtual size_t formatLeader(char* buffer, size_t size) const = 0; + virtual HttpError parseLeader(const char* line, size_t len) = 0; + +protected: + virtual ~HttpData(); + void clear(bool release_document); + void copy(const HttpData& src); + +private: + HeaderMap headers_; +}; + +struct HttpRequestData : public HttpData { + HttpVerb verb; + std::string path; + + HttpRequestData() : verb(HV_GET) { } + + void clear(bool release_document); + void copy(const HttpRequestData& src); + + size_t formatLeader(char* buffer, size_t size) const override; + HttpError parseLeader(const char* line, size_t len) override; + + bool getAbsoluteUri(std::string* uri) const; + bool getRelativeUri(std::string* host, std::string* path) const; +}; + +struct HttpResponseData : public HttpData { + uint32_t scode; + std::string message; + + HttpResponseData() : scode(HC_INTERNAL_SERVER_ERROR) { } + void clear(bool release_document); + void copy(const HttpResponseData& src); + + // Convenience methods + void set_success(uint32_t scode = HC_OK); + void set_success(const std::string& content_type, + StreamInterface* document, + uint32_t scode = HC_OK); + void set_redirect(const std::string& location, + uint32_t scode = HC_MOVED_TEMPORARILY); + void set_error(uint32_t scode); + + size_t formatLeader(char* buffer, size_t size) const override; + HttpError parseLeader(const char* line, size_t len) override; +}; + +struct HttpTransaction { + HttpRequestData request; + HttpResponseData response; +}; + +////////////////////////////////////////////////////////////////////// +// Http Authentication +////////////////////////////////////////////////////////////////////// + +struct HttpAuthContext { + std::string auth_method; + HttpAuthContext(const std::string& auth) : auth_method(auth) { } + virtual ~HttpAuthContext() { } +}; + +enum HttpAuthResult { HAR_RESPONSE, HAR_IGNORE, HAR_CREDENTIALS, HAR_ERROR }; + +// 'context' is used by this function to record information between calls. +// Start by passing a null pointer, then pass the same pointer each additional +// call. When the authentication attempt is finished, delete the context. +HttpAuthResult HttpAuthenticate( + const char * challenge, size_t len, + const SocketAddress& server, + const std::string& method, const std::string& uri, + const std::string& username, const CryptString& password, + HttpAuthContext *& context, std::string& response, std::string& auth_method); + +////////////////////////////////////////////////////////////////////// + +} // namespace rtc + +#endif // WEBRTC_BASE_HTTPCOMMON_H__ diff --git a/webrtc/rtc_base/httpcommon_unittest.cc b/webrtc/base/httpcommon_unittest.cc similarity index 100% rename from webrtc/rtc_base/httpcommon_unittest.cc rename to webrtc/base/httpcommon_unittest.cc diff --git a/webrtc/rtc_base/httpserver.cc b/webrtc/base/httpserver.cc similarity index 100% rename from webrtc/rtc_base/httpserver.cc rename to webrtc/base/httpserver.cc diff --git a/webrtc/base/httpserver.h b/webrtc/base/httpserver.h index 4fd75a2a05..cbee734873 100644 --- a/webrtc/base/httpserver.h +++ b/webrtc/base/httpserver.h @@ -8,12 +8,132 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_HTTPSERVER_H_ -#define WEBRTC_BASE_HTTPSERVER_H_ +#ifndef WEBRTC_BASE_HTTPSERVER_H__ +#define WEBRTC_BASE_HTTPSERVER_H__ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/httpserver.h" +#include "webrtc/base/httpbase.h" -#endif // WEBRTC_BASE_HTTPSERVER_H_ +namespace rtc { + +class AsyncSocket; +class HttpServer; +class SocketAddress; + +////////////////////////////////////////////////////////////////////// +// HttpServer +////////////////////////////////////////////////////////////////////// + +const int HTTP_INVALID_CONNECTION_ID = 0; + +struct HttpServerTransaction : public HttpTransaction { +public: + HttpServerTransaction(int id) : connection_id_(id) { } + int connection_id() const { return connection_id_; } + +private: + int connection_id_; +}; + +class HttpServer { +public: + HttpServer(); + virtual ~HttpServer(); + + int HandleConnection(StreamInterface* stream); + // Due to sigslot issues, we can't destroy some streams at an arbitrary time. + sigslot::signal3 SignalConnectionClosed; + + // This signal occurs when the HTTP request headers have been received, but + // before the request body is written to the request document. By default, + // the request document is a MemoryStream. By handling this signal, the + // document can be overridden, in which case the third signal argument should + // be set to true. In the case where the request body should be ignored, + // the document can be set to null. Note that the transaction object is still + // owened by the HttpServer at this point. + sigslot::signal3 + SignalHttpRequestHeader; + + // An HTTP request has been made, and is available in the transaction object. + // Populate the transaction's response, and then return the object via the + // Respond method. Note that during this time, ownership of the transaction + // object is transferred, so it may be passed between threads, although + // respond must be called on the server's active thread. + sigslot::signal2 SignalHttpRequest; + void Respond(HttpServerTransaction* transaction); + + // If you want to know when a request completes, listen to this event. + sigslot::signal3 + SignalHttpRequestComplete; + + // Stop processing the connection indicated by connection_id. + // Unless force is true, the server will complete sending a response that is + // in progress. + void Close(int connection_id, bool force); + void CloseAll(bool force); + + // After calling CloseAll, this event is signalled to indicate that all + // outstanding connections have closed. + sigslot::signal1 SignalCloseAllComplete; + +private: + class Connection : private IHttpNotify { + public: + Connection(int connection_id, HttpServer* server); + ~Connection() override; + + void BeginProcess(StreamInterface* stream); + StreamInterface* EndProcess(); + + void Respond(HttpServerTransaction* transaction); + void InitiateClose(bool force); + + // IHttpNotify Interface + HttpError onHttpHeaderComplete(bool chunked, size_t& data_size) override; + void onHttpComplete(HttpMode mode, HttpError err) override; + void onHttpClosed(HttpError err) override; + + int connection_id_; + HttpServer* server_; + HttpBase base_; + HttpServerTransaction* current_; + bool signalling_, close_; + }; + + Connection* Find(int connection_id); + void Remove(int connection_id); + + friend class Connection; + typedef std::map ConnectionMap; + + ConnectionMap connections_; + int next_connection_id_; + bool closing_; +}; + +////////////////////////////////////////////////////////////////////// + +class HttpListenServer : public HttpServer, public sigslot::has_slots<> { +public: + HttpListenServer(); + ~HttpListenServer() override; + + int Listen(const SocketAddress& address); + bool GetAddress(SocketAddress* address) const; + void StopListening(); + +private: + void OnReadEvent(AsyncSocket* socket); + void OnConnectionClosed(HttpServer* server, int connection_id, + StreamInterface* stream); + + std::unique_ptr listener_; +}; + +////////////////////////////////////////////////////////////////////// + +} // namespace rtc + +#endif // WEBRTC_BASE_HTTPSERVER_H__ diff --git a/webrtc/rtc_base/httpserver_unittest.cc b/webrtc/base/httpserver_unittest.cc similarity index 100% rename from webrtc/rtc_base/httpserver_unittest.cc rename to webrtc/base/httpserver_unittest.cc diff --git a/webrtc/rtc_base/ifaddrs-android.cc b/webrtc/base/ifaddrs-android.cc similarity index 100% rename from webrtc/rtc_base/ifaddrs-android.cc rename to webrtc/base/ifaddrs-android.cc diff --git a/webrtc/base/ifaddrs-android.h b/webrtc/base/ifaddrs-android.h index 9c49c9ffb0..10890af652 100644 --- a/webrtc/base/ifaddrs-android.h +++ b/webrtc/base/ifaddrs-android.h @@ -11,9 +11,29 @@ #ifndef WEBRTC_BASE_IFADDRS_ANDROID_H_ #define WEBRTC_BASE_IFADDRS_ANDROID_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/ifaddrs-android.h" + +// Implementation of getifaddrs for Android. +// Fills out a list of ifaddr structs (see below) which contain information +// about every network interface available on the host. +// See 'man getifaddrs' on Linux or OS X (nb: it is not a POSIX function). +struct ifaddrs { + struct ifaddrs* ifa_next; + char* ifa_name; + unsigned int ifa_flags; + struct sockaddr* ifa_addr; + struct sockaddr* ifa_netmask; + // Real ifaddrs has broadcast, point to point and data members. + // We don't need them (yet?). +}; + +namespace rtc { + +int getifaddrs(struct ifaddrs** result); +void freeifaddrs(struct ifaddrs* addrs); + +} // namespace rtc #endif // WEBRTC_BASE_IFADDRS_ANDROID_H_ diff --git a/webrtc/rtc_base/ifaddrs_converter.cc b/webrtc/base/ifaddrs_converter.cc similarity index 100% rename from webrtc/rtc_base/ifaddrs_converter.cc rename to webrtc/base/ifaddrs_converter.cc diff --git a/webrtc/base/ifaddrs_converter.h b/webrtc/base/ifaddrs_converter.h index de7ad87eee..0a1cdb9e41 100644 --- a/webrtc/base/ifaddrs_converter.h +++ b/webrtc/base/ifaddrs_converter.h @@ -11,9 +11,35 @@ #ifndef WEBRTC_BASE_IFADDRS_CONVERTER_H_ #define WEBRTC_BASE_IFADDRS_CONVERTER_H_ +#if defined(WEBRTC_ANDROID) +#include "webrtc/base/ifaddrs-android.h" +#else +#include +#endif // WEBRTC_ANDROID -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/ifaddrs_converter.h" +#include "webrtc/base/ipaddress.h" + +namespace rtc { + +// This class converts native interface addresses to our internal IPAddress +// class. Subclasses should override ConvertNativeToIPAttributes to implement +// the different ways of retrieving IPv6 attributes for various POSIX platforms. +class IfAddrsConverter { + public: + IfAddrsConverter(); + virtual ~IfAddrsConverter(); + virtual bool ConvertIfAddrsToIPAddress(const struct ifaddrs* interface, + InterfaceAddress* ipaddress, + IPAddress* mask); + + protected: + virtual bool ConvertNativeAttributesToIPAttributes( + const struct ifaddrs* interface, + int* ip_attributes); +}; + +IfAddrsConverter* CreateIfAddrsConverter(); + +} // namespace rtc #endif // WEBRTC_BASE_IFADDRS_CONVERTER_H_ diff --git a/webrtc/base/ignore_wundef.h b/webrtc/base/ignore_wundef.h index fdfba9b84a..b5bf7f79b6 100644 --- a/webrtc/base/ignore_wundef.h +++ b/webrtc/base/ignore_wundef.h @@ -11,9 +11,23 @@ #ifndef WEBRTC_BASE_IGNORE_WUNDEF_H_ #define WEBRTC_BASE_IGNORE_WUNDEF_H_ +// If a header file uses #if on possibly undefined macros (and it's for some +// reason not possible to just fix the header file), include it like this: +// +// RTC_PUSH_IGNORING_WUNDEF() +// #include "misbehaving_header.h" +// RTC_POP_IGNORING_WUNDEF() +// +// This will cause the compiler to not emit -Wundef warnings for that file. -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/ignore_wundef.h" +#ifdef __clang__ +#define RTC_PUSH_IGNORING_WUNDEF() \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wundef\"") +#define RTC_POP_IGNORING_WUNDEF() _Pragma("clang diagnostic pop") +#else +#define RTC_PUSH_IGNORING_WUNDEF() +#define RTC_POP_IGNORING_WUNDEF() +#endif // __clang__ #endif // WEBRTC_BASE_IGNORE_WUNDEF_H_ diff --git a/webrtc/rtc_base/ipaddress.cc b/webrtc/base/ipaddress.cc similarity index 100% rename from webrtc/rtc_base/ipaddress.cc rename to webrtc/base/ipaddress.cc diff --git a/webrtc/base/ipaddress.h b/webrtc/base/ipaddress.h index 44e432d2c8..ef1e3d8170 100644 --- a/webrtc/base/ipaddress.h +++ b/webrtc/base/ipaddress.h @@ -11,9 +11,178 @@ #ifndef WEBRTC_BASE_IPADDRESS_H_ #define WEBRTC_BASE_IPADDRESS_H_ +#if defined(WEBRTC_POSIX) +#include +#include +#include +#include +#endif +#if defined(WEBRTC_WIN) +#include +#include +#endif +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/ipaddress.h" +#include "webrtc/base/basictypes.h" +#include "webrtc/base/byteorder.h" +#if defined(WEBRTC_WIN) +#include "webrtc/base/win32.h" +#endif + +namespace rtc { + +enum IPv6AddressFlag { + IPV6_ADDRESS_FLAG_NONE = 0x00, + + // Temporary address is dynamic by nature and will not carry MAC + // address. + IPV6_ADDRESS_FLAG_TEMPORARY = 1 << 0, + + // Temporary address could become deprecated once the preferred + // lifetime is reached. It is still valid but just shouldn't be used + // to create new connection. + IPV6_ADDRESS_FLAG_DEPRECATED = 1 << 1, +}; + +// Version-agnostic IP address class, wraps a union of in_addr and in6_addr. +class IPAddress { + public: + IPAddress() : family_(AF_UNSPEC) { + ::memset(&u_, 0, sizeof(u_)); + } + + explicit IPAddress(const in_addr& ip4) : family_(AF_INET) { + memset(&u_, 0, sizeof(u_)); + u_.ip4 = ip4; + } + + explicit IPAddress(const in6_addr& ip6) : family_(AF_INET6) { + u_.ip6 = ip6; + } + + explicit IPAddress(uint32_t ip_in_host_byte_order) : family_(AF_INET) { + memset(&u_, 0, sizeof(u_)); + u_.ip4.s_addr = HostToNetwork32(ip_in_host_byte_order); + } + + IPAddress(const IPAddress& other) : family_(other.family_) { + ::memcpy(&u_, &other.u_, sizeof(u_)); + } + + virtual ~IPAddress() {} + + const IPAddress & operator=(const IPAddress& other) { + family_ = other.family_; + ::memcpy(&u_, &other.u_, sizeof(u_)); + return *this; + } + + bool operator==(const IPAddress& other) const; + bool operator!=(const IPAddress& other) const; + bool operator <(const IPAddress& other) const; + bool operator >(const IPAddress& other) const; + friend std::ostream& operator<<(std::ostream& os, const IPAddress& addr); + + int family() const { return family_; } + in_addr ipv4_address() const; + in6_addr ipv6_address() const; + + // Returns the number of bytes needed to store the raw address. + size_t Size() const; + + // Wraps inet_ntop. + std::string ToString() const; + + // Same as ToString but anonymizes it by hiding the last part. + std::string ToSensitiveString() const; + + // Returns an unmapped address from a possibly-mapped address. + // Returns the same address if this isn't a mapped address. + IPAddress Normalized() const; + + // Returns this address as an IPv6 address. + // Maps v4 addresses (as ::ffff:a.b.c.d), returns v6 addresses unchanged. + IPAddress AsIPv6Address() const; + + // For socketaddress' benefit. Returns the IP in host byte order. + uint32_t v4AddressAsHostOrderInteger() const; + + // Whether this is an unspecified IP address. + bool IsNil() const; + + private: + int family_; + union { + in_addr ip4; + in6_addr ip6; + } u_; +}; + +// IP class which could represent IPv6 address flags which is only +// meaningful in IPv6 case. +class InterfaceAddress : public IPAddress { + public: + InterfaceAddress() : ipv6_flags_(IPV6_ADDRESS_FLAG_NONE) {} + + InterfaceAddress(IPAddress ip) + : IPAddress(ip), ipv6_flags_(IPV6_ADDRESS_FLAG_NONE) {} + + InterfaceAddress(IPAddress addr, int ipv6_flags) + : IPAddress(addr), ipv6_flags_(ipv6_flags) {} + + InterfaceAddress(const in6_addr& ip6, int ipv6_flags) + : IPAddress(ip6), ipv6_flags_(ipv6_flags) {} + + const InterfaceAddress & operator=(const InterfaceAddress& other); + + bool operator==(const InterfaceAddress& other) const; + bool operator!=(const InterfaceAddress& other) const; + + int ipv6_flags() const { return ipv6_flags_; } + friend std::ostream& operator<<(std::ostream& os, + const InterfaceAddress& addr); + + private: + int ipv6_flags_; +}; + +bool IPFromAddrInfo(struct addrinfo* info, IPAddress* out); +bool IPFromString(const std::string& str, IPAddress* out); +bool IPFromString(const std::string& str, int flags, + InterfaceAddress* out); +bool IPIsAny(const IPAddress& ip); +bool IPIsLoopback(const IPAddress& ip); +bool IPIsPrivate(const IPAddress& ip); +bool IPIsUnspec(const IPAddress& ip); +size_t HashIP(const IPAddress& ip); + +// These are only really applicable for IPv6 addresses. +bool IPIs6Bone(const IPAddress& ip); +bool IPIs6To4(const IPAddress& ip); +bool IPIsLinkLocal(const IPAddress& ip); +bool IPIsMacBased(const IPAddress& ip); +bool IPIsSiteLocal(const IPAddress& ip); +bool IPIsTeredo(const IPAddress& ip); +bool IPIsULA(const IPAddress& ip); +bool IPIsV4Compatibility(const IPAddress& ip); +bool IPIsV4Mapped(const IPAddress& ip); + +// Returns the precedence value for this IP as given in RFC3484. +int IPAddressPrecedence(const IPAddress& ip); + +// Returns 'ip' truncated to be 'length' bits long. +IPAddress TruncateIP(const IPAddress& ip, int length); + +IPAddress GetLoopbackIP(int family); +IPAddress GetAnyIP(int family); + +// Returns the number of contiguously set bits, counting from the MSB in network +// byte order, in this IPAddress. Bits after the first 0 encountered are not +// counted. +int CountIPMaskBits(IPAddress mask); + +} // namespace rtc #endif // WEBRTC_BASE_IPADDRESS_H_ diff --git a/webrtc/rtc_base/ipaddress_unittest.cc b/webrtc/base/ipaddress_unittest.cc similarity index 100% rename from webrtc/rtc_base/ipaddress_unittest.cc rename to webrtc/base/ipaddress_unittest.cc diff --git a/webrtc/rtc_base/java/src/org/webrtc/ContextUtils.java b/webrtc/base/java/src/org/webrtc/ContextUtils.java similarity index 100% rename from webrtc/rtc_base/java/src/org/webrtc/ContextUtils.java rename to webrtc/base/java/src/org/webrtc/ContextUtils.java diff --git a/webrtc/rtc_base/java/src/org/webrtc/Logging.java b/webrtc/base/java/src/org/webrtc/Logging.java similarity index 100% rename from webrtc/rtc_base/java/src/org/webrtc/Logging.java rename to webrtc/base/java/src/org/webrtc/Logging.java diff --git a/webrtc/rtc_base/java/src/org/webrtc/OWNERS b/webrtc/base/java/src/org/webrtc/OWNERS similarity index 100% rename from webrtc/rtc_base/java/src/org/webrtc/OWNERS rename to webrtc/base/java/src/org/webrtc/OWNERS diff --git a/webrtc/rtc_base/java/src/org/webrtc/Size.java b/webrtc/base/java/src/org/webrtc/Size.java similarity index 100% rename from webrtc/rtc_base/java/src/org/webrtc/Size.java rename to webrtc/base/java/src/org/webrtc/Size.java diff --git a/webrtc/rtc_base/java/src/org/webrtc/ThreadUtils.java b/webrtc/base/java/src/org/webrtc/ThreadUtils.java similarity index 100% rename from webrtc/rtc_base/java/src/org/webrtc/ThreadUtils.java rename to webrtc/base/java/src/org/webrtc/ThreadUtils.java diff --git a/webrtc/rtc_base/json.cc b/webrtc/base/json.cc similarity index 100% rename from webrtc/rtc_base/json.cc rename to webrtc/base/json.cc diff --git a/webrtc/base/json.h b/webrtc/base/json.h index 175028f607..4c0d22243a 100644 --- a/webrtc/base/json.h +++ b/webrtc/base/json.h @@ -11,9 +11,81 @@ #ifndef WEBRTC_BASE_JSON_H_ #define WEBRTC_BASE_JSON_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/json.h" +#if !defined(WEBRTC_EXTERNAL_JSON) +#include "json/json.h" +#else +#include "third_party/jsoncpp/json.h" +#endif + +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// +// JSON Helpers +/////////////////////////////////////////////////////////////////////////////// + +// Robust conversion operators, better than the ones in JsonCpp. +bool GetIntFromJson(const Json::Value& in, int* out); +bool GetUIntFromJson(const Json::Value& in, unsigned int* out); +bool GetStringFromJson(const Json::Value& in, std::string* out); +bool GetBoolFromJson(const Json::Value& in, bool* out); +bool GetDoubleFromJson(const Json::Value& in, double* out); + +// Pull values out of a JSON array. +bool GetValueFromJsonArray(const Json::Value& in, size_t n, + Json::Value* out); +bool GetIntFromJsonArray(const Json::Value& in, size_t n, + int* out); +bool GetUIntFromJsonArray(const Json::Value& in, size_t n, + unsigned int* out); +bool GetStringFromJsonArray(const Json::Value& in, size_t n, + std::string* out); +bool GetBoolFromJsonArray(const Json::Value& in, size_t n, + bool* out); +bool GetDoubleFromJsonArray(const Json::Value& in, size_t n, + double* out); + +// Convert json arrays to std::vector +bool JsonArrayToValueVector(const Json::Value& in, + std::vector* out); +bool JsonArrayToIntVector(const Json::Value& in, + std::vector* out); +bool JsonArrayToUIntVector(const Json::Value& in, + std::vector* out); +bool JsonArrayToStringVector(const Json::Value& in, + std::vector* out); +bool JsonArrayToBoolVector(const Json::Value& in, + std::vector* out); +bool JsonArrayToDoubleVector(const Json::Value& in, + std::vector* out); + +// Convert std::vector to json array +Json::Value ValueVectorToJsonArray(const std::vector& in); +Json::Value IntVectorToJsonArray(const std::vector& in); +Json::Value UIntVectorToJsonArray(const std::vector& in); +Json::Value StringVectorToJsonArray(const std::vector& in); +Json::Value BoolVectorToJsonArray(const std::vector& in); +Json::Value DoubleVectorToJsonArray(const std::vector& in); + +// Pull values out of a JSON object. +bool GetValueFromJsonObject(const Json::Value& in, const std::string& k, + Json::Value* out); +bool GetIntFromJsonObject(const Json::Value& in, const std::string& k, + int* out); +bool GetUIntFromJsonObject(const Json::Value& in, const std::string& k, + unsigned int* out); +bool GetStringFromJsonObject(const Json::Value& in, const std::string& k, + std::string* out); +bool GetBoolFromJsonObject(const Json::Value& in, const std::string& k, + bool* out); +bool GetDoubleFromJsonObject(const Json::Value& in, const std::string& k, + double* out); + +// Writes out a Json value as a string. +std::string JsonValueToString(const Json::Value& json); + +} // namespace rtc #endif // WEBRTC_BASE_JSON_H_ diff --git a/webrtc/rtc_base/json_unittest.cc b/webrtc/base/json_unittest.cc similarity index 100% rename from webrtc/rtc_base/json_unittest.cc rename to webrtc/base/json_unittest.cc diff --git a/webrtc/base/keep_ref_until_done.h b/webrtc/base/keep_ref_until_done.h index 171e04886d..269e1c8657 100644 --- a/webrtc/base/keep_ref_until_done.h +++ b/webrtc/base/keep_ref_until_done.h @@ -11,9 +11,33 @@ #ifndef WEBRTC_BASE_KEEP_REF_UNTIL_DONE_H_ #define WEBRTC_BASE_KEEP_REF_UNTIL_DONE_H_ +#include "webrtc/base/bind.h" +#include "webrtc/base/callback.h" +#include "webrtc/base/refcount.h" +#include "webrtc/base/scoped_ref_ptr.h" + +namespace rtc { + +namespace impl { +template +static inline void DoNothing(const scoped_refptr& object) {} +} // namespace impl + +// KeepRefUntilDone keeps a reference to |object| until the returned +// callback goes out of scope. If the returned callback is copied, the +// reference will be released when the last callback goes out of scope. +template +static inline Callback0 KeepRefUntilDone(ObjectT* object) { + return rtc::Bind(&impl::DoNothing, scoped_refptr(object)); +} + +template +static inline Callback0 KeepRefUntilDone( + const scoped_refptr& object) { + return rtc::Bind(&impl::DoNothing, object); +} + +} // namespace rtc -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/keep_ref_until_done.h" #endif // WEBRTC_BASE_KEEP_REF_UNTIL_DONE_H_ diff --git a/webrtc/rtc_base/location.cc b/webrtc/base/location.cc similarity index 100% rename from webrtc/rtc_base/location.cc rename to webrtc/base/location.cc diff --git a/webrtc/base/location.h b/webrtc/base/location.h index 432471c013..541be9ac14 100644 --- a/webrtc/base/location.h +++ b/webrtc/base/location.h @@ -11,9 +11,47 @@ #ifndef WEBRTC_BASE_LOCATION_H_ #define WEBRTC_BASE_LOCATION_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/location.h" +#include "webrtc/base/stringize_macros.h" + +namespace rtc { + +// Location provides basic info where of an object was constructed, or was +// significantly brought to life. +// This is a stripped down version of: +// https://code.google.com/p/chromium/codesearch#chromium/src/base/location.h +class Location { + public: + // Constructor should be called with a long-lived char*, such as __FILE__. + // It assumes the provided value will persist as a global constant, and it + // will not make a copy of it. + // + // TODO(deadbeef): Tracing is currently limited to 2 arguments, which is + // why the file name and line number are combined into one argument. + // + // Once TracingV2 is available, separate the file name and line number. + Location(const char* function_name, const char* file_and_line); + Location(); + Location(const Location& other); + Location& operator=(const Location& other); + + const char* function_name() const { return function_name_; } + const char* file_and_line() const { return file_and_line_; } + + std::string ToString() const; + + private: + const char* function_name_; + const char* file_and_line_; +}; + +// Define a macro to record the current source location. +#define RTC_FROM_HERE RTC_FROM_HERE_WITH_FUNCTION(__FUNCTION__) + +#define RTC_FROM_HERE_WITH_FUNCTION(function_name) \ + ::rtc::Location(function_name, __FILE__ ":" STRINGIZE(__LINE__)) + +} // namespace rtc #endif // WEBRTC_BASE_LOCATION_H_ diff --git a/webrtc/rtc_base/logging.cc b/webrtc/base/logging.cc similarity index 100% rename from webrtc/rtc_base/logging.cc rename to webrtc/base/logging.cc diff --git a/webrtc/base/logging.h b/webrtc/base/logging.h index 594d9c992a..8f476a0215 100644 --- a/webrtc/base/logging.h +++ b/webrtc/base/logging.h @@ -46,9 +46,325 @@ #ifndef WEBRTC_BASE_LOGGING_H_ #define WEBRTC_BASE_LOGGING_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/logging.h" +#include +#include +#include +#include + +#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) +#include +#endif + +#include "webrtc/base/basictypes.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/thread_annotations.h" + +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// +// ConstantLabel can be used to easily generate string names from constant +// values. This can be useful for logging descriptive names of error messages. +// Usage: +// const ConstantLabel LIBRARY_ERRORS[] = { +// KLABEL(SOME_ERROR), +// KLABEL(SOME_OTHER_ERROR), +// ... +// LASTLABEL +// } +// +// int err = LibraryFunc(); +// LOG(LS_ERROR) << "LibraryFunc returned: " +// << ErrorName(err, LIBRARY_ERRORS); + +struct ConstantLabel { int value; const char * label; }; +#define KLABEL(x) { x, #x } +#define TLABEL(x, y) { x, y } +#define LASTLABEL { 0, 0 } + +const char* FindLabel(int value, const ConstantLabel entries[]); +std::string ErrorName(int err, const ConstantLabel* err_table); + +#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) +// Returns a UTF8 description from an OS X Status error. +std::string DescriptionFromOSStatus(OSStatus err); +#endif + +////////////////////////////////////////////////////////////////////// + +// Note that the non-standard LoggingSeverity aliases exist because they are +// still in broad use. The meanings of the levels are: +// LS_SENSITIVE: Information which should only be logged with the consent +// of the user, due to privacy concerns. +// LS_VERBOSE: This level is for data which we do not want to appear in the +// normal debug log, but should appear in diagnostic logs. +// LS_INFO: Chatty level used in debugging for all sorts of things, the default +// in debug builds. +// LS_WARNING: Something that may warrant investigation. +// LS_ERROR: Something that should not have occurred. +// LS_NONE: Don't log. +enum LoggingSeverity { + LS_SENSITIVE, + LS_VERBOSE, + LS_INFO, + LS_WARNING, + LS_ERROR, + LS_NONE, + INFO = LS_INFO, + WARNING = LS_WARNING, + LERROR = LS_ERROR +}; + +// LogErrorContext assists in interpreting the meaning of an error value. +enum LogErrorContext { + ERRCTX_NONE, + ERRCTX_ERRNO, // System-local errno + ERRCTX_HRESULT, // Windows HRESULT + ERRCTX_OSSTATUS, // MacOS OSStatus + + // Abbreviations for LOG_E macro + ERRCTX_EN = ERRCTX_ERRNO, // LOG_E(sev, EN, x) + ERRCTX_HR = ERRCTX_HRESULT, // LOG_E(sev, HR, x) + ERRCTX_OS = ERRCTX_OSSTATUS, // LOG_E(sev, OS, x) +}; + +// Virtual sink interface that can receive log messages. +class LogSink { + public: + LogSink() {} + virtual ~LogSink() {} + virtual void OnLogMessage(const std::string& message) = 0; +}; + +class LogMessage { + public: + LogMessage(const char* file, + int line, + LoggingSeverity sev, + LogErrorContext err_ctx = ERRCTX_NONE, + int err = 0, + const char* module = nullptr); + + LogMessage(const char* file, + int line, + LoggingSeverity sev, + const std::string& tag); + + ~LogMessage(); + + static inline bool Loggable(LoggingSeverity sev) { return (sev >= min_sev_); } + std::ostream& stream() { return print_stream_; } + + // Returns the time at which this function was called for the first time. + // The time will be used as the logging start time. + // If this is not called externally, the LogMessage ctor also calls it, in + // which case the logging start time will be the time of the first LogMessage + // instance is created. + static int64_t LogStartTime(); + + // Returns the wall clock equivalent of |LogStartTime|, in seconds from the + // epoch. + static uint32_t WallClockStartTime(); + + // LogThreads: Display the thread identifier of the current thread + static void LogThreads(bool on = true); + + // LogTimestamps: Display the elapsed time of the program + static void LogTimestamps(bool on = true); + + // These are the available logging channels + // Debug: Debug console on Windows, otherwise stderr + static void LogToDebug(LoggingSeverity min_sev); + static LoggingSeverity GetLogToDebug() { return dbg_sev_; } + + // Sets whether logs will be directed to stderr in debug mode. + static void SetLogToStderr(bool log_to_stderr); + + // Stream: Any non-blocking stream interface. LogMessage takes ownership of + // the stream. Multiple streams may be specified by using AddLogToStream. + // LogToStream is retained for backwards compatibility; when invoked, it + // will discard any previously set streams and install the specified stream. + // GetLogToStream gets the severity for the specified stream, of if none + // is specified, the minimum stream severity. + // RemoveLogToStream removes the specified stream, without destroying it. + static int GetLogToStream(LogSink* stream = nullptr); + static void AddLogToStream(LogSink* stream, LoggingSeverity min_sev); + static void RemoveLogToStream(LogSink* stream); + + // Testing against MinLogSeverity allows code to avoid potentially expensive + // logging operations by pre-checking the logging level. + static int GetMinLogSeverity() { return min_sev_; } + + // Parses the provided parameter stream to configure the options above. + // Useful for configuring logging from the command line. + static void ConfigureLogging(const char* params); + + private: + typedef std::pair StreamAndSeverity; + typedef std::list StreamList; + + // Updates min_sev_ appropriately when debug sinks change. + static void UpdateMinLogSeverity(); + + // These write out the actual log messages. + static void OutputToDebug(const std::string& msg, + LoggingSeverity severity, + const std::string& tag); + + // The ostream that buffers the formatted message before output + std::ostringstream print_stream_; + + // The severity level of this message + LoggingSeverity severity_; + + // The Android debug output tag. + std::string tag_; + + // String data generated in the constructor, that should be appended to + // the message before output. + std::string extra_; + + // dbg_sev_ is the thresholds for those output targets + // min_sev_ is the minimum (most verbose) of those levels, and is used + // as a short-circuit in the logging macros to identify messages that won't + // be logged. + // ctx_sev_ is the minimum level at which file context is displayed + static LoggingSeverity min_sev_, dbg_sev_, ctx_sev_; + + // The output streams and their associated severities + static StreamList streams_; + + // Flags for formatting options + static bool thread_, timestamp_; + + // Determines if logs will be directed to stderr in debug mode. + static bool log_to_stderr_; + + RTC_DISALLOW_COPY_AND_ASSIGN(LogMessage); +}; + +////////////////////////////////////////////////////////////////////// +// Logging Helpers +////////////////////////////////////////////////////////////////////// + +class LogMultilineState { + public: + size_t unprintable_count_[2]; + LogMultilineState() { + unprintable_count_[0] = unprintable_count_[1] = 0; + } +}; + +// When possible, pass optional state variable to track various data across +// multiple calls to LogMultiline. Otherwise, pass null. +void LogMultiline(LoggingSeverity level, const char* label, bool input, + const void* data, size_t len, bool hex_mode, + LogMultilineState* state); + +#ifndef LOG + +// The following non-obvious technique for implementation of a +// conditional log stream was stolen from google3/base/logging.h. + +// This class is used to explicitly ignore values in the conditional +// logging macros. This avoids compiler warnings like "value computed +// is not used" and "statement has no effect". + +class LogMessageVoidify { + public: + LogMessageVoidify() { } + // This has to be an operator with a precedence lower than << but + // higher than ?: + void operator&(std::ostream&) { } +}; + +#define LOG_SEVERITY_PRECONDITION(sev) \ + !(rtc::LogMessage::Loggable(sev)) \ + ? (void) 0 \ + : rtc::LogMessageVoidify() & + +#define LOG(sev) \ + LOG_SEVERITY_PRECONDITION(rtc::sev) \ + rtc::LogMessage(__FILE__, __LINE__, rtc::sev).stream() + +// The _V version is for when a variable is passed in. It doesn't do the +// namespace concatination. +#define LOG_V(sev) \ + LOG_SEVERITY_PRECONDITION(sev) \ + rtc::LogMessage(__FILE__, __LINE__, sev).stream() + +// The _F version prefixes the message with the current function name. +#if (defined(__GNUC__) && !defined(NDEBUG)) || defined(WANT_PRETTY_LOG_F) +#define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": " +#define LOG_T_F(sev) LOG(sev) << this << ": " << __PRETTY_FUNCTION__ << ": " +#else +#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " +#define LOG_T_F(sev) LOG(sev) << this << ": " << __FUNCTION__ << ": " +#endif + +#define LOG_CHECK_LEVEL(sev) \ + rtc::LogCheckLevel(rtc::sev) +#define LOG_CHECK_LEVEL_V(sev) \ + rtc::LogCheckLevel(sev) + +inline bool LogCheckLevel(LoggingSeverity sev) { + return (LogMessage::GetMinLogSeverity() <= sev); +} + +#define LOG_E(sev, ctx, err, ...) \ + LOG_SEVERITY_PRECONDITION(rtc::sev) \ + rtc::LogMessage(__FILE__, __LINE__, rtc::sev, \ + rtc::ERRCTX_ ## ctx, err , ##__VA_ARGS__) \ + .stream() + +#define LOG_T(sev) LOG(sev) << this << ": " + +#define LOG_ERRNO_EX(sev, err) \ + LOG_E(sev, ERRNO, err) +#define LOG_ERRNO(sev) \ + LOG_ERRNO_EX(sev, errno) + +#if defined(WEBRTC_WIN) +#define LOG_GLE_EX(sev, err) \ + LOG_E(sev, HRESULT, err) +#define LOG_GLE(sev) \ + LOG_GLE_EX(sev, GetLastError()) +#define LOG_GLEM(sev, mod) \ + LOG_E(sev, HRESULT, GetLastError(), mod) +#define LOG_ERR_EX(sev, err) \ + LOG_GLE_EX(sev, err) +#define LOG_ERR(sev) \ + LOG_GLE(sev) +#define LAST_SYSTEM_ERROR \ + (::GetLastError()) +#elif defined(__native_client__) && __native_client__ +#define LOG_ERR_EX(sev, err) \ + LOG(sev) +#define LOG_ERR(sev) \ + LOG(sev) +#define LAST_SYSTEM_ERROR \ + (0) +#elif defined(WEBRTC_POSIX) +#define LOG_ERR_EX(sev, err) \ + LOG_ERRNO_EX(sev, err) +#define LOG_ERR(sev) \ + LOG_ERRNO(sev) +#define LAST_SYSTEM_ERROR \ + (errno) +#endif // WEBRTC_WIN + +#define LOG_TAG(sev, tag) \ + LOG_SEVERITY_PRECONDITION(sev) \ + rtc::LogMessage(nullptr, 0, sev, tag).stream() + +#define PLOG(sev, err) \ + LOG_ERR_EX(sev, err) + +// TODO(?): Add an "assert" wrapper that logs in the same manner. + +#endif // LOG + +} // namespace rtc #endif // WEBRTC_BASE_LOGGING_H_ diff --git a/webrtc/rtc_base/logging_mac.mm b/webrtc/base/logging_mac.mm similarity index 100% rename from webrtc/rtc_base/logging_mac.mm rename to webrtc/base/logging_mac.mm diff --git a/webrtc/rtc_base/logging_unittest.cc b/webrtc/base/logging_unittest.cc similarity index 100% rename from webrtc/rtc_base/logging_unittest.cc rename to webrtc/base/logging_unittest.cc diff --git a/webrtc/rtc_base/logsinks.cc b/webrtc/base/logsinks.cc similarity index 100% rename from webrtc/rtc_base/logsinks.cc rename to webrtc/base/logsinks.cc diff --git a/webrtc/base/logsinks.h b/webrtc/base/logsinks.h index 95e6dc6154..e75120e3f5 100644 --- a/webrtc/base/logsinks.h +++ b/webrtc/base/logsinks.h @@ -8,12 +8,61 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_LOGSINKS_H_ -#define WEBRTC_BASE_LOGSINKS_H_ +#ifndef WEBRTC_BASE_FILE_ROTATING_LOG_SINK_H_ +#define WEBRTC_BASE_FILE_ROTATING_LOG_SINK_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/logsinks.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/filerotatingstream.h" +#include "webrtc/base/logging.h" -#endif // WEBRTC_BASE_LOGSINKS_H_ +namespace rtc { + +// Log sink that uses a FileRotatingStream to write to disk. +// Init() must be called before adding this sink. +class FileRotatingLogSink : public LogSink { + public: + // |num_log_files| must be greater than 1 and |max_log_size| must be greater + // than 0. + FileRotatingLogSink(const std::string& log_dir_path, + const std::string& log_prefix, + size_t max_log_size, + size_t num_log_files); + ~FileRotatingLogSink() override; + + // Writes the message to the current file. It will spill over to the next + // file if needed. + void OnLogMessage(const std::string& message) override; + + // Deletes any existing files in the directory and creates a new log file. + virtual bool Init(); + + // Disables buffering on the underlying stream. + bool DisableBuffering(); + + protected: + explicit FileRotatingLogSink(FileRotatingStream* stream); + + private: + std::unique_ptr stream_; + + RTC_DISALLOW_COPY_AND_ASSIGN(FileRotatingLogSink); +}; + +// Log sink that uses a CallSessionFileRotatingStream to write to disk. +// Init() must be called before adding this sink. +class CallSessionFileRotatingLogSink : public FileRotatingLogSink { + public: + CallSessionFileRotatingLogSink(const std::string& log_dir_path, + size_t max_total_log_size); + ~CallSessionFileRotatingLogSink() override; + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(CallSessionFileRotatingLogSink); +}; + +} // namespace rtc + +#endif // WEBRTC_BASE_FILE_ROTATING_LOG_SINK_H_ diff --git a/webrtc/rtc_base/macifaddrs_converter.cc b/webrtc/base/macifaddrs_converter.cc similarity index 100% rename from webrtc/rtc_base/macifaddrs_converter.cc rename to webrtc/base/macifaddrs_converter.cc diff --git a/webrtc/rtc_base/macutils.cc b/webrtc/base/macutils.cc similarity index 100% rename from webrtc/rtc_base/macutils.cc rename to webrtc/base/macutils.cc diff --git a/webrtc/base/macutils.h b/webrtc/base/macutils.h index ed0c4f5473..fdcb3eee5b 100644 --- a/webrtc/base/macutils.h +++ b/webrtc/base/macutils.h @@ -8,12 +8,43 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_MACUTILS_H_ -#define WEBRTC_BASE_MACUTILS_H_ +#ifndef WEBRTC_BASE_MACUTILS_H__ +#define WEBRTC_BASE_MACUTILS_H__ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/macutils.h" +namespace rtc { -#endif // WEBRTC_BASE_MACUTILS_H_ +/////////////////////////////////////////////////////////////////////////////// + +// Note that some of these functions work for both iOS and Mac OS X. The ones +// that are specific to Mac are #ifdef'ed as such. + +bool ToUtf8(const CFStringRef str16, std::string* str8); +bool ToUtf16(const std::string& str8, CFStringRef* str16); + +#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) +void DecodeFourChar(UInt32 fc, std::string* out); + +enum MacOSVersionName { + kMacOSUnknown, // ??? + kMacOSOlder, // 10.2- + kMacOSPanther, // 10.3 + kMacOSTiger, // 10.4 + kMacOSLeopard, // 10.5 + kMacOSSnowLeopard, // 10.6 + kMacOSLion, // 10.7 + kMacOSMountainLion, // 10.8 + kMacOSMavericks, // 10.9 + kMacOSNewer, // 10.10+ +}; + +MacOSVersionName GetOSVersionName(); +#endif + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace rtc + +#endif // WEBRTC_BASE_MACUTILS_H__ diff --git a/webrtc/rtc_base/macutils_unittest.cc b/webrtc/base/macutils_unittest.cc similarity index 100% rename from webrtc/rtc_base/macutils_unittest.cc rename to webrtc/base/macutils_unittest.cc diff --git a/webrtc/base/mathutils.h b/webrtc/base/mathutils.h index 9e5c3cab78..3c70e765e1 100644 --- a/webrtc/base/mathutils.h +++ b/webrtc/base/mathutils.h @@ -11,9 +11,29 @@ #ifndef WEBRTC_BASE_MATHUTILS_H_ #define WEBRTC_BASE_MATHUTILS_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/mathutils.h" +#include "webrtc/base/checks.h" + +#ifndef M_PI +#define M_PI 3.14159265359f +#endif + +// Given two numbers |x| and |y| such that x >= y, computes the difference +// x - y without causing undefined behavior due to signed overflow. +template +typename std::make_unsigned::type unsigned_difference(T x, T y) { + static_assert( + std::is_signed::value, + "Function unsigned_difference is only meaningful for signed types."); + RTC_DCHECK_GE(x, y); + typedef typename std::make_unsigned::type unsigned_type; + // int -> unsigned conversion repeatedly adds UINT_MAX + 1 until the number + // can be represented as an unsigned. Since we know that the actual + // difference x - y can be represented as an unsigned, it is sufficient to + // compute the difference modulo UINT_MAX + 1, i.e using unsigned arithmetic. + return static_cast(x) - static_cast(y); +} #endif // WEBRTC_BASE_MATHUTILS_H_ diff --git a/webrtc/rtc_base/md5.cc b/webrtc/base/md5.cc similarity index 100% rename from webrtc/rtc_base/md5.cc rename to webrtc/base/md5.cc diff --git a/webrtc/base/md5.h b/webrtc/base/md5.h index fd17541960..45e00b73d1 100644 --- a/webrtc/base/md5.h +++ b/webrtc/base/md5.h @@ -23,9 +23,22 @@ #ifndef WEBRTC_BASE_MD5_H_ #define WEBRTC_BASE_MD5_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/md5.h" +namespace rtc { + +struct MD5Context { + uint32_t buf[4]; + uint32_t bits[2]; + uint32_t in[16]; +}; + +void MD5Init(MD5Context* context); +void MD5Update(MD5Context* context, const uint8_t* data, size_t len); +void MD5Final(MD5Context* context, uint8_t digest[16]); +void MD5Transform(uint32_t buf[4], const uint32_t in[16]); + +} // namespace rtc #endif // WEBRTC_BASE_MD5_H_ diff --git a/webrtc/rtc_base/md5digest.cc b/webrtc/base/md5digest.cc similarity index 100% rename from webrtc/rtc_base/md5digest.cc rename to webrtc/base/md5digest.cc diff --git a/webrtc/base/md5digest.h b/webrtc/base/md5digest.h index 66d6ee1820..3f8d656d8f 100644 --- a/webrtc/base/md5digest.h +++ b/webrtc/base/md5digest.h @@ -11,9 +11,26 @@ #ifndef WEBRTC_BASE_MD5DIGEST_H_ #define WEBRTC_BASE_MD5DIGEST_H_ +#include "webrtc/base/md5.h" +#include "webrtc/base/messagedigest.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/md5digest.h" +namespace rtc { + +// A simple wrapper for our MD5 implementation. +class Md5Digest : public MessageDigest { + public: + enum { kSize = 16 }; + Md5Digest() { + MD5Init(&ctx_); + } + size_t Size() const override; + void Update(const void* buf, size_t len) override; + size_t Finish(void* buf, size_t len) override; + + private: + MD5Context ctx_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_MD5DIGEST_H_ diff --git a/webrtc/rtc_base/md5digest_unittest.cc b/webrtc/base/md5digest_unittest.cc similarity index 100% rename from webrtc/rtc_base/md5digest_unittest.cc rename to webrtc/base/md5digest_unittest.cc diff --git a/webrtc/rtc_base/memory_usage.cc b/webrtc/base/memory_usage.cc similarity index 100% rename from webrtc/rtc_base/memory_usage.cc rename to webrtc/base/memory_usage.cc diff --git a/webrtc/base/memory_usage.h b/webrtc/base/memory_usage.h index 5c225597a7..2699082c38 100644 --- a/webrtc/base/memory_usage.h +++ b/webrtc/base/memory_usage.h @@ -10,9 +10,15 @@ #ifndef WEBRTC_BASE_MEMORY_USAGE_H_ #define WEBRTC_BASE_MEMORY_USAGE_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/memory_usage.h" +namespace rtc { + +// Returns current memory used by the process in bytes (working set size on +// Windows and resident set size on other platforms). +// Returns -1 on failure. +int64_t GetProcessResidentSizeBytes(); + +} // namespace rtc #endif // WEBRTC_BASE_MEMORY_USAGE_H_ diff --git a/webrtc/rtc_base/memory_usage_unittest.cc b/webrtc/base/memory_usage_unittest.cc similarity index 100% rename from webrtc/rtc_base/memory_usage_unittest.cc rename to webrtc/base/memory_usage_unittest.cc diff --git a/webrtc/rtc_base/messagedigest.cc b/webrtc/base/messagedigest.cc similarity index 100% rename from webrtc/rtc_base/messagedigest.cc rename to webrtc/base/messagedigest.cc diff --git a/webrtc/base/messagedigest.h b/webrtc/base/messagedigest.h index b73f9079c8..5cfcb47723 100644 --- a/webrtc/base/messagedigest.h +++ b/webrtc/base/messagedigest.h @@ -11,9 +11,99 @@ #ifndef WEBRTC_BASE_MESSAGEDIGEST_H_ #define WEBRTC_BASE_MESSAGEDIGEST_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/messagedigest.h" +namespace rtc { + +// Definitions for the digest algorithms. +extern const char DIGEST_MD5[]; +extern const char DIGEST_SHA_1[]; +extern const char DIGEST_SHA_224[]; +extern const char DIGEST_SHA_256[]; +extern const char DIGEST_SHA_384[]; +extern const char DIGEST_SHA_512[]; + +// A general class for computing hashes. +class MessageDigest { + public: + enum { kMaxSize = 64 }; // Maximum known size (SHA-512) + virtual ~MessageDigest() {} + // Returns the digest output size (e.g. 16 bytes for MD5). + virtual size_t Size() const = 0; + // Updates the digest with |len| bytes from |buf|. + virtual void Update(const void* buf, size_t len) = 0; + // Outputs the digest value to |buf| with length |len|. + // Returns the number of bytes written, i.e., Size(). + virtual size_t Finish(void* buf, size_t len) = 0; +}; + +// A factory class for creating digest objects. +class MessageDigestFactory { + public: + static MessageDigest* Create(const std::string& alg); +}; + +// A whitelist of approved digest algorithms from RFC 4572 (FIPS 180). +bool IsFips180DigestAlgorithm(const std::string& alg); + +// Functions to create hashes. + +// Computes the hash of |in_len| bytes of |input|, using the |digest| hash +// implementation, and outputs the hash to the buffer |output|, which is +// |out_len| bytes long. Returns the number of bytes written to |output| if +// successful, or 0 if |out_len| was too small. +size_t ComputeDigest(MessageDigest* digest, const void* input, size_t in_len, + void* output, size_t out_len); +// Like the previous function, but creates a digest implementation based on +// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns 0 if there is no +// digest with the given name. +size_t ComputeDigest(const std::string& alg, const void* input, size_t in_len, + void* output, size_t out_len); +// Computes the hash of |input| using the |digest| hash implementation, and +// returns it as a hex-encoded string. +std::string ComputeDigest(MessageDigest* digest, const std::string& input); +// Like the previous function, but creates a digest implementation based on +// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns empty string if +// there is no digest with the given name. +std::string ComputeDigest(const std::string& alg, const std::string& input); +// Like the previous function, but returns an explicit result code. +bool ComputeDigest(const std::string& alg, const std::string& input, + std::string* output); + +// Shorthand way to compute a hex-encoded hash using MD5. +inline std::string MD5(const std::string& input) { + return ComputeDigest(DIGEST_MD5, input); +} + +// Functions to compute RFC 2104 HMACs. + +// Computes the HMAC of |in_len| bytes of |input|, using the |digest| hash +// implementation and |key_len| bytes of |key| to key the HMAC, and outputs +// the HMAC to the buffer |output|, which is |out_len| bytes long. Returns the +// number of bytes written to |output| if successful, or 0 if |out_len| was too +// small. +size_t ComputeHmac(MessageDigest* digest, const void* key, size_t key_len, + const void* input, size_t in_len, + void* output, size_t out_len); +// Like the previous function, but creates a digest implementation based on +// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns 0 if there is no +// digest with the given name. +size_t ComputeHmac(const std::string& alg, const void* key, size_t key_len, + const void* input, size_t in_len, + void* output, size_t out_len); +// Computes the HMAC of |input| using the |digest| hash implementation and |key| +// to key the HMAC, and returns it as a hex-encoded string. +std::string ComputeHmac(MessageDigest* digest, const std::string& key, + const std::string& input); +// Like the previous function, but creates a digest implementation based on +// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns empty string if +// there is no digest with the given name. +std::string ComputeHmac(const std::string& alg, const std::string& key, + const std::string& input); +// Like the previous function, but returns an explicit result code. +bool ComputeHmac(const std::string& alg, const std::string& key, + const std::string& input, std::string* output); + +} // namespace rtc #endif // WEBRTC_BASE_MESSAGEDIGEST_H_ diff --git a/webrtc/rtc_base/messagedigest_unittest.cc b/webrtc/base/messagedigest_unittest.cc similarity index 100% rename from webrtc/rtc_base/messagedigest_unittest.cc rename to webrtc/base/messagedigest_unittest.cc diff --git a/webrtc/rtc_base/messagehandler.cc b/webrtc/base/messagehandler.cc similarity index 100% rename from webrtc/rtc_base/messagehandler.cc rename to webrtc/base/messagehandler.cc diff --git a/webrtc/base/messagehandler.h b/webrtc/base/messagehandler.h index 943d0d7d9b..72c0dc6907 100644 --- a/webrtc/base/messagehandler.h +++ b/webrtc/base/messagehandler.h @@ -11,9 +11,65 @@ #ifndef WEBRTC_BASE_MESSAGEHANDLER_H_ #define WEBRTC_BASE_MESSAGEHANDLER_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/messagehandler.h" +#include "webrtc/base/constructormagic.h" + +namespace rtc { + +struct Message; + +// Messages get dispatched to a MessageHandler + +class MessageHandler { + public: + virtual ~MessageHandler(); + virtual void OnMessage(Message* msg) = 0; + + protected: + MessageHandler() {} + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(MessageHandler); +}; + +// Helper class to facilitate executing a functor on a thread. +template +class FunctorMessageHandler : public MessageHandler { + public: + explicit FunctorMessageHandler(const FunctorT& functor) + : functor_(functor) {} + virtual void OnMessage(Message* msg) { + result_ = functor_(); + } + const ReturnT& result() const { return result_; } + + // Returns moved result. Should not call result() or MoveResult() again + // after this. + ReturnT MoveResult() { return std::move(result_); } + + private: + FunctorT functor_; + ReturnT result_; +}; + +// Specialization for ReturnT of void. +template +class FunctorMessageHandler : public MessageHandler { + public: + explicit FunctorMessageHandler(const FunctorT& functor) + : functor_(functor) {} + virtual void OnMessage(Message* msg) { + functor_(); + } + void result() const {} + void MoveResult() {} + + private: + FunctorT functor_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_MESSAGEHANDLER_H_ diff --git a/webrtc/rtc_base/messagequeue.cc b/webrtc/base/messagequeue.cc similarity index 100% rename from webrtc/rtc_base/messagequeue.cc rename to webrtc/base/messagequeue.cc diff --git a/webrtc/base/messagequeue.h b/webrtc/base/messagequeue.h index 353a4b7725..e39c9f9869 100644 --- a/webrtc/base/messagequeue.h +++ b/webrtc/base/messagequeue.h @@ -11,9 +11,317 @@ #ifndef WEBRTC_BASE_MESSAGEQUEUE_H_ #define WEBRTC_BASE_MESSAGEQUEUE_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/messagequeue.h" +#include +#include +#include +#include +#include +#include + +#include "webrtc/base/basictypes.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/criticalsection.h" +#include "webrtc/base/location.h" +#include "webrtc/base/messagehandler.h" +#include "webrtc/base/scoped_ref_ptr.h" +#include "webrtc/base/sigslot.h" +#include "webrtc/base/socketserver.h" +#include "webrtc/base/timeutils.h" +#include "webrtc/base/thread_annotations.h" + +namespace rtc { + +struct Message; +class MessageQueue; + +// MessageQueueManager does cleanup of of message queues + +class MessageQueueManager { + public: + static void Add(MessageQueue *message_queue); + static void Remove(MessageQueue *message_queue); + static void Clear(MessageHandler *handler); + + // For testing purposes, we expose whether or not the MessageQueueManager + // instance has been initialized. It has no other use relative to the rest of + // the functions of this class, which auto-initialize the underlying + // MessageQueueManager instance when necessary. + static bool IsInitialized(); + + // Mainly for testing purposes, for use with a simulated clock. + // Ensures that all message queues have processed delayed messages + // up until the current point in time. + static void ProcessAllMessageQueues(); + + private: + static MessageQueueManager* Instance(); + + MessageQueueManager(); + ~MessageQueueManager(); + + void AddInternal(MessageQueue *message_queue); + void RemoveInternal(MessageQueue *message_queue); + void ClearInternal(MessageHandler *handler); + void ProcessAllMessageQueuesInternal(); + + static MessageQueueManager* instance_; + // This list contains all live MessageQueues. + std::vector message_queues_ GUARDED_BY(crit_); + + // Acquire this with DebugNonReentrantCritScope. + CriticalSection crit_; + bool locked_ GUARDED_BY(crit_); +}; + +// Derive from this for specialized data +// App manages lifetime, except when messages are purged + +class MessageData { + public: + MessageData() {} + virtual ~MessageData() {} +}; + +template +class TypedMessageData : public MessageData { + public: + explicit TypedMessageData(const T& data) : data_(data) { } + const T& data() const { return data_; } + T& data() { return data_; } + private: + T data_; +}; + +// Like TypedMessageData, but for pointers that require a delete. +template +class ScopedMessageData : public MessageData { + public: + explicit ScopedMessageData(std::unique_ptr data) + : data_(std::move(data)) {} + // Deprecated. + // TODO(deadbeef): Remove this once downstream applications stop using it. + explicit ScopedMessageData(T* data) : data_(data) {} + // Deprecated. + // TODO(deadbeef): Returning a reference to a unique ptr? Why. Get rid of + // this once downstream applications stop using it, then rename inner_data to + // just data. + const std::unique_ptr& data() const { return data_; } + std::unique_ptr& data() { return data_; } + + const T& inner_data() const { return *data_; } + T& inner_data() { return *data_; } + + private: + std::unique_ptr data_; +}; + +// Like ScopedMessageData, but for reference counted pointers. +template +class ScopedRefMessageData : public MessageData { + public: + explicit ScopedRefMessageData(T* data) : data_(data) { } + const scoped_refptr& data() const { return data_; } + scoped_refptr& data() { return data_; } + private: + scoped_refptr data_; +}; + +template +inline MessageData* WrapMessageData(const T& data) { + return new TypedMessageData(data); +} + +template +inline const T& UseMessageData(MessageData* data) { + return static_cast< TypedMessageData* >(data)->data(); +} + +template +class DisposeData : public MessageData { + public: + explicit DisposeData(T* data) : data_(data) { } + virtual ~DisposeData() { delete data_; } + private: + T* data_; +}; + +const uint32_t MQID_ANY = static_cast(-1); +const uint32_t MQID_DISPOSE = static_cast(-2); + +// No destructor + +struct Message { + Message() + : phandler(nullptr), message_id(0), pdata(nullptr), ts_sensitive(0) {} + inline bool Match(MessageHandler* handler, uint32_t id) const { + return (handler == nullptr || handler == phandler) && + (id == MQID_ANY || id == message_id); + } + Location posted_from; + MessageHandler *phandler; + uint32_t message_id; + MessageData *pdata; + int64_t ts_sensitive; +}; + +typedef std::list MessageList; + +// DelayedMessage goes into a priority queue, sorted by trigger time. Messages +// with the same trigger time are processed in num_ (FIFO) order. + +class DelayedMessage { + public: + DelayedMessage(int64_t delay, + int64_t trigger, + uint32_t num, + const Message& msg) + : cmsDelay_(delay), msTrigger_(trigger), num_(num), msg_(msg) {} + + bool operator< (const DelayedMessage& dmsg) const { + return (dmsg.msTrigger_ < msTrigger_) + || ((dmsg.msTrigger_ == msTrigger_) && (dmsg.num_ < num_)); + } + + int64_t cmsDelay_; // for debugging + int64_t msTrigger_; + uint32_t num_; + Message msg_; +}; + +class MessageQueue { + public: + static const int kForever = -1; + + // Create a new MessageQueue and optionally assign it to the passed + // SocketServer. Subclasses that override Clear should pass false for + // init_queue and call DoInit() from their constructor to prevent races + // with the MessageQueueManager using the object while the vtable is still + // being created. + MessageQueue(SocketServer* ss, bool init_queue); + MessageQueue(std::unique_ptr ss, bool init_queue); + + // NOTE: SUBCLASSES OF MessageQueue THAT OVERRIDE Clear MUST CALL + // DoDestroy() IN THEIR DESTRUCTORS! This is required to avoid a data race + // between the destructor modifying the vtable, and the MessageQueueManager + // calling Clear on the object from a different thread. + virtual ~MessageQueue(); + + SocketServer* socketserver(); + + // Note: The behavior of MessageQueue has changed. When a MQ is stopped, + // futher Posts and Sends will fail. However, any pending Sends and *ready* + // Posts (as opposed to unexpired delayed Posts) will be delivered before + // Get (or Peek) returns false. By guaranteeing delivery of those messages, + // we eliminate the race condition when an MessageHandler and MessageQueue + // may be destroyed independently of each other. + virtual void Quit(); + virtual bool IsQuitting(); + virtual void Restart(); + // Not all message queues actually process messages (such as SignalThread). + // In those cases, it's important to know, before posting, that it won't be + // Processed. Normally, this would be true until IsQuitting() is true. + virtual bool IsProcessingMessages(); + + // Get() will process I/O until: + // 1) A message is available (returns true) + // 2) cmsWait seconds have elapsed (returns false) + // 3) Stop() is called (returns false) + virtual bool Get(Message *pmsg, int cmsWait = kForever, + bool process_io = true); + virtual bool Peek(Message *pmsg, int cmsWait = 0); + virtual void Post(const Location& posted_from, + MessageHandler* phandler, + uint32_t id = 0, + MessageData* pdata = nullptr, + bool time_sensitive = false); + virtual void PostDelayed(const Location& posted_from, + int cmsDelay, + MessageHandler* phandler, + uint32_t id = 0, + MessageData* pdata = nullptr); + virtual void PostAt(const Location& posted_from, + int64_t tstamp, + MessageHandler* phandler, + uint32_t id = 0, + MessageData* pdata = nullptr); + // TODO(honghaiz): Remove this when all the dependencies are removed. + virtual void PostAt(const Location& posted_from, + uint32_t tstamp, + MessageHandler* phandler, + uint32_t id = 0, + MessageData* pdata = nullptr); + virtual void Clear(MessageHandler* phandler, + uint32_t id = MQID_ANY, + MessageList* removed = nullptr); + virtual void Dispatch(Message *pmsg); + virtual void ReceiveSends(); + + // Amount of time until the next message can be retrieved + virtual int GetDelay(); + + bool empty() const { return size() == 0u; } + size_t size() const { + CritScope cs(&crit_); // msgq_.size() is not thread safe. + return msgq_.size() + dmsgq_.size() + (fPeekKeep_ ? 1u : 0u); + } + + // Internally posts a message which causes the doomed object to be deleted + template void Dispose(T* doomed) { + if (doomed) { + Post(RTC_FROM_HERE, nullptr, MQID_DISPOSE, new DisposeData(doomed)); + } + } + + // When this signal is sent out, any references to this queue should + // no longer be used. + sigslot::signal0<> SignalQueueDestroyed; + + protected: + class PriorityQueue : public std::priority_queue { + public: + container_type& container() { return c; } + void reheap() { make_heap(c.begin(), c.end(), comp); } + }; + + void DoDelayPost(const Location& posted_from, + int64_t cmsDelay, + int64_t tstamp, + MessageHandler* phandler, + uint32_t id, + MessageData* pdata); + + // Perform initialization, subclasses must call this from their constructor + // if false was passed as init_queue to the MessageQueue constructor. + void DoInit(); + + // Perform cleanup, subclasses that override Clear must call this from the + // destructor. + void DoDestroy(); + + void WakeUpSocketServer(); + + bool fPeekKeep_; + Message msgPeek_; + MessageList msgq_ GUARDED_BY(crit_); + PriorityQueue dmsgq_ GUARDED_BY(crit_); + uint32_t dmsgq_next_num_ GUARDED_BY(crit_); + CriticalSection crit_; + bool fInitialized_; + bool fDestroyed_; + + private: + volatile int stop_; + + // The SocketServer might not be owned by MessageQueue. + SocketServer* const ss_; + // Used if SocketServer ownership lies with |this|. + std::unique_ptr own_ss_; + + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MessageQueue); +}; + +} // namespace rtc #endif // WEBRTC_BASE_MESSAGEQUEUE_H_ diff --git a/webrtc/rtc_base/messagequeue_unittest.cc b/webrtc/base/messagequeue_unittest.cc similarity index 100% rename from webrtc/rtc_base/messagequeue_unittest.cc rename to webrtc/base/messagequeue_unittest.cc diff --git a/webrtc/base/mod_ops.h b/webrtc/base/mod_ops.h index d61bd055e7..7ce100ec60 100644 --- a/webrtc/base/mod_ops.h +++ b/webrtc/base/mod_ops.h @@ -11,9 +11,125 @@ #ifndef WEBRTC_BASE_MOD_OPS_H_ #define WEBRTC_BASE_MOD_OPS_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/mod_ops.h" +#include "webrtc/base/checks.h" + +namespace webrtc { + +template // NOLINT +inline unsigned long Add(unsigned long a, unsigned long b) { // NOLINT + RTC_DCHECK_LT(a, M); + unsigned long t = M - b % M; // NOLINT + unsigned long res = a - t; // NOLINT + if (t > a) + return res + M; + return res; +} + +template // NOLINT +inline unsigned long Subtract(unsigned long a, unsigned long b) { // NOLINT + RTC_DCHECK_LT(a, M); + unsigned long sub = b % M; // NOLINT + if (a < sub) + return M - (sub - a); + return a - sub; +} + +// Calculates the forward difference between two wrapping numbers. +// +// Example: +// uint8_t x = 253; +// uint8_t y = 2; +// +// ForwardDiff(x, y) == 5 +// +// 252 253 254 255 0 1 2 3 +// ################################################# +// | | x | | | | | y | | +// ################################################# +// |----->----->----->----->-----> +// +// ForwardDiff(y, x) == 251 +// +// 252 253 254 255 0 1 2 3 +// ################################################# +// | | x | | | | | y | | +// ################################################# +// -->-----> |----->--- +// +template +inline T ForwardDiff(T a, T b) { + static_assert(std::is_unsigned::value, + "Type must be an unsigned integer."); + RTC_DCHECK_LT(a, M); + RTC_DCHECK_LT(b, M); + return a <= b ? b - a : M - (a - b); +} + +template +inline T ForwardDiff(T a, T b) { + static_assert(std::is_unsigned::value, + "Type must be an unsigned integer."); + return b - a; +} + +// Calculates the reverse difference between two wrapping numbers. +// +// Example: +// uint8_t x = 253; +// uint8_t y = 2; +// +// ReverseDiff(y, x) == 5 +// +// 252 253 254 255 0 1 2 3 +// ################################################# +// | | x | | | | | y | | +// ################################################# +// <-----<-----<-----<-----<-----| +// +// ReverseDiff(x, y) == 251 +// +// 252 253 254 255 0 1 2 3 +// ################################################# +// | | x | | | | | y | | +// ################################################# +// ---<-----| |<-----<-- +// +template +inline T ReverseDiff(T a, T b) { + static_assert(std::is_unsigned::value, + "Type must be an unsigned integer."); + RTC_DCHECK_LT(a, M); + RTC_DCHECK_LT(b, M); + return b <= a ? a - b : M - (b - a); +} + +template +inline T ReverseDiff(T a, T b) { + static_assert(std::is_unsigned::value, + "Type must be an unsigned integer."); + return a - b; +} + +// Calculates the minimum distance between to wrapping numbers. +// +// The minimum distance is defined as min(ForwardDiff(a, b), ReverseDiff(a, b)) +template +inline T MinDiff(T a, T b) { + static_assert(std::is_unsigned::value, + "Type must be an unsigned integer."); + return std::min(ForwardDiff(a, b), ReverseDiff(a, b)); +} + +template +inline T MinDiff(T a, T b) { + static_assert(std::is_unsigned::value, + "Type must be an unsigned integer."); + return std::min(ForwardDiff(a, b), ReverseDiff(a, b)); +} + +} // namespace webrtc #endif // WEBRTC_BASE_MOD_OPS_H_ diff --git a/webrtc/rtc_base/mod_ops_unittest.cc b/webrtc/base/mod_ops_unittest.cc similarity index 100% rename from webrtc/rtc_base/mod_ops_unittest.cc rename to webrtc/base/mod_ops_unittest.cc diff --git a/webrtc/rtc_base/nat_unittest.cc b/webrtc/base/nat_unittest.cc similarity index 100% rename from webrtc/rtc_base/nat_unittest.cc rename to webrtc/base/nat_unittest.cc diff --git a/webrtc/rtc_base/natserver.cc b/webrtc/base/natserver.cc similarity index 100% rename from webrtc/rtc_base/natserver.cc rename to webrtc/base/natserver.cc diff --git a/webrtc/base/natserver.h b/webrtc/base/natserver.h index b803ad8587..460518bd2e 100644 --- a/webrtc/base/natserver.h +++ b/webrtc/base/natserver.h @@ -11,9 +11,114 @@ #ifndef WEBRTC_BASE_NATSERVER_H_ #define WEBRTC_BASE_NATSERVER_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/natserver.h" +#include "webrtc/base/asyncudpsocket.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/socketaddresspair.h" +#include "webrtc/base/thread.h" +#include "webrtc/base/socketfactory.h" +#include "webrtc/base/nattypes.h" +#include "webrtc/base/proxyserver.h" + +namespace rtc { + +// Change how routes (socketaddress pairs) are compared based on the type of +// NAT. The NAT server maintains a hashtable of the routes that it knows +// about. So these affect which routes are treated the same. +struct RouteCmp { + explicit RouteCmp(NAT* nat); + size_t operator()(const SocketAddressPair& r) const; + bool operator()( + const SocketAddressPair& r1, const SocketAddressPair& r2) const; + + bool symmetric; +}; + +// Changes how addresses are compared based on the filtering rules of the NAT. +struct AddrCmp { + explicit AddrCmp(NAT* nat); + size_t operator()(const SocketAddress& r) const; + bool operator()(const SocketAddress& r1, const SocketAddress& r2) const; + + bool use_ip; + bool use_port; +}; + +// Implements the NAT device. It listens for packets on the internal network, +// translates them, and sends them out over the external network. +// +// TCP connections initiated from the internal side of the NAT server are +// also supported, by making a connection to the NAT server's TCP address and +// then sending the remote address in quasi-STUN format. The connection status +// will be indicated back to the client as a 1 byte status code, where '0' +// indicates success. + +const int NAT_SERVER_UDP_PORT = 4237; +const int NAT_SERVER_TCP_PORT = 4238; + +class NATServer : public sigslot::has_slots<> { + public: + NATServer( + NATType type, SocketFactory* internal, + const SocketAddress& internal_udp_addr, + const SocketAddress& internal_tcp_addr, + SocketFactory* external, const SocketAddress& external_ip); + ~NATServer() override; + + SocketAddress internal_udp_address() const { + return udp_server_socket_->GetLocalAddress(); + } + + SocketAddress internal_tcp_address() const { + return tcp_proxy_server_->GetServerAddress(); + } + + // Packets received on one of the networks. + void OnInternalUDPPacket(AsyncPacketSocket* socket, const char* buf, + size_t size, const SocketAddress& addr, + const PacketTime& packet_time); + void OnExternalUDPPacket(AsyncPacketSocket* socket, const char* buf, + size_t size, const SocketAddress& remote_addr, + const PacketTime& packet_time); + + private: + typedef std::set AddressSet; + + /* Records a translation and the associated external socket. */ + struct TransEntry { + TransEntry(const SocketAddressPair& r, AsyncUDPSocket* s, NAT* nat); + ~TransEntry(); + + void WhitelistInsert(const SocketAddress& addr); + bool WhitelistContains(const SocketAddress& ext_addr); + + SocketAddressPair route; + AsyncUDPSocket* socket; + AddressSet* whitelist; + CriticalSection crit_; + }; + + typedef std::map InternalMap; + typedef std::map ExternalMap; + + /* Creates a new entry that translates the given route. */ + void Translate(const SocketAddressPair& route); + + /* Determines whether the NAT would filter out a packet from this address. */ + bool ShouldFilterOut(TransEntry* entry, const SocketAddress& ext_addr); + + NAT* nat_; + SocketFactory* external_; + SocketAddress external_ip_; + AsyncUDPSocket* udp_server_socket_; + ProxyServer* tcp_proxy_server_; + InternalMap* int_map_; + ExternalMap* ext_map_; + RTC_DISALLOW_COPY_AND_ASSIGN(NATServer); +}; + +} // namespace rtc #endif // WEBRTC_BASE_NATSERVER_H_ diff --git a/webrtc/rtc_base/natsocketfactory.cc b/webrtc/base/natsocketfactory.cc similarity index 100% rename from webrtc/rtc_base/natsocketfactory.cc rename to webrtc/base/natsocketfactory.cc diff --git a/webrtc/base/natsocketfactory.h b/webrtc/base/natsocketfactory.h index 31c29ab277..6fad30c560 100644 --- a/webrtc/base/natsocketfactory.h +++ b/webrtc/base/natsocketfactory.h @@ -11,9 +11,158 @@ #ifndef WEBRTC_BASE_NATSOCKETFACTORY_H_ #define WEBRTC_BASE_NATSOCKETFACTORY_H_ +#include +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/natsocketfactory.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/natserver.h" +#include "webrtc/base/socketaddress.h" +#include "webrtc/base/socketserver.h" + +namespace rtc { + +const size_t kNATEncodedIPv4AddressSize = 8U; +const size_t kNATEncodedIPv6AddressSize = 20U; + +// Used by the NAT socket implementation. +class NATInternalSocketFactory { + public: + virtual ~NATInternalSocketFactory() {} + virtual AsyncSocket* CreateInternalSocket(int family, int type, + const SocketAddress& local_addr, SocketAddress* nat_addr) = 0; +}; + +// Creates sockets that will send all traffic through a NAT, using an existing +// NATServer instance running at nat_addr. The actual data is sent using sockets +// from a socket factory, given to the constructor. +class NATSocketFactory : public SocketFactory, public NATInternalSocketFactory { + public: + NATSocketFactory(SocketFactory* factory, const SocketAddress& nat_udp_addr, + const SocketAddress& nat_tcp_addr); + + // SocketFactory implementation + Socket* CreateSocket(int type) override; + Socket* CreateSocket(int family, int type) override; + AsyncSocket* CreateAsyncSocket(int type) override; + AsyncSocket* CreateAsyncSocket(int family, int type) override; + + // NATInternalSocketFactory implementation + AsyncSocket* CreateInternalSocket(int family, + int type, + const SocketAddress& local_addr, + SocketAddress* nat_addr) override; + + private: + SocketFactory* factory_; + SocketAddress nat_udp_addr_; + SocketAddress nat_tcp_addr_; + RTC_DISALLOW_COPY_AND_ASSIGN(NATSocketFactory); +}; + +// Creates sockets that will send traffic through a NAT depending on what +// address they bind to. This can be used to simulate a client on a NAT sending +// to a client that is not behind a NAT. +// Note that the internal addresses of clients must be unique. This is because +// there is only one socketserver per thread, and the Bind() address is used to +// figure out which NAT (if any) the socket should talk to. +// +// Example with 3 NATs (2 cascaded), and 3 clients. +// ss->AddTranslator("1.2.3.4", "192.168.0.1", NAT_ADDR_RESTRICTED); +// ss->AddTranslator("99.99.99.99", "10.0.0.1", NAT_SYMMETRIC)-> +// AddTranslator("10.0.0.2", "192.168.1.1", NAT_OPEN_CONE); +// ss->GetTranslator("1.2.3.4")->AddClient("1.2.3.4", "192.168.0.2"); +// ss->GetTranslator("99.99.99.99")->AddClient("10.0.0.3"); +// ss->GetTranslator("99.99.99.99")->GetTranslator("10.0.0.2")-> +// AddClient("192.168.1.2"); +class NATSocketServer : public SocketServer, public NATInternalSocketFactory { + public: + class Translator; + // holds a list of NATs + class TranslatorMap : private std::map { + public: + ~TranslatorMap(); + Translator* Get(const SocketAddress& ext_ip); + Translator* Add(const SocketAddress& ext_ip, Translator*); + void Remove(const SocketAddress& ext_ip); + Translator* FindClient(const SocketAddress& int_ip); + }; + + // a specific NAT + class Translator { + public: + Translator(NATSocketServer* server, NATType type, + const SocketAddress& int_addr, SocketFactory* ext_factory, + const SocketAddress& ext_addr); + ~Translator(); + + SocketFactory* internal_factory() { return internal_factory_.get(); } + SocketAddress internal_udp_address() const { + return nat_server_->internal_udp_address(); + } + SocketAddress internal_tcp_address() const { + return SocketAddress(); // nat_server_->internal_tcp_address(); + } + + Translator* GetTranslator(const SocketAddress& ext_ip); + Translator* AddTranslator(const SocketAddress& ext_ip, + const SocketAddress& int_ip, NATType type); + void RemoveTranslator(const SocketAddress& ext_ip); + + bool AddClient(const SocketAddress& int_ip); + void RemoveClient(const SocketAddress& int_ip); + + // Looks for the specified client in this or a child NAT. + Translator* FindClient(const SocketAddress& int_ip); + + private: + NATSocketServer* server_; + std::unique_ptr internal_factory_; + std::unique_ptr nat_server_; + TranslatorMap nats_; + std::set clients_; + }; + + explicit NATSocketServer(SocketServer* ss); + + SocketServer* socketserver() { return server_; } + MessageQueue* queue() { return msg_queue_; } + + Translator* GetTranslator(const SocketAddress& ext_ip); + Translator* AddTranslator(const SocketAddress& ext_ip, + const SocketAddress& int_ip, NATType type); + void RemoveTranslator(const SocketAddress& ext_ip); + + // SocketServer implementation + Socket* CreateSocket(int type) override; + Socket* CreateSocket(int family, int type) override; + + AsyncSocket* CreateAsyncSocket(int type) override; + AsyncSocket* CreateAsyncSocket(int family, int type) override; + + void SetMessageQueue(MessageQueue* queue) override; + bool Wait(int cms, bool process_io) override; + void WakeUp() override; + + // NATInternalSocketFactory implementation + AsyncSocket* CreateInternalSocket(int family, + int type, + const SocketAddress& local_addr, + SocketAddress* nat_addr) override; + + private: + SocketServer* server_; + MessageQueue* msg_queue_; + TranslatorMap nats_; + RTC_DISALLOW_COPY_AND_ASSIGN(NATSocketServer); +}; + +// Free-standing NAT helper functions. +size_t PackAddressForNAT(char* buf, size_t buf_size, + const SocketAddress& remote_addr); +size_t UnpackAddressFromNAT(const char* buf, size_t buf_size, + SocketAddress* remote_addr); +} // namespace rtc #endif // WEBRTC_BASE_NATSOCKETFACTORY_H_ diff --git a/webrtc/rtc_base/nattypes.cc b/webrtc/base/nattypes.cc similarity index 100% rename from webrtc/rtc_base/nattypes.cc rename to webrtc/base/nattypes.cc diff --git a/webrtc/base/nattypes.h b/webrtc/base/nattypes.h index 001f57fe7d..27e4b2f457 100644 --- a/webrtc/base/nattypes.h +++ b/webrtc/base/nattypes.h @@ -8,12 +8,40 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_NATTYPES_H_ -#define WEBRTC_BASE_NATTYPES_H_ +#ifndef WEBRTC_BASE_NATTYPE_H__ +#define WEBRTC_BASE_NATTYPE_H__ +namespace rtc { -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/nattypes.h" +/* Identifies each type of NAT that can be simulated. */ +enum NATType { + NAT_OPEN_CONE, + NAT_ADDR_RESTRICTED, + NAT_PORT_RESTRICTED, + NAT_SYMMETRIC +}; -#endif // WEBRTC_BASE_NATTYPES_H_ +// Implements the rules for each specific type of NAT. +class NAT { +public: + virtual ~NAT() { } + + // Determines whether this NAT uses both source and destination address when + // checking whether a mapping already exists. + virtual bool IsSymmetric() = 0; + + // Determines whether this NAT drops packets received from a different IP + // the one last sent to. + virtual bool FiltersIP() = 0; + + // Determines whether this NAT drops packets received from a different port + // the one last sent to. + virtual bool FiltersPort() = 0; + + // Returns an implementation of the given type of NAT. + static NAT* Create(NATType type); +}; + +} // namespace rtc + +#endif // WEBRTC_BASE_NATTYPE_H__ diff --git a/webrtc/rtc_base/nethelpers.cc b/webrtc/base/nethelpers.cc similarity index 100% rename from webrtc/rtc_base/nethelpers.cc rename to webrtc/base/nethelpers.cc diff --git a/webrtc/base/nethelpers.h b/webrtc/base/nethelpers.h index 9a8e6073dd..b0727f861b 100644 --- a/webrtc/base/nethelpers.h +++ b/webrtc/base/nethelpers.h @@ -11,9 +11,56 @@ #ifndef WEBRTC_BASE_NETHELPERS_H_ #define WEBRTC_BASE_NETHELPERS_H_ +#if defined(WEBRTC_POSIX) +#include +#include +#elif WEBRTC_WIN +#include // NOLINT +#endif -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/nethelpers.h" +#include + +#include "webrtc/base/asyncresolverinterface.h" +#include "webrtc/base/signalthread.h" +#include "webrtc/base/sigslot.h" +#include "webrtc/base/socketaddress.h" + +namespace rtc { + +class AsyncResolverTest; + +// AsyncResolver will perform async DNS resolution, signaling the result on +// the SignalDone from AsyncResolverInterface when the operation completes. +class AsyncResolver : public SignalThread, public AsyncResolverInterface { + public: + AsyncResolver(); + ~AsyncResolver() override; + + void Start(const SocketAddress& addr) override; + bool GetResolvedAddress(int family, SocketAddress* addr) const override; + int GetError() const override; + void Destroy(bool wait) override; + + const std::vector& addresses() const { return addresses_; } + void set_error(int error) { error_ = error; } + + protected: + void DoWork() override; + void OnWorkDone() override; + + private: + SocketAddress addr_; + std::vector addresses_; + int error_; +}; + +// rtc namespaced wrappers for inet_ntop and inet_pton so we can avoid +// the windows-native versions of these. +const char* inet_ntop(int af, const void *src, char* dst, socklen_t size); +int inet_pton(int af, const char* src, void *dst); + +bool HasIPv4Enabled(); +bool HasIPv6Enabled(); +} // namespace rtc #endif // WEBRTC_BASE_NETHELPERS_H_ diff --git a/webrtc/rtc_base/network.cc b/webrtc/base/network.cc similarity index 100% rename from webrtc/rtc_base/network.cc rename to webrtc/base/network.cc diff --git a/webrtc/base/network.h b/webrtc/base/network.h index 29530987c1..34d6538c33 100644 --- a/webrtc/base/network.h +++ b/webrtc/base/network.h @@ -11,9 +11,424 @@ #ifndef WEBRTC_BASE_NETWORK_H_ #define WEBRTC_BASE_NETWORK_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/network.h" +#include +#include +#include +#include +#include + +#include "webrtc/base/ipaddress.h" +#include "webrtc/base/networkmonitor.h" +#include "webrtc/base/messagehandler.h" +#include "webrtc/base/sigslot.h" + +#if defined(WEBRTC_POSIX) +struct ifaddrs; +#endif // defined(WEBRTC_POSIX) + +namespace rtc { + +extern const char kPublicIPv4Host[]; +extern const char kPublicIPv6Host[]; + +class IfAddrsConverter; +class Network; +class NetworkMonitorInterface; +class Thread; + +static const uint16_t kNetworkCostMax = 999; +static const uint16_t kNetworkCostHigh = 900; +static const uint16_t kNetworkCostUnknown = 50; +static const uint16_t kNetworkCostLow = 10; +static const uint16_t kNetworkCostMin = 0; + +// By default, ignore loopback interfaces on the host. +const int kDefaultNetworkIgnoreMask = ADAPTER_TYPE_LOOPBACK; + +// Makes a string key for this network. Used in the network manager's maps. +// Network objects are keyed on interface name, network prefix and the +// length of that prefix. +std::string MakeNetworkKey(const std::string& name, const IPAddress& prefix, + int prefix_length); + +class DefaultLocalAddressProvider { + public: + virtual ~DefaultLocalAddressProvider() = default; + // The default local address is the local address used in multi-homed endpoint + // when the any address (0.0.0.0 or ::) is used as the local address. It's + // important to check the return value as a IP family may not be enabled. + virtual bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const = 0; +}; + +// Generic network manager interface. It provides list of local +// networks. +// +// Every method of NetworkManager (including the destructor) must be called on +// the same thread, except for the constructor which may be called on any +// thread. +// +// This allows constructing a NetworkManager subclass on one thread and +// passing it into an object that uses it on a different thread. +class NetworkManager : public DefaultLocalAddressProvider { + public: + typedef std::vector NetworkList; + + // This enum indicates whether adapter enumeration is allowed. + enum EnumerationPermission { + ENUMERATION_ALLOWED, // Adapter enumeration is allowed. Getting 0 network + // from GetNetworks means that there is no network + // available. + ENUMERATION_BLOCKED, // Adapter enumeration is disabled. + // GetAnyAddressNetworks() should be used instead. + }; + + NetworkManager(); + ~NetworkManager() override; + + // Called when network list is updated. + sigslot::signal0<> SignalNetworksChanged; + + // Indicates a failure when getting list of network interfaces. + sigslot::signal0<> SignalError; + + // This should be called on the NetworkManager's thread before the + // NetworkManager is used. Subclasses may override this if necessary. + virtual void Initialize() {} + + // Start/Stop monitoring of network interfaces + // list. SignalNetworksChanged or SignalError is emitted immediately + // after StartUpdating() is called. After that SignalNetworksChanged + // is emitted whenever list of networks changes. + virtual void StartUpdating() = 0; + virtual void StopUpdating() = 0; + + // Returns the current list of networks available on this machine. + // StartUpdating() must be called before this method is called. + // It makes sure that repeated calls return the same object for a + // given network, so that quality is tracked appropriately. Does not + // include ignored networks. + virtual void GetNetworks(NetworkList* networks) const = 0; + + // return the current permission state of GetNetworks() + virtual EnumerationPermission enumeration_permission() const; + + // "AnyAddressNetwork" is a network which only contains single "any address" + // IP address. (i.e. INADDR_ANY for IPv4 or in6addr_any for IPv6). This is + // useful as binding to such interfaces allow default routing behavior like + // http traffic. + // + // This method appends the "any address" networks to the list, such that this + // can optionally be called after GetNetworks. + // + // TODO(guoweis): remove this body when chromium implements this. + virtual void GetAnyAddressNetworks(NetworkList* networks) {} + + // Dumps the current list of networks in the network manager. + virtual void DumpNetworks() {} + bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const override; + + struct Stats { + int ipv4_network_count; + int ipv6_network_count; + Stats() { + ipv4_network_count = 0; + ipv6_network_count = 0; + } + }; +}; + +// Base class for NetworkManager implementations. +class NetworkManagerBase : public NetworkManager { + public: + NetworkManagerBase(); + ~NetworkManagerBase() override; + + void GetNetworks(NetworkList* networks) const override; + void GetAnyAddressNetworks(NetworkList* networks) override; + // Defaults to true. + bool ipv6_enabled() const { return ipv6_enabled_; } + void set_ipv6_enabled(bool enabled) { ipv6_enabled_ = enabled; } + + void set_max_ipv6_networks(int networks) { max_ipv6_networks_ = networks; } + int max_ipv6_networks() { return max_ipv6_networks_; } + + EnumerationPermission enumeration_permission() const override; + + bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const override; + + protected: + typedef std::map NetworkMap; + // Updates |networks_| with the networks listed in |list|. If + // |network_map_| already has a Network object for a network listed + // in the |list| then it is reused. Accept ownership of the Network + // objects in the |list|. |changed| will be set to true if there is + // any change in the network list. + void MergeNetworkList(const NetworkList& list, bool* changed); + + // |stats| will be populated even if |*changed| is false. + void MergeNetworkList(const NetworkList& list, + bool* changed, + NetworkManager::Stats* stats); + + void set_enumeration_permission(EnumerationPermission state) { + enumeration_permission_ = state; + } + + void set_default_local_addresses(const IPAddress& ipv4, + const IPAddress& ipv6); + + private: + friend class NetworkTest; + + Network* GetNetworkFromAddress(const rtc::IPAddress& ip) const; + + EnumerationPermission enumeration_permission_; + + NetworkList networks_; + int max_ipv6_networks_; + + NetworkMap networks_map_; + bool ipv6_enabled_; + + std::unique_ptr ipv4_any_address_network_; + std::unique_ptr ipv6_any_address_network_; + + IPAddress default_local_ipv4_address_; + IPAddress default_local_ipv6_address_; + // We use 16 bits to save the bandwidth consumption when sending the network + // id over the Internet. It is OK that the 16-bit integer overflows to get a + // network id 0 because we only compare the network ids in the old and the new + // best connections in the transport channel. + uint16_t next_available_network_id_ = 1; +}; + +// Basic implementation of the NetworkManager interface that gets list +// of networks using OS APIs. +class BasicNetworkManager : public NetworkManagerBase, + public MessageHandler, + public sigslot::has_slots<> { + public: + BasicNetworkManager(); + ~BasicNetworkManager() override; + + void StartUpdating() override; + void StopUpdating() override; + + void DumpNetworks() override; + + // MessageHandler interface. + void OnMessage(Message* msg) override; + bool started() { return start_count_ > 0; } + + // Sets the network ignore list, which is empty by default. Any network on the + // ignore list will be filtered from network enumeration results. + void set_network_ignore_list(const std::vector& list) { + network_ignore_list_ = list; + } + +#if defined(WEBRTC_LINUX) + // Sets the flag for ignoring non-default routes. + void set_ignore_non_default_routes(bool value) { + ignore_non_default_routes_ = true; + } +#endif + + protected: +#if defined(WEBRTC_POSIX) + // Separated from CreateNetworks for tests. + void ConvertIfAddrs(ifaddrs* interfaces, + IfAddrsConverter* converter, + bool include_ignored, + NetworkList* networks) const; +#endif // defined(WEBRTC_POSIX) + + // Creates a network object for each network available on the machine. + bool CreateNetworks(bool include_ignored, NetworkList* networks) const; + + // Determines if a network should be ignored. This should only be determined + // based on the network's property instead of any individual IP. + bool IsIgnoredNetwork(const Network& network) const; + + // This function connects a UDP socket to a public address and returns the + // local address associated it. Since it binds to the "any" address + // internally, it returns the default local address on a multi-homed endpoint. + IPAddress QueryDefaultLocalAddress(int family) const; + + private: + friend class NetworkTest; + + // Creates a network monitor and listens for network updates. + void StartNetworkMonitor(); + // Stops and removes the network monitor. + void StopNetworkMonitor(); + // Called when it receives updates from the network monitor. + void OnNetworksChanged(); + + // Updates the networks and reschedules the next update. + void UpdateNetworksContinually(); + // Only updates the networks; does not reschedule the next update. + void UpdateNetworksOnce(); + + AdapterType GetAdapterTypeFromName(const char* network_name) const; + + Thread* thread_; + bool sent_first_update_; + int start_count_; + std::vector network_ignore_list_; + bool ignore_non_default_routes_; + std::unique_ptr network_monitor_; +}; + +// Represents a Unix-type network interface, with a name and single address. +class Network { + public: + Network(const std::string& name, + const std::string& description, + const IPAddress& prefix, + int prefix_length); + + Network(const std::string& name, + const std::string& description, + const IPAddress& prefix, + int prefix_length, + AdapterType type); + ~Network(); + + sigslot::signal1 SignalTypeChanged; + + const DefaultLocalAddressProvider* default_local_address_provider() { + return default_local_address_provider_; + } + void set_default_local_address_provider( + const DefaultLocalAddressProvider* provider) { + default_local_address_provider_ = provider; + } + + // Returns the name of the interface this network is associated wtih. + const std::string& name() const { return name_; } + + // Returns the OS-assigned name for this network. This is useful for + // debugging but should not be sent over the wire (for privacy reasons). + const std::string& description() const { return description_; } + + // Returns the prefix for this network. + const IPAddress& prefix() const { return prefix_; } + // Returns the length, in bits, of this network's prefix. + int prefix_length() const { return prefix_length_; } + + // |key_| has unique value per network interface. Used in sorting network + // interfaces. Key is derived from interface name and it's prefix. + std::string key() const { return key_; } + + // Returns the Network's current idea of the 'best' IP it has. + // Or return an unset IP if this network has no active addresses. + // Here is the rule on how we mark the IPv6 address as ignorable for WebRTC. + // 1) return all global temporary dynamic and non-deprecrated ones. + // 2) if #1 not available, return global ones. + // 3) if #2 not available, use ULA ipv6 as last resort. (ULA stands + // for unique local address, which is not route-able in open + // internet but might be useful for a close WebRTC deployment. + + // TODO(guoweis): rule #3 actually won't happen at current + // implementation. The reason being that ULA address starting with + // 0xfc 0r 0xfd will be grouped into its own Network. The result of + // that is WebRTC will have one extra Network to generate candidates + // but the lack of rule #3 shouldn't prevent turning on IPv6 since + // ULA should only be tried in a close deployment anyway. + + // Note that when not specifying any flag, it's treated as case global + // IPv6 address + IPAddress GetBestIP() const; + + // Keep the original function here for now. + // TODO(guoweis): Remove this when all callers are migrated to GetBestIP(). + IPAddress ip() const { return GetBestIP(); } + + // Adds an active IP address to this network. Does not check for duplicates. + void AddIP(const InterfaceAddress& ip) { ips_.push_back(ip); } + + // Sets the network's IP address list. Returns true if new IP addresses were + // detected. Passing true to already_changed skips this check. + bool SetIPs(const std::vector& ips, bool already_changed); + // Get the list of IP Addresses associated with this network. + const std::vector& GetIPs() const { return ips_;} + // Clear the network's list of addresses. + void ClearIPs() { ips_.clear(); } + + // Returns the scope-id of the network's address. + // Should only be relevant for link-local IPv6 addresses. + int scope_id() const { return scope_id_; } + void set_scope_id(int id) { scope_id_ = id; } + + // Indicates whether this network should be ignored, perhaps because + // the IP is 0, or the interface is one we know is invalid. + bool ignored() const { return ignored_; } + void set_ignored(bool ignored) { ignored_ = ignored; } + + AdapterType type() const { return type_; } + void set_type(AdapterType type) { + if (type_ == type) { + return; + } + type_ = type; + SignalTypeChanged(this); + } + + uint16_t GetCost() const { + switch (type_) { + case rtc::ADAPTER_TYPE_ETHERNET: + case rtc::ADAPTER_TYPE_LOOPBACK: + return kNetworkCostMin; + case rtc::ADAPTER_TYPE_WIFI: + case rtc::ADAPTER_TYPE_VPN: + return kNetworkCostLow; + case rtc::ADAPTER_TYPE_CELLULAR: + return kNetworkCostHigh; + default: + return kNetworkCostUnknown; + } + } + // A unique id assigned by the network manager, which may be signaled + // to the remote side in the candidate. + uint16_t id() const { return id_; } + void set_id(uint16_t id) { id_ = id; } + + int preference() const { return preference_; } + void set_preference(int preference) { preference_ = preference; } + + // When we enumerate networks and find a previously-seen network is missing, + // we do not remove it (because it may be used elsewhere). Instead, we mark + // it inactive, so that we can detect network changes properly. + bool active() const { return active_; } + void set_active(bool active) { + if (active_ != active) { + active_ = active; + } + } + + // Debugging description of this network + std::string ToString() const; + + private: + const DefaultLocalAddressProvider* default_local_address_provider_ = nullptr; + std::string name_; + std::string description_; + IPAddress prefix_; + int prefix_length_; + std::string key_; + std::vector ips_; + int scope_id_; + bool ignored_; + AdapterType type_; + int preference_; + bool active_ = true; + uint16_t id_ = 0; + + friend class NetworkManager; +}; + +} // namespace rtc #endif // WEBRTC_BASE_NETWORK_H_ diff --git a/webrtc/rtc_base/network_unittest.cc b/webrtc/base/network_unittest.cc similarity index 100% rename from webrtc/rtc_base/network_unittest.cc rename to webrtc/base/network_unittest.cc diff --git a/webrtc/rtc_base/networkmonitor.cc b/webrtc/base/networkmonitor.cc similarity index 100% rename from webrtc/rtc_base/networkmonitor.cc rename to webrtc/base/networkmonitor.cc diff --git a/webrtc/base/networkmonitor.h b/webrtc/base/networkmonitor.h index 290da4f48e..72b07b449c 100644 --- a/webrtc/base/networkmonitor.h +++ b/webrtc/base/networkmonitor.h @@ -11,9 +11,118 @@ #ifndef WEBRTC_BASE_NETWORKMONITOR_H_ #define WEBRTC_BASE_NETWORKMONITOR_H_ +#include "webrtc/base/logging.h" +#include "webrtc/base/sigslot.h" +#include "webrtc/base/thread.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/networkmonitor.h" +namespace rtc { + +class IPAddress; + +enum class NetworkBindingResult { + SUCCESS = 0, // No error + FAILURE = -1, // Generic error + NOT_IMPLEMENTED = -2, + ADDRESS_NOT_FOUND = -3, + NETWORK_CHANGED = -4 +}; + +enum AdapterType { + // This enum resembles the one in Chromium net::ConnectionType. + ADAPTER_TYPE_UNKNOWN = 0, + ADAPTER_TYPE_ETHERNET = 1 << 0, + ADAPTER_TYPE_WIFI = 1 << 1, + ADAPTER_TYPE_CELLULAR = 1 << 2, + ADAPTER_TYPE_VPN = 1 << 3, + ADAPTER_TYPE_LOOPBACK = 1 << 4 +}; + +class NetworkBinderInterface { + public: + // Binds a socket to the network that is attached to |address| so that all + // packets on the socket |socket_fd| will be sent via that network. + // This is needed because some operating systems (like Android) require a + // special bind call to put packets on a non-default network interface. + virtual NetworkBindingResult BindSocketToNetwork( + int socket_fd, + const IPAddress& address) = 0; + virtual ~NetworkBinderInterface() {} +}; + +/* + * Receives network-change events via |OnNetworksChanged| and signals the + * networks changed event. + * + * Threading consideration: + * It is expected that all upstream operations (from native to Java) are + * performed from the worker thread. This includes creating, starting and + * stopping the monitor. This avoids the potential race condition when creating + * the singleton Java NetworkMonitor class. Downstream operations can be from + * any thread, but this class will forward all the downstream operations onto + * the worker thread. + * + * Memory consideration: + * NetworkMonitor is owned by the caller (NetworkManager). The global network + * monitor factory is owned by the factory itself but needs to be released from + * the factory creator. + */ +// Generic network monitor interface. It starts and stops monitoring network +// changes, and fires the SignalNetworksChanged event when networks change. +class NetworkMonitorInterface { + public: + NetworkMonitorInterface(); + virtual ~NetworkMonitorInterface(); + + sigslot::signal0<> SignalNetworksChanged; + + virtual void Start() = 0; + virtual void Stop() = 0; + + // Implementations should call this method on the base when networks change, + // and the base will fire SignalNetworksChanged on the right thread. + virtual void OnNetworksChanged() = 0; + + virtual AdapterType GetAdapterType(const std::string& interface_name) = 0; +}; + +class NetworkMonitorBase : public NetworkMonitorInterface, + public MessageHandler, + public sigslot::has_slots<> { + public: + NetworkMonitorBase(); + ~NetworkMonitorBase() override; + + void OnNetworksChanged() override; + + void OnMessage(Message* msg) override; + + protected: + Thread* worker_thread() { return worker_thread_; } + + private: + Thread* worker_thread_; +}; + +/* + * NetworkMonitorFactory creates NetworkMonitors. + */ +class NetworkMonitorFactory { + public: + // This is not thread-safe; it should be called once (or once per audio/video + // call) during the call initialization. + static void SetFactory(NetworkMonitorFactory* factory); + + static void ReleaseFactory(NetworkMonitorFactory* factory); + static NetworkMonitorFactory* GetFactory(); + + virtual NetworkMonitorInterface* CreateNetworkMonitor() = 0; + + virtual ~NetworkMonitorFactory(); + + protected: + NetworkMonitorFactory(); +}; + +} // namespace rtc #endif // WEBRTC_BASE_NETWORKMONITOR_H_ diff --git a/webrtc/base/networkroute.h b/webrtc/base/networkroute.h index b5e8c13842..a34e6d304d 100644 --- a/webrtc/base/networkroute.h +++ b/webrtc/base/networkroute.h @@ -11,9 +11,43 @@ #ifndef WEBRTC_BASE_NETWORKROUTE_H_ #define WEBRTC_BASE_NETWORKROUTE_H_ +// TODO(honghaiz): Make a directory that describes the interfaces and structs +// the media code can rely on and the network code can implement, and both can +// depend on that, but not depend on each other. Then, move this file to that +// directory. +namespace rtc { -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/networkroute.h" +struct NetworkRoute { + bool connected; + uint16_t local_network_id; + uint16_t remote_network_id; + int last_sent_packet_id; // Last packet id sent on the PREVIOUS route. + + NetworkRoute() + : connected(false), + local_network_id(0), + remote_network_id(0), + last_sent_packet_id(-1) {} + + // The route is connected if the local and remote network ids are provided. + NetworkRoute(bool connected, + uint16_t local_net_id, + uint16_t remote_net_id, + int last_packet_id) + : connected(connected), + local_network_id(local_net_id), + remote_network_id(remote_net_id), + last_sent_packet_id(last_packet_id) {} + + // |last_sent_packet_id| does not affect the NetworkRoute comparison. + bool operator==(const NetworkRoute& nr) const { + return connected == nr.connected && + local_network_id == nr.local_network_id && + remote_network_id == nr.remote_network_id; + } + + bool operator!=(const NetworkRoute& nr) const { return !(*this == nr); } +}; +} // namespace rtc #endif // WEBRTC_BASE_NETWORKROUTE_H_ diff --git a/webrtc/rtc_base/nullsocketserver.cc b/webrtc/base/nullsocketserver.cc similarity index 100% rename from webrtc/rtc_base/nullsocketserver.cc rename to webrtc/base/nullsocketserver.cc diff --git a/webrtc/base/nullsocketserver.h b/webrtc/base/nullsocketserver.h index 214c542b5f..e59f2fafe5 100644 --- a/webrtc/base/nullsocketserver.h +++ b/webrtc/base/nullsocketserver.h @@ -11,9 +11,28 @@ #ifndef WEBRTC_BASE_NULLSOCKETSERVER_H_ #define WEBRTC_BASE_NULLSOCKETSERVER_H_ +#include "webrtc/base/event.h" +#include "webrtc/base/socketserver.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/nullsocketserver.h" +namespace rtc { + +class NullSocketServer : public SocketServer { + public: + NullSocketServer(); + ~NullSocketServer() override; + + bool Wait(int cms, bool process_io) override; + void WakeUp() override; + + Socket* CreateSocket(int type) override; + Socket* CreateSocket(int family, int type) override; + AsyncSocket* CreateAsyncSocket(int type) override; + AsyncSocket* CreateAsyncSocket(int family, int type) override; + + private: + Event event_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_NULLSOCKETSERVER_H_ diff --git a/webrtc/rtc_base/nullsocketserver_unittest.cc b/webrtc/base/nullsocketserver_unittest.cc similarity index 100% rename from webrtc/rtc_base/nullsocketserver_unittest.cc rename to webrtc/base/nullsocketserver_unittest.cc diff --git a/webrtc/rtc_base/numerics/exp_filter.cc b/webrtc/base/numerics/exp_filter.cc similarity index 100% rename from webrtc/rtc_base/numerics/exp_filter.cc rename to webrtc/base/numerics/exp_filter.cc diff --git a/webrtc/base/numerics/exp_filter.h b/webrtc/base/numerics/exp_filter.h index a4eaea2c91..2361702c36 100644 --- a/webrtc/base/numerics/exp_filter.h +++ b/webrtc/base/numerics/exp_filter.h @@ -11,9 +11,38 @@ #ifndef WEBRTC_BASE_NUMERICS_EXP_FILTER_H_ #define WEBRTC_BASE_NUMERICS_EXP_FILTER_H_ +namespace rtc { -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/numerics/exp_filter.h" +// This class can be used, for example, for smoothing the result of bandwidth +// estimation and packet loss estimation. + +class ExpFilter { + public: + static const float kValueUndefined; + + explicit ExpFilter(float alpha, float max = kValueUndefined) : max_(max) { + Reset(alpha); + } + + // Resets the filter to its initial state, and resets filter factor base to + // the given value |alpha|. + void Reset(float alpha); + + // Applies the filter with a given exponent on the provided sample: + // y(k) = min(alpha_^ exp * y(k-1) + (1 - alpha_^ exp) * sample, max_). + float Apply(float exp, float sample); + + // Returns current filtered value. + float filtered() const { return filtered_; } + + // Changes the filter factor base to the given value |alpha|. + void UpdateBase(float alpha); + + private: + float alpha_; // Filter factor base. + float filtered_; // Current filter output. + const float max_; +}; +} // namespace rtc #endif // WEBRTC_BASE_NUMERICS_EXP_FILTER_H_ diff --git a/webrtc/rtc_base/numerics/exp_filter_unittest.cc b/webrtc/base/numerics/exp_filter_unittest.cc similarity index 100% rename from webrtc/rtc_base/numerics/exp_filter_unittest.cc rename to webrtc/base/numerics/exp_filter_unittest.cc diff --git a/webrtc/base/numerics/percentile_filter.h b/webrtc/base/numerics/percentile_filter.h index a9058a2b4c..638857de51 100644 --- a/webrtc/base/numerics/percentile_filter.h +++ b/webrtc/base/numerics/percentile_filter.h @@ -11,9 +11,105 @@ #ifndef WEBRTC_BASE_NUMERICS_PERCENTILE_FILTER_H_ #define WEBRTC_BASE_NUMERICS_PERCENTILE_FILTER_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/numerics/percentile_filter.h" +#include +#include + +#include "webrtc/base/checks.h" + +namespace webrtc { + +// Class to efficiently get the percentile value from a group of observations. +// The percentile is the value below which a given percentage of the +// observations fall. +template +class PercentileFilter { + public: + // Construct filter. |percentile| should be between 0 and 1. + explicit PercentileFilter(float percentile); + + // Insert one observation. The complexity of this operation is logarithmic in + // the size of the container. + void Insert(const T& value); + + // Remove one observation or return false if |value| doesn't exist in the + // container. The complexity of this operation is logarithmic in the size of + // the container. + bool Erase(const T& value); + + // Get the percentile value. The complexity of this operation is constant. + T GetPercentileValue() const; + + private: + // Update iterator and index to point at target percentile value. + void UpdatePercentileIterator(); + + const float percentile_; + std::multiset set_; + // Maintain iterator and index of current target percentile value. + typename std::multiset::iterator percentile_it_; + int64_t percentile_index_; +}; + +template +PercentileFilter::PercentileFilter(float percentile) + : percentile_(percentile), + percentile_it_(set_.begin()), + percentile_index_(0) { + RTC_CHECK_GE(percentile, 0.0f); + RTC_CHECK_LE(percentile, 1.0f); +} + +template +void PercentileFilter::Insert(const T& value) { + // Insert element at the upper bound. + set_.insert(value); + if (set_.size() == 1u) { + // First element inserted - initialize percentile iterator and index. + percentile_it_ = set_.begin(); + percentile_index_ = 0; + } else if (value < *percentile_it_) { + // If new element is before us, increment |percentile_index_|. + ++percentile_index_; + } + UpdatePercentileIterator(); +} + +template +bool PercentileFilter::Erase(const T& value) { + typename std::multiset::const_iterator it = set_.lower_bound(value); + // Ignore erase operation if the element is not present in the current set. + if (it == set_.end() || *it != value) + return false; + if (it == percentile_it_) { + // If same iterator, update to the following element. Index is not + // affected. + percentile_it_ = set_.erase(it); + } else { + set_.erase(it); + // If erased element was before us, decrement |percentile_index_|. + if (value <= *percentile_it_) + --percentile_index_; + } + UpdatePercentileIterator(); + return true; +} + +template +void PercentileFilter::UpdatePercentileIterator() { + if (set_.empty()) + return; + const int64_t index = static_cast(percentile_ * (set_.size() - 1)); + std::advance(percentile_it_, index - percentile_index_); + percentile_index_ = index; +} + +template +T PercentileFilter::GetPercentileValue() const { + return set_.empty() ? 0 : *percentile_it_; +} + +} // namespace webrtc #endif // WEBRTC_BASE_NUMERICS_PERCENTILE_FILTER_H_ diff --git a/webrtc/rtc_base/numerics/percentile_filter_unittest.cc b/webrtc/base/numerics/percentile_filter_unittest.cc similarity index 100% rename from webrtc/rtc_base/numerics/percentile_filter_unittest.cc rename to webrtc/base/numerics/percentile_filter_unittest.cc diff --git a/webrtc/base/onetimeevent.h b/webrtc/base/onetimeevent.h index 6849bac581..240cf14c58 100644 --- a/webrtc/base/onetimeevent.h +++ b/webrtc/base/onetimeevent.h @@ -11,9 +11,51 @@ #ifndef WEBRTC_BASE_ONETIMEEVENT_H_ #define WEBRTC_BASE_ONETIMEEVENT_H_ +#include "webrtc/base/criticalsection.h" +#include "webrtc/typedefs.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/onetimeevent.h" +namespace webrtc { +// Provides a simple way to perform an operation (such as logging) one +// time in a certain scope. +// Example: +// OneTimeEvent firstFrame; +// ... +// if (firstFrame()) { +// LOG(LS_INFO) << "This is the first frame". +// } +class OneTimeEvent { + public: + OneTimeEvent() {} + bool operator()() { + rtc::CritScope cs(&critsect_); + if (happened_) { + return false; + } + happened_ = true; + return true; + } + + private: + bool happened_ = false; + rtc::CriticalSection critsect_; +}; + +// A non-thread-safe, ligher-weight version of the OneTimeEvent class. +class ThreadUnsafeOneTimeEvent { + public: + ThreadUnsafeOneTimeEvent() {} + bool operator()() { + if (happened_) { + return false; + } + happened_ = true; + return true; + } + + private: + bool happened_ = false; +}; + +} // namespace webrtc #endif // WEBRTC_BASE_ONETIMEEVENT_H_ diff --git a/webrtc/rtc_base/onetimeevent_unittest.cc b/webrtc/base/onetimeevent_unittest.cc similarity index 100% rename from webrtc/rtc_base/onetimeevent_unittest.cc rename to webrtc/base/onetimeevent_unittest.cc diff --git a/webrtc/base/openssl.h b/webrtc/base/openssl.h index 795af70321..2071619d5d 100644 --- a/webrtc/base/openssl.h +++ b/webrtc/base/openssl.h @@ -11,9 +11,10 @@ #ifndef WEBRTC_BASE_OPENSSL_H_ #define WEBRTC_BASE_OPENSSL_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/openssl.h" +#if (OPENSSL_VERSION_NUMBER < 0x10000000L) +#error OpenSSL is older than 1.0.0, which is the minimum supported version. +#endif #endif // WEBRTC_BASE_OPENSSL_H_ diff --git a/webrtc/rtc_base/openssladapter.cc b/webrtc/base/openssladapter.cc similarity index 100% rename from webrtc/rtc_base/openssladapter.cc rename to webrtc/base/openssladapter.cc diff --git a/webrtc/base/openssladapter.h b/webrtc/base/openssladapter.h index 6444215098..2f0150f0f9 100644 --- a/webrtc/base/openssladapter.h +++ b/webrtc/base/openssladapter.h @@ -8,12 +8,105 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_OPENSSLADAPTER_H_ -#define WEBRTC_BASE_OPENSSLADAPTER_H_ +#ifndef WEBRTC_BASE_OPENSSLADAPTER_H__ +#define WEBRTC_BASE_OPENSSLADAPTER_H__ +#include +#include "webrtc/base/buffer.h" +#include "webrtc/base/messagehandler.h" +#include "webrtc/base/messagequeue.h" +#include "webrtc/base/ssladapter.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/openssladapter.h" +typedef struct ssl_st SSL; +typedef struct ssl_ctx_st SSL_CTX; +typedef struct x509_store_ctx_st X509_STORE_CTX; -#endif // WEBRTC_BASE_OPENSSLADAPTER_H_ +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// + +class OpenSSLAdapter : public SSLAdapter, public MessageHandler { +public: + static bool InitializeSSL(VerificationCallback callback); + static bool InitializeSSLThread(); + static bool CleanupSSL(); + + OpenSSLAdapter(AsyncSocket* socket); + ~OpenSSLAdapter() override; + + void SetMode(SSLMode mode) override; + int StartSSL(const char* hostname, bool restartable) override; + int Send(const void* pv, size_t cb) override; + int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; + int Recv(void* pv, size_t cb, int64_t* timestamp) override; + int RecvFrom(void* pv, + size_t cb, + SocketAddress* paddr, + int64_t* timestamp) override; + int Close() override; + + // Note that the socket returns ST_CONNECTING while SSL is being negotiated. + ConnState GetState() const override; + +protected: + void OnConnectEvent(AsyncSocket* socket) override; + void OnReadEvent(AsyncSocket* socket) override; + void OnWriteEvent(AsyncSocket* socket) override; + void OnCloseEvent(AsyncSocket* socket, int err) override; + +private: + enum SSLState { + SSL_NONE, SSL_WAIT, SSL_CONNECTING, SSL_CONNECTED, SSL_ERROR + }; + + enum { MSG_TIMEOUT }; + + int BeginSSL(); + int ContinueSSL(); + void Error(const char* context, int err, bool signal = true); + void Cleanup(); + + // Return value and arguments have the same meanings as for Send; |error| is + // an output parameter filled with the result of SSL_get_error. + int DoSslWrite(const void* pv, size_t cb, int* error); + + void OnMessage(Message* msg) override; + + static bool VerifyServerName(SSL* ssl, const char* host, + bool ignore_bad_cert); + bool SSLPostConnectionCheck(SSL* ssl, const char* host); +#if !defined(NDEBUG) + static void SSLInfoCallback(const SSL* s, int where, int ret); +#endif + static int SSLVerifyCallback(int ok, X509_STORE_CTX* store); + static VerificationCallback custom_verify_callback_; + friend class OpenSSLStreamAdapter; // for custom_verify_callback_; + + static bool ConfigureTrustedRootCertificates(SSL_CTX* ctx); + SSL_CTX* SetupSSLContext(); + + SSLState state_; + bool ssl_read_needs_write_; + bool ssl_write_needs_read_; + // If true, socket will retain SSL configuration after Close. + bool restartable_; + + // This buffer is used if SSL_write fails with SSL_ERROR_WANT_WRITE, which + // means we need to keep retrying with *the same exact data* until it + // succeeds. Afterwards it will be cleared. + Buffer pending_data_; + + SSL* ssl_; + SSL_CTX* ssl_ctx_; + std::string ssl_host_name_; + // Do DTLS or not + SSLMode ssl_mode_; + + bool custom_verification_succeeded_; +}; + +///////////////////////////////////////////////////////////////////////////// + +} // namespace rtc + +#endif // WEBRTC_BASE_OPENSSLADAPTER_H__ diff --git a/webrtc/rtc_base/openssldigest.cc b/webrtc/base/openssldigest.cc similarity index 100% rename from webrtc/rtc_base/openssldigest.cc rename to webrtc/base/openssldigest.cc diff --git a/webrtc/base/openssldigest.h b/webrtc/base/openssldigest.h index 031c0b1cb0..413df45145 100644 --- a/webrtc/base/openssldigest.h +++ b/webrtc/base/openssldigest.h @@ -11,9 +11,40 @@ #ifndef WEBRTC_BASE_OPENSSLDIGEST_H_ #define WEBRTC_BASE_OPENSSLDIGEST_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/openssldigest.h" +#include "webrtc/base/messagedigest.h" + +namespace rtc { + +// An implementation of the digest class that uses OpenSSL. +class OpenSSLDigest : public MessageDigest { + public: + // Creates an OpenSSLDigest with |algorithm| as the hash algorithm. + explicit OpenSSLDigest(const std::string& algorithm); + ~OpenSSLDigest() override; + // Returns the digest output size (e.g. 16 bytes for MD5). + size_t Size() const override; + // Updates the digest with |len| bytes from |buf|. + void Update(const void* buf, size_t len) override; + // Outputs the digest value to |buf| with length |len|. + size_t Finish(void* buf, size_t len) override; + + // Helper function to look up a digest's EVP by name. + static bool GetDigestEVP(const std::string &algorithm, + const EVP_MD** md); + // Helper function to look up a digest's name by EVP. + static bool GetDigestName(const EVP_MD* md, + std::string* algorithm); + // Helper function to get the length of a digest. + static bool GetDigestSize(const std::string &algorithm, + size_t* len); + + private: + EVP_MD_CTX ctx_; + const EVP_MD* md_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_OPENSSLDIGEST_H_ diff --git a/webrtc/rtc_base/opensslidentity.cc b/webrtc/base/opensslidentity.cc similarity index 100% rename from webrtc/rtc_base/opensslidentity.cc rename to webrtc/base/opensslidentity.cc diff --git a/webrtc/base/opensslidentity.h b/webrtc/base/opensslidentity.h index 59fa571ce5..84716d1720 100644 --- a/webrtc/base/opensslidentity.h +++ b/webrtc/base/opensslidentity.h @@ -11,9 +11,137 @@ #ifndef WEBRTC_BASE_OPENSSLIDENTITY_H_ #define WEBRTC_BASE_OPENSSLIDENTITY_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/opensslidentity.h" +#include +#include + +#include "webrtc/base/checks.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/sslidentity.h" + +typedef struct ssl_ctx_st SSL_CTX; + +namespace rtc { + +// OpenSSLKeyPair encapsulates an OpenSSL EVP_PKEY* keypair object, +// which is reference counted inside the OpenSSL library. +class OpenSSLKeyPair { + public: + explicit OpenSSLKeyPair(EVP_PKEY* pkey) : pkey_(pkey) { + RTC_DCHECK(pkey_ != nullptr); + } + + static OpenSSLKeyPair* Generate(const KeyParams& key_params); + // Constructs a key pair from the private key PEM string. This must not result + // in missing public key parameters. Returns null on error. + static OpenSSLKeyPair* FromPrivateKeyPEMString( + const std::string& pem_string); + + virtual ~OpenSSLKeyPair(); + + virtual OpenSSLKeyPair* GetReference(); + + EVP_PKEY* pkey() const { return pkey_; } + std::string PrivateKeyToPEMString() const; + std::string PublicKeyToPEMString() const; + bool operator==(const OpenSSLKeyPair& other) const; + bool operator!=(const OpenSSLKeyPair& other) const; + + private: + void AddReference(); + + EVP_PKEY* pkey_; + + RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLKeyPair); +}; + +// OpenSSLCertificate encapsulates an OpenSSL X509* certificate object, +// which is also reference counted inside the OpenSSL library. +class OpenSSLCertificate : public SSLCertificate { + public: + // Caller retains ownership of the X509 object. + explicit OpenSSLCertificate(X509* x509) : x509_(x509) { + AddReference(); + } + + static OpenSSLCertificate* Generate(OpenSSLKeyPair* key_pair, + const SSLIdentityParams& params); + static OpenSSLCertificate* FromPEMString(const std::string& pem_string); + + ~OpenSSLCertificate() override; + + OpenSSLCertificate* GetReference() const override; + + X509* x509() const { return x509_; } + + std::string ToPEMString() const override; + void ToDER(Buffer* der_buffer) const override; + bool operator==(const OpenSSLCertificate& other) const; + bool operator!=(const OpenSSLCertificate& other) const; + + // Compute the digest of the certificate given algorithm + bool ComputeDigest(const std::string& algorithm, + unsigned char* digest, + size_t size, + size_t* length) const override; + + // Compute the digest of a certificate as an X509 * + static bool ComputeDigest(const X509* x509, + const std::string& algorithm, + unsigned char* digest, + size_t size, + size_t* length); + + bool GetSignatureDigestAlgorithm(std::string* algorithm) const override; + std::unique_ptr GetChain() const override; + + int64_t CertificateExpirationTime() const override; + + private: + void AddReference() const; + + X509* x509_; + + RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLCertificate); +}; + +// Holds a keypair and certificate together, and a method to generate +// them consistently. +class OpenSSLIdentity : public SSLIdentity { + public: + static OpenSSLIdentity* GenerateWithExpiration(const std::string& common_name, + const KeyParams& key_params, + time_t certificate_lifetime); + static OpenSSLIdentity* GenerateForTest(const SSLIdentityParams& params); + static SSLIdentity* FromPEMStrings(const std::string& private_key, + const std::string& certificate); + ~OpenSSLIdentity() override; + + const OpenSSLCertificate& certificate() const override; + OpenSSLIdentity* GetReference() const override; + + // Configure an SSL context object to use our key and certificate. + bool ConfigureIdentity(SSL_CTX* ctx); + + std::string PrivateKeyToPEMString() const override; + std::string PublicKeyToPEMString() const override; + bool operator==(const OpenSSLIdentity& other) const; + bool operator!=(const OpenSSLIdentity& other) const; + + private: + OpenSSLIdentity(OpenSSLKeyPair* key_pair, OpenSSLCertificate* certificate); + + static OpenSSLIdentity* GenerateInternal(const SSLIdentityParams& params); + + std::unique_ptr key_pair_; + std::unique_ptr certificate_; + + RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLIdentity); +}; + + +} // namespace rtc #endif // WEBRTC_BASE_OPENSSLIDENTITY_H_ diff --git a/webrtc/rtc_base/opensslstreamadapter.cc b/webrtc/base/opensslstreamadapter.cc similarity index 100% rename from webrtc/rtc_base/opensslstreamadapter.cc rename to webrtc/base/opensslstreamadapter.cc diff --git a/webrtc/base/opensslstreamadapter.h b/webrtc/base/opensslstreamadapter.h index e17e029ffe..16b62eb3fe 100644 --- a/webrtc/base/opensslstreamadapter.h +++ b/webrtc/base/opensslstreamadapter.h @@ -8,12 +8,219 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_OPENSSLSTREAMADAPTER_H_ -#define WEBRTC_BASE_OPENSSLSTREAMADAPTER_H_ +#ifndef WEBRTC_BASE_OPENSSLSTREAMADAPTER_H__ +#define WEBRTC_BASE_OPENSSLSTREAMADAPTER_H__ +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/opensslstreamadapter.h" +#include "webrtc/base/buffer.h" +#include "webrtc/base/sslstreamadapter.h" +#include "webrtc/base/opensslidentity.h" -#endif // WEBRTC_BASE_OPENSSLSTREAMADAPTER_H_ +typedef struct ssl_st SSL; +typedef struct ssl_ctx_st SSL_CTX; +typedef struct ssl_cipher_st SSL_CIPHER; +typedef struct x509_store_ctx_st X509_STORE_CTX; + +namespace rtc { + +// This class was written with OpenSSLAdapter (a socket adapter) as a +// starting point. It has similar structure and functionality, but uses a +// "peer-to-peer" mode, verifying the peer's certificate using a digest +// sent over a secure signaling channel. +// +// Static methods to initialize and deinit the SSL library are in +// OpenSSLAdapter. These should probably be moved out to a neutral class. +// +// In a few cases I have factored out some OpenSSLAdapter code into static +// methods so it can be reused from this class. Eventually that code should +// probably be moved to a common support class. Unfortunately there remain a +// few duplicated sections of code. I have not done more restructuring because +// I did not want to affect existing code that uses OpenSSLAdapter. +// +// This class does not support the SSL connection restart feature present in +// OpenSSLAdapter. I am not entirely sure how the feature is useful and I am +// not convinced that it works properly. +// +// This implementation is careful to disallow data exchange after an SSL error, +// and it has an explicit SSL_CLOSED state. It should not be possible to send +// any data in clear after one of the StartSSL methods has been called. + +// Look in sslstreamadapter.h for documentation of the methods. + +class OpenSSLIdentity; + +/////////////////////////////////////////////////////////////////////////////// + +class OpenSSLStreamAdapter : public SSLStreamAdapter { + public: + explicit OpenSSLStreamAdapter(StreamInterface* stream); + ~OpenSSLStreamAdapter() override; + + void SetIdentity(SSLIdentity* identity) override; + + // Default argument is for compatibility + void SetServerRole(SSLRole role = SSL_SERVER) override; + bool SetPeerCertificateDigest( + const std::string& digest_alg, + const unsigned char* digest_val, + size_t digest_len, + SSLPeerCertificateDigestError* error = nullptr) override; + + std::unique_ptr GetPeerCertificate() const override; + + // Goes from state SSL_NONE to either SSL_CONNECTING or SSL_WAIT, depending + // on whether the underlying stream is already open or not. + int StartSSL() override; + void SetMode(SSLMode mode) override; + void SetMaxProtocolVersion(SSLProtocolVersion version) override; + void SetInitialRetransmissionTimeout(int timeout_ms) override; + + StreamResult Read(void* data, + size_t data_len, + size_t* read, + int* error) override; + StreamResult Write(const void* data, + size_t data_len, + size_t* written, + int* error) override; + void Close() override; + StreamState GetState() const override; + + // TODO(guoweis): Move this away from a static class method. + static std::string SslCipherSuiteToName(int crypto_suite); + + bool GetSslCipherSuite(int* cipher) override; + + int GetSslVersion() const override; + + // Key Extractor interface + bool ExportKeyingMaterial(const std::string& label, + const uint8_t* context, + size_t context_len, + bool use_context, + uint8_t* result, + size_t result_len) override; + + // DTLS-SRTP interface + bool SetDtlsSrtpCryptoSuites(const std::vector& crypto_suites) override; + bool GetDtlsSrtpCryptoSuite(int* crypto_suite) override; + + bool IsTlsConnected() override; + + // Capabilities interfaces. + static bool IsBoringSsl(); + + static bool IsAcceptableCipher(int cipher, KeyType key_type); + static bool IsAcceptableCipher(const std::string& cipher, KeyType key_type); + + // Use our timeutils.h source of timing in BoringSSL, allowing us to test + // using a fake clock. + static void enable_time_callback_for_testing(); + + protected: + void OnEvent(StreamInterface* stream, int events, int err) override; + + private: + enum SSLState { + // Before calling one of the StartSSL methods, data flows + // in clear text. + SSL_NONE, + SSL_WAIT, // waiting for the stream to open to start SSL negotiation + SSL_CONNECTING, // SSL negotiation in progress + SSL_CONNECTED, // SSL stream successfully established + SSL_ERROR, // some SSL error occurred, stream is closed + SSL_CLOSED // Clean close + }; + + enum { MSG_TIMEOUT = MSG_MAX+1}; + + // The following three methods return 0 on success and a negative + // error code on failure. The error code may be from OpenSSL or -1 + // on some other error cases, so it can't really be interpreted + // unfortunately. + + // Prepare SSL library, state is SSL_CONNECTING. + int BeginSSL(); + // Perform SSL negotiation steps. + int ContinueSSL(); + + // Error handler helper. signal is given as true for errors in + // asynchronous contexts (when an error method was not returned + // through some other method), and in that case an SE_CLOSE event is + // raised on the stream with the specified error. + // A 0 error means a graceful close, otherwise there is not really enough + // context to interpret the error code. + // |alert| indicates an alert description (one of the SSL_AD constants) to + // send to the remote endpoint when closing the association. If 0, a normal + // shutdown will be performed. + void Error(const char* context, int err, uint8_t alert, bool signal); + void Cleanup(uint8_t alert); + + // Override MessageHandler + void OnMessage(Message* msg) override; + + // Flush the input buffers by reading left bytes (for DTLS) + void FlushInput(unsigned int left); + + // SSL library configuration + SSL_CTX* SetupSSLContext(); + // Verify the peer certificate matches the signaled digest. + bool VerifyPeerCertificate(); + // SSL certification verification error handler, called back from + // the openssl library. Returns an int interpreted as a boolean in + // the C style: zero means verification failure, non-zero means + // passed. + static int SSLVerifyCallback(int ok, X509_STORE_CTX* store); + + bool waiting_to_verify_peer_certificate() const { + return client_auth_enabled() && !peer_certificate_verified_; + } + + bool has_peer_certificate_digest() const { + return !peer_certificate_digest_algorithm_.empty() && + !peer_certificate_digest_value_.empty(); + } + + SSLState state_; + SSLRole role_; + int ssl_error_code_; // valid when state_ == SSL_ERROR or SSL_CLOSED + // Whether the SSL negotiation is blocked on needing to read or + // write to the wrapped stream. + bool ssl_read_needs_write_; + bool ssl_write_needs_read_; + + SSL* ssl_; + SSL_CTX* ssl_ctx_; + + // Our key and certificate. + std::unique_ptr identity_; + // The certificate that the peer presented. Initially null, until the + // connection is established. + std::unique_ptr peer_certificate_; + bool peer_certificate_verified_ = false; + // The digest of the certificate that the peer must present. + Buffer peer_certificate_digest_value_; + std::string peer_certificate_digest_algorithm_; + + // The DtlsSrtp ciphers + std::string srtp_ciphers_; + + // Do DTLS or not + SSLMode ssl_mode_; + + // Max. allowed protocol version + SSLProtocolVersion ssl_max_version_; + + // A 50-ms initial timeout ensures rapid setup on fast connections, but may + // be too aggressive for low bandwidth links. + int dtls_handshake_timeout_ms_ = 50; +}; + +///////////////////////////////////////////////////////////////////////////// + +} // namespace rtc + +#endif // WEBRTC_BASE_OPENSSLSTREAMADAPTER_H__ diff --git a/webrtc/rtc_base/optional.cc b/webrtc/base/optional.cc similarity index 100% rename from webrtc/rtc_base/optional.cc rename to webrtc/base/optional.cc diff --git a/webrtc/base/optional.h b/webrtc/base/optional.h index 7657ec3366..4f883a8862 100644 --- a/webrtc/base/optional.h +++ b/webrtc/base/optional.h @@ -11,9 +11,399 @@ #ifndef WEBRTC_BASE_OPTIONAL_H_ #define WEBRTC_BASE_OPTIONAL_H_ +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/optional.h" +#ifdef UNIT_TEST +#include +#include +#endif // UNIT_TEST + +#include "webrtc/base/array_view.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/sanitizer.h" + +namespace rtc { + +namespace optional_internal { + +#if RTC_HAS_ASAN + +// This is a non-inlined function. The optimizer can't see inside it. It +// prevents the compiler from generating optimized code that reads value_ even +// if it is unset. Although safe, this causes memory sanitizers to complain. +void* FunctionThatDoesNothingImpl(void*); + +template +inline T* FunctionThatDoesNothing(T* x) { + return reinterpret_cast( + FunctionThatDoesNothingImpl(reinterpret_cast(x))); +} + +#else + +template +inline T* FunctionThatDoesNothing(T* x) { return x; } + +#endif + +} // namespace optional_internal + +// Simple std::optional-wannabe. It either contains a T or not. +// +// A moved-from Optional may only be destroyed, and assigned to if T allows +// being assigned to after having been moved from. Specifically, you may not +// assume that it just doesn't contain a value anymore. +// +// Examples of good places to use Optional: +// +// - As a class or struct member, when the member doesn't always have a value: +// struct Prisoner { +// std::string name; +// Optional cell_number; // Empty if not currently incarcerated. +// }; +// +// - As a return value for functions that may fail to return a value on all +// allowed inputs. For example, a function that searches an array might +// return an Optional (the index where it found the element, or +// nothing if it didn't find it); and a function that parses numbers might +// return Optional (the parsed number, or nothing if parsing failed). +// +// Examples of bad places to use Optional: +// +// - As a return value for functions that may fail because of disallowed +// inputs. For example, a string length function should not return +// Optional so that it can return nothing in case the caller passed +// it a null pointer; the function should probably use RTC_[D]CHECK instead, +// and return plain size_t. +// +// - As a return value for functions that may fail to return a value on all +// allowed inputs, but need to tell the caller what went wrong. Returning +// Optional when parsing a single number as in the example above +// might make sense, but any larger parse job is probably going to need to +// tell the caller what the problem was, not just that there was one. +// +// - As a non-mutable function argument. When you want to pass a value of a +// type T that can fail to be there, const T* is almost always both fastest +// and cleanest. (If you're *sure* that the the caller will always already +// have an Optional, const Optional& is slightly faster than const T*, +// but this is a micro-optimization. In general, stick to const T*.) +// +// TODO(kwiberg): Get rid of this class when the standard library has +// std::optional (and we're allowed to use it). +template +class Optional final { + public: + // Construct an empty Optional. + Optional() : has_value_(false), empty_('\0') { + PoisonValue(); + } + + // Construct an Optional that contains a value. + explicit Optional(const T& value) : has_value_(true) { + new (&value_) T(value); + } + explicit Optional(T&& value) : has_value_(true) { + new (&value_) T(std::move(value)); + } + + // Copy constructor: copies the value from m if it has one. + Optional(const Optional& m) : has_value_(m.has_value_) { + if (has_value_) + new (&value_) T(m.value_); + else + PoisonValue(); + } + + // Move constructor: if m has a value, moves the value from m, leaving m + // still in a state where it has a value, but a moved-from one (the + // properties of which depends on T; the only general guarantee is that we + // can destroy m). + Optional(Optional&& m) : has_value_(m.has_value_) { + if (has_value_) + new (&value_) T(std::move(m.value_)); + else + PoisonValue(); + } + + ~Optional() { + if (has_value_) + value_.~T(); + else + UnpoisonValue(); + } + + // Copy assignment. Uses T's copy assignment if both sides have a value, T's + // copy constructor if only the right-hand side has a value. + Optional& operator=(const Optional& m) { + if (m.has_value_) { + if (has_value_) { + value_ = m.value_; // T's copy assignment. + } else { + UnpoisonValue(); + new (&value_) T(m.value_); // T's copy constructor. + has_value_ = true; + } + } else { + reset(); + } + return *this; + } + + // Move assignment. Uses T's move assignment if both sides have a value, T's + // move constructor if only the right-hand side has a value. The state of m + // after it's been moved from is as for the move constructor. + Optional& operator=(Optional&& m) { + if (m.has_value_) { + if (has_value_) { + value_ = std::move(m.value_); // T's move assignment. + } else { + UnpoisonValue(); + new (&value_) T(std::move(m.value_)); // T's move constructor. + has_value_ = true; + } + } else { + reset(); + } + return *this; + } + + // Swap the values if both m1 and m2 have values; move the value if only one + // of them has one. + friend void swap(Optional& m1, Optional& m2) { + if (m1.has_value_) { + if (m2.has_value_) { + // Both have values: swap. + using std::swap; + swap(m1.value_, m2.value_); + } else { + // Only m1 has a value: move it to m2. + m2.UnpoisonValue(); + new (&m2.value_) T(std::move(m1.value_)); + m1.value_.~T(); // Destroy the moved-from value. + m1.has_value_ = false; + m2.has_value_ = true; + m1.PoisonValue(); + } + } else if (m2.has_value_) { + // Only m2 has a value: move it to m1. + m1.UnpoisonValue(); + new (&m1.value_) T(std::move(m2.value_)); + m2.value_.~T(); // Destroy the moved-from value. + m1.has_value_ = true; + m2.has_value_ = false; + m2.PoisonValue(); + } + } + + // Destroy any contained value. Has no effect if we have no value. + void reset() { + if (!has_value_) + return; + value_.~T(); + has_value_ = false; + PoisonValue(); + } + + template + void emplace(Args&&... args) { + if (has_value_) + value_.~T(); + else + UnpoisonValue(); + new (&value_) T(std::forward(args)...); + has_value_ = true; + } + + // Conversion to bool to test if we have a value. + explicit operator bool() const { return has_value_; } + bool has_value() const { return has_value_; } + + // Dereferencing. Only allowed if we have a value. + const T* operator->() const { + RTC_DCHECK(has_value_); + return &value_; + } + T* operator->() { + RTC_DCHECK(has_value_); + return &value_; + } + const T& operator*() const { + RTC_DCHECK(has_value_); + return value_; + } + T& operator*() { + RTC_DCHECK(has_value_); + return value_; + } + const T& value() const { + RTC_DCHECK(has_value_); + return value_; + } + T& value() { + RTC_DCHECK(has_value_); + return value_; + } + + // Dereference with a default value in case we don't have a value. + const T& value_or(const T& default_val) const { + // The no-op call prevents the compiler from generating optimized code that + // reads value_ even if !has_value_, but only if FunctionThatDoesNothing is + // not completely inlined; see its declaration.). + return has_value_ ? *optional_internal::FunctionThatDoesNothing(&value_) + : default_val; + } + + // Dereference and move value. + T MoveValue() { + RTC_DCHECK(has_value_); + return std::move(value_); + } + + // Equality tests. Two Optionals are equal if they contain equivalent values, + // or if they're both empty. + friend bool operator==(const Optional& m1, const Optional& m2) { + return m1.has_value_ && m2.has_value_ ? m1.value_ == m2.value_ + : m1.has_value_ == m2.has_value_; + } + friend bool operator==(const Optional& opt, const T& value) { + return opt.has_value_ && opt.value_ == value; + } + friend bool operator==(const T& value, const Optional& opt) { + return opt.has_value_ && value == opt.value_; + } + + friend bool operator!=(const Optional& m1, const Optional& m2) { + return m1.has_value_ && m2.has_value_ ? m1.value_ != m2.value_ + : m1.has_value_ != m2.has_value_; + } + friend bool operator!=(const Optional& opt, const T& value) { + return !opt.has_value_ || opt.value_ != value; + } + friend bool operator!=(const T& value, const Optional& opt) { + return !opt.has_value_ || value != opt.value_; + } + + private: + // Tell sanitizers that value_ shouldn't be touched. + void PoisonValue() { + rtc::AsanPoison(rtc::MakeArrayView(&value_, 1)); + rtc::MsanMarkUninitialized(rtc::MakeArrayView(&value_, 1)); + } + + // Tell sanitizers that value_ is OK to touch again. + void UnpoisonValue() { + rtc::AsanUnpoison(rtc::MakeArrayView(&value_, 1)); + } + + bool has_value_; // True iff value_ contains a live value. + union { + // empty_ exists only to make it possible to initialize the union, even when + // it doesn't contain any data. If the union goes uninitialized, it may + // trigger compiler warnings. + char empty_; + // By placing value_ in a union, we get to manage its construction and + // destruction manually: the Optional constructors won't automatically + // construct it, and the Optional destructor won't automatically destroy + // it. Basically, this just allocates a properly sized and aligned block of + // memory in which we can manually put a T with placement new. + T value_; + }; +}; + +#ifdef UNIT_TEST +namespace optional_internal { + +// Checks if there's a valid PrintTo(const T&, std::ostream*) call for T. +template +struct HasPrintTo { + private: + struct No {}; + + template + static auto Test(const T2& obj) + -> decltype(PrintTo(obj, std::declval())); + + template + static No Test(...); + + public: + static constexpr bool value = + !std::is_same(std::declval())), No>::value; +}; + +// Checks if there's a valid operator<<(std::ostream&, const T&) call for T. +template +struct HasOstreamOperator { + private: + struct No {}; + + template + static auto Test(const T2& obj) + -> decltype(std::declval() << obj); + + template + static No Test(...); + + public: + static constexpr bool value = + !std::is_same(std::declval())), No>::value; +}; + +// Prefer using PrintTo to print the object. +template +typename std::enable_if::value, void>::type OptionalPrintToHelper( + const T& value, + std::ostream* os) { + PrintTo(value, os); +} + +// Fall back to operator<<(std::ostream&, ...) if it exists. +template +typename std::enable_if::value && !HasPrintTo::value, + void>::type +OptionalPrintToHelper(const T& value, std::ostream* os) { + *os << value; +} + +inline void OptionalPrintObjectBytes(const unsigned char* bytes, + size_t size, + std::ostream* os) { + *os << "(bytes[i]); + } + *os << "]>"; +} + +// As a final back-up, just print the contents of the objcets byte-wise. +template +typename std::enable_if::value && !HasPrintTo::value, + void>::type +OptionalPrintToHelper(const T& value, std::ostream* os) { + OptionalPrintObjectBytes(reinterpret_cast(&value), + sizeof(value), os); +} + +} // namespace optional_internal + +// PrintTo is used by gtest to print out the results of tests. We want to ensure +// the object contained in an Optional can be printed out if it's set, while +// avoiding touching the object's storage if it is undefined. +template +void PrintTo(const rtc::Optional& opt, std::ostream* os) { + if (opt) { + optional_internal::OptionalPrintToHelper(*opt, os); + } else { + *os << ""; + } +} + +#endif // UNIT_TEST + +} // namespace rtc #endif // WEBRTC_BASE_OPTIONAL_H_ diff --git a/webrtc/rtc_base/optional_unittest.cc b/webrtc/base/optional_unittest.cc similarity index 100% rename from webrtc/rtc_base/optional_unittest.cc rename to webrtc/base/optional_unittest.cc diff --git a/webrtc/rtc_base/optionsfile.cc b/webrtc/base/optionsfile.cc similarity index 100% rename from webrtc/rtc_base/optionsfile.cc rename to webrtc/base/optionsfile.cc diff --git a/webrtc/base/optionsfile.h b/webrtc/base/optionsfile.h index e77fd8adfc..9eb484e320 100644 --- a/webrtc/base/optionsfile.h +++ b/webrtc/base/optionsfile.h @@ -11,9 +11,40 @@ #ifndef WEBRTC_BASE_OPTIONSFILE_H_ #define WEBRTC_BASE_OPTIONSFILE_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/optionsfile.h" +namespace rtc { + +// Implements storage of simple options in a text file on disk. This is +// cross-platform, but it is intended mostly for Linux where there is no +// first-class options storage system. +class OptionsFile { + public: + OptionsFile(const std::string &path); + ~OptionsFile(); + + // Loads the file from disk, overwriting the in-memory values. + bool Load(); + // Saves the contents in memory, overwriting the on-disk values. + bool Save(); + + bool GetStringValue(const std::string& option, std::string* out_val) const; + bool GetIntValue(const std::string& option, int* out_val) const; + bool SetStringValue(const std::string& option, const std::string& val); + bool SetIntValue(const std::string& option, int val); + bool RemoveValue(const std::string& option); + + private: + typedef std::map OptionsMap; + + static bool IsLegalName(const std::string &name); + static bool IsLegalValue(const std::string &value); + + std::string path_; + OptionsMap options_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_OPTIONSFILE_H_ diff --git a/webrtc/rtc_base/optionsfile_unittest.cc b/webrtc/base/optionsfile_unittest.cc similarity index 100% rename from webrtc/rtc_base/optionsfile_unittest.cc rename to webrtc/base/optionsfile_unittest.cc diff --git a/webrtc/rtc_base/pathutils.cc b/webrtc/base/pathutils.cc similarity index 100% rename from webrtc/rtc_base/pathutils.cc rename to webrtc/base/pathutils.cc diff --git a/webrtc/base/pathutils.h b/webrtc/base/pathutils.h index b45ca04f7c..ff0906938b 100644 --- a/webrtc/base/pathutils.h +++ b/webrtc/base/pathutils.h @@ -8,12 +8,86 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_PATHUTILS_H_ -#define WEBRTC_BASE_PATHUTILS_H_ +#ifndef WEBRTC_BASE_PATHUTILS_H__ +#define WEBRTC_BASE_PATHUTILS_H__ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/pathutils.h" +#include "webrtc/base/checks.h" -#endif // WEBRTC_BASE_PATHUTILS_H_ +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// +// Pathname - parsing of pathnames into components, and vice versa. +// +// To establish consistent terminology, a filename never contains a folder +// component. A folder never contains a filename. A pathname may include +// a folder and/or filename component. Here are some examples: +// +// pathname() /home/john/example.txt +// folder() /home/john/ +// filename() example.txt +// parent_folder() /home/ +// folder_name() john/ +// basename() example +// extension() .txt +// +// Basename may begin, end, and/or include periods, but no folder delimiters. +// If extension exists, it consists of a period followed by zero or more +// non-period/non-delimiter characters, and basename is non-empty. +/////////////////////////////////////////////////////////////////////////////// + +class Pathname { +public: + // Folder delimiters are slash and backslash + static bool IsFolderDelimiter(char ch); + static char DefaultFolderDelimiter(); + + Pathname(); + Pathname(const Pathname&); + Pathname(Pathname&&); + Pathname(const std::string& pathname); + Pathname(const std::string& folder, const std::string& filename); + + Pathname& operator=(const Pathname&); + Pathname& operator=(Pathname&&); + + // Normalize changes all folder delimiters to folder_delimiter() + void Normalize(); + + // Reset to the empty pathname + void clear(); + + // Returns true if the pathname is empty. Note: this->pathname().empty() + // is always false. + bool empty() const; + + // Returns the folder and filename components. If the pathname is empty, + // returns a string representing the current directory (as a relative path, + // i.e., "."). + std::string pathname() const; + void SetPathname(const std::string& pathname); + void SetPathname(const std::string& folder, const std::string& filename); + + std::string folder() const; + std::string parent_folder() const; + // SetFolder and AppendFolder will append a folder delimiter, if needed. + void SetFolder(const std::string& folder); + void AppendFolder(const std::string& folder); + + bool SetBasename(const std::string& basename); + + // SetExtension will prefix a period, if needed. + bool SetExtension(const std::string& extension); + + std::string filename() const; + bool SetFilename(const std::string& filename); + +private: + std::string folder_, basename_, extension_; + char folder_delimiter_; +}; + +} // namespace rtc + +#endif // WEBRTC_BASE_PATHUTILS_H__ diff --git a/webrtc/rtc_base/pathutils_unittest.cc b/webrtc/base/pathutils_unittest.cc similarity index 100% rename from webrtc/rtc_base/pathutils_unittest.cc rename to webrtc/base/pathutils_unittest.cc diff --git a/webrtc/rtc_base/physicalsocketserver.cc b/webrtc/base/physicalsocketserver.cc similarity index 100% rename from webrtc/rtc_base/physicalsocketserver.cc rename to webrtc/base/physicalsocketserver.cc diff --git a/webrtc/base/physicalsocketserver.h b/webrtc/base/physicalsocketserver.h index 63e6dfa5b9..dec37c256c 100644 --- a/webrtc/base/physicalsocketserver.h +++ b/webrtc/base/physicalsocketserver.h @@ -8,12 +8,263 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_PHYSICALSOCKETSERVER_H_ -#define WEBRTC_BASE_PHYSICALSOCKETSERVER_H_ +#ifndef WEBRTC_BASE_PHYSICALSOCKETSERVER_H__ +#define WEBRTC_BASE_PHYSICALSOCKETSERVER_H__ +#if defined(WEBRTC_POSIX) && defined(WEBRTC_LINUX) +#include +#define WEBRTC_USE_EPOLL 1 +#endif -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/physicalsocketserver.h" +#include +#include +#include -#endif // WEBRTC_BASE_PHYSICALSOCKETSERVER_H_ +#include "webrtc/base/nethelpers.h" +#include "webrtc/base/socketserver.h" +#include "webrtc/base/criticalsection.h" + +#if defined(WEBRTC_POSIX) +typedef int SOCKET; +#endif // WEBRTC_POSIX + +namespace rtc { + +// Event constants for the Dispatcher class. +enum DispatcherEvent { + DE_READ = 0x0001, + DE_WRITE = 0x0002, + DE_CONNECT = 0x0004, + DE_CLOSE = 0x0008, + DE_ACCEPT = 0x0010, +}; + +class Signaler; +#if defined(WEBRTC_POSIX) +class PosixSignalDispatcher; +#endif + +class Dispatcher { + public: + virtual ~Dispatcher() {} + virtual uint32_t GetRequestedEvents() = 0; + virtual void OnPreEvent(uint32_t ff) = 0; + virtual void OnEvent(uint32_t ff, int err) = 0; +#if defined(WEBRTC_WIN) + virtual WSAEVENT GetWSAEvent() = 0; + virtual SOCKET GetSocket() = 0; + virtual bool CheckSignalClose() = 0; +#elif defined(WEBRTC_POSIX) + virtual int GetDescriptor() = 0; + virtual bool IsDescriptorClosed() = 0; +#endif +}; + +// A socket server that provides the real sockets of the underlying OS. +class PhysicalSocketServer : public SocketServer { + public: + PhysicalSocketServer(); + ~PhysicalSocketServer() override; + + // SocketFactory: + Socket* CreateSocket(int type) override; + Socket* CreateSocket(int family, int type) override; + + AsyncSocket* CreateAsyncSocket(int type) override; + AsyncSocket* CreateAsyncSocket(int family, int type) override; + + // Internal Factory for Accept (virtual so it can be overwritten in tests). + virtual AsyncSocket* WrapSocket(SOCKET s); + + // SocketServer: + bool Wait(int cms, bool process_io) override; + void WakeUp() override; + + void Add(Dispatcher* dispatcher); + void Remove(Dispatcher* dispatcher); + void Update(Dispatcher* dispatcher); + +#if defined(WEBRTC_POSIX) + // Sets the function to be executed in response to the specified POSIX signal. + // The function is executed from inside Wait() using the "self-pipe trick"-- + // regardless of which thread receives the signal--and hence can safely + // manipulate user-level data structures. + // "handler" may be SIG_IGN, SIG_DFL, or a user-specified function, just like + // with signal(2). + // Only one PhysicalSocketServer should have user-level signal handlers. + // Dispatching signals on multiple PhysicalSocketServers is not reliable. + // The signal mask is not modified. It is the caller's responsibily to + // maintain it as desired. + virtual bool SetPosixSignalHandler(int signum, void (*handler)(int)); + + protected: + Dispatcher* signal_dispatcher(); +#endif + + private: + typedef std::set DispatcherSet; + + void AddRemovePendingDispatchers(); + +#if defined(WEBRTC_POSIX) + bool WaitSelect(int cms, bool process_io); + static bool InstallSignal(int signum, void (*handler)(int)); + + std::unique_ptr signal_dispatcher_; +#endif // WEBRTC_POSIX +#if defined(WEBRTC_USE_EPOLL) + void AddEpoll(Dispatcher* dispatcher); + void RemoveEpoll(Dispatcher* dispatcher); + void UpdateEpoll(Dispatcher* dispatcher); + bool WaitEpoll(int cms); + bool WaitPoll(int cms, Dispatcher* dispatcher); + + int epoll_fd_ = INVALID_SOCKET; + std::vector epoll_events_; +#endif // WEBRTC_USE_EPOLL + DispatcherSet dispatchers_; + DispatcherSet pending_add_dispatchers_; + DispatcherSet pending_remove_dispatchers_; + bool processing_dispatchers_ = false; + Signaler* signal_wakeup_; + CriticalSection crit_; + bool fWait_; +#if defined(WEBRTC_WIN) + WSAEVENT socket_ev_; +#endif +}; + +class PhysicalSocket : public AsyncSocket, public sigslot::has_slots<> { + public: + PhysicalSocket(PhysicalSocketServer* ss, SOCKET s = INVALID_SOCKET); + ~PhysicalSocket() override; + + // Creates the underlying OS socket (same as the "socket" function). + virtual bool Create(int family, int type); + + SocketAddress GetLocalAddress() const override; + SocketAddress GetRemoteAddress() const override; + + int Bind(const SocketAddress& bind_addr) override; + int Connect(const SocketAddress& addr) override; + + int GetError() const override; + void SetError(int error) override; + + ConnState GetState() const override; + + int GetOption(Option opt, int* value) override; + int SetOption(Option opt, int value) override; + + int Send(const void* pv, size_t cb) override; + int SendTo(const void* buffer, + size_t length, + const SocketAddress& addr) override; + + int Recv(void* buffer, size_t length, int64_t* timestamp) override; + int RecvFrom(void* buffer, + size_t length, + SocketAddress* out_addr, + int64_t* timestamp) override; + + int Listen(int backlog) override; + AsyncSocket* Accept(SocketAddress* out_addr) override; + + int Close() override; + + SocketServer* socketserver() { return ss_; } + + protected: + int DoConnect(const SocketAddress& connect_addr); + + // Make virtual so ::accept can be overwritten in tests. + virtual SOCKET DoAccept(SOCKET socket, sockaddr* addr, socklen_t* addrlen); + + // Make virtual so ::send can be overwritten in tests. + virtual int DoSend(SOCKET socket, const char* buf, int len, int flags); + + // Make virtual so ::sendto can be overwritten in tests. + virtual int DoSendTo(SOCKET socket, const char* buf, int len, int flags, + const struct sockaddr* dest_addr, socklen_t addrlen); + + void OnResolveResult(AsyncResolverInterface* resolver); + + void UpdateLastError(); + void MaybeRemapSendError(); + + uint8_t enabled_events() const { return enabled_events_; } + virtual void SetEnabledEvents(uint8_t events); + virtual void EnableEvents(uint8_t events); + virtual void DisableEvents(uint8_t events); + + static int TranslateOption(Option opt, int* slevel, int* sopt); + + PhysicalSocketServer* ss_; + SOCKET s_; + bool udp_; + CriticalSection crit_; + int error_ GUARDED_BY(crit_); + ConnState state_; + AsyncResolver* resolver_; + +#if !defined(NDEBUG) + std::string dbg_addr_; +#endif + + private: + uint8_t enabled_events_ = 0; +}; + +class SocketDispatcher : public Dispatcher, public PhysicalSocket { + public: + explicit SocketDispatcher(PhysicalSocketServer *ss); + SocketDispatcher(SOCKET s, PhysicalSocketServer *ss); + ~SocketDispatcher() override; + + bool Initialize(); + + virtual bool Create(int type); + bool Create(int family, int type) override; + +#if defined(WEBRTC_WIN) + WSAEVENT GetWSAEvent() override; + SOCKET GetSocket() override; + bool CheckSignalClose() override; +#elif defined(WEBRTC_POSIX) + int GetDescriptor() override; + bool IsDescriptorClosed() override; +#endif + + uint32_t GetRequestedEvents() override; + void OnPreEvent(uint32_t ff) override; + void OnEvent(uint32_t ff, int err) override; + + int Close() override; + +#if defined(WEBRTC_USE_EPOLL) + protected: + void StartBatchedEventUpdates(); + void FinishBatchedEventUpdates(); + + void SetEnabledEvents(uint8_t events) override; + void EnableEvents(uint8_t events) override; + void DisableEvents(uint8_t events) override; +#endif + + private: +#if defined(WEBRTC_WIN) + static int next_id_; + int id_; + bool signal_close_; + int signal_err_; +#endif // WEBRTC_WIN +#if defined(WEBRTC_USE_EPOLL) + void MaybeUpdateDispatcher(uint8_t old_events); + + int saved_enabled_events_ = -1; +#endif +}; + +} // namespace rtc + +#endif // WEBRTC_BASE_PHYSICALSOCKETSERVER_H__ diff --git a/webrtc/rtc_base/physicalsocketserver_unittest.cc b/webrtc/base/physicalsocketserver_unittest.cc similarity index 100% rename from webrtc/rtc_base/physicalsocketserver_unittest.cc rename to webrtc/base/physicalsocketserver_unittest.cc diff --git a/webrtc/rtc_base/platform_file.cc b/webrtc/base/platform_file.cc similarity index 100% rename from webrtc/rtc_base/platform_file.cc rename to webrtc/base/platform_file.cc diff --git a/webrtc/base/platform_file.h b/webrtc/base/platform_file.h index c7396ec4c7..27accf050b 100644 --- a/webrtc/base/platform_file.h +++ b/webrtc/base/platform_file.h @@ -11,9 +11,46 @@ #ifndef WEBRTC_BASE_PLATFORM_FILE_H_ #define WEBRTC_BASE_PLATFORM_FILE_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/platform_file.h" +#if defined(WEBRTC_WIN) +#include "webrtc/base/win32.h" +#endif + +namespace rtc { + +#if defined(WEBRTC_WIN) +typedef HANDLE PlatformFile; +#elif defined(WEBRTC_POSIX) +typedef int PlatformFile; +#else +#error Unsupported platform +#endif + +extern const PlatformFile kInvalidPlatformFileValue; + +// Associates a standard FILE stream with an existing PlatformFile. +// Note that after this function has returned a valid FILE stream, +// the PlatformFile should no longer be used. +FILE* FdopenPlatformFileForWriting(PlatformFile file); + +// Closes a PlatformFile. +// Don't use ClosePlatformFile to close a file opened with FdopenPlatformFile. +// Use fclose instead. +bool ClosePlatformFile(PlatformFile file); + +// Removes a file in the filesystem. +bool RemoveFile(const std::string& path); + +// Opens a file for reading and writing. You might want to use base/file.h +// instead. +PlatformFile OpenPlatformFile(const std::string& path); + +// Creates a new file for reading and writing. If the file already exists it +// will be overwritten. You might want to use base/file.h instead. +PlatformFile CreatePlatformFile(const std::string& path); + +} // namespace rtc #endif // WEBRTC_BASE_PLATFORM_FILE_H_ diff --git a/webrtc/rtc_base/platform_thread.cc b/webrtc/base/platform_thread.cc similarity index 100% rename from webrtc/rtc_base/platform_thread.cc rename to webrtc/base/platform_thread.cc diff --git a/webrtc/base/platform_thread.h b/webrtc/base/platform_thread.h index 626d66fc07..ed26ca03cc 100644 --- a/webrtc/base/platform_thread.h +++ b/webrtc/base/platform_thread.h @@ -11,9 +11,114 @@ #ifndef WEBRTC_BASE_PLATFORM_THREAD_H_ #define WEBRTC_BASE_PLATFORM_THREAD_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/platform_thread.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/event.h" +#include "webrtc/base/platform_thread_types.h" +#include "webrtc/base/thread_checker.h" + +namespace rtc { + +PlatformThreadId CurrentThreadId(); +PlatformThreadRef CurrentThreadRef(); + +// Compares two thread identifiers for equality. +bool IsThreadRefEqual(const PlatformThreadRef& a, const PlatformThreadRef& b); + +// Sets the current thread name. +void SetCurrentThreadName(const char* name); + +// Callback function that the spawned thread will enter once spawned. +// A return value of false is interpreted as that the function has no +// more work to do and that the thread can be released. +typedef bool (*ThreadRunFunctionDeprecated)(void*); +typedef void (*ThreadRunFunction)(void*); + +enum ThreadPriority { +#ifdef WEBRTC_WIN + kLowPriority = THREAD_PRIORITY_BELOW_NORMAL, + kNormalPriority = THREAD_PRIORITY_NORMAL, + kHighPriority = THREAD_PRIORITY_ABOVE_NORMAL, + kHighestPriority = THREAD_PRIORITY_HIGHEST, + kRealtimePriority = THREAD_PRIORITY_TIME_CRITICAL +#else + kLowPriority = 1, + kNormalPriority = 2, + kHighPriority = 3, + kHighestPriority = 4, + kRealtimePriority = 5 +#endif +}; + +// Represents a simple worker thread. The implementation must be assumed +// to be single threaded, meaning that all methods of the class, must be +// called from the same thread, including instantiation. +class PlatformThread { + public: + PlatformThread(ThreadRunFunctionDeprecated func, + void* obj, + const char* thread_name); + PlatformThread(ThreadRunFunction func, + void* obj, + const char* thread_name, + ThreadPriority priority = kNormalPriority); + virtual ~PlatformThread(); + + const std::string& name() const { return name_; } + + // Spawns a thread and tries to set thread priority according to the priority + // from when CreateThread was called. + void Start(); + + bool IsRunning() const; + + // Returns an identifier for the worker thread that can be used to do + // thread checks. + PlatformThreadRef GetThreadRef() const; + + // Stops (joins) the spawned thread. + void Stop(); + + // Set the priority of the thread. Must be called when thread is running. + // TODO(tommi): Make private and only allow public support via ctor. + bool SetPriority(ThreadPriority priority); + + protected: +#if defined(WEBRTC_WIN) + // Exposed to derived classes to allow for special cases specific to Windows. + bool QueueAPC(PAPCFUNC apc_function, ULONG_PTR data); +#endif + + private: + void Run(); + + ThreadRunFunctionDeprecated const run_function_deprecated_ = nullptr; + ThreadRunFunction const run_function_ = nullptr; + const ThreadPriority priority_ = kNormalPriority; + void* const obj_; + // TODO(pbos): Make sure call sites use string literals and update to a const + // char* instead of a std::string. + const std::string name_; + rtc::ThreadChecker thread_checker_; + rtc::ThreadChecker spawned_thread_checker_; +#if defined(WEBRTC_WIN) + static DWORD WINAPI StartThread(void* param); + + bool stop_ = false; + HANDLE thread_ = nullptr; + DWORD thread_id_ = 0; +#else + static void* StartThread(void* param); + + // An atomic flag that we use to stop the thread. Only modified on the + // controlling thread and checked on the worker thread. + volatile int stop_flag_ = 0; + pthread_t thread_ = 0; +#endif // defined(WEBRTC_WIN) + RTC_DISALLOW_COPY_AND_ASSIGN(PlatformThread); +}; + +} // namespace rtc #endif // WEBRTC_BASE_PLATFORM_THREAD_H_ diff --git a/webrtc/base/platform_thread_types.h b/webrtc/base/platform_thread_types.h index f2dbd58363..546fffd96d 100644 --- a/webrtc/base/platform_thread_types.h +++ b/webrtc/base/platform_thread_types.h @@ -11,9 +11,22 @@ #ifndef WEBRTC_BASE_PLATFORM_THREAD_TYPES_H_ #define WEBRTC_BASE_PLATFORM_THREAD_TYPES_H_ +#if defined(WEBRTC_WIN) +#include +#include +#elif defined(WEBRTC_POSIX) +#include +#include +#endif -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/platform_thread_types.h" +namespace rtc { +#if defined(WEBRTC_WIN) +typedef DWORD PlatformThreadId; +typedef DWORD PlatformThreadRef; +#elif defined(WEBRTC_POSIX) +typedef pid_t PlatformThreadId; +typedef pthread_t PlatformThreadRef; +#endif +} // namespace rtc #endif // WEBRTC_BASE_PLATFORM_THREAD_TYPES_H_ diff --git a/webrtc/rtc_base/platform_thread_unittest.cc b/webrtc/base/platform_thread_unittest.cc similarity index 100% rename from webrtc/rtc_base/platform_thread_unittest.cc rename to webrtc/base/platform_thread_unittest.cc diff --git a/webrtc/base/protobuf_utils.h b/webrtc/base/protobuf_utils.h index 3d2dd862ff..69f47cf4bf 100644 --- a/webrtc/base/protobuf_utils.h +++ b/webrtc/base/protobuf_utils.h @@ -13,9 +13,24 @@ #ifndef WEBRTC_BASE_PROTOBUF_UTILS_H_ #define WEBRTC_BASE_PROTOBUF_UTILS_H_ +namespace webrtc { -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/protobuf_utils.h" +using ProtoString = std::string; + +} // namespace webrtc + +#if WEBRTC_ENABLE_PROTOBUF + +#include "third_party/protobuf/src/google/protobuf/message_lite.h" +#include "third_party/protobuf/src/google/protobuf/repeated_field.h" + +namespace webrtc { + +using google::protobuf::MessageLite; +using google::protobuf::RepeatedPtrField; + +} // namespace webrtc + +#endif // WEBRTC_ENABLE_PROTOBUF #endif // WEBRTC_BASE_PROTOBUF_UTILS_H_ diff --git a/webrtc/rtc_base/proxy_unittest.cc b/webrtc/base/proxy_unittest.cc similarity index 100% rename from webrtc/rtc_base/proxy_unittest.cc rename to webrtc/base/proxy_unittest.cc diff --git a/webrtc/rtc_base/proxyinfo.cc b/webrtc/base/proxyinfo.cc similarity index 100% rename from webrtc/rtc_base/proxyinfo.cc rename to webrtc/base/proxyinfo.cc diff --git a/webrtc/base/proxyinfo.h b/webrtc/base/proxyinfo.h index f0ae1825e4..2251b13ee2 100644 --- a/webrtc/base/proxyinfo.h +++ b/webrtc/base/proxyinfo.h @@ -8,12 +8,36 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_PROXYINFO_H_ -#define WEBRTC_BASE_PROXYINFO_H_ +#ifndef WEBRTC_BASE_PROXYINFO_H__ +#define WEBRTC_BASE_PROXYINFO_H__ +#include +#include "webrtc/base/socketaddress.h" +#include "webrtc/base/cryptstring.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/proxyinfo.h" +namespace rtc { -#endif // WEBRTC_BASE_PROXYINFO_H_ +enum ProxyType { + PROXY_NONE, + PROXY_HTTPS, + PROXY_SOCKS5, + PROXY_UNKNOWN +}; +const char * ProxyToString(ProxyType proxy); + +struct ProxyInfo { + ProxyType type; + SocketAddress address; + std::string autoconfig_url; + bool autodetect; + std::string bypass_list; + std::string username; + CryptString password; + + ProxyInfo(); + ~ProxyInfo(); +}; + +} // namespace rtc + +#endif // WEBRTC_BASE_PROXYINFO_H__ diff --git a/webrtc/rtc_base/proxyserver.cc b/webrtc/base/proxyserver.cc similarity index 100% rename from webrtc/rtc_base/proxyserver.cc rename to webrtc/base/proxyserver.cc diff --git a/webrtc/base/proxyserver.h b/webrtc/base/proxyserver.h index 1bf580ad70..86007c3606 100644 --- a/webrtc/base/proxyserver.h +++ b/webrtc/base/proxyserver.h @@ -11,9 +11,90 @@ #ifndef WEBRTC_BASE_PROXYSERVER_H_ #define WEBRTC_BASE_PROXYSERVER_H_ +#include +#include +#include "webrtc/base/asyncsocket.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/socketadapters.h" +#include "webrtc/base/socketaddress.h" +#include "webrtc/base/stream.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/proxyserver.h" +namespace rtc { + +class SocketFactory; + +// ProxyServer is a base class that allows for easy construction of proxy +// servers. With its helper class ProxyBinding, it contains all the necessary +// logic for receiving and bridging connections. The specific client-server +// proxy protocol is implemented by an instance of the AsyncProxyServerSocket +// class; children of ProxyServer implement WrapSocket appropriately to return +// the correct protocol handler. + +class ProxyBinding : public sigslot::has_slots<> { + public: + ProxyBinding(AsyncProxyServerSocket* in_socket, AsyncSocket* out_socket); + ~ProxyBinding() override; + sigslot::signal1 SignalDestroyed; + + private: + void OnConnectRequest(AsyncProxyServerSocket* socket, + const SocketAddress& addr); + void OnInternalRead(AsyncSocket* socket); + void OnInternalWrite(AsyncSocket* socket); + void OnInternalClose(AsyncSocket* socket, int err); + void OnExternalConnect(AsyncSocket* socket); + void OnExternalRead(AsyncSocket* socket); + void OnExternalWrite(AsyncSocket* socket); + void OnExternalClose(AsyncSocket* socket, int err); + + static void Read(AsyncSocket* socket, FifoBuffer* buffer); + static void Write(AsyncSocket* socket, FifoBuffer* buffer); + void Destroy(); + + static const int kBufferSize = 4096; + std::unique_ptr int_socket_; + std::unique_ptr ext_socket_; + bool connected_; + FifoBuffer out_buffer_; + FifoBuffer in_buffer_; + RTC_DISALLOW_COPY_AND_ASSIGN(ProxyBinding); +}; + +class ProxyServer : public sigslot::has_slots<> { + public: + ProxyServer(SocketFactory* int_factory, const SocketAddress& int_addr, + SocketFactory* ext_factory, const SocketAddress& ext_ip); + ~ProxyServer() override; + + // Returns the address to which the proxy server is bound + SocketAddress GetServerAddress(); + + protected: + void OnAcceptEvent(AsyncSocket* socket); + virtual AsyncProxyServerSocket* WrapSocket(AsyncSocket* socket) = 0; + void OnBindingDestroyed(ProxyBinding* binding); + + private: + typedef std::list BindingList; + SocketFactory* ext_factory_; + SocketAddress ext_ip_; + std::unique_ptr server_socket_; + BindingList bindings_; + RTC_DISALLOW_COPY_AND_ASSIGN(ProxyServer); +}; + +// SocksProxyServer is a simple extension of ProxyServer to implement SOCKS. +class SocksProxyServer : public ProxyServer { + public: + SocksProxyServer(SocketFactory* int_factory, const SocketAddress& int_addr, + SocketFactory* ext_factory, const SocketAddress& ext_ip) + : ProxyServer(int_factory, int_addr, ext_factory, ext_ip) { + } + protected: + AsyncProxyServerSocket* WrapSocket(AsyncSocket* socket) override; + RTC_DISALLOW_COPY_AND_ASSIGN(SocksProxyServer); +}; + +} // namespace rtc #endif // WEBRTC_BASE_PROXYSERVER_H_ diff --git a/webrtc/base/ptr_util.h b/webrtc/base/ptr_util.h index aa6f3b4016..43895c7279 100644 --- a/webrtc/base/ptr_util.h +++ b/webrtc/base/ptr_util.h @@ -13,9 +13,70 @@ #ifndef WEBRTC_BASE_PTR_UTIL_H_ #define WEBRTC_BASE_PTR_UTIL_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/ptr_util.h" +namespace rtc { + +// Helper to transfer ownership of a raw pointer to a std::unique_ptr. +// Note that std::unique_ptr has very different semantics from +// std::unique_ptr: do not use this helper for array allocations. +template +std::unique_ptr WrapUnique(T* ptr) { + return std::unique_ptr(ptr); +} + +namespace internal { + +template +struct MakeUniqueResult { + using Scalar = std::unique_ptr; +}; + +template +struct MakeUniqueResult { + using Array = std::unique_ptr; +}; + +template +struct MakeUniqueResult { + using Invalid = void; +}; + +} // namespace internal + +// Helper to construct an object wrapped in a std::unique_ptr. This is an +// implementation of C++14's std::make_unique that can be used in Chrome. +// +// MakeUnique(args) should be preferred over WrapUnique(new T(args)): bare +// calls to `new` should be treated with scrutiny. +// +// Usage: +// // ptr is a std::unique_ptr +// auto ptr = MakeUnique("hello world!"); +// +// // arr is a std::unique_ptr +// auto arr = MakeUnique(5); + +// Overload for non-array types. Arguments are forwarded to T's constructor. +template +typename internal::MakeUniqueResult::Scalar MakeUnique(Args&&... args) { + return std::unique_ptr(new T(std::forward(args)...)); +} + +// Overload for array types of unknown bound, e.g. T[]. The array is allocated +// with `new T[n]()` and value-initialized: note that this is distinct from +// `new T[n]`, which default-initializes. +template +typename internal::MakeUniqueResult::Array MakeUnique(size_t size) { + return std::unique_ptr(new typename std::remove_extent::type[size]()); +} + +// Overload to reject array types of known bound, e.g. T[n]. +template +typename internal::MakeUniqueResult::Invalid MakeUnique(Args&&... args) = + delete; + +} // namespace rtc #endif // WEBRTC_BASE_PTR_UTIL_H_ diff --git a/webrtc/rtc_base/ptr_util_unittest.cc b/webrtc/base/ptr_util_unittest.cc similarity index 100% rename from webrtc/rtc_base/ptr_util_unittest.cc rename to webrtc/base/ptr_util_unittest.cc diff --git a/webrtc/rtc_base/race_checker.cc b/webrtc/base/race_checker.cc similarity index 100% rename from webrtc/rtc_base/race_checker.cc rename to webrtc/base/race_checker.cc diff --git a/webrtc/base/race_checker.h b/webrtc/base/race_checker.h index 474fdb59ba..a6ba771f90 100644 --- a/webrtc/base/race_checker.h +++ b/webrtc/base/race_checker.h @@ -11,9 +11,68 @@ #ifndef WEBRTC_BASE_RACE_CHECKER_H_ #define WEBRTC_BASE_RACE_CHECKER_H_ +#include "webrtc/base/checks.h" +#include "webrtc/base/platform_thread.h" +#include "webrtc/base/thread_annotations.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/race_checker.h" +namespace rtc { + +namespace internal { +class RaceCheckerScope; +} // namespace internal + +// Best-effort race-checking implementation. This primitive uses no +// synchronization at all to be as-fast-as-possible in the non-racy case. +class LOCKABLE RaceChecker { + public: + friend class internal::RaceCheckerScope; + RaceChecker(); + + private: + bool Acquire() const EXCLUSIVE_LOCK_FUNCTION(); + void Release() const UNLOCK_FUNCTION(); + + // Volatile to prevent code being optimized away in Acquire()/Release(). + mutable volatile int access_count_ = 0; + mutable volatile PlatformThreadRef accessing_thread_; +}; + +namespace internal { +class SCOPED_LOCKABLE RaceCheckerScope { + public: + explicit RaceCheckerScope(const RaceChecker* race_checker) + EXCLUSIVE_LOCK_FUNCTION(race_checker); + + bool RaceDetected() const; + ~RaceCheckerScope() UNLOCK_FUNCTION(); + + private: + const RaceChecker* const race_checker_; + const bool race_check_ok_; +}; + +class SCOPED_LOCKABLE RaceCheckerScopeDoNothing { + public: + explicit RaceCheckerScopeDoNothing(const RaceChecker* race_checker) + EXCLUSIVE_LOCK_FUNCTION(race_checker) {} + + ~RaceCheckerScopeDoNothing() UNLOCK_FUNCTION() {} +}; + +} // namespace internal +} // namespace rtc + +#define RTC_CHECK_RUNS_SERIALIZED(x) \ + rtc::internal::RaceCheckerScope race_checker(x); \ + RTC_CHECK(!race_checker.RaceDetected()) + +#if RTC_DCHECK_IS_ON +#define RTC_DCHECK_RUNS_SERIALIZED(x) \ + rtc::internal::RaceCheckerScope race_checker(x); \ + RTC_DCHECK(!race_checker.RaceDetected()) +#else +#define RTC_DCHECK_RUNS_SERIALIZED(x) \ + rtc::internal::RaceCheckerScopeDoNothing race_checker(x) +#endif #endif // WEBRTC_BASE_RACE_CHECKER_H_ diff --git a/webrtc/rtc_base/random.cc b/webrtc/base/random.cc similarity index 100% rename from webrtc/rtc_base/random.cc rename to webrtc/base/random.cc diff --git a/webrtc/base/random.h b/webrtc/base/random.h index 12a490202b..cb7b9ebe4a 100644 --- a/webrtc/base/random.h +++ b/webrtc/base/random.h @@ -11,9 +11,83 @@ #ifndef WEBRTC_BASE_RANDOM_H_ #define WEBRTC_BASE_RANDOM_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/random.h" +#include "webrtc/typedefs.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/checks.h" + +namespace webrtc { + +class Random { + public: + // TODO(tommi): Change this so that the seed can be initialized internally, + // e.g. by offering two ways of constructing or offer a static method that + // returns a seed that's suitable for initialization. + // The problem now is that callers are calling clock_->TimeInMicroseconds() + // which calls TickTime::Now().Ticks(), which can return a very low value on + // Mac and can result in a seed of 0 after conversion to microseconds. + // Besides the quality of the random seed being poor, this also requires + // the client to take on extra dependencies to generate a seed. + // If we go for a static seed generator in Random, we can use something from + // webrtc/base and make sure that it works the same way across platforms. + // See also discussion here: https://codereview.webrtc.org/1623543002/ + explicit Random(uint64_t seed); + + // Return pseudo-random integer of the specified type. + // We need to limit the size to 32 bits to keep the output close to uniform. + template + T Rand() { + static_assert(std::numeric_limits::is_integer && + std::numeric_limits::radix == 2 && + std::numeric_limits::digits <= 32, + "Rand is only supported for built-in integer types that are " + "32 bits or smaller."); + return static_cast(NextOutput()); + } + + // Uniformly distributed pseudo-random number in the interval [0, t]. + uint32_t Rand(uint32_t t); + + // Uniformly distributed pseudo-random number in the interval [low, high]. + uint32_t Rand(uint32_t low, uint32_t high); + + // Uniformly distributed pseudo-random number in the interval [low, high]. + int32_t Rand(int32_t low, int32_t high); + + // Normal Distribution. + double Gaussian(double mean, double standard_deviation); + + // Exponential Distribution. + double Exponential(double lambda); + + private: + // Outputs a nonzero 64-bit random number. + uint64_t NextOutput() { + state_ ^= state_ >> 12; + state_ ^= state_ << 25; + state_ ^= state_ >> 27; + RTC_DCHECK(state_ != 0x0ULL); + return state_ * 2685821657736338717ull; + } + + uint64_t state_; + + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Random); +}; + +// Return pseudo-random number in the interval [0.0, 1.0). +template <> +float Random::Rand(); + +// Return pseudo-random number in the interval [0.0, 1.0). +template <> +double Random::Rand(); + +// Return pseudo-random boolean value. +template <> +bool Random::Rand(); + +} // namespace webrtc #endif // WEBRTC_BASE_RANDOM_H_ diff --git a/webrtc/rtc_base/random_unittest.cc b/webrtc/base/random_unittest.cc similarity index 100% rename from webrtc/rtc_base/random_unittest.cc rename to webrtc/base/random_unittest.cc diff --git a/webrtc/rtc_base/rate_limiter.cc b/webrtc/base/rate_limiter.cc similarity index 100% rename from webrtc/rtc_base/rate_limiter.cc rename to webrtc/base/rate_limiter.cc diff --git a/webrtc/base/rate_limiter.h b/webrtc/base/rate_limiter.h index 0cba5fb9a9..ceeccfc5a4 100644 --- a/webrtc/base/rate_limiter.h +++ b/webrtc/base/rate_limiter.h @@ -11,9 +11,46 @@ #ifndef WEBRTC_BASE_RATE_LIMITER_H_ #define WEBRTC_BASE_RATE_LIMITER_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/rate_limiter.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/criticalsection.h" +#include "webrtc/base/rate_statistics.h" + +namespace webrtc { + +class Clock; + +// Class used to limit a bitrate, making sure the average does not exceed a +// maximum as measured over a sliding window. This class is thread safe; all +// methods will acquire (the same) lock befeore executing. +class RateLimiter { + public: + RateLimiter(const Clock* clock, int64_t max_window_ms); + ~RateLimiter(); + + // Try to use rate to send bytes. Returns true on success and if so updates + // current rate. + bool TryUseRate(size_t packet_size_bytes); + + // Set the maximum bitrate, in bps, that this limiter allows to send. + void SetMaxRate(uint32_t max_rate_bps); + + // Set the window size over which to measure the current bitrate. + // For example, irt retransmissions, this is typically the RTT. + // Returns true on success and false if window_size_ms is out of range. + bool SetWindowSize(int64_t window_size_ms); + + private: + const Clock* const clock_; + rtc::CriticalSection lock_; + RateStatistics current_rate_ GUARDED_BY(lock_); + int64_t window_size_ms_ GUARDED_BY(lock_); + uint32_t max_rate_bps_ GUARDED_BY(lock_); + + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RateLimiter); +}; + +} // namespace webrtc #endif // WEBRTC_BASE_RATE_LIMITER_H_ diff --git a/webrtc/rtc_base/rate_limiter_unittest.cc b/webrtc/base/rate_limiter_unittest.cc similarity index 100% rename from webrtc/rtc_base/rate_limiter_unittest.cc rename to webrtc/base/rate_limiter_unittest.cc diff --git a/webrtc/rtc_base/rate_statistics.cc b/webrtc/base/rate_statistics.cc similarity index 100% rename from webrtc/rtc_base/rate_statistics.cc rename to webrtc/base/rate_statistics.cc diff --git a/webrtc/base/rate_statistics.h b/webrtc/base/rate_statistics.h index 1a17500727..8a90a46a84 100644 --- a/webrtc/base/rate_statistics.h +++ b/webrtc/base/rate_statistics.h @@ -11,9 +11,74 @@ #ifndef WEBRTC_BASE_RATE_STATISTICS_H_ #define WEBRTC_BASE_RATE_STATISTICS_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/rate_statistics.h" +#include "webrtc/base/optional.h" +#include "webrtc/typedefs.h" + +namespace webrtc { + +class RateStatistics { + public: + static constexpr float kBpsScale = 8000.0f; + + // max_window_size_ms = Maximum window size in ms for the rate estimation. + // Initial window size is set to this, but may be changed + // to something lower by calling SetWindowSize(). + // scale = coefficient to convert counts/ms to desired unit + // ex: kBpsScale (8000) for bits/s if count represents bytes. + RateStatistics(int64_t max_window_size_ms, float scale); + ~RateStatistics(); + + // Reset instance to original state. + void Reset(); + + // Update rate with a new data point, moving averaging window as needed. + void Update(size_t count, int64_t now_ms); + + // Note that despite this being a const method, it still updates the internal + // state (moves averaging window), but it doesn't make any alterations that + // are observable from the other methods, as long as supplied timestamps are + // from a monotonic clock. Ie, it doesn't matter if this call moves the + // window, since any subsequent call to Update or Rate would still have moved + // the window as much or more. + rtc::Optional Rate(int64_t now_ms) const; + + // Update the size of the averaging window. The maximum allowed value for + // window_size_ms is max_window_size_ms as supplied in the constructor. + bool SetWindowSize(int64_t window_size_ms, int64_t now_ms); + + private: + void EraseOld(int64_t now_ms); + bool IsInitialized() const; + + // Counters are kept in buckets (circular buffer), with one bucket + // per millisecond. + struct Bucket { + size_t sum; // Sum of all samples in this bucket. + size_t samples; // Number of samples in this bucket. + }; + std::unique_ptr buckets_; + + // Total count recorded in buckets. + size_t accumulated_count_; + + // The total number of samples in the buckets. + size_t num_samples_; + + // Oldest time recorded in buckets. + int64_t oldest_time_; + + // Bucket index of oldest counter recorded in buckets. + uint32_t oldest_index_; + + // To convert counts/ms to desired units + const float scale_; + + // The window sizes, in ms, over which the rate is calculated. + const int64_t max_window_size_ms_; + int64_t current_window_size_ms_; +}; +} // namespace webrtc #endif // WEBRTC_BASE_RATE_STATISTICS_H_ diff --git a/webrtc/rtc_base/rate_statistics_unittest.cc b/webrtc/base/rate_statistics_unittest.cc similarity index 100% rename from webrtc/rtc_base/rate_statistics_unittest.cc rename to webrtc/base/rate_statistics_unittest.cc diff --git a/webrtc/rtc_base/ratelimiter.cc b/webrtc/base/ratelimiter.cc similarity index 100% rename from webrtc/rtc_base/ratelimiter.cc rename to webrtc/base/ratelimiter.cc diff --git a/webrtc/base/ratelimiter.h b/webrtc/base/ratelimiter.h index 0e372db691..1423e991bc 100644 --- a/webrtc/base/ratelimiter.h +++ b/webrtc/base/ratelimiter.h @@ -11,9 +11,52 @@ #ifndef WEBRTC_BASE_RATELIMITER_H_ #define WEBRTC_BASE_RATELIMITER_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/ratelimiter.h" +namespace rtc { + +// Limits the rate of use to a certain maximum quantity per period of +// time. Use, for example, for simple bandwidth throttling. +// +// It's implemented like a diet plan: You have so many calories per +// day. If you hit the limit, you can't eat any more until the next +// day. +class RateLimiter { + public: + // For example, 100kb per second. + RateLimiter(size_t max, double period) + : max_per_period_(max), + period_length_(period), + used_in_period_(0), + period_start_(0.0), + period_end_(period) { + } + virtual ~RateLimiter() {} + + // Returns true if if the desired quantity is available in the + // current period (< (max - used)). Once the given time passes the + // end of the period, used is set to zero and more use is available. + bool CanUse(size_t desired, double time); + // Increment the quantity used this period. If past the end of a + // period, a new period is started. + void Use(size_t used, double time); + + size_t used_in_period() const { + return used_in_period_; + } + + size_t max_per_period() const { + return max_per_period_; + } + + private: + size_t max_per_period_; + double period_length_; + size_t used_in_period_; + double period_start_; + double period_end_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_RATELIMITER_H_ diff --git a/webrtc/rtc_base/ratelimiter_unittest.cc b/webrtc/base/ratelimiter_unittest.cc similarity index 100% rename from webrtc/rtc_base/ratelimiter_unittest.cc rename to webrtc/base/ratelimiter_unittest.cc diff --git a/webrtc/rtc_base/ratetracker.cc b/webrtc/base/ratetracker.cc similarity index 100% rename from webrtc/rtc_base/ratetracker.cc rename to webrtc/base/ratetracker.cc diff --git a/webrtc/base/ratetracker.h b/webrtc/base/ratetracker.h index d1fd75d0ee..6ae9bec119 100644 --- a/webrtc/base/ratetracker.h +++ b/webrtc/base/ratetracker.h @@ -11,9 +11,59 @@ #ifndef WEBRTC_BASE_RATETRACKER_H_ #define WEBRTC_BASE_RATETRACKER_H_ +#include +#include "webrtc/base/basictypes.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/ratetracker.h" +namespace rtc { + +// Computes units per second over a given interval by tracking the units over +// each bucket of a given size and calculating the instantaneous rate assuming +// that over each bucket the rate was constant. +class RateTracker { + public: + RateTracker(int64_t bucket_milliseconds, size_t bucket_count); + virtual ~RateTracker(); + + // Computes the average rate over the most recent interval_milliseconds, + // or if the first sample was added within this period, computes the rate + // since the first sample was added. + double ComputeRateForInterval(int64_t interval_milliseconds) const; + + // Computes the average rate over the rate tracker's recording interval + // of bucket_milliseconds * bucket_count. + double ComputeRate() const { + return ComputeRateForInterval(bucket_milliseconds_ * + static_cast(bucket_count_)); + } + + // Computes the average rate since the first sample was added to the + // rate tracker. + double ComputeTotalRate() const; + + // The total number of samples added. + size_t TotalSampleCount() const; + + // Reads the current time in order to determine the appropriate bucket for + // these samples, and increments the count for that bucket by sample_count. + void AddSamples(size_t sample_count); + + protected: + // overrideable for tests + virtual int64_t Time() const; + + private: + void EnsureInitialized(); + size_t NextBucketIndex(size_t bucket_index) const; + + const int64_t bucket_milliseconds_; + const size_t bucket_count_; + size_t* sample_buckets_; + size_t total_sample_count_; + size_t current_bucket_; + int64_t bucket_start_time_milliseconds_; + int64_t initialization_time_milliseconds_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_RATETRACKER_H_ diff --git a/webrtc/rtc_base/ratetracker_unittest.cc b/webrtc/base/ratetracker_unittest.cc similarity index 100% rename from webrtc/rtc_base/ratetracker_unittest.cc rename to webrtc/base/ratetracker_unittest.cc diff --git a/webrtc/base/refcount.h b/webrtc/base/refcount.h index 4a7cea313f..565ae495b2 100644 --- a/webrtc/base/refcount.h +++ b/webrtc/base/refcount.h @@ -10,9 +10,20 @@ #ifndef WEBRTC_BASE_REFCOUNT_H_ #define WEBRTC_BASE_REFCOUNT_H_ +#include "webrtc/base/refcountedobject.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/refcount.h" +namespace rtc { + +// Reference count interface. +class RefCountInterface { + public: + virtual int AddRef() const = 0; + virtual int Release() const = 0; + + protected: + virtual ~RefCountInterface() {} +}; + +} // namespace rtc #endif // WEBRTC_BASE_REFCOUNT_H_ diff --git a/webrtc/base/refcountedobject.h b/webrtc/base/refcountedobject.h index 78304fa5f5..285ed36b1d 100644 --- a/webrtc/base/refcountedobject.h +++ b/webrtc/base/refcountedobject.h @@ -10,9 +10,52 @@ #ifndef WEBRTC_BASE_REFCOUNTEDOBJECT_H_ #define WEBRTC_BASE_REFCOUNTEDOBJECT_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/refcountedobject.h" +#include "webrtc/base/atomicops.h" + +namespace rtc { + +template +class RefCountedObject : public T { + public: + RefCountedObject() {} + + template + explicit RefCountedObject(P0&& p0) : T(std::forward(p0)) {} + + template + RefCountedObject(P0&& p0, P1&& p1, Args&&... args) + : T(std::forward(p0), + std::forward(p1), + std::forward(args)...) {} + + virtual int AddRef() const { return AtomicOps::Increment(&ref_count_); } + + virtual int Release() const { + int count = AtomicOps::Decrement(&ref_count_); + if (!count) { + delete this; + } + return count; + } + + // Return whether the reference count is one. If the reference count is used + // in the conventional way, a reference count of 1 implies that the current + // thread owns the reference and no other thread shares it. This call + // performs the test for a reference count of one, and performs the memory + // barrier needed for the owning thread to act on the object, knowing that it + // has exclusive access to the object. + virtual bool HasOneRef() const { + return AtomicOps::AcquireLoad(&ref_count_) == 1; + } + + protected: + virtual ~RefCountedObject() {} + + mutable volatile int ref_count_ = 0; +}; + +} // namespace rtc #endif // WEBRTC_BASE_REFCOUNTEDOBJECT_H_ diff --git a/webrtc/rtc_base/refcountedobject_unittest.cc b/webrtc/base/refcountedobject_unittest.cc similarity index 100% rename from webrtc/rtc_base/refcountedobject_unittest.cc rename to webrtc/base/refcountedobject_unittest.cc diff --git a/webrtc/base/rollingaccumulator.h b/webrtc/base/rollingaccumulator.h index a7de4f19dd..66273755f1 100644 --- a/webrtc/base/rollingaccumulator.h +++ b/webrtc/base/rollingaccumulator.h @@ -11,9 +11,164 @@ #ifndef WEBRTC_BASE_ROLLINGACCUMULATOR_H_ #define WEBRTC_BASE_ROLLINGACCUMULATOR_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/rollingaccumulator.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/constructormagic.h" + +namespace rtc { + +// RollingAccumulator stores and reports statistics +// over N most recent samples. +// +// T is assumed to be an int, long, double or float. +template +class RollingAccumulator { + public: + explicit RollingAccumulator(size_t max_count) + : samples_(max_count) { + Reset(); + } + ~RollingAccumulator() { + } + + size_t max_count() const { + return samples_.size(); + } + + size_t count() const { + return count_; + } + + void Reset() { + count_ = 0U; + next_index_ = 0U; + sum_ = 0.0; + sum_2_ = 0.0; + max_ = T(); + max_stale_ = false; + min_ = T(); + min_stale_ = false; + } + + void AddSample(T sample) { + if (count_ == max_count()) { + // Remove oldest sample. + T sample_to_remove = samples_[next_index_]; + sum_ -= sample_to_remove; + sum_2_ -= static_cast(sample_to_remove) * sample_to_remove; + if (sample_to_remove >= max_) { + max_stale_ = true; + } + if (sample_to_remove <= min_) { + min_stale_ = true; + } + } else { + // Increase count of samples. + ++count_; + } + // Add new sample. + samples_[next_index_] = sample; + sum_ += sample; + sum_2_ += static_cast(sample) * sample; + if (count_ == 1 || sample >= max_) { + max_ = sample; + max_stale_ = false; + } + if (count_ == 1 || sample <= min_) { + min_ = sample; + min_stale_ = false; + } + // Update next_index_. + next_index_ = (next_index_ + 1) % max_count(); + } + + T ComputeSum() const { + return static_cast(sum_); + } + + double ComputeMean() const { + if (count_ == 0) { + return 0.0; + } + return sum_ / count_; + } + + T ComputeMax() const { + if (max_stale_) { + RTC_DCHECK(count_ > 0) << + "It shouldn't be possible for max_stale_ && count_ == 0"; + max_ = samples_[next_index_]; + for (size_t i = 1u; i < count_; i++) { + max_ = std::max(max_, samples_[(next_index_ + i) % max_count()]); + } + max_stale_ = false; + } + return max_; + } + + T ComputeMin() const { + if (min_stale_) { + RTC_DCHECK(count_ > 0) << + "It shouldn't be possible for min_stale_ && count_ == 0"; + min_ = samples_[next_index_]; + for (size_t i = 1u; i < count_; i++) { + min_ = std::min(min_, samples_[(next_index_ + i) % max_count()]); + } + min_stale_ = false; + } + return min_; + } + + // O(n) time complexity. + // Weights nth sample with weight (learning_rate)^n. Learning_rate should be + // between (0.0, 1.0], otherwise the non-weighted mean is returned. + double ComputeWeightedMean(double learning_rate) const { + if (count_ < 1 || learning_rate <= 0.0 || learning_rate >= 1.0) { + return ComputeMean(); + } + double weighted_mean = 0.0; + double current_weight = 1.0; + double weight_sum = 0.0; + const size_t max_size = max_count(); + for (size_t i = 0; i < count_; ++i) { + current_weight *= learning_rate; + weight_sum += current_weight; + // Add max_size to prevent underflow. + size_t index = (next_index_ + max_size - i - 1) % max_size; + weighted_mean += current_weight * samples_[index]; + } + return weighted_mean / weight_sum; + } + + // Compute estimated variance. Estimation is more accurate + // as the number of samples grows. + double ComputeVariance() const { + if (count_ == 0) { + return 0.0; + } + // Var = E[x^2] - (E[x])^2 + double count_inv = 1.0 / count_; + double mean_2 = sum_2_ * count_inv; + double mean = sum_ * count_inv; + return mean_2 - (mean * mean); + } + + private: + size_t count_; + size_t next_index_; + double sum_; // Sum(x) - double to avoid overflow + double sum_2_; // Sum(x*x) - double to avoid overflow + mutable T max_; + mutable bool max_stale_; + mutable T min_; + mutable bool min_stale_; + std::vector samples_; + + RTC_DISALLOW_COPY_AND_ASSIGN(RollingAccumulator); +}; + +} // namespace rtc #endif // WEBRTC_BASE_ROLLINGACCUMULATOR_H_ diff --git a/webrtc/rtc_base/rollingaccumulator_unittest.cc b/webrtc/base/rollingaccumulator_unittest.cc similarity index 100% rename from webrtc/rtc_base/rollingaccumulator_unittest.cc rename to webrtc/base/rollingaccumulator_unittest.cc diff --git a/webrtc/rtc_base/rtccertificate.cc b/webrtc/base/rtccertificate.cc similarity index 100% rename from webrtc/rtc_base/rtccertificate.cc rename to webrtc/base/rtccertificate.cc diff --git a/webrtc/base/rtccertificate.h b/webrtc/base/rtccertificate.h index 22d8fe754b..dfc76808ac 100644 --- a/webrtc/base/rtccertificate.h +++ b/webrtc/base/rtccertificate.h @@ -11,9 +11,77 @@ #ifndef WEBRTC_BASE_RTCCERTIFICATE_H_ #define WEBRTC_BASE_RTCCERTIFICATE_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/rtccertificate.h" +#include + +#include "webrtc/base/refcount.h" +#include "webrtc/base/scoped_ref_ptr.h" +#include "webrtc/base/sslidentity.h" + +namespace rtc { + +// This class contains PEM strings of an RTCCertificate's private key and +// certificate and acts as a text representation of RTCCertificate. Certificates +// can be serialized and deserialized to and from this format, which allows for +// cloning and storing of certificates to disk. The PEM format is that of +// |SSLIdentity::PrivateKeyToPEMString| and |SSLCertificate::ToPEMString|, e.g. +// the string representations used by OpenSSL. +class RTCCertificatePEM { + public: + RTCCertificatePEM( + const std::string& private_key, + const std::string& certificate) + : private_key_(private_key), + certificate_(certificate) {} + + const std::string& private_key() const { return private_key_; } + const std::string& certificate() const { return certificate_; } + + private: + std::string private_key_; + std::string certificate_; +}; + +// A thin abstraction layer between "lower level crypto stuff" like +// SSLCertificate and WebRTC usage. Takes ownership of some lower level objects, +// reference counting protects these from premature destruction. +class RTCCertificate : public RefCountInterface { + public: + // Takes ownership of |identity|. + static scoped_refptr Create( + std::unique_ptr identity); + + // Returns the expiration time in ms relative to epoch, 1970-01-01T00:00:00Z. + uint64_t Expires() const; + // Checks if the certificate has expired, where |now| is expressed in ms + // relative to epoch, 1970-01-01T00:00:00Z. + bool HasExpired(uint64_t now) const; + const SSLCertificate& ssl_certificate() const; + + // TODO(hbos): If possible, remove once RTCCertificate and its + // ssl_certificate() is used in all relevant places. Should not pass around + // raw SSLIdentity* for the sake of accessing SSLIdentity::certificate(). + // However, some places might need SSLIdentity* for its public/private key... + SSLIdentity* identity() const { return identity_.get(); } + + // To/from PEM, a text representation of the RTCCertificate. + RTCCertificatePEM ToPEM() const; + // Can return nullptr if the certificate is invalid. + static scoped_refptr FromPEM(const RTCCertificatePEM& pem); + bool operator==(const RTCCertificate& certificate) const; + bool operator!=(const RTCCertificate& certificate) const; + + protected: + explicit RTCCertificate(SSLIdentity* identity); + ~RTCCertificate() override; + + private: + // The SSLIdentity is the owner of the SSLCertificate. To protect our + // ssl_certificate() we take ownership of |identity_|. + std::unique_ptr identity_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_RTCCERTIFICATE_H_ diff --git a/webrtc/rtc_base/rtccertificate_unittest.cc b/webrtc/base/rtccertificate_unittest.cc similarity index 100% rename from webrtc/rtc_base/rtccertificate_unittest.cc rename to webrtc/base/rtccertificate_unittest.cc diff --git a/webrtc/rtc_base/rtccertificategenerator.cc b/webrtc/base/rtccertificategenerator.cc similarity index 100% rename from webrtc/rtc_base/rtccertificategenerator.cc rename to webrtc/base/rtccertificategenerator.cc diff --git a/webrtc/base/rtccertificategenerator.h b/webrtc/base/rtccertificategenerator.h index fac1cec9ef..c131d695fd 100644 --- a/webrtc/base/rtccertificategenerator.h +++ b/webrtc/base/rtccertificategenerator.h @@ -11,9 +11,76 @@ #ifndef WEBRTC_BASE_RTCCERTIFICATEGENERATOR_H_ #define WEBRTC_BASE_RTCCERTIFICATEGENERATOR_H_ +#include "webrtc/base/optional.h" +#include "webrtc/base/refcount.h" +#include "webrtc/base/rtccertificate.h" +#include "webrtc/base/scoped_ref_ptr.h" +#include "webrtc/base/sslidentity.h" +#include "webrtc/base/thread.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/rtccertificategenerator.h" +namespace rtc { + +// See |RTCCertificateGeneratorInterface::GenerateCertificateAsync|. +class RTCCertificateGeneratorCallback : public RefCountInterface { + public: + virtual void OnSuccess( + const scoped_refptr& certificate) = 0; + virtual void OnFailure() = 0; + + protected: + ~RTCCertificateGeneratorCallback() override {} +}; + +// Generates |RTCCertificate|s. +// See |RTCCertificateGenerator| for the WebRTC repo's implementation. +class RTCCertificateGeneratorInterface { + public: + virtual ~RTCCertificateGeneratorInterface() {} + + // Generates a certificate asynchronously on the worker thread. + // Must be called on the signaling thread. The |callback| is invoked with the + // result on the signaling thread. |exipres_ms| optionally specifies for how + // long we want the certificate to be valid, but the implementation may choose + // its own restrictions on the expiration time. + virtual void GenerateCertificateAsync( + const KeyParams& key_params, + const Optional& expires_ms, + const scoped_refptr& callback) = 0; +}; + +// Standard implementation of |RTCCertificateGeneratorInterface|. +// The static function |GenerateCertificate| generates a certificate on the +// current thread. The |RTCCertificateGenerator| instance generates certificates +// asynchronously on the worker thread with |GenerateCertificateAsync|. +class RTCCertificateGenerator : public RTCCertificateGeneratorInterface { + public: + // Generates a certificate on the current thread. Returns null on failure. + // If |expires_ms| is specified, the certificate will expire in approximately + // that many milliseconds from now. |expires_ms| is limited to a year, a + // larger value than that is clamped down to a year. If |expires_ms| is not + // specified, a default expiration time is used. + static scoped_refptr GenerateCertificate( + const KeyParams& key_params, + const Optional& expires_ms); + + RTCCertificateGenerator(Thread* signaling_thread, Thread* worker_thread); + ~RTCCertificateGenerator() override {} + + // |RTCCertificateGeneratorInterface| overrides. + // If |expires_ms| is specified, the certificate will expire in approximately + // that many milliseconds from now. |expires_ms| is limited to a year, a + // larger value than that is clamped down to a year. If |expires_ms| is not + // specified, a default expiration time is used. + void GenerateCertificateAsync( + const KeyParams& key_params, + const Optional& expires_ms, + const scoped_refptr& callback) override; + + private: + Thread* const signaling_thread_; + Thread* const worker_thread_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_RTCCERTIFICATEGENERATOR_H_ diff --git a/webrtc/rtc_base/rtccertificategenerator_unittest.cc b/webrtc/base/rtccertificategenerator_unittest.cc similarity index 100% rename from webrtc/rtc_base/rtccertificategenerator_unittest.cc rename to webrtc/base/rtccertificategenerator_unittest.cc diff --git a/webrtc/base/safe_compare.h b/webrtc/base/safe_compare.h index acdd9cebd7..a57f08293a 100644 --- a/webrtc/base/safe_compare.h +++ b/webrtc/base/safe_compare.h @@ -31,9 +31,146 @@ #ifndef WEBRTC_BASE_SAFE_COMPARE_H_ #define WEBRTC_BASE_SAFE_COMPARE_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/safe_compare.h" +#include +#include + +#include "webrtc/base/type_traits.h" + +namespace rtc { + +namespace safe_cmp_impl { + +template +struct LargerIntImpl : std::false_type {}; +template <> +struct LargerIntImpl : std::true_type { + using type = int16_t; +}; +template <> +struct LargerIntImpl : std::true_type { + using type = int32_t; +}; +template <> +struct LargerIntImpl : std::true_type { + using type = int64_t; +}; + +// LargerInt::value is true iff there's a signed type that's larger +// than T1 (and no larger than the larger of T2 and int*, for performance +// reasons); and if there is such a type, LargerInt::type is an alias +// for it. +template +struct LargerInt + : LargerIntImpl {}; + +template +constexpr typename std::make_unsigned::type MakeUnsigned(T a) { + return static_cast::type>(a); +} + +// Overload for when both T1 and T2 have the same signedness. +template ::value == + std::is_signed::value>::type* = nullptr> +constexpr bool Cmp(T1 a, T2 b) { + return Op::Op(a, b); +} + +// Overload for signed - unsigned comparison that can be promoted to a bigger +// signed type. +template ::value && + std::is_unsigned::value && + LargerInt::value>::type* = nullptr> +constexpr bool Cmp(T1 a, T2 b) { + return Op::Op(a, static_cast::type>(b)); +} + +// Overload for unsigned - signed comparison that can be promoted to a bigger +// signed type. +template ::value && + std::is_signed::value && + LargerInt::value>::type* = nullptr> +constexpr bool Cmp(T1 a, T2 b) { + return Op::Op(static_cast::type>(a), b); +} + +// Overload for signed - unsigned comparison that can't be promoted to a bigger +// signed type. +template ::value && + std::is_unsigned::value && + !LargerInt::value>::type* = nullptr> +constexpr bool Cmp(T1 a, T2 b) { + return a < 0 ? Op::Op(-1, 0) : Op::Op(safe_cmp_impl::MakeUnsigned(a), b); +} + +// Overload for unsigned - signed comparison that can't be promoted to a bigger +// signed type. +template ::value && + std::is_signed::value && + !LargerInt::value>::type* = nullptr> +constexpr bool Cmp(T1 a, T2 b) { + return b < 0 ? Op::Op(0, -1) : Op::Op(a, safe_cmp_impl::MakeUnsigned(b)); +} + +#define RTC_SAFECMP_MAKE_OP(name, op) \ + struct name { \ + template \ + static constexpr bool Op(T1 a, T2 b) { \ + return a op b; \ + } \ + }; +RTC_SAFECMP_MAKE_OP(EqOp, ==) +RTC_SAFECMP_MAKE_OP(NeOp, !=) +RTC_SAFECMP_MAKE_OP(LtOp, <) +RTC_SAFECMP_MAKE_OP(LeOp, <=) +RTC_SAFECMP_MAKE_OP(GtOp, >) +RTC_SAFECMP_MAKE_OP(GeOp, >=) +#undef RTC_SAFECMP_MAKE_OP + +} // namespace safe_cmp_impl + +#define RTC_SAFECMP_MAKE_FUN(name) \ + template \ + constexpr \ + typename std::enable_if::value && IsIntlike::value, \ + bool>::type Safe##name(T1 a, T2 b) { \ + /* Unary plus here turns enums into real integral types. */ \ + return safe_cmp_impl::Cmp(+a, +b); \ + } \ + template \ + constexpr \ + typename std::enable_if::value || !IsIntlike::value, \ + bool>::type Safe##name(const T1& a, \ + const T2& b) { \ + return safe_cmp_impl::name##Op::Op(a, b); \ + } +RTC_SAFECMP_MAKE_FUN(Eq) +RTC_SAFECMP_MAKE_FUN(Ne) +RTC_SAFECMP_MAKE_FUN(Lt) +RTC_SAFECMP_MAKE_FUN(Le) +RTC_SAFECMP_MAKE_FUN(Gt) +RTC_SAFECMP_MAKE_FUN(Ge) +#undef RTC_SAFECMP_MAKE_FUN + +} // namespace rtc #endif // WEBRTC_BASE_SAFE_COMPARE_H_ diff --git a/webrtc/rtc_base/safe_compare_unittest.cc b/webrtc/base/safe_compare_unittest.cc similarity index 100% rename from webrtc/rtc_base/safe_compare_unittest.cc rename to webrtc/base/safe_compare_unittest.cc diff --git a/webrtc/base/safe_conversions.h b/webrtc/base/safe_conversions.h index ac0bb651f3..ff9cc44bc2 100644 --- a/webrtc/base/safe_conversions.h +++ b/webrtc/base/safe_conversions.h @@ -13,9 +13,64 @@ #ifndef WEBRTC_BASE_SAFE_CONVERSIONS_H_ #define WEBRTC_BASE_SAFE_CONVERSIONS_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/safe_conversions.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/safe_conversions_impl.h" + +namespace rtc { + +// Convenience function that returns true if the supplied value is in range +// for the destination type. +template +inline bool IsValueInRangeForNumericType(Src value) { + return internal::RangeCheck(value) == internal::TYPE_VALID; +} + +// checked_cast<> and dchecked_cast<> are analogous to static_cast<> for +// numeric types, except that they [D]CHECK that the specified numeric +// conversion will not overflow or underflow. NaN source will always trigger +// the [D]CHECK. +template +inline Dst checked_cast(Src value) { + RTC_CHECK(IsValueInRangeForNumericType(value)); + return static_cast(value); +} +template +inline Dst dchecked_cast(Src value) { + RTC_DCHECK(IsValueInRangeForNumericType(value)); + return static_cast(value); +} + +// saturated_cast<> is analogous to static_cast<> for numeric types, except +// that the specified numeric conversion will saturate rather than overflow or +// underflow. NaN assignment to an integral will trigger a RTC_CHECK condition. +template +inline Dst saturated_cast(Src value) { + // Optimization for floating point values, which already saturate. + if (std::numeric_limits::is_iec559) + return static_cast(value); + + switch (internal::RangeCheck(value)) { + case internal::TYPE_VALID: + return static_cast(value); + + case internal::TYPE_UNDERFLOW: + return std::numeric_limits::min(); + + case internal::TYPE_OVERFLOW: + return std::numeric_limits::max(); + + // Should fail only on attempting to assign NaN to a saturated integer. + case internal::TYPE_INVALID: + FATAL(); + return std::numeric_limits::max(); + } + + FATAL(); + return static_cast(value); +} + +} // namespace rtc #endif // WEBRTC_BASE_SAFE_CONVERSIONS_H_ diff --git a/webrtc/base/safe_conversions_impl.h b/webrtc/base/safe_conversions_impl.h index 497e156dbb..52e52eff82 100644 --- a/webrtc/base/safe_conversions_impl.h +++ b/webrtc/base/safe_conversions_impl.h @@ -13,9 +13,176 @@ #ifndef WEBRTC_BASE_SAFE_CONVERSIONS_IMPL_H_ #define WEBRTC_BASE_SAFE_CONVERSIONS_IMPL_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/safe_conversions_impl.h" +namespace rtc { +namespace internal { + +enum DstSign { + DST_UNSIGNED, + DST_SIGNED +}; + +enum SrcSign { + SRC_UNSIGNED, + SRC_SIGNED +}; + +enum DstRange { + OVERLAPS_RANGE, + CONTAINS_RANGE +}; + +// Helper templates to statically determine if our destination type can contain +// all values represented by the source type. + +template ::is_signed ? + DST_SIGNED : DST_UNSIGNED, + SrcSign IsSrcSigned = std::numeric_limits::is_signed ? + SRC_SIGNED : SRC_UNSIGNED> +struct StaticRangeCheck {}; + +template +struct StaticRangeCheck { + typedef std::numeric_limits DstLimits; + typedef std::numeric_limits SrcLimits; + // Compare based on max_exponent, which we must compute for integrals. + static const size_t kDstMaxExponent = DstLimits::is_iec559 ? + DstLimits::max_exponent : + (sizeof(Dst) * 8 - 1); + static const size_t kSrcMaxExponent = SrcLimits::is_iec559 ? + SrcLimits::max_exponent : + (sizeof(Src) * 8 - 1); + static const DstRange value = kDstMaxExponent >= kSrcMaxExponent ? + CONTAINS_RANGE : OVERLAPS_RANGE; +}; + +template +struct StaticRangeCheck { + static const DstRange value = sizeof(Dst) >= sizeof(Src) ? + CONTAINS_RANGE : OVERLAPS_RANGE; +}; + +template +struct StaticRangeCheck { + typedef std::numeric_limits DstLimits; + typedef std::numeric_limits SrcLimits; + // Compare based on max_exponent, which we must compute for integrals. + static const size_t kDstMaxExponent = DstLimits::is_iec559 ? + DstLimits::max_exponent : + (sizeof(Dst) * 8 - 1); + static const size_t kSrcMaxExponent = sizeof(Src) * 8; + static const DstRange value = kDstMaxExponent >= kSrcMaxExponent ? + CONTAINS_RANGE : OVERLAPS_RANGE; +}; + +template +struct StaticRangeCheck { + static const DstRange value = OVERLAPS_RANGE; +}; + + +enum RangeCheckResult { + TYPE_VALID = 0, // Value can be represented by the destination type. + TYPE_UNDERFLOW = 1, // Value would overflow. + TYPE_OVERFLOW = 2, // Value would underflow. + TYPE_INVALID = 3 // Source value is invalid (i.e. NaN). +}; + +// This macro creates a RangeCheckResult from an upper and lower bound +// check by taking advantage of the fact that only NaN can be out of range in +// both directions at once. +#define BASE_NUMERIC_RANGE_CHECK_RESULT(is_in_upper_bound, is_in_lower_bound) \ + RangeCheckResult(((is_in_upper_bound) ? 0 : TYPE_OVERFLOW) | \ + ((is_in_lower_bound) ? 0 : TYPE_UNDERFLOW)) + +template ::is_signed ? + DST_SIGNED : DST_UNSIGNED, + SrcSign IsSrcSigned = std::numeric_limits::is_signed ? + SRC_SIGNED : SRC_UNSIGNED, + DstRange IsSrcRangeContained = StaticRangeCheck::value> +struct RangeCheckImpl {}; + +// The following templates are for ranges that must be verified at runtime. We +// split it into checks based on signedness to avoid confusing casts and +// compiler warnings on signed an unsigned comparisons. + +// Dst range always contains the result: nothing to check. +template +struct RangeCheckImpl { + static RangeCheckResult Check(Src value) { + return TYPE_VALID; + } +}; + +// Signed to signed narrowing. +template +struct RangeCheckImpl { + static RangeCheckResult Check(Src value) { + typedef std::numeric_limits DstLimits; + return DstLimits::is_iec559 ? + BASE_NUMERIC_RANGE_CHECK_RESULT( + value <= static_cast(DstLimits::max()), + value >= static_cast(DstLimits::max() * -1)) : + BASE_NUMERIC_RANGE_CHECK_RESULT( + value <= static_cast(DstLimits::max()), + value >= static_cast(DstLimits::min())); + } +}; + +// Unsigned to unsigned narrowing. +template +struct RangeCheckImpl { + static RangeCheckResult Check(Src value) { + typedef std::numeric_limits DstLimits; + return BASE_NUMERIC_RANGE_CHECK_RESULT( + value <= static_cast(DstLimits::max()), true); + } +}; + +// Unsigned to signed. +template +struct RangeCheckImpl { + static RangeCheckResult Check(Src value) { + typedef std::numeric_limits DstLimits; + return sizeof(Dst) > sizeof(Src) ? TYPE_VALID : + BASE_NUMERIC_RANGE_CHECK_RESULT( + value <= static_cast(DstLimits::max()), true); + } +}; + +// Signed to unsigned. +template +struct RangeCheckImpl { + static RangeCheckResult Check(Src value) { + typedef std::numeric_limits DstLimits; + typedef std::numeric_limits SrcLimits; + // Compare based on max_exponent, which we must compute for integrals. + static const size_t kDstMaxExponent = sizeof(Dst) * 8; + static const size_t kSrcMaxExponent = SrcLimits::is_iec559 ? + SrcLimits::max_exponent : + (sizeof(Src) * 8 - 1); + return (kDstMaxExponent >= kSrcMaxExponent) ? + BASE_NUMERIC_RANGE_CHECK_RESULT(true, value >= static_cast(0)) : + BASE_NUMERIC_RANGE_CHECK_RESULT( + value <= static_cast(DstLimits::max()), + value >= static_cast(0)); + } +}; + +template +inline RangeCheckResult RangeCheck(Src value) { + static_assert(std::numeric_limits::is_specialized, + "argument must be numeric"); + static_assert(std::numeric_limits::is_specialized, + "result must be numeric"); + return RangeCheckImpl::Check(value); +} + +} // namespace internal +} // namespace rtc #endif // WEBRTC_BASE_SAFE_CONVERSIONS_IMPL_H_ diff --git a/webrtc/base/safe_minmax.h b/webrtc/base/safe_minmax.h index 54d99b720b..bf1cf43b0c 100644 --- a/webrtc/base/safe_minmax.h +++ b/webrtc/base/safe_minmax.h @@ -8,11 +8,328 @@ * be found in the AUTHORS file in the root of the source tree. */ +// Minimum and maximum +// =================== +// +// rtc::SafeMin(x, y) +// rtc::SafeMax(x, y) +// +// (These are both constexpr.) +// +// Accept two arguments of either any two integral or any two floating-point +// types, and return the smaller and larger value, respectively, with no +// truncation or wrap-around. If only one of the input types is statically +// guaranteed to be able to represent the result, the return type is that type; +// if either one would do, the result type is the smaller type. (One of these +// two cases always applies.) +// +// * The case with one floating-point and one integral type is not allowed, +// because the floating-point type will have greater range, but may not +// have sufficient precision to represent the integer value exactly.) +// +// Clamp (a.k.a. constrain to a given interval) +// ============================================ +// +// rtc::SafeClamp(x, a, b) +// +// Accepts three arguments of any mix of integral types or any mix of +// floating-point types, and returns the value in the closed interval [a, b] +// that is closest to x (that is, if x < a it returns a; if x > b it returns b; +// and if a <= x <= b it returns x). As for SafeMin() and SafeMax(), there is +// no truncation or wrap-around. The result type +// +// 1. is statically guaranteed to be able to represent the result; +// +// 2. is no larger than the largest of the three argument types; and +// +// 3. has the same signedness as the type of the third argument, if this is +// possible without violating the First or Second Law. +// +// There is always at least one type that meets criteria 1 and 2. If more than +// one type meets these criteria equally well, the result type is one of the +// types that is smallest. Note that unlike SafeMin() and SafeMax(), +// SafeClamp() will sometimes pick a return type that isn't the type of any of +// its arguments. +// +// * In this context, a type A is smaller than a type B if it has a smaller +// range; that is, if A::max() - A::min() < B::max() - B::min(). For +// example, int8_t < int16_t == uint16_t < int32_t, and all integral types +// are smaller than all floating-point types.) +// +// * As for SafeMin and SafeMax, mixing integer and floating-point arguments +// is not allowed, because floating-point types have greater range than +// integer types, but do not have sufficient precision to represent the +// values of most integer types exactly. +// +// Requesting a specific return type +// ================================= +// +// All three functions allow callers to explicitly specify the return type as a +// template parameter, overriding the default return type. E.g. +// +// rtc::SafeMin(x, y) // returns an int +// +// If the requested type is statically guaranteed to be able to represent the +// result, then everything's fine, and the return type is as requested. But if +// the requested type is too small, a static_assert is triggered. + #ifndef WEBRTC_BASE_SAFE_MINMAX_H_ #define WEBRTC_BASE_SAFE_MINMAX_H_ -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/safe_minmax.h" +#include +#include + +#include "webrtc/base/checks.h" +#include "webrtc/base/safe_compare.h" +#include "webrtc/base/type_traits.h" + +namespace rtc { + +namespace safe_minmax_impl { + +// Make the range of a type available via something other than a constexpr +// function, to work around MSVC limitations. See +// https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expression-sfinae-in-vs-2015-update-1/ +template +struct Limits { + static constexpr T lowest = std::numeric_limits::lowest(); + static constexpr T max = std::numeric_limits::max(); +}; + +template ::value> +struct UnderlyingType; + +template +struct UnderlyingType { + using type = T; +}; + +template +struct UnderlyingType { + using type = typename std::underlying_type::type; +}; + +// Given two types T1 and T2, find types that can hold the smallest (in +// ::min_t) and the largest (in ::max_t) of the two values. +template ::value, + bool int2 = IsIntlike::value> +struct MType { + static_assert(int1 == int2, + "You may not mix integral and floating-point arguments"); +}; + +// Specialization for when neither type is integral (and therefore presumably +// floating-point). +template +struct MType { + using min_t = typename std::common_type::type; + static_assert(std::is_same::value || + std::is_same::value, + ""); + + using max_t = typename std::common_type::type; + static_assert(std::is_same::value || + std::is_same::value, + ""); +}; + +// Specialization for when both types are integral. +template +struct MType { + // The type with the lowest minimum value. In case of a tie, the type with + // the lowest maximum value. In case that too is a tie, the types have the + // same range, and we arbitrarily pick T1. + using min_t = typename std::conditional< + SafeLt(Limits::lowest, Limits::lowest), + T1, + typename std::conditional< + SafeGt(Limits::lowest, Limits::lowest), + T2, + typename std::conditional::max, Limits::max), + T1, + T2>::type>::type>::type; + static_assert(std::is_same::value || + std::is_same::value, + ""); + + // The type with the highest maximum value. In case of a tie, the types have + // the same range (because in C++, integer types with the same maximum also + // have the same minimum). + static_assert(SafeNe(Limits::max, Limits::max) || + SafeEq(Limits::lowest, Limits::lowest), + "integer types with the same max should have the same min"); + using max_t = typename std:: + conditional::max, Limits::max), T1, T2>::type; + static_assert(std::is_same::value || + std::is_same::value, + ""); +}; + +// A dummy type that we pass around at compile time but never actually use. +// Declared but not defined. +struct DefaultType; + +// ::type is A, except we fall back to B if A is DefaultType. We static_assert +// that the chosen type can hold all values that B can hold. +template +struct TypeOr { + using type = typename std:: + conditional::value, B, A>::type; + static_assert(SafeLe(Limits::lowest, Limits::lowest) && + SafeGe(Limits::max, Limits::max), + "The specified type isn't large enough"); + static_assert(IsIntlike::value == IsIntlike::value && + std::is_floating_point::value == + std::is_floating_point::value, + "float<->int conversions not allowed"); +}; + +} // namespace safe_minmax_impl + +template < + typename R = safe_minmax_impl::DefaultType, + typename T1 = safe_minmax_impl::DefaultType, + typename T2 = safe_minmax_impl::DefaultType, + typename R2 = typename safe_minmax_impl::TypeOr< + R, + typename safe_minmax_impl::MType< + typename safe_minmax_impl::UnderlyingType::type, + typename safe_minmax_impl::UnderlyingType::type>::min_t>::type> +constexpr R2 SafeMin(T1 a, T2 b) { + static_assert(IsIntlike::value || std::is_floating_point::value, + "The first argument must be integral or floating-point"); + static_assert(IsIntlike::value || std::is_floating_point::value, + "The second argument must be integral or floating-point"); + return SafeLt(a, b) ? static_cast(a) : static_cast(b); +} + +template < + typename R = safe_minmax_impl::DefaultType, + typename T1 = safe_minmax_impl::DefaultType, + typename T2 = safe_minmax_impl::DefaultType, + typename R2 = typename safe_minmax_impl::TypeOr< + R, + typename safe_minmax_impl::MType< + typename safe_minmax_impl::UnderlyingType::type, + typename safe_minmax_impl::UnderlyingType::type>::max_t>::type> +constexpr R2 SafeMax(T1 a, T2 b) { + static_assert(IsIntlike::value || std::is_floating_point::value, + "The first argument must be integral or floating-point"); + static_assert(IsIntlike::value || std::is_floating_point::value, + "The second argument must be integral or floating-point"); + return SafeGt(a, b) ? static_cast(a) : static_cast(b); +} + +namespace safe_minmax_impl { + +// Given three types T, L, and H, let ::type be a suitable return value for +// SafeClamp(T, L, H). See the docs at the top of this file for details. +template ::value, + bool int2 = IsIntlike::value, + bool int3 = IsIntlike::value> +struct ClampType { + static_assert(int1 == int2 && int1 == int3, + "You may not mix integral and floating-point arguments"); +}; + +// Specialization for when all three types are floating-point. +template +struct ClampType { + using type = typename std::common_type::type; +}; + +// Specialization for when all three types are integral. +template +struct ClampType { + private: + // Range of the return value. The return type must be able to represent this + // full range. + static constexpr auto r_min = + SafeMax(Limits::lowest, SafeMin(Limits::lowest, Limits::lowest)); + static constexpr auto r_max = + SafeMin(Limits::max, SafeMax(Limits::max, Limits::max)); + + // Is the given type an acceptable return type? (That is, can it represent + // all possible return values, and is it no larger than the largest of the + // input types?) + template + struct AcceptableType { + private: + static constexpr bool not_too_large = sizeof(A) <= sizeof(L) || + sizeof(A) <= sizeof(H) || + sizeof(A) <= sizeof(T); + static constexpr bool range_contained = + SafeLe(Limits::lowest, r_min) && SafeLe(r_max, Limits::max); + + public: + static constexpr bool value = not_too_large && range_contained; + }; + + using best_signed_type = typename std::conditional< + AcceptableType::value, + int8_t, + typename std::conditional< + AcceptableType::value, + int16_t, + typename std::conditional::value, + int32_t, + int64_t>::type>::type>::type; + + using best_unsigned_type = typename std::conditional< + AcceptableType::value, + uint8_t, + typename std::conditional< + AcceptableType::value, + uint16_t, + typename std::conditional::value, + uint32_t, + uint64_t>::type>::type>::type; + + public: + // Pick the best type, preferring the same signedness as T but falling back + // to the other one if necessary. + using type = typename std::conditional< + std::is_signed::value, + typename std::conditional::value, + best_signed_type, + best_unsigned_type>::type, + typename std::conditional::value, + best_unsigned_type, + best_signed_type>::type>::type; + static_assert(AcceptableType::value, ""); +}; + +} // namespace safe_minmax_impl + +template < + typename R = safe_minmax_impl::DefaultType, + typename T = safe_minmax_impl::DefaultType, + typename L = safe_minmax_impl::DefaultType, + typename H = safe_minmax_impl::DefaultType, + typename R2 = typename safe_minmax_impl::TypeOr< + R, + typename safe_minmax_impl::ClampType< + typename safe_minmax_impl::UnderlyingType::type, + typename safe_minmax_impl::UnderlyingType::type, + typename safe_minmax_impl::UnderlyingType::type>::type>::type> +R2 SafeClamp(T x, L min, H max) { + static_assert(IsIntlike::value || std::is_floating_point::value, + "The first argument must be integral or floating-point"); + static_assert(IsIntlike::value || std::is_floating_point::value, + "The second argument must be integral or floating-point"); + static_assert(IsIntlike::value || std::is_floating_point::value, + "The third argument must be integral or floating-point"); + RTC_DCHECK_LE(min, max); + return SafeLe(x, min) + ? static_cast(min) + : SafeGe(x, max) ? static_cast(max) : static_cast(x); +} + +} // namespace rtc #endif // WEBRTC_BASE_SAFE_MINMAX_H_ diff --git a/webrtc/rtc_base/safe_minmax_unittest.cc b/webrtc/base/safe_minmax_unittest.cc similarity index 100% rename from webrtc/rtc_base/safe_minmax_unittest.cc rename to webrtc/base/safe_minmax_unittest.cc diff --git a/webrtc/base/sanitizer.h b/webrtc/base/sanitizer.h index 56a5e103f7..e27a692164 100644 --- a/webrtc/base/sanitizer.h +++ b/webrtc/base/sanitizer.h @@ -11,9 +11,106 @@ #ifndef WEBRTC_BASE_SANITIZER_H_ #define WEBRTC_BASE_SANITIZER_H_ +#if defined(__has_feature) +#if __has_feature(address_sanitizer) +#define RTC_HAS_ASAN 1 +#endif +#if __has_feature(memory_sanitizer) +#define RTC_HAS_MSAN 1 +#endif +#endif +#ifndef RTC_HAS_ASAN +#define RTC_HAS_ASAN 0 +#endif +#ifndef RTC_HAS_MSAN +#define RTC_HAS_MSAN 0 +#endif -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/sanitizer.h" +#if RTC_HAS_ASAN +#include +#endif +#if RTC_HAS_MSAN +#include +#endif + +#ifdef __has_attribute +#if __has_attribute(no_sanitize) +#define RTC_NO_SANITIZE(what) __attribute__((no_sanitize(what))) +#endif +#endif +#ifndef RTC_NO_SANITIZE +#define RTC_NO_SANITIZE(what) +#endif + +// Ask ASan to mark the memory range [ptr, ptr + element_size * num_elements) +// as being unaddressable, so that reads and writes are not allowed. ASan may +// narrow the range to the nearest alignment boundaries. +static inline void rtc_AsanPoison(const volatile void* ptr, + size_t element_size, + size_t num_elements) { +#if RTC_HAS_ASAN + ASAN_POISON_MEMORY_REGION(ptr, element_size * num_elements); +#endif +} + +// Ask ASan to mark the memory range [ptr, ptr + element_size * num_elements) +// as being addressable, so that reads and writes are allowed. ASan may widen +// the range to the nearest alignment boundaries. +static inline void rtc_AsanUnpoison(const volatile void* ptr, + size_t element_size, + size_t num_elements) { +#if RTC_HAS_ASAN + ASAN_UNPOISON_MEMORY_REGION(ptr, element_size * num_elements); +#endif +} + +// Ask MSan to mark the memory range [ptr, ptr + element_size * num_elements) +// as being uninitialized. +static inline void rtc_MsanMarkUninitialized(const volatile void* ptr, + size_t element_size, + size_t num_elements) { +#if RTC_HAS_MSAN + __msan_poison(ptr, element_size * num_elements); +#endif +} + +// Force an MSan check (if any bits in the memory range [ptr, ptr + +// element_size * num_elements) are uninitialized the call will crash with an +// MSan report). +static inline void rtc_MsanCheckInitialized(const volatile void* ptr, + size_t element_size, + size_t num_elements) { +#if RTC_HAS_MSAN + __msan_check_mem_is_initialized(ptr, element_size * num_elements); +#endif +} + +#ifdef __cplusplus + +namespace rtc { + +template +inline void AsanPoison(const T& mem) { + rtc_AsanPoison(mem.data(), sizeof(mem.data()[0]), mem.size()); +} + +template +inline void AsanUnpoison(const T& mem) { + rtc_AsanUnpoison(mem.data(), sizeof(mem.data()[0]), mem.size()); +} + +template +inline void MsanMarkUninitialized(const T& mem) { + rtc_MsanMarkUninitialized(mem.data(), sizeof(mem.data()[0]), mem.size()); +} + +template +inline void MsanCheckInitialized(const T& mem) { + rtc_MsanCheckInitialized(mem.data(), sizeof(mem.data()[0]), mem.size()); +} + +} // namespace rtc + +#endif // __cplusplus #endif // WEBRTC_BASE_SANITIZER_H_ diff --git a/webrtc/base/scoped_ref_ptr.h b/webrtc/base/scoped_ref_ptr.h index 259956292f..26aff03504 100644 --- a/webrtc/base/scoped_ref_ptr.h +++ b/webrtc/base/scoped_ref_ptr.h @@ -63,9 +63,101 @@ #ifndef WEBRTC_BASE_SCOPED_REF_PTR_H_ #define WEBRTC_BASE_SCOPED_REF_PTR_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/scoped_ref_ptr.h" +namespace rtc { + +template +class scoped_refptr { + public: + scoped_refptr() : ptr_(nullptr) {} + + scoped_refptr(T* p) : ptr_(p) { + if (ptr_) + ptr_->AddRef(); + } + + scoped_refptr(const scoped_refptr& r) : ptr_(r.ptr_) { + if (ptr_) + ptr_->AddRef(); + } + + template + scoped_refptr(const scoped_refptr& r) : ptr_(r.get()) { + if (ptr_) + ptr_->AddRef(); + } + + // Move constructors. + scoped_refptr(scoped_refptr&& r) : ptr_(r.release()) {} + + template + scoped_refptr(scoped_refptr&& r) : ptr_(r.release()) {} + + ~scoped_refptr() { + if (ptr_) + ptr_->Release(); + } + + T* get() const { return ptr_; } + operator T*() const { return ptr_; } + T* operator->() const { return ptr_; } + + // Release a pointer. + // The return value is the current pointer held by this object. + // If this object holds a null pointer, the return value is null. + // After this operation, this object will hold a null pointer, + // and will not own the object any more. + T* release() { + T* retVal = ptr_; + ptr_ = nullptr; + return retVal; + } + + scoped_refptr& operator=(T* p) { + // AddRef first so that self assignment should work + if (p) + p->AddRef(); + if (ptr_ ) + ptr_ ->Release(); + ptr_ = p; + return *this; + } + + scoped_refptr& operator=(const scoped_refptr& r) { + return *this = r.ptr_; + } + + template + scoped_refptr& operator=(const scoped_refptr& r) { + return *this = r.get(); + } + + scoped_refptr& operator=(scoped_refptr&& r) { + scoped_refptr(std::move(r)).swap(*this); + return *this; + } + + template + scoped_refptr& operator=(scoped_refptr&& r) { + scoped_refptr(std::move(r)).swap(*this); + return *this; + } + + void swap(T** pp) { + T* p = ptr_; + ptr_ = *pp; + *pp = p; + } + + void swap(scoped_refptr& r) { + swap(&r.ptr_); + } + + protected: + T* ptr_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_SCOPED_REF_PTR_H_ diff --git a/webrtc/base/sequenced_task_checker.h b/webrtc/base/sequenced_task_checker.h index e586b8d6da..4df5b5420c 100644 --- a/webrtc/base/sequenced_task_checker.h +++ b/webrtc/base/sequenced_task_checker.h @@ -11,9 +11,68 @@ #ifndef WEBRTC_BASE_SEQUENCED_TASK_CHECKER_H_ #define WEBRTC_BASE_SEQUENCED_TASK_CHECKER_H_ +// Apart from debug builds, we also enable the sequence checker in +// builds with RTC_DCHECK_IS_ON so that trybots and waterfall bots +// with this define will get the same level of checking as debug bots. +#define ENABLE_SEQUENCED_TASK_CHECKER RTC_DCHECK_IS_ON -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/sequenced_task_checker.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/thread_annotations.h" +#include "webrtc/base/sequenced_task_checker_impl.h" +namespace rtc { + +// Do nothing implementation, for use in release mode. +// +// Note: You should almost always use the SequencedTaskChecker class to get the +// right version for your build configuration. +class SequencedTaskCheckerDoNothing { + public: + bool CalledSequentially() const { return true; } + + void Detach() {} +}; + +// SequencedTaskChecker is a helper class used to help verify that some methods +// of a class are called on the same task queue or thread. A +// SequencedTaskChecker is bound to a a task queue if the object is +// created on a task queue, or a thread otherwise. +// +// +// Example: +// class MyClass { +// public: +// void Foo() { +// RTC_DCHECK(sequence_checker_.CalledSequentially()); +// ... (do stuff) ... +// } +// +// private: +// SequencedTaskChecker sequence_checker_; +// } +// +// In Release mode, CalledOnValidThread will always return true. +#if ENABLE_SEQUENCED_TASK_CHECKER +class LOCKABLE SequencedTaskChecker : public SequencedTaskCheckerImpl {}; +#else +class LOCKABLE SequencedTaskChecker : public SequencedTaskCheckerDoNothing {}; +#endif // ENABLE_SEQUENCED_TASK_CHECKER_H_ + +namespace internal { +class SCOPED_LOCKABLE SequencedTaskCheckerScope { + public: + explicit SequencedTaskCheckerScope(const SequencedTaskChecker* checker) + EXCLUSIVE_LOCK_FUNCTION(checker); + ~SequencedTaskCheckerScope() UNLOCK_FUNCTION(); +}; + +} // namespace internal + +#define RTC_DCHECK_CALLED_SEQUENTIALLY(x) \ + rtc::internal::SequencedTaskCheckerScope checker(x) + +#undef ENABLE_SEQUENCED_TASK_CHECKER + +} // namespace rtc #endif // WEBRTC_BASE_SEQUENCED_TASK_CHECKER_H_ diff --git a/webrtc/rtc_base/sequenced_task_checker_impl.cc b/webrtc/base/sequenced_task_checker_impl.cc similarity index 100% rename from webrtc/rtc_base/sequenced_task_checker_impl.cc rename to webrtc/base/sequenced_task_checker_impl.cc diff --git a/webrtc/base/sequenced_task_checker_impl.h b/webrtc/base/sequenced_task_checker_impl.h index 4972539e66..684b1dc502 100644 --- a/webrtc/base/sequenced_task_checker_impl.h +++ b/webrtc/base/sequenced_task_checker_impl.h @@ -11,9 +11,35 @@ #ifndef WEBRTC_BASE_SEQUENCED_TASK_CHECKER_IMPL_H_ #define WEBRTC_BASE_SEQUENCED_TASK_CHECKER_IMPL_H_ +#include "webrtc/base/thread_checker.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/sequenced_task_checker_impl.h" +namespace rtc { +class TaskQueue; +// Real implementation of SequencedTaskChecker, for use in debug mode, or +// for temporary use in release mode. +// +// Note: You should almost always use the SequencedTaskChecker class to get the +// right version for your build configuration. +class SequencedTaskCheckerImpl { + public: + SequencedTaskCheckerImpl(); + ~SequencedTaskCheckerImpl(); + + bool CalledSequentially() const; + + // Changes the task queue or thread that is checked for in IsCurrent. This + // may be useful when an object may be created on one task queue / thread and + // then used exclusively on another thread. + void Detach(); + + private: + typedef const void* QueueId; + CriticalSection lock_; + ThreadChecker thread_checker_; + mutable bool attached_; + mutable QueueId valid_queue_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_SEQUENCED_TASK_CHECKER_IMPL_H_ diff --git a/webrtc/rtc_base/sequenced_task_checker_unittest.cc b/webrtc/base/sequenced_task_checker_unittest.cc similarity index 100% rename from webrtc/rtc_base/sequenced_task_checker_unittest.cc rename to webrtc/base/sequenced_task_checker_unittest.cc diff --git a/webrtc/rtc_base/sha1.cc b/webrtc/base/sha1.cc similarity index 100% rename from webrtc/rtc_base/sha1.cc rename to webrtc/base/sha1.cc diff --git a/webrtc/base/sha1.h b/webrtc/base/sha1.h index fde3e598c3..aa5a6a5506 100644 --- a/webrtc/base/sha1.h +++ b/webrtc/base/sha1.h @@ -10,9 +10,24 @@ #ifndef WEBRTC_BASE_SHA1_H_ #define WEBRTC_BASE_SHA1_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/sha1.h" +namespace rtc { + +struct SHA1_CTX { + uint32_t state[5]; + // TODO: Change bit count to uint64_t. + uint32_t count[2]; // Bit count of input. + uint8_t buffer[64]; +}; + +#define SHA1_DIGEST_SIZE 20 + +void SHA1Init(SHA1_CTX* context); +void SHA1Update(SHA1_CTX* context, const uint8_t* data, size_t len); +void SHA1Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]); #endif // WEBRTC_BASE_SHA1_H_ + +} // namespace rtc diff --git a/webrtc/rtc_base/sha1digest.cc b/webrtc/base/sha1digest.cc similarity index 100% rename from webrtc/rtc_base/sha1digest.cc rename to webrtc/base/sha1digest.cc diff --git a/webrtc/base/sha1digest.h b/webrtc/base/sha1digest.h index e3b4ef840b..d321cb8a12 100644 --- a/webrtc/base/sha1digest.h +++ b/webrtc/base/sha1digest.h @@ -11,9 +11,26 @@ #ifndef WEBRTC_BASE_SHA1DIGEST_H_ #define WEBRTC_BASE_SHA1DIGEST_H_ +#include "webrtc/base/messagedigest.h" +#include "webrtc/base/sha1.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/sha1digest.h" +namespace rtc { + +// A simple wrapper for our SHA-1 implementation. +class Sha1Digest : public MessageDigest { + public: + enum { kSize = SHA1_DIGEST_SIZE }; + Sha1Digest() { + SHA1Init(&ctx_); + } + size_t Size() const override; + void Update(const void* buf, size_t len) override; + size_t Finish(void* buf, size_t len) override; + + private: + SHA1_CTX ctx_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_SHA1DIGEST_H_ diff --git a/webrtc/rtc_base/sha1digest_unittest.cc b/webrtc/base/sha1digest_unittest.cc similarity index 100% rename from webrtc/rtc_base/sha1digest_unittest.cc rename to webrtc/base/sha1digest_unittest.cc diff --git a/webrtc/rtc_base/signalthread.cc b/webrtc/base/signalthread.cc similarity index 100% rename from webrtc/rtc_base/signalthread.cc rename to webrtc/base/signalthread.cc diff --git a/webrtc/base/signalthread.h b/webrtc/base/signalthread.h index f5fcf2c4a1..d42d6efd59 100644 --- a/webrtc/base/signalthread.h +++ b/webrtc/base/signalthread.h @@ -11,9 +11,151 @@ #ifndef WEBRTC_BASE_SIGNALTHREAD_H_ #define WEBRTC_BASE_SIGNALTHREAD_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/signalthread.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/nullsocketserver.h" +#include "webrtc/base/sigslot.h" +#include "webrtc/base/thread.h" + +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// +// SignalThread - Base class for worker threads. The main thread should call +// Start() to begin work, and then follow one of these models: +// Normal: Wait for SignalWorkDone, and then call Release to destroy. +// Cancellation: Call Release(true), to abort the worker thread. +// Fire-and-forget: Call Release(false), which allows the thread to run to +// completion, and then self-destruct without further notification. +// Periodic tasks: Wait for SignalWorkDone, then eventually call Start() +// again to repeat the task. When the instance isn't needed anymore, +// call Release. DoWork, OnWorkStart and OnWorkStop are called again, +// on a new thread. +// The subclass should override DoWork() to perform the background task. By +// periodically calling ContinueWork(), it can check for cancellation. +// OnWorkStart and OnWorkDone can be overridden to do pre- or post-work +// tasks in the context of the main thread. +/////////////////////////////////////////////////////////////////////////////// + +class SignalThread + : public sigslot::has_slots<>, + protected MessageHandler { + public: + explicit SignalThread(bool use_socket_server = true); + + // Context: Main Thread. Call before Start to change the worker's name. + bool SetName(const std::string& name, const void* obj); + + // Context: Main Thread. Call to begin the worker thread. + void Start(); + + // Context: Main Thread. If the worker thread is not running, deletes the + // object immediately. Otherwise, asks the worker thread to abort processing, + // and schedules the object to be deleted once the worker exits. + // SignalWorkDone will not be signalled. If wait is true, does not return + // until the thread is deleted. + void Destroy(bool wait); + + // Context: Main Thread. If the worker thread is complete, deletes the + // object immediately. Otherwise, schedules the object to be deleted once + // the worker thread completes. SignalWorkDone will be signalled. + void Release(); + + // Context: Main Thread. Signalled when work is complete. + sigslot::signal1 SignalWorkDone; + + enum { ST_MSG_WORKER_DONE, ST_MSG_FIRST_AVAILABLE }; + + protected: + ~SignalThread() override; + + Thread* worker() { return &worker_; } + + // Context: Main Thread. Subclass should override to do pre-work setup. + virtual void OnWorkStart() { } + + // Context: Worker Thread. Subclass should override to do work. + virtual void DoWork() = 0; + + // Context: Worker Thread. Subclass should call periodically to + // dispatch messages and determine if the thread should terminate. + bool ContinueWork(); + + // Context: Worker Thread. Subclass should override when extra work is + // needed to abort the worker thread. + virtual void OnWorkStop() { } + + // Context: Main Thread. Subclass should override to do post-work cleanup. + virtual void OnWorkDone() { } + + // Context: Any Thread. If subclass overrides, be sure to call the base + // implementation. Do not use (message_id < ST_MSG_FIRST_AVAILABLE) + void OnMessage(Message* msg) override; + + private: + enum State { + kInit, // Initialized, but not started + kRunning, // Started and doing work + kReleasing, // Same as running, but to be deleted when work is done + kComplete, // Work is done + kStopping, // Work is being interrupted + }; + + class Worker : public Thread { + public: + explicit Worker(SignalThread* parent, bool use_socket_server) + : Thread(use_socket_server + ? SocketServer::CreateDefault() + : std::unique_ptr(new NullSocketServer())), + parent_(parent) {} + ~Worker() override; + void Run() override; + bool IsProcessingMessages() override; + + private: + SignalThread* parent_; + + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Worker); + }; + + class SCOPED_LOCKABLE EnterExit { + public: + explicit EnterExit(SignalThread* t) EXCLUSIVE_LOCK_FUNCTION(t->cs_) + : t_(t) { + t_->cs_.Enter(); + // If refcount_ is zero then the object has already been deleted and we + // will be double-deleting it in ~EnterExit()! (shouldn't happen) + RTC_DCHECK_NE(0, t_->refcount_); + ++t_->refcount_; + } + ~EnterExit() UNLOCK_FUNCTION() { + bool d = (0 == --t_->refcount_); + t_->cs_.Leave(); + if (d) + delete t_; + } + + private: + SignalThread* t_; + + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EnterExit); + }; + + void Run(); + void OnMainThreadDestroyed(); + + Thread* main_; + Worker worker_; + CriticalSection cs_; + State state_; + int refcount_; + + RTC_DISALLOW_COPY_AND_ASSIGN(SignalThread); +}; + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace rtc #endif // WEBRTC_BASE_SIGNALTHREAD_H_ diff --git a/webrtc/rtc_base/signalthread_unittest.cc b/webrtc/base/signalthread_unittest.cc similarity index 100% rename from webrtc/rtc_base/signalthread_unittest.cc rename to webrtc/base/signalthread_unittest.cc diff --git a/webrtc/rtc_base/sigslot.cc b/webrtc/base/sigslot.cc similarity index 100% rename from webrtc/rtc_base/sigslot.cc rename to webrtc/base/sigslot.cc diff --git a/webrtc/base/sigslot.h b/webrtc/base/sigslot.h index 9d31441a49..4649f51613 100644 --- a/webrtc/base/sigslot.h +++ b/webrtc/base/sigslot.h @@ -93,12 +93,555 @@ // If signalx is single threaded the user must ensure that disconnect, connect // or signal is not happening concurrently or data race may occur. -#ifndef WEBRTC_BASE_SIGSLOT_H_ -#define WEBRTC_BASE_SIGSLOT_H_ +#ifndef WEBRTC_BASE_SIGSLOT_H__ +#define WEBRTC_BASE_SIGSLOT_H__ +#include +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/sigslot.h" +// On our copy of sigslot.h, we set single threading as default. +#define SIGSLOT_DEFAULT_MT_POLICY single_threaded -#endif // WEBRTC_BASE_SIGSLOT_H_ +#if defined(SIGSLOT_PURE_ISO) || \ + (!defined(WEBRTC_WIN) && !defined(__GNUG__) && \ + !defined(SIGSLOT_USE_POSIX_THREADS)) +#define _SIGSLOT_SINGLE_THREADED +#elif defined(WEBRTC_WIN) +#define _SIGSLOT_HAS_WIN32_THREADS +#if !defined(WIN32_LEAN_AND_MEAN) +#define WIN32_LEAN_AND_MEAN +#endif +#include "webrtc/base/win32.h" +#elif defined(__GNUG__) || defined(SIGSLOT_USE_POSIX_THREADS) +#define _SIGSLOT_HAS_POSIX_THREADS +#include +#else +#define _SIGSLOT_SINGLE_THREADED +#endif + +#ifndef SIGSLOT_DEFAULT_MT_POLICY +#ifdef _SIGSLOT_SINGLE_THREADED +#define SIGSLOT_DEFAULT_MT_POLICY single_threaded +#else +#define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local +#endif +#endif + +// TODO: change this namespace to rtc? +namespace sigslot { + +class single_threaded { + public: + void lock() {} + void unlock() {} +}; + +#ifdef _SIGSLOT_HAS_WIN32_THREADS +// The multi threading policies only get compiled in if they are enabled. +class multi_threaded_global { + public: + multi_threaded_global() { + static bool isinitialised = false; + + if (!isinitialised) { + InitializeCriticalSection(get_critsec()); + isinitialised = true; + } + } + + void lock() { EnterCriticalSection(get_critsec()); } + + void unlock() { LeaveCriticalSection(get_critsec()); } + + private: + CRITICAL_SECTION* get_critsec() { + static CRITICAL_SECTION g_critsec; + return &g_critsec; + } +}; + +class multi_threaded_local { + public: + multi_threaded_local() { InitializeCriticalSection(&m_critsec); } + + multi_threaded_local(const multi_threaded_local&) { + InitializeCriticalSection(&m_critsec); + } + + ~multi_threaded_local() { DeleteCriticalSection(&m_critsec); } + + void lock() { EnterCriticalSection(&m_critsec); } + + void unlock() { LeaveCriticalSection(&m_critsec); } + + private: + CRITICAL_SECTION m_critsec; +}; +#endif // _SIGSLOT_HAS_WIN32_THREADS + +#ifdef _SIGSLOT_HAS_POSIX_THREADS +// The multi threading policies only get compiled in if they are enabled. +class multi_threaded_global { + public: + void lock() { pthread_mutex_lock(get_mutex()); } + void unlock() { pthread_mutex_unlock(get_mutex()); } + + private: + static pthread_mutex_t* get_mutex(); +}; + +class multi_threaded_local { + public: + multi_threaded_local() { pthread_mutex_init(&m_mutex, nullptr); } + multi_threaded_local(const multi_threaded_local&) { + pthread_mutex_init(&m_mutex, nullptr); + } + ~multi_threaded_local() { pthread_mutex_destroy(&m_mutex); } + void lock() { pthread_mutex_lock(&m_mutex); } + void unlock() { pthread_mutex_unlock(&m_mutex); } + + private: + pthread_mutex_t m_mutex; +}; +#endif // _SIGSLOT_HAS_POSIX_THREADS + +template +class lock_block { + public: + mt_policy* m_mutex; + + lock_block(mt_policy* mtx) : m_mutex(mtx) { m_mutex->lock(); } + + ~lock_block() { m_mutex->unlock(); } +}; + +class _signal_base_interface; + +class has_slots_interface { + private: + typedef void (*signal_connect_t)(has_slots_interface* self, + _signal_base_interface* sender); + typedef void (*signal_disconnect_t)(has_slots_interface* self, + _signal_base_interface* sender); + typedef void (*disconnect_all_t)(has_slots_interface* self); + + const signal_connect_t m_signal_connect; + const signal_disconnect_t m_signal_disconnect; + const disconnect_all_t m_disconnect_all; + + protected: + has_slots_interface(signal_connect_t conn, + signal_disconnect_t disc, + disconnect_all_t disc_all) + : m_signal_connect(conn), + m_signal_disconnect(disc), + m_disconnect_all(disc_all) {} + + // Doesn't really need to be virtual, but is for backwards compatibility + // (it was virtual in a previous version of sigslot). + virtual ~has_slots_interface() {} + + public: + void signal_connect(_signal_base_interface* sender) { + m_signal_connect(this, sender); + } + + void signal_disconnect(_signal_base_interface* sender) { + m_signal_disconnect(this, sender); + } + + void disconnect_all() { m_disconnect_all(this); } +}; + +class _signal_base_interface { + private: + typedef void (*slot_disconnect_t)(_signal_base_interface* self, + has_slots_interface* pslot); + typedef void (*slot_duplicate_t)(_signal_base_interface* self, + const has_slots_interface* poldslot, + has_slots_interface* pnewslot); + + const slot_disconnect_t m_slot_disconnect; + const slot_duplicate_t m_slot_duplicate; + + protected: + _signal_base_interface(slot_disconnect_t disc, slot_duplicate_t dupl) + : m_slot_disconnect(disc), m_slot_duplicate(dupl) {} + + ~_signal_base_interface() {} + + public: + void slot_disconnect(has_slots_interface* pslot) { + m_slot_disconnect(this, pslot); + } + + void slot_duplicate(const has_slots_interface* poldslot, + has_slots_interface* pnewslot) { + m_slot_duplicate(this, poldslot, pnewslot); + } +}; + +class _opaque_connection { + private: + typedef void (*emit_t)(const _opaque_connection*); + template + union union_caster { + FromT from; + ToT to; + }; + + emit_t pemit; + has_slots_interface* pdest; + // Pointers to member functions may be up to 16 bytes for virtual classes, + // so make sure we have enough space to store it. + unsigned char pmethod[16]; + + public: + template + _opaque_connection(DestT* pd, void (DestT::*pm)(Args...)) : pdest(pd) { + typedef void (DestT::*pm_t)(Args...); + static_assert(sizeof(pm_t) <= sizeof(pmethod), + "Size of slot function pointer too large."); + + std::memcpy(pmethod, &pm, sizeof(pm_t)); + + typedef void (*em_t)(const _opaque_connection* self, Args...); + union_caster caster2; + caster2.from = &_opaque_connection::emitter; + pemit = caster2.to; + } + + has_slots_interface* getdest() const { return pdest; } + + _opaque_connection duplicate(has_slots_interface* newtarget) const { + _opaque_connection res = *this; + res.pdest = newtarget; + return res; + } + + // Just calls the stored "emitter" function pointer stored at construction + // time. + template + void emit(Args... args) const { + typedef void (*em_t)(const _opaque_connection*, Args...); + union_caster caster; + caster.from = pemit; + (caster.to)(this, args...); + } + + private: + template + static void emitter(const _opaque_connection* self, Args... args) { + typedef void (DestT::*pm_t)(Args...); + pm_t pm; + std::memcpy(&pm, self->pmethod, sizeof(pm_t)); + (static_cast(self->pdest)->*(pm))(args...); + } +}; + +template +class _signal_base : public _signal_base_interface, public mt_policy { + protected: + typedef std::list<_opaque_connection> connections_list; + + _signal_base() + : _signal_base_interface(&_signal_base::do_slot_disconnect, + &_signal_base::do_slot_duplicate), + m_current_iterator(m_connected_slots.end()) {} + + ~_signal_base() { disconnect_all(); } + + private: + _signal_base& operator=(_signal_base const& that); + + public: + _signal_base(const _signal_base& o) + : _signal_base_interface(&_signal_base::do_slot_disconnect, + &_signal_base::do_slot_duplicate), + m_current_iterator(m_connected_slots.end()) { + lock_block lock(this); + for (const auto& connection : o.m_connected_slots) { + connection.getdest()->signal_connect(this); + m_connected_slots.push_back(connection); + } + } + + bool is_empty() { + lock_block lock(this); + return m_connected_slots.empty(); + } + + void disconnect_all() { + lock_block lock(this); + + while (!m_connected_slots.empty()) { + has_slots_interface* pdest = m_connected_slots.front().getdest(); + m_connected_slots.pop_front(); + pdest->signal_disconnect(static_cast<_signal_base_interface*>(this)); + } + // If disconnect_all is called while the signal is firing, advance the + // current slot iterator to the end to avoid an invalidated iterator from + // being dereferenced. + m_current_iterator = m_connected_slots.end(); + } + +#if !defined(NDEBUG) + bool connected(has_slots_interface* pclass) { + lock_block lock(this); + connections_list::const_iterator it = m_connected_slots.begin(); + connections_list::const_iterator itEnd = m_connected_slots.end(); + while (it != itEnd) { + if (it->getdest() == pclass) + return true; + ++it; + } + return false; + } +#endif + + void disconnect(has_slots_interface* pclass) { + lock_block lock(this); + connections_list::iterator it = m_connected_slots.begin(); + connections_list::iterator itEnd = m_connected_slots.end(); + + while (it != itEnd) { + if (it->getdest() == pclass) { + // If we're currently using this iterator because the signal is firing, + // advance it to avoid it being invalidated. + if (m_current_iterator == it) { + m_current_iterator = m_connected_slots.erase(it); + } else { + m_connected_slots.erase(it); + } + pclass->signal_disconnect(static_cast<_signal_base_interface*>(this)); + return; + } + ++it; + } + } + + private: + static void do_slot_disconnect(_signal_base_interface* p, + has_slots_interface* pslot) { + _signal_base* const self = static_cast<_signal_base*>(p); + lock_block lock(self); + connections_list::iterator it = self->m_connected_slots.begin(); + connections_list::iterator itEnd = self->m_connected_slots.end(); + + while (it != itEnd) { + connections_list::iterator itNext = it; + ++itNext; + + if (it->getdest() == pslot) { + // If we're currently using this iterator because the signal is firing, + // advance it to avoid it being invalidated. + if (self->m_current_iterator == it) { + self->m_current_iterator = self->m_connected_slots.erase(it); + } else { + self->m_connected_slots.erase(it); + } + } + + it = itNext; + } + } + + static void do_slot_duplicate(_signal_base_interface* p, + const has_slots_interface* oldtarget, + has_slots_interface* newtarget) { + _signal_base* const self = static_cast<_signal_base*>(p); + lock_block lock(self); + connections_list::iterator it = self->m_connected_slots.begin(); + connections_list::iterator itEnd = self->m_connected_slots.end(); + + while (it != itEnd) { + if (it->getdest() == oldtarget) { + self->m_connected_slots.push_back(it->duplicate(newtarget)); + } + + ++it; + } + } + + protected: + connections_list m_connected_slots; + + // Used to handle a slot being disconnected while a signal is + // firing (iterating m_connected_slots). + connections_list::iterator m_current_iterator; + bool m_erase_current_iterator = false; +}; + +template +class has_slots : public has_slots_interface, public mt_policy { + private: + typedef std::set<_signal_base_interface*> sender_set; + typedef sender_set::const_iterator const_iterator; + + public: + has_slots() + : has_slots_interface(&has_slots::do_signal_connect, + &has_slots::do_signal_disconnect, + &has_slots::do_disconnect_all) {} + + has_slots(has_slots const& o) + : has_slots_interface(&has_slots::do_signal_connect, + &has_slots::do_signal_disconnect, + &has_slots::do_disconnect_all) { + lock_block lock(this); + for (auto* sender : o.m_senders) { + sender->slot_duplicate(&o, this); + m_senders.insert(sender); + } + } + + ~has_slots() { this->disconnect_all(); } + + private: + has_slots& operator=(has_slots const&); + + static void do_signal_connect(has_slots_interface* p, + _signal_base_interface* sender) { + has_slots* const self = static_cast(p); + lock_block lock(self); + self->m_senders.insert(sender); + } + + static void do_signal_disconnect(has_slots_interface* p, + _signal_base_interface* sender) { + has_slots* const self = static_cast(p); + lock_block lock(self); + self->m_senders.erase(sender); + } + + static void do_disconnect_all(has_slots_interface* p) { + has_slots* const self = static_cast(p); + lock_block lock(self); + while (!self->m_senders.empty()) { + std::set<_signal_base_interface*> senders; + senders.swap(self->m_senders); + const_iterator it = senders.begin(); + const_iterator itEnd = senders.end(); + + while (it != itEnd) { + _signal_base_interface* s = *it; + ++it; + s->slot_disconnect(p); + } + } + } + + private: + sender_set m_senders; +}; + +template +class signal_with_thread_policy : public _signal_base { + private: + typedef _signal_base base; + + protected: + typedef typename base::connections_list connections_list; + + public: + signal_with_thread_policy() {} + + template + void connect(desttype* pclass, void (desttype::*pmemfun)(Args...)) { + lock_block lock(this); + this->m_connected_slots.push_back(_opaque_connection(pclass, pmemfun)); + pclass->signal_connect(static_cast<_signal_base_interface*>(this)); + } + + void emit(Args... args) { + lock_block lock(this); + this->m_current_iterator = this->m_connected_slots.begin(); + while (this->m_current_iterator != this->m_connected_slots.end()) { + _opaque_connection const& conn = *this->m_current_iterator; + ++(this->m_current_iterator); + conn.emit(args...); + } + } + + void operator()(Args... args) { emit(args...); } +}; + +// Alias with default thread policy. Needed because both default arguments +// and variadic template arguments must go at the end of the list, so we +// can't have both at once. +template +using signal = signal_with_thread_policy; + +// The previous verion of sigslot didn't use variadic templates, so you would +// need to write "sigslot::signal2", for example. +// Now you can just write "sigslot::signal", but these aliases +// exist for backwards compatibility. +template +using signal0 = signal_with_thread_policy; + +template +using signal1 = signal_with_thread_policy; + +template +using signal2 = signal_with_thread_policy; + +template +using signal3 = signal_with_thread_policy; + +template +using signal4 = signal_with_thread_policy; + +template +using signal5 = signal_with_thread_policy; + +template +using signal6 = signal_with_thread_policy; + +template +using signal7 = + signal_with_thread_policy; + +template +using signal8 = + signal_with_thread_policy; + +} // namespace sigslot + +#endif // WEBRTC_BASE_SIGSLOT_H__ diff --git a/webrtc/rtc_base/sigslot_unittest.cc b/webrtc/base/sigslot_unittest.cc similarity index 100% rename from webrtc/rtc_base/sigslot_unittest.cc rename to webrtc/base/sigslot_unittest.cc diff --git a/webrtc/base/sigslottester.h b/webrtc/base/sigslottester.h old mode 100644 new mode 100755 index 545bf9e235..18ddde30cb --- a/webrtc/base/sigslottester.h +++ b/webrtc/base/sigslottester.h @@ -15,9 +15,202 @@ #ifndef WEBRTC_BASE_SIGSLOTTESTER_H_ #define WEBRTC_BASE_SIGSLOTTESTER_H_ +// To generate sigslottester.h from sigslottester.h.pump, execute: +// /home/build/google3/third_party/gtest/scripts/pump.py sigslottester.h.pump -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/sigslottester.h" + +// SigslotTester(s) are utility classes to check if signals owned by an +// object are being invoked at the right time and with the right arguments. +// They are meant to be used in tests. Tests must provide "capture" pointers +// (i.e. address of variables) where the arguments from the signal callback +// can be stored. +// +// Example: +// /* Some signal */ +// sigslot::signal1 foo; +// +// /* We want to monitor foo in some test. Note how signal argument is +// const std::string&, but capture-type is std::string. Capture type +// must be type that can be assigned to. */ +// std::string capture; +// SigslotTester1 slot(&foo, &capture); +// foo.emit("hello"); +// EXPECT_EQ(1, slot.callback_count()); +// EXPECT_EQ("hello", capture); +// /* See unit-tests for more examples */ + +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/sigslot.h" + +namespace rtc { + +// Base version for testing signals that passes no arguments. +class SigslotTester0 : public sigslot::has_slots<> { + public: + explicit SigslotTester0(sigslot::signal0<>* signal) : callback_count_(0) { + signal->connect(this, &SigslotTester0::OnSignalCallback); + } + + int callback_count() const { return callback_count_; } + + private: + void OnSignalCallback() { callback_count_++; } + int callback_count_; + + RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester0); +}; + +// Versions below are for testing signals that pass arguments. For all the +// templates below: +// - A1-A5 is the type of the argument i in the callback. Signals may and often +// do use const-references here for efficiency. +// - C1-C5 is the type of the variable to capture argument i. These should be +// non-const value types suitable for use as lvalues. + +template +class SigslotTester1 : public sigslot::has_slots<> { + public: + SigslotTester1(sigslot::signal1* signal, + C1* capture1) + : callback_count_(0), + capture1_(capture1) { + signal->connect(this, &SigslotTester1::OnSignalCallback); + } + + int callback_count() const { return callback_count_; } + + private: + void OnSignalCallback(A1 arg1) { + callback_count_++; + *capture1_ = arg1; + } + + int callback_count_; + C1* capture1_; + + RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester1); +}; + +template +class SigslotTester2 : public sigslot::has_slots<> { + public: + SigslotTester2(sigslot::signal2* signal, + C1* capture1, C2* capture2) + : callback_count_(0), + capture1_(capture1), capture2_(capture2) { + signal->connect(this, &SigslotTester2::OnSignalCallback); + } + + int callback_count() const { return callback_count_; } + + private: + void OnSignalCallback(A1 arg1, A2 arg2) { + callback_count_++; + *capture1_ = arg1; + *capture2_ = arg2; + } + + int callback_count_; + C1* capture1_; + C2* capture2_; + + RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester2); +}; + +template +class SigslotTester3 : public sigslot::has_slots<> { + public: + SigslotTester3(sigslot::signal3* signal, + C1* capture1, C2* capture2, C3* capture3) + : callback_count_(0), + capture1_(capture1), capture2_(capture2), capture3_(capture3) { + signal->connect(this, &SigslotTester3::OnSignalCallback); + } + + int callback_count() const { return callback_count_; } + + private: + void OnSignalCallback(A1 arg1, A2 arg2, A3 arg3) { + callback_count_++; + *capture1_ = arg1; + *capture2_ = arg2; + *capture3_ = arg3; + } + + int callback_count_; + C1* capture1_; + C2* capture2_; + C3* capture3_; + + RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester3); +}; + +template +class SigslotTester4 : public sigslot::has_slots<> { + public: + SigslotTester4(sigslot::signal4* signal, + C1* capture1, C2* capture2, C3* capture3, C4* capture4) + : callback_count_(0), + capture1_(capture1), capture2_(capture2), capture3_(capture3), + capture4_(capture4) { + signal->connect(this, &SigslotTester4::OnSignalCallback); + } + + int callback_count() const { return callback_count_; } + + private: + void OnSignalCallback(A1 arg1, A2 arg2, A3 arg3, A4 arg4) { + callback_count_++; + *capture1_ = arg1; + *capture2_ = arg2; + *capture3_ = arg3; + *capture4_ = arg4; + } + + int callback_count_; + C1* capture1_; + C2* capture2_; + C3* capture3_; + C4* capture4_; + + RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester4); +}; + +template +class SigslotTester5 : public sigslot::has_slots<> { + public: + SigslotTester5(sigslot::signal5* signal, + C1* capture1, C2* capture2, C3* capture3, C4* capture4, + C5* capture5) + : callback_count_(0), + capture1_(capture1), capture2_(capture2), capture3_(capture3), + capture4_(capture4), capture5_(capture5) { + signal->connect(this, &SigslotTester5::OnSignalCallback); + } + + int callback_count() const { return callback_count_; } + + private: + void OnSignalCallback(A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5) { + callback_count_++; + *capture1_ = arg1; + *capture2_ = arg2; + *capture3_ = arg3; + *capture4_ = arg4; + *capture5_ = arg5; + } + + int callback_count_; + C1* capture1_; + C2* capture2_; + C3* capture3_; + C4* capture4_; + C5* capture5_; + + RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester5); +}; +} // namespace rtc #endif // WEBRTC_BASE_SIGSLOTTESTER_H_ diff --git a/webrtc/rtc_base/sigslottester.h.pump b/webrtc/base/sigslottester.h.pump similarity index 96% rename from webrtc/rtc_base/sigslottester.h.pump rename to webrtc/base/sigslottester.h.pump index a88f0c6616..8be9d7c31d 100755 --- a/webrtc/rtc_base/sigslottester.h.pump +++ b/webrtc/base/sigslottester.h.pump @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_RTC_BASE_SIGSLOTTESTER_H_ -#define WEBRTC_RTC_BASE_SIGSLOTTESTER_H_ +#ifndef WEBRTC_BASE_SIGSLOTTESTER_H_ +#define WEBRTC_BASE_SIGSLOTTESTER_H_ // To generate sigslottester.h from sigslottester.h.pump, execute: // /home/build/google3/third_party/gtest/scripts/pump.py sigslottester.h.pump @@ -99,4 +99,4 @@ class SigslotTester$i : public sigslot::has_slots<> { ]] } // namespace rtc -#endif // WEBRTC_RTC_BASE_SIGSLOTTESTER_H_ +#endif // WEBRTC_BASE_SIGSLOTTESTER_H_ diff --git a/webrtc/rtc_base/sigslottester_unittest.cc b/webrtc/base/sigslottester_unittest.cc similarity index 100% rename from webrtc/rtc_base/sigslottester_unittest.cc rename to webrtc/base/sigslottester_unittest.cc diff --git a/webrtc/base/socket.h b/webrtc/base/socket.h index 19ea7a032f..38a51f828e 100644 --- a/webrtc/base/socket.h +++ b/webrtc/base/socket.h @@ -8,12 +8,190 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_SOCKET_H_ -#define WEBRTC_BASE_SOCKET_H_ +#ifndef WEBRTC_BASE_SOCKET_H__ +#define WEBRTC_BASE_SOCKET_H__ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/socket.h" +#if defined(WEBRTC_POSIX) +#include +#include +#include +#include +#define SOCKET_EACCES EACCES +#endif -#endif // WEBRTC_BASE_SOCKET_H_ +#if defined(WEBRTC_WIN) +#include "webrtc/base/win32.h" +#endif + +#include "webrtc/base/basictypes.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/socketaddress.h" + +// Rather than converting errors into a private namespace, +// Reuse the POSIX socket api errors. Note this depends on +// Win32 compatibility. + +#if defined(WEBRTC_WIN) +#undef EWOULDBLOCK // Remove errno.h's definition for each macro below. +#define EWOULDBLOCK WSAEWOULDBLOCK +#undef EINPROGRESS +#define EINPROGRESS WSAEINPROGRESS +#undef EALREADY +#define EALREADY WSAEALREADY +#undef ENOTSOCK +#define ENOTSOCK WSAENOTSOCK +#undef EDESTADDRREQ +#define EDESTADDRREQ WSAEDESTADDRREQ +#undef EMSGSIZE +#define EMSGSIZE WSAEMSGSIZE +#undef EPROTOTYPE +#define EPROTOTYPE WSAEPROTOTYPE +#undef ENOPROTOOPT +#define ENOPROTOOPT WSAENOPROTOOPT +#undef EPROTONOSUPPORT +#define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#undef ESOCKTNOSUPPORT +#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#undef EOPNOTSUPP +#define EOPNOTSUPP WSAEOPNOTSUPP +#undef EPFNOSUPPORT +#define EPFNOSUPPORT WSAEPFNOSUPPORT +#undef EAFNOSUPPORT +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#undef EADDRINUSE +#define EADDRINUSE WSAEADDRINUSE +#undef EADDRNOTAVAIL +#define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#undef ENETDOWN +#define ENETDOWN WSAENETDOWN +#undef ENETUNREACH +#define ENETUNREACH WSAENETUNREACH +#undef ENETRESET +#define ENETRESET WSAENETRESET +#undef ECONNABORTED +#define ECONNABORTED WSAECONNABORTED +#undef ECONNRESET +#define ECONNRESET WSAECONNRESET +#undef ENOBUFS +#define ENOBUFS WSAENOBUFS +#undef EISCONN +#define EISCONN WSAEISCONN +#undef ENOTCONN +#define ENOTCONN WSAENOTCONN +#undef ESHUTDOWN +#define ESHUTDOWN WSAESHUTDOWN +#undef ETOOMANYREFS +#define ETOOMANYREFS WSAETOOMANYREFS +#undef ETIMEDOUT +#define ETIMEDOUT WSAETIMEDOUT +#undef ECONNREFUSED +#define ECONNREFUSED WSAECONNREFUSED +#undef ELOOP +#define ELOOP WSAELOOP +#undef ENAMETOOLONG +#define ENAMETOOLONG WSAENAMETOOLONG +#undef EHOSTDOWN +#define EHOSTDOWN WSAEHOSTDOWN +#undef EHOSTUNREACH +#define EHOSTUNREACH WSAEHOSTUNREACH +#undef ENOTEMPTY +#define ENOTEMPTY WSAENOTEMPTY +#undef EPROCLIM +#define EPROCLIM WSAEPROCLIM +#undef EUSERS +#define EUSERS WSAEUSERS +#undef EDQUOT +#define EDQUOT WSAEDQUOT +#undef ESTALE +#define ESTALE WSAESTALE +#undef EREMOTE +#define EREMOTE WSAEREMOTE +#undef EACCES +#define SOCKET_EACCES WSAEACCES +#endif // WEBRTC_WIN + +#if defined(WEBRTC_POSIX) +#define INVALID_SOCKET (-1) +#define SOCKET_ERROR (-1) +#define closesocket(s) close(s) +#endif // WEBRTC_POSIX + +namespace rtc { + +inline bool IsBlockingError(int e) { + return (e == EWOULDBLOCK) || (e == EAGAIN) || (e == EINPROGRESS); +} + +struct SentPacket { + SentPacket() : packet_id(-1), send_time_ms(-1) {} + SentPacket(int packet_id, int64_t send_time_ms) + : packet_id(packet_id), send_time_ms(send_time_ms) {} + + int packet_id; + int64_t send_time_ms; +}; + +// General interface for the socket implementations of various networks. The +// methods match those of normal UNIX sockets very closely. +class Socket { + public: + virtual ~Socket() {} + + // Returns the address to which the socket is bound. If the socket is not + // bound, then the any-address is returned. + virtual SocketAddress GetLocalAddress() const = 0; + + // Returns the address to which the socket is connected. If the socket is + // not connected, then the any-address is returned. + virtual SocketAddress GetRemoteAddress() const = 0; + + virtual int Bind(const SocketAddress& addr) = 0; + virtual int Connect(const SocketAddress& addr) = 0; + virtual int Send(const void *pv, size_t cb) = 0; + virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr) = 0; + // |timestamp| is in units of microseconds. + virtual int Recv(void* pv, size_t cb, int64_t* timestamp) = 0; + virtual int RecvFrom(void* pv, + size_t cb, + SocketAddress* paddr, + int64_t* timestamp) = 0; + virtual int Listen(int backlog) = 0; + virtual Socket *Accept(SocketAddress *paddr) = 0; + virtual int Close() = 0; + virtual int GetError() const = 0; + virtual void SetError(int error) = 0; + inline bool IsBlocking() const { return IsBlockingError(GetError()); } + + enum ConnState { + CS_CLOSED, + CS_CONNECTING, + CS_CONNECTED + }; + virtual ConnState GetState() const = 0; + + enum Option { + OPT_DONTFRAGMENT, + OPT_RCVBUF, // receive buffer size + OPT_SNDBUF, // send buffer size + OPT_NODELAY, // whether Nagle algorithm is enabled + OPT_IPV6_V6ONLY, // Whether the socket is IPv6 only. + OPT_DSCP, // DSCP code + OPT_RTP_SENDTIME_EXTN_ID, // This is a non-traditional socket option param. + // This is specific to libjingle and will be used + // if SendTime option is needed at socket level. + }; + virtual int GetOption(Option opt, int* value) = 0; + virtual int SetOption(Option opt, int value) = 0; + + protected: + Socket() {} + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(Socket); +}; + +} // namespace rtc + +#endif // WEBRTC_BASE_SOCKET_H__ diff --git a/webrtc/rtc_base/socket_unittest.cc b/webrtc/base/socket_unittest.cc similarity index 100% rename from webrtc/rtc_base/socket_unittest.cc rename to webrtc/base/socket_unittest.cc diff --git a/webrtc/base/socket_unittest.h b/webrtc/base/socket_unittest.h index f6769f9470..8172edd036 100644 --- a/webrtc/base/socket_unittest.h +++ b/webrtc/base/socket_unittest.h @@ -11,9 +11,90 @@ #ifndef WEBRTC_BASE_SOCKET_UNITTEST_H_ #define WEBRTC_BASE_SOCKET_UNITTEST_H_ +#include "webrtc/base/gunit.h" +#include "webrtc/base/thread.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/socket_unittest.h" +namespace rtc { + +// Generic socket tests, to be used when testing individual socketservers. +// Derive your specific test class from SocketTest, install your +// socketserver, and call the SocketTest test methods. +class SocketTest : public testing::Test { + protected: + SocketTest() : kIPv4Loopback(INADDR_LOOPBACK), + kIPv6Loopback(in6addr_loopback), + ss_(nullptr) {} + virtual void SetUp() { ss_ = Thread::Current()->socketserver(); } + void TestConnectIPv4(); + void TestConnectIPv6(); + void TestConnectWithDnsLookupIPv4(); + void TestConnectWithDnsLookupIPv6(); + void TestConnectFailIPv4(); + void TestConnectFailIPv6(); + void TestConnectWithDnsLookupFailIPv4(); + void TestConnectWithDnsLookupFailIPv6(); + void TestConnectWithClosedSocketIPv4(); + void TestConnectWithClosedSocketIPv6(); + void TestConnectWhileNotClosedIPv4(); + void TestConnectWhileNotClosedIPv6(); + void TestServerCloseDuringConnectIPv4(); + void TestServerCloseDuringConnectIPv6(); + void TestClientCloseDuringConnectIPv4(); + void TestClientCloseDuringConnectIPv6(); + void TestServerCloseIPv4(); + void TestServerCloseIPv6(); + void TestCloseInClosedCallbackIPv4(); + void TestCloseInClosedCallbackIPv6(); + void TestSocketServerWaitIPv4(); + void TestSocketServerWaitIPv6(); + void TestTcpIPv4(); + void TestTcpIPv6(); + void TestSingleFlowControlCallbackIPv4(); + void TestSingleFlowControlCallbackIPv6(); + void TestUdpIPv4(); + void TestUdpIPv6(); + void TestUdpReadyToSendIPv4(); + void TestUdpReadyToSendIPv6(); + void TestGetSetOptionsIPv4(); + void TestGetSetOptionsIPv6(); + void TestSocketRecvTimestampIPv4(); + void TestSocketRecvTimestampIPv6(); + + static const int kTimeout = 5000; // ms + const IPAddress kIPv4Loopback; + const IPAddress kIPv6Loopback; + + protected: + void TcpInternal(const IPAddress& loopback, size_t data_size, + ptrdiff_t max_send_size); + + private: + void ConnectInternal(const IPAddress& loopback); + void ConnectWithDnsLookupInternal(const IPAddress& loopback, + const std::string& host); + void ConnectFailInternal(const IPAddress& loopback); + + void ConnectWithDnsLookupFailInternal(const IPAddress& loopback); + void ConnectWithClosedSocketInternal(const IPAddress& loopback); + void ConnectWhileNotClosedInternal(const IPAddress& loopback); + void ServerCloseDuringConnectInternal(const IPAddress& loopback); + void ClientCloseDuringConnectInternal(const IPAddress& loopback); + void ServerCloseInternal(const IPAddress& loopback); + void CloseInClosedCallbackInternal(const IPAddress& loopback); + void SocketServerWaitInternal(const IPAddress& loopback); + void SingleFlowControlCallbackInternal(const IPAddress& loopback); + void UdpInternal(const IPAddress& loopback); + void UdpReadyToSend(const IPAddress& loopback); + void GetSetOptionsInternal(const IPAddress& loopback); + void SocketRecvTimestamp(const IPAddress& loopback); + + SocketServer* ss_; +}; + +// For unbound sockets, GetLocalAddress / GetRemoteAddress return AF_UNSPEC +// values on Windows, but an empty address of the same family on Linux/MacOS X. +bool IsUnspecOrEmptyIP(const IPAddress& address); + +} // namespace rtc #endif // WEBRTC_BASE_SOCKET_UNITTEST_H_ diff --git a/webrtc/rtc_base/socketadapters.cc b/webrtc/base/socketadapters.cc similarity index 100% rename from webrtc/rtc_base/socketadapters.cc rename to webrtc/base/socketadapters.cc diff --git a/webrtc/base/socketadapters.h b/webrtc/base/socketadapters.h index 7df0f3ae2f..3b5be10c61 100644 --- a/webrtc/base/socketadapters.h +++ b/webrtc/base/socketadapters.h @@ -11,9 +11,197 @@ #ifndef WEBRTC_BASE_SOCKETADAPTERS_H_ #define WEBRTC_BASE_SOCKETADAPTERS_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/socketadapters.h" +#include "webrtc/base/asyncsocket.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/cryptstring.h" +#include "webrtc/base/logging.h" + +namespace rtc { + +struct HttpAuthContext; +class ByteBufferReader; +class ByteBufferWriter; + +/////////////////////////////////////////////////////////////////////////////// + +// Implements a socket adapter that can buffer and process data internally, +// as in the case of connecting to a proxy, where you must speak the proxy +// protocol before commencing normal socket behavior. +class BufferedReadAdapter : public AsyncSocketAdapter { + public: + BufferedReadAdapter(AsyncSocket* socket, size_t buffer_size); + ~BufferedReadAdapter() override; + + int Send(const void* pv, size_t cb) override; + int Recv(void* pv, size_t cb, int64_t* timestamp) override; + + protected: + int DirectSend(const void* pv, size_t cb) { + return AsyncSocketAdapter::Send(pv, cb); + } + + void BufferInput(bool on = true); + virtual void ProcessInput(char* data, size_t* len) = 0; + + void OnReadEvent(AsyncSocket* socket) override; + + private: + char * buffer_; + size_t buffer_size_, data_len_; + bool buffering_; + RTC_DISALLOW_COPY_AND_ASSIGN(BufferedReadAdapter); +}; + +/////////////////////////////////////////////////////////////////////////////// + +// Interface for implementing proxy server sockets. +class AsyncProxyServerSocket : public BufferedReadAdapter { + public: + AsyncProxyServerSocket(AsyncSocket* socket, size_t buffer_size); + ~AsyncProxyServerSocket() override; + sigslot::signal2 SignalConnectRequest; + virtual void SendConnectResult(int err, const SocketAddress& addr) = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// + +// Implements a socket adapter that performs the client side of a +// fake SSL handshake. Used for "ssltcp" P2P functionality. +class AsyncSSLSocket : public BufferedReadAdapter { + public: + explicit AsyncSSLSocket(AsyncSocket* socket); + + int Connect(const SocketAddress& addr) override; + + protected: + void OnConnectEvent(AsyncSocket* socket) override; + void ProcessInput(char* data, size_t* len) override; + RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSSLSocket); +}; + +// Implements a socket adapter that performs the server side of a +// fake SSL handshake. Used when implementing a relay server that does "ssltcp". +class AsyncSSLServerSocket : public BufferedReadAdapter { + public: + explicit AsyncSSLServerSocket(AsyncSocket* socket); + + protected: + void ProcessInput(char* data, size_t* len) override; + RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSSLServerSocket); +}; + +/////////////////////////////////////////////////////////////////////////////// + +// Implements a socket adapter that speaks the HTTP/S proxy protocol. +class AsyncHttpsProxySocket : public BufferedReadAdapter { + public: + AsyncHttpsProxySocket(AsyncSocket* socket, const std::string& user_agent, + const SocketAddress& proxy, + const std::string& username, const CryptString& password); + ~AsyncHttpsProxySocket() override; + + // If connect is forced, the adapter will always issue an HTTP CONNECT to the + // target address. Otherwise, it will connect only if the destination port + // is not port 80. + void SetForceConnect(bool force) { force_connect_ = force; } + + int Connect(const SocketAddress& addr) override; + SocketAddress GetRemoteAddress() const override; + int Close() override; + ConnState GetState() const override; + + protected: + void OnConnectEvent(AsyncSocket* socket) override; + void OnCloseEvent(AsyncSocket* socket, int err) override; + void ProcessInput(char* data, size_t* len) override; + + bool ShouldIssueConnect() const; + void SendRequest(); + void ProcessLine(char* data, size_t len); + void EndResponse(); + void Error(int error); + + private: + SocketAddress proxy_, dest_; + std::string agent_, user_, headers_; + CryptString pass_; + bool force_connect_; + size_t content_length_; + int defer_error_; + bool expect_close_; + enum ProxyState { + PS_INIT, PS_LEADER, PS_AUTHENTICATE, PS_SKIP_HEADERS, PS_ERROR_HEADERS, + PS_TUNNEL_HEADERS, PS_SKIP_BODY, PS_TUNNEL, PS_WAIT_CLOSE, PS_ERROR + } state_; + HttpAuthContext * context_; + std::string unknown_mechanisms_; + RTC_DISALLOW_COPY_AND_ASSIGN(AsyncHttpsProxySocket); +}; + +/////////////////////////////////////////////////////////////////////////////// + +// Implements a socket adapter that speaks the SOCKS proxy protocol. +class AsyncSocksProxySocket : public BufferedReadAdapter { + public: + AsyncSocksProxySocket(AsyncSocket* socket, const SocketAddress& proxy, + const std::string& username, const CryptString& password); + ~AsyncSocksProxySocket() override; + + int Connect(const SocketAddress& addr) override; + SocketAddress GetRemoteAddress() const override; + int Close() override; + ConnState GetState() const override; + + protected: + void OnConnectEvent(AsyncSocket* socket) override; + void ProcessInput(char* data, size_t* len) override; + + void SendHello(); + void SendConnect(); + void SendAuth(); + void Error(int error); + + private: + enum State { + SS_INIT, SS_HELLO, SS_AUTH, SS_CONNECT, SS_TUNNEL, SS_ERROR + }; + State state_; + SocketAddress proxy_, dest_; + std::string user_; + CryptString pass_; + RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSocksProxySocket); +}; + +// Implements a proxy server socket for the SOCKS protocol. +class AsyncSocksProxyServerSocket : public AsyncProxyServerSocket { + public: + explicit AsyncSocksProxyServerSocket(AsyncSocket* socket); + + private: + void ProcessInput(char* data, size_t* len) override; + void DirectSend(const ByteBufferWriter& buf); + + void HandleHello(ByteBufferReader* request); + void SendHelloReply(uint8_t method); + void HandleAuth(ByteBufferReader* request); + void SendAuthReply(uint8_t result); + void HandleConnect(ByteBufferReader* request); + void SendConnectResult(int result, const SocketAddress& addr) override; + + void Error(int error); + + static const int kBufferSize = 1024; + enum State { + SS_HELLO, SS_AUTH, SS_CONNECT, SS_CONNECT_PENDING, SS_TUNNEL, SS_ERROR + }; + State state_; + RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSocksProxyServerSocket); +}; + +} // namespace rtc #endif // WEBRTC_BASE_SOCKETADAPTERS_H_ diff --git a/webrtc/rtc_base/socketaddress.cc b/webrtc/base/socketaddress.cc similarity index 100% rename from webrtc/rtc_base/socketaddress.cc rename to webrtc/base/socketaddress.cc diff --git a/webrtc/base/socketaddress.h b/webrtc/base/socketaddress.h index 20199ad96b..bcff3900b8 100644 --- a/webrtc/base/socketaddress.h +++ b/webrtc/base/socketaddress.h @@ -11,9 +11,187 @@ #ifndef WEBRTC_BASE_SOCKETADDRESS_H_ #define WEBRTC_BASE_SOCKETADDRESS_H_ +#include +#include +#include +#include "webrtc/base/basictypes.h" +#include "webrtc/base/ipaddress.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/socketaddress.h" +#undef SetPort + +struct sockaddr_in; +struct sockaddr_storage; + +namespace rtc { + +// Records an IP address and port. +class SocketAddress { + public: + // Creates a nil address. + SocketAddress(); + + // Creates the address with the given host and port. Host may be a + // literal IP string or a hostname to be resolved later. + // DCHECKs that port is in valid range (0 to 2^16-1). + SocketAddress(const std::string& hostname, int port); + + // Creates the address with the given IP and port. + // IP is given as an integer in host byte order. V4 only, to be deprecated. + // DCHECKs that port is in valid range (0 to 2^16-1). + SocketAddress(uint32_t ip_as_host_order_integer, int port); + + // Creates the address with the given IP and port. + // DCHECKs that port is in valid range (0 to 2^16-1). + SocketAddress(const IPAddress& ip, int port); + + // Creates a copy of the given address. + SocketAddress(const SocketAddress& addr); + + // Resets to the nil address. + void Clear(); + + // Determines if this is a nil address (empty hostname, any IP, null port) + bool IsNil() const; + + // Returns true if ip and port are set. + bool IsComplete() const; + + // Replaces our address with the given one. + SocketAddress& operator=(const SocketAddress& addr); + + // Changes the IP of this address to the given one, and clears the hostname + // IP is given as an integer in host byte order. V4 only, to be deprecated.. + void SetIP(uint32_t ip_as_host_order_integer); + + // Changes the IP of this address to the given one, and clears the hostname. + void SetIP(const IPAddress& ip); + + // Changes the hostname of this address to the given one. + // Does not resolve the address; use Resolve to do so. + void SetIP(const std::string& hostname); + + // Sets the IP address while retaining the hostname. Useful for bypassing + // DNS for a pre-resolved IP. + // IP is given as an integer in host byte order. V4 only, to be deprecated. + void SetResolvedIP(uint32_t ip_as_host_order_integer); + + // Sets the IP address while retaining the hostname. Useful for bypassing + // DNS for a pre-resolved IP. + void SetResolvedIP(const IPAddress& ip); + + // Changes the port of this address to the given one. + // DCHECKs that port is in valid range (0 to 2^16-1). + void SetPort(int port); + + // Returns the hostname. + const std::string& hostname() const { return hostname_; } + + // Returns the IP address as a host byte order integer. + // Returns 0 for non-v4 addresses. + uint32_t ip() const; + + const IPAddress& ipaddr() const; + + int family() const {return ip_.family(); } + + // Returns the port part of this address. + uint16_t port() const; + + // Returns the scope ID associated with this address. Scope IDs are a + // necessary addition to IPv6 link-local addresses, with different network + // interfaces having different scope-ids for their link-local addresses. + // IPv4 address do not have scope_ids and sockaddr_in structures do not have + // a field for them. + int scope_id() const {return scope_id_; } + void SetScopeID(int id) { scope_id_ = id; } + + // Returns the 'host' portion of the address (hostname or IP) in a form + // suitable for use in a URI. If both IP and hostname are present, hostname + // is preferred. IPv6 addresses are enclosed in square brackets ('[' and ']'). + std::string HostAsURIString() const; + + // Same as HostAsURIString but anonymizes IP addresses by hiding the last + // part. + std::string HostAsSensitiveURIString() const; + + // Returns the port as a string. + std::string PortAsString() const; + + // Returns hostname:port or [hostname]:port. + std::string ToString() const; + + // Same as ToString but anonymizes it by hiding the last part. + std::string ToSensitiveString() const; + + // Parses hostname:port and [hostname]:port. + bool FromString(const std::string& str); + + friend std::ostream& operator<<(std::ostream& os, const SocketAddress& addr); + + // Determines whether this represents a missing / any IP address. + // That is, 0.0.0.0 or ::. + // Hostname and/or port may be set. + bool IsAnyIP() const; + + // Determines whether the IP address refers to a loopback address. + // For v4 addresses this means the address is in the range 127.0.0.0/8. + // For v6 addresses this means the address is ::1. + bool IsLoopbackIP() const; + + // Determines whether the IP address is in one of the private ranges: + // For v4: 127.0.0.0/8 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12. + // For v6: FE80::/16 and ::1. + bool IsPrivateIP() const; + + // Determines whether the hostname has been resolved to an IP. + bool IsUnresolvedIP() const; + + // Determines whether this address is identical to the given one. + bool operator ==(const SocketAddress& addr) const; + inline bool operator !=(const SocketAddress& addr) const { + return !this->operator ==(addr); + } + + // Compares based on IP and then port. + bool operator <(const SocketAddress& addr) const; + + // Determines whether this address has the same IP as the one given. + bool EqualIPs(const SocketAddress& addr) const; + + // Determines whether this address has the same port as the one given. + bool EqualPorts(const SocketAddress& addr) const; + + // Hashes this address into a small number. + size_t Hash() const; + + // Write this address to a sockaddr_in. + // If IPv6, will zero out the sockaddr_in and sets family to AF_UNSPEC. + void ToSockAddr(sockaddr_in* saddr) const; + + // Read this address from a sockaddr_in. + bool FromSockAddr(const sockaddr_in& saddr); + + // Read and write the address to/from a sockaddr_storage. + // Dual stack version always sets family to AF_INET6, and maps v4 addresses. + // The other version doesn't map, and outputs an AF_INET address for + // v4 or mapped addresses, and AF_INET6 addresses for others. + // Returns the size of the sockaddr_in or sockaddr_in6 structure that is + // written to the sockaddr_storage, or zero on failure. + size_t ToDualStackSockAddrStorage(sockaddr_storage* saddr) const; + size_t ToSockAddrStorage(sockaddr_storage* saddr) const; + + private: + std::string hostname_; + IPAddress ip_; + uint16_t port_; + int scope_id_; + bool literal_; // Indicates that 'hostname_' contains a literal IP string. +}; + +bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr, + SocketAddress* out); +SocketAddress EmptySocketAddressWithFamily(int family); + +} // namespace rtc #endif // WEBRTC_BASE_SOCKETADDRESS_H_ diff --git a/webrtc/rtc_base/socketaddress_unittest.cc b/webrtc/base/socketaddress_unittest.cc similarity index 100% rename from webrtc/rtc_base/socketaddress_unittest.cc rename to webrtc/base/socketaddress_unittest.cc diff --git a/webrtc/rtc_base/socketaddresspair.cc b/webrtc/base/socketaddresspair.cc similarity index 100% rename from webrtc/rtc_base/socketaddresspair.cc rename to webrtc/base/socketaddresspair.cc diff --git a/webrtc/base/socketaddresspair.h b/webrtc/base/socketaddresspair.h index 3f53f10fee..73a627f104 100644 --- a/webrtc/base/socketaddresspair.h +++ b/webrtc/base/socketaddresspair.h @@ -8,12 +8,34 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_SOCKETADDRESSPAIR_H_ -#define WEBRTC_BASE_SOCKETADDRESSPAIR_H_ +#ifndef WEBRTC_BASE_SOCKETADDRESSPAIR_H__ +#define WEBRTC_BASE_SOCKETADDRESSPAIR_H__ +#include "webrtc/base/socketaddress.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/socketaddresspair.h" +namespace rtc { -#endif // WEBRTC_BASE_SOCKETADDRESSPAIR_H_ +// Records a pair (source,destination) of socket addresses. The two addresses +// identify a connection between two machines. (For UDP, this "connection" is +// not maintained explicitly in a socket.) +class SocketAddressPair { +public: + SocketAddressPair() {} + SocketAddressPair(const SocketAddress& srs, const SocketAddress& dest); + + const SocketAddress& source() const { return src_; } + const SocketAddress& destination() const { return dest_; } + + bool operator ==(const SocketAddressPair& r) const; + bool operator <(const SocketAddressPair& r) const; + + size_t Hash() const; + +private: + SocketAddress src_; + SocketAddress dest_; +}; + +} // namespace rtc + +#endif // WEBRTC_BASE_SOCKETADDRESSPAIR_H__ diff --git a/webrtc/base/socketfactory.h b/webrtc/base/socketfactory.h index 3a829ac10d..fe0f32bdbb 100644 --- a/webrtc/base/socketfactory.h +++ b/webrtc/base/socketfactory.h @@ -8,12 +8,31 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_SOCKETFACTORY_H_ -#define WEBRTC_BASE_SOCKETFACTORY_H_ +#ifndef WEBRTC_BASE_SOCKETFACTORY_H__ +#define WEBRTC_BASE_SOCKETFACTORY_H__ +#include "webrtc/base/socket.h" +#include "webrtc/base/asyncsocket.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/socketfactory.h" +namespace rtc { -#endif // WEBRTC_BASE_SOCKETFACTORY_H_ +class SocketFactory { +public: + virtual ~SocketFactory() {} + + // Returns a new socket for blocking communication. The type can be + // SOCK_DGRAM and SOCK_STREAM. + // TODO: C++ inheritance rules mean that all users must have both + // CreateSocket(int) and CreateSocket(int,int). Will remove CreateSocket(int) + // (and CreateAsyncSocket(int) when all callers are changed. + virtual Socket* CreateSocket(int type) = 0; + virtual Socket* CreateSocket(int family, int type) = 0; + // Returns a new socket for nonblocking communication. The type can be + // SOCK_DGRAM and SOCK_STREAM. + virtual AsyncSocket* CreateAsyncSocket(int type) = 0; + virtual AsyncSocket* CreateAsyncSocket(int family, int type) = 0; +}; + +} // namespace rtc + +#endif // WEBRTC_BASE_SOCKETFACTORY_H__ diff --git a/webrtc/base/socketserver.h b/webrtc/base/socketserver.h index 55b427da7e..5eada4a406 100644 --- a/webrtc/base/socketserver.h +++ b/webrtc/base/socketserver.h @@ -11,9 +11,52 @@ #ifndef WEBRTC_BASE_SOCKETSERVER_H_ #define WEBRTC_BASE_SOCKETSERVER_H_ +#include +#include "webrtc/base/socketfactory.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/socketserver.h" +namespace rtc { + +class MessageQueue; +// Needs to be forward declared because there's a circular dependency between +// NetworkMonitor and Thread. +// TODO(deadbeef): Fix this. +class NetworkBinderInterface; + +// Provides the ability to wait for activity on a set of sockets. The Thread +// class provides a nice wrapper on a socket server. +// +// The server is also a socket factory. The sockets it creates will be +// notified of asynchronous I/O from this server's Wait method. +class SocketServer : public SocketFactory { + public: + static const int kForever = -1; + + static std::unique_ptr CreateDefault(); + // When the socket server is installed into a Thread, this function is + // called to allow the socket server to use the thread's message queue for + // any messaging that it might need to perform. + virtual void SetMessageQueue(MessageQueue* queue) {} + + // Sleeps until: + // 1) cms milliseconds have elapsed (unless cms == kForever) + // 2) WakeUp() is called + // While sleeping, I/O is performed if process_io is true. + virtual bool Wait(int cms, bool process_io) = 0; + + // Causes the current wait (if one is in progress) to wake up. + virtual void WakeUp() = 0; + + // A network binder will bind the created sockets to a network. + // It is only used in PhysicalSocketServer. + void set_network_binder(NetworkBinderInterface* binder) { + network_binder_ = binder; + } + NetworkBinderInterface* network_binder() const { return network_binder_; } + + private: + NetworkBinderInterface* network_binder_ = nullptr; +}; + +} // namespace rtc #endif // WEBRTC_BASE_SOCKETSERVER_H_ diff --git a/webrtc/rtc_base/socketstream.cc b/webrtc/base/socketstream.cc similarity index 100% rename from webrtc/rtc_base/socketstream.cc rename to webrtc/base/socketstream.cc diff --git a/webrtc/base/socketstream.h b/webrtc/base/socketstream.h index a76ffb3814..a1f8ad9306 100644 --- a/webrtc/base/socketstream.h +++ b/webrtc/base/socketstream.h @@ -11,9 +11,51 @@ #ifndef WEBRTC_BASE_SOCKETSTREAM_H_ #define WEBRTC_BASE_SOCKETSTREAM_H_ +#include "webrtc/base/asyncsocket.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/stream.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/socketstream.h" +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// + +class SocketStream : public StreamInterface, public sigslot::has_slots<> { + public: + explicit SocketStream(AsyncSocket* socket); + ~SocketStream() override; + + void Attach(AsyncSocket* socket); + AsyncSocket* Detach(); + + AsyncSocket* GetSocket() { return socket_; } + + StreamState GetState() const override; + + StreamResult Read(void* buffer, + size_t buffer_len, + size_t* read, + int* error) override; + + StreamResult Write(const void* data, + size_t data_len, + size_t* written, + int* error) override; + + void Close() override; + + private: + void OnConnectEvent(AsyncSocket* socket); + void OnReadEvent(AsyncSocket* socket); + void OnWriteEvent(AsyncSocket* socket); + void OnCloseEvent(AsyncSocket* socket, int err); + + AsyncSocket* socket_; + + RTC_DISALLOW_COPY_AND_ASSIGN(SocketStream); +}; + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace rtc #endif // WEBRTC_BASE_SOCKETSTREAM_H_ diff --git a/webrtc/rtc_base/ssladapter.cc b/webrtc/base/ssladapter.cc similarity index 100% rename from webrtc/rtc_base/ssladapter.cc rename to webrtc/base/ssladapter.cc diff --git a/webrtc/base/ssladapter.h b/webrtc/base/ssladapter.h index 3d432ecd0c..0317544f92 100644 --- a/webrtc/base/ssladapter.h +++ b/webrtc/base/ssladapter.h @@ -11,9 +11,55 @@ #ifndef WEBRTC_BASE_SSLADAPTER_H_ #define WEBRTC_BASE_SSLADAPTER_H_ +#include "webrtc/base/asyncsocket.h" +#include "webrtc/base/sslstreamadapter.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/ssladapter.h" +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// + +class SSLAdapter : public AsyncSocketAdapter { + public: + explicit SSLAdapter(AsyncSocket* socket) + : AsyncSocketAdapter(socket), ignore_bad_cert_(false) { } + + bool ignore_bad_cert() const { return ignore_bad_cert_; } + void set_ignore_bad_cert(bool ignore) { ignore_bad_cert_ = ignore; } + + // Do DTLS or TLS (default is TLS, if unspecified) + virtual void SetMode(SSLMode mode) = 0; + + // StartSSL returns 0 if successful. + // If StartSSL is called while the socket is closed or connecting, the SSL + // negotiation will begin as soon as the socket connects. + virtual int StartSSL(const char* hostname, bool restartable) = 0; + + // Create the default SSL adapter for this platform. On failure, returns null + // and deletes |socket|. Otherwise, the returned SSLAdapter takes ownership + // of |socket|. + static SSLAdapter* Create(AsyncSocket* socket); + + private: + // If true, the server certificate need not match the configured hostname. + bool ignore_bad_cert_; +}; + +/////////////////////////////////////////////////////////////////////////////// + +typedef bool (*VerificationCallback)(void* cert); + +// Call this on the main thread, before using SSL. +// Call CleanupSSLThread when finished with SSL. +bool InitializeSSL(VerificationCallback callback = nullptr); + +// Call to initialize additional threads. +bool InitializeSSLThread(); + +// Call to cleanup additional threads, and also the main thread. +bool CleanupSSL(); + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace rtc #endif // WEBRTC_BASE_SSLADAPTER_H_ diff --git a/webrtc/rtc_base/ssladapter_unittest.cc b/webrtc/base/ssladapter_unittest.cc similarity index 100% rename from webrtc/rtc_base/ssladapter_unittest.cc rename to webrtc/base/ssladapter_unittest.cc diff --git a/webrtc/rtc_base/sslfingerprint.cc b/webrtc/base/sslfingerprint.cc similarity index 100% rename from webrtc/rtc_base/sslfingerprint.cc rename to webrtc/base/sslfingerprint.cc diff --git a/webrtc/base/sslfingerprint.h b/webrtc/base/sslfingerprint.h index 6be82fd1b2..62b4bc812f 100644 --- a/webrtc/base/sslfingerprint.h +++ b/webrtc/base/sslfingerprint.h @@ -11,9 +11,47 @@ #ifndef WEBRTC_BASE_SSLFINGERPRINT_H_ #define WEBRTC_BASE_SSLFINGERPRINT_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/sslfingerprint.h" +#include "webrtc/base/basictypes.h" +#include "webrtc/base/copyonwritebuffer.h" +#include "webrtc/base/rtccertificate.h" +#include "webrtc/base/sslidentity.h" + +namespace rtc { + +class SSLCertificate; + +struct SSLFingerprint { + static SSLFingerprint* Create(const std::string& algorithm, + const rtc::SSLIdentity* identity); + + static SSLFingerprint* Create(const std::string& algorithm, + const rtc::SSLCertificate* cert); + + static SSLFingerprint* CreateFromRfc4572(const std::string& algorithm, + const std::string& fingerprint); + + // Creates a fingerprint from a certificate, using the same digest algorithm + // as the certificate's signature. + static SSLFingerprint* CreateFromCertificate(const RTCCertificate* cert); + + SSLFingerprint(const std::string& algorithm, + const uint8_t* digest_in, + size_t digest_len); + + SSLFingerprint(const SSLFingerprint& from); + + bool operator==(const SSLFingerprint& other) const; + + std::string GetRfc4572Fingerprint() const; + + std::string ToString() const; + + std::string algorithm; + rtc::CopyOnWriteBuffer digest; +}; + +} // namespace rtc #endif // WEBRTC_BASE_SSLFINGERPRINT_H_ diff --git a/webrtc/rtc_base/sslidentity.cc b/webrtc/base/sslidentity.cc similarity index 100% rename from webrtc/rtc_base/sslidentity.cc rename to webrtc/base/sslidentity.cc diff --git a/webrtc/base/sslidentity.h b/webrtc/base/sslidentity.h index 1cedfa09c1..263d0dcd03 100644 --- a/webrtc/base/sslidentity.h +++ b/webrtc/base/sslidentity.h @@ -13,9 +13,262 @@ #ifndef WEBRTC_BASE_SSLIDENTITY_H_ #define WEBRTC_BASE_SSLIDENTITY_H_ +#include +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/sslidentity.h" +#include "webrtc/base/buffer.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/messagedigest.h" +#include "webrtc/base/timeutils.h" + +namespace rtc { + +// Forward declaration due to circular dependency with SSLCertificate. +class SSLCertChain; + +struct SSLCertificateStats { + SSLCertificateStats(std::string&& fingerprint, + std::string&& fingerprint_algorithm, + std::string&& base64_certificate, + std::unique_ptr&& issuer); + ~SSLCertificateStats(); + std::string fingerprint; + std::string fingerprint_algorithm; + std::string base64_certificate; + std::unique_ptr issuer; +}; + +// Abstract interface overridden by SSL library specific +// implementations. + +// A somewhat opaque type used to encapsulate a certificate. +// Wraps the SSL library's notion of a certificate, with reference counting. +// The SSLCertificate object is pretty much immutable once created. +// (The OpenSSL implementation only does reference counting and +// possibly caching of intermediate results.) +class SSLCertificate { + public: + // Parses and builds a certificate from a PEM encoded string. + // Returns null on failure. + // The length of the string representation of the certificate is + // stored in *pem_length if it is non-null, and only if + // parsing was successful. + // Caller is responsible for freeing the returned object. + static SSLCertificate* FromPEMString(const std::string& pem_string); + virtual ~SSLCertificate() {} + + // Returns a new SSLCertificate object instance wrapping the same + // underlying certificate, including its chain if present. + // Caller is responsible for freeing the returned object. + virtual SSLCertificate* GetReference() const = 0; + + // Provides the cert chain, or null. The chain includes a copy of each + // certificate, excluding the leaf. + virtual std::unique_ptr GetChain() const = 0; + + // Returns a PEM encoded string representation of the certificate. + virtual std::string ToPEMString() const = 0; + + // Provides a DER encoded binary representation of the certificate. + virtual void ToDER(Buffer* der_buffer) const = 0; + + // Gets the name of the digest algorithm that was used to compute this + // certificate's signature. + virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const = 0; + + // Compute the digest of the certificate given algorithm + virtual bool ComputeDigest(const std::string& algorithm, + unsigned char* digest, + size_t size, + size_t* length) const = 0; + + // Returns the time in seconds relative to epoch, 1970-01-01T00:00:00Z (UTC), + // or -1 if an expiration time could not be retrieved. + virtual int64_t CertificateExpirationTime() const = 0; + + // Gets information (fingerprint, etc.) about this certificate and its chain + // (if it has a certificate chain). This is used for certificate stats, see + // https://w3c.github.io/webrtc-stats/#certificatestats-dict*. + std::unique_ptr GetStats() const; + + private: + std::unique_ptr GetStats( + std::unique_ptr issuer) const; +}; + +// SSLCertChain is a simple wrapper for a vector of SSLCertificates. It serves +// primarily to ensure proper memory management (especially deletion) of the +// SSLCertificate pointers. +class SSLCertChain { + public: + // These constructors copy the provided SSLCertificate(s), so the caller + // retains ownership. + explicit SSLCertChain(const std::vector& certs); + explicit SSLCertChain(const SSLCertificate* cert); + ~SSLCertChain(); + + // Vector access methods. + size_t GetSize() const { return certs_.size(); } + + // Returns a temporary reference, only valid until the chain is destroyed. + const SSLCertificate& Get(size_t pos) const { return *(certs_[pos]); } + + // Returns a new SSLCertChain object instance wrapping the same underlying + // certificate chain. Caller is responsible for freeing the returned object. + SSLCertChain* Copy() const { + return new SSLCertChain(certs_); + } + + private: + // Helper function for duplicating a vector of certificates. + static SSLCertificate* DupCert(const SSLCertificate* cert) { + return cert->GetReference(); + } + + // Helper function for deleting a vector of certificates. + static void DeleteCert(SSLCertificate* cert) { delete cert; } + + std::vector certs_; + + RTC_DISALLOW_COPY_AND_ASSIGN(SSLCertChain); +}; + +// KT_LAST is intended for vector declarations and loops over all key types; +// it does not represent any key type in itself. +// KT_DEFAULT is used as the default KeyType for KeyParams. +enum KeyType { KT_RSA, KT_ECDSA, KT_LAST, KT_DEFAULT = KT_ECDSA }; + +static const int kRsaDefaultModSize = 1024; +static const int kRsaDefaultExponent = 0x10001; // = 2^16+1 = 65537 +static const int kRsaMinModSize = 1024; +static const int kRsaMaxModSize = 8192; + +// Certificate default validity lifetime. +static const int kDefaultCertificateLifetimeInSeconds = + 60 * 60 * 24 * 30; // 30 days +// Certificate validity window. +// This is to compensate for slightly incorrect system clocks. +static const int kCertificateWindowInSeconds = -60 * 60 * 24; + +struct RSAParams { + unsigned int mod_size; + unsigned int pub_exp; +}; + +enum ECCurve { EC_NIST_P256, /* EC_FANCY, */ EC_LAST }; + +class KeyParams { + public: + // Generate a KeyParams object from a simple KeyType, using default params. + explicit KeyParams(KeyType key_type = KT_DEFAULT); + + // Generate a a KeyParams for RSA with explicit parameters. + static KeyParams RSA(int mod_size = kRsaDefaultModSize, + int pub_exp = kRsaDefaultExponent); + + // Generate a a KeyParams for ECDSA specifying the curve. + static KeyParams ECDSA(ECCurve curve = EC_NIST_P256); + + // Check validity of a KeyParams object. Since the factory functions have + // no way of returning errors, this function can be called after creation + // to make sure the parameters are OK. + bool IsValid() const; + + RSAParams rsa_params() const; + + ECCurve ec_curve() const; + + KeyType type() const { return type_; } + + private: + KeyType type_; + union { + RSAParams rsa; + ECCurve curve; + } params_; +}; + +// TODO(hbos): Remove once rtc::KeyType (to be modified) and +// blink::WebRTCKeyType (to be landed) match. By using this function in Chromium +// appropriately we can change KeyType enum -> class without breaking Chromium. +KeyType IntKeyTypeFamilyToKeyType(int key_type_family); + +// Parameters for generating a certificate. If |common_name| is non-empty, it +// will be used for the certificate's subject and issuer name, otherwise a +// random string will be used. +struct SSLIdentityParams { + std::string common_name; + time_t not_before; // Absolute time since epoch in seconds. + time_t not_after; // Absolute time since epoch in seconds. + KeyParams key_params; +}; + +// Our identity in an SSL negotiation: a keypair and certificate (both +// with the same public key). +// This too is pretty much immutable once created. +class SSLIdentity { + public: + // Generates an identity (keypair and self-signed certificate). If + // |common_name| is non-empty, it will be used for the certificate's subject + // and issuer name, otherwise a random string will be used. The key type and + // parameters are defined in |key_param|. The certificate's lifetime in + // seconds from the current time is defined in |certificate_lifetime|; it + // should be a non-negative number. + // Returns null on failure. + // Caller is responsible for freeing the returned object. + static SSLIdentity* GenerateWithExpiration(const std::string& common_name, + const KeyParams& key_param, + time_t certificate_lifetime); + static SSLIdentity* Generate(const std::string& common_name, + const KeyParams& key_param); + static SSLIdentity* Generate(const std::string& common_name, + KeyType key_type); + + // Generates an identity with the specified validity period. + // TODO(torbjorng): Now that Generate() accepts relevant params, make tests + // use that instead of this function. + static SSLIdentity* GenerateForTest(const SSLIdentityParams& params); + + // Construct an identity from a private key and a certificate. + static SSLIdentity* FromPEMStrings(const std::string& private_key, + const std::string& certificate); + + virtual ~SSLIdentity() {} + + // Returns a new SSLIdentity object instance wrapping the same + // identity information. + // Caller is responsible for freeing the returned object. + // TODO(hbos,torbjorng): Rename to a less confusing name. + virtual SSLIdentity* GetReference() const = 0; + + // Returns a temporary reference to the certificate. + virtual const SSLCertificate& certificate() const = 0; + virtual std::string PrivateKeyToPEMString() const = 0; + virtual std::string PublicKeyToPEMString() const = 0; + + // Helpers for parsing converting between PEM and DER format. + static bool PemToDer(const std::string& pem_type, + const std::string& pem_string, + std::string* der); + static std::string DerToPem(const std::string& pem_type, + const unsigned char* data, + size_t length); +}; + +bool operator==(const SSLIdentity& a, const SSLIdentity& b); +bool operator!=(const SSLIdentity& a, const SSLIdentity& b); + +// Convert from ASN1 time as restricted by RFC 5280 to seconds from 1970-01-01 +// 00.00 ("epoch"). If the ASN1 time cannot be read, return -1. The data at +// |s| is not 0-terminated; its char count is defined by |length|. +int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format); + +extern const char kPemTypeCertificate[]; +extern const char kPemTypeRsaPrivateKey[]; +extern const char kPemTypeEcPrivateKey[]; + +} // namespace rtc #endif // WEBRTC_BASE_SSLIDENTITY_H_ diff --git a/webrtc/rtc_base/sslidentity_unittest.cc b/webrtc/base/sslidentity_unittest.cc similarity index 100% rename from webrtc/rtc_base/sslidentity_unittest.cc rename to webrtc/base/sslidentity_unittest.cc diff --git a/webrtc/base/sslroots.h b/webrtc/base/sslroots.h index 683f48c833..0464ac8339 100644 --- a/webrtc/base/sslroots.h +++ b/webrtc/base/sslroots.h @@ -1,6 +1,3 @@ -#ifndef WEBRTC_BASE_SSLROOTS_H_ -#define WEBRTC_BASE_SSLROOTS_H_ - // This file is the root certificates in C form that are needed to connect to // Google. @@ -4267,4 +4264,3 @@ const size_t kSSLCertCertificateSizeList[] = { 1122, }; -#endif // WEBRTC_BASE_SSLROOTS_H_ diff --git a/webrtc/rtc_base/sslstreamadapter.cc b/webrtc/base/sslstreamadapter.cc similarity index 100% rename from webrtc/rtc_base/sslstreamadapter.cc rename to webrtc/base/sslstreamadapter.cc diff --git a/webrtc/base/sslstreamadapter.h b/webrtc/base/sslstreamadapter.h index d7c062e4b8..62a724996e 100644 --- a/webrtc/base/sslstreamadapter.h +++ b/webrtc/base/sslstreamadapter.h @@ -11,9 +11,265 @@ #ifndef WEBRTC_BASE_SSLSTREAMADAPTER_H_ #define WEBRTC_BASE_SSLSTREAMADAPTER_H_ +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/sslstreamadapter.h" +#include "webrtc/base/stream.h" +#include "webrtc/base/sslidentity.h" + +namespace rtc { + +// Constants for SSL profile. +const int TLS_NULL_WITH_NULL_NULL = 0; + +// Constants for SRTP profiles. +const int SRTP_INVALID_CRYPTO_SUITE = 0; +#ifndef SRTP_AES128_CM_SHA1_80 +const int SRTP_AES128_CM_SHA1_80 = 0x0001; +#endif +#ifndef SRTP_AES128_CM_SHA1_32 +const int SRTP_AES128_CM_SHA1_32 = 0x0002; +#endif +#ifndef SRTP_AEAD_AES_128_GCM +const int SRTP_AEAD_AES_128_GCM = 0x0007; +#endif +#ifndef SRTP_AEAD_AES_256_GCM +const int SRTP_AEAD_AES_256_GCM = 0x0008; +#endif + +// Names of SRTP profiles listed above. +// 128-bit AES with 80-bit SHA-1 HMAC. +extern const char CS_AES_CM_128_HMAC_SHA1_80[]; +// 128-bit AES with 32-bit SHA-1 HMAC. +extern const char CS_AES_CM_128_HMAC_SHA1_32[]; +// 128-bit AES GCM with 16 byte AEAD auth tag. +extern const char CS_AEAD_AES_128_GCM[]; +// 256-bit AES GCM with 16 byte AEAD auth tag. +extern const char CS_AEAD_AES_256_GCM[]; + +// Given the DTLS-SRTP protection profile ID, as defined in +// https://tools.ietf.org/html/rfc4568#section-6.2 , return the SRTP profile +// name, as defined in https://tools.ietf.org/html/rfc5764#section-4.1.2. +std::string SrtpCryptoSuiteToName(int crypto_suite); + +// The reverse of above conversion. +int SrtpCryptoSuiteFromName(const std::string& crypto_suite); + +// Get key length and salt length for given crypto suite. Returns true for +// valid suites, otherwise false. +bool GetSrtpKeyAndSaltLengths(int crypto_suite, int *key_length, + int *salt_length); + +// Returns true if the given crypto suite id uses a GCM cipher. +bool IsGcmCryptoSuite(int crypto_suite); + +// Returns true if the given crypto suite name uses a GCM cipher. +bool IsGcmCryptoSuiteName(const std::string& crypto_suite); + +struct CryptoOptions { + CryptoOptions() {} + + // Helper method to return an instance of the CryptoOptions with GCM crypto + // suites disabled. This method should be used instead of depending on current + // default values set by the constructor. + static CryptoOptions NoGcm(); + + // Enable GCM crypto suites from RFC 7714 for SRTP. GCM will only be used + // if both sides enable it. + bool enable_gcm_crypto_suites = false; +}; + +// Returns supported crypto suites, given |crypto_options|. +// CS_AES_CM_128_HMAC_SHA1_32 will be preferred by default. +std::vector GetSupportedDtlsSrtpCryptoSuites( + const rtc::CryptoOptions& crypto_options); + +// SSLStreamAdapter : A StreamInterfaceAdapter that does SSL/TLS. +// After SSL has been started, the stream will only open on successful +// SSL verification of certificates, and the communication is +// encrypted of course. +// +// This class was written with SSLAdapter as a starting point. It +// offers a similar interface, with two differences: there is no +// support for a restartable SSL connection, and this class has a +// peer-to-peer mode. +// +// The SSL library requires initialization and cleanup. Static method +// for doing this are in SSLAdapter. They should possibly be moved out +// to a neutral class. + + +enum SSLRole { SSL_CLIENT, SSL_SERVER }; +enum SSLMode { SSL_MODE_TLS, SSL_MODE_DTLS }; +enum SSLProtocolVersion { + SSL_PROTOCOL_TLS_10, + SSL_PROTOCOL_TLS_11, + SSL_PROTOCOL_TLS_12, + SSL_PROTOCOL_DTLS_10 = SSL_PROTOCOL_TLS_11, + SSL_PROTOCOL_DTLS_12 = SSL_PROTOCOL_TLS_12, +}; +enum class SSLPeerCertificateDigestError { + NONE, + UNKNOWN_ALGORITHM, + INVALID_LENGTH, + VERIFICATION_FAILED, +}; + +// Errors for Read -- in the high range so no conflict with OpenSSL. +enum { SSE_MSG_TRUNC = 0xff0001 }; + +// Used to send back UMA histogram value. Logged when Dtls handshake fails. +enum class SSLHandshakeError { UNKNOWN, INCOMPATIBLE_CIPHERSUITE, MAX_VALUE }; + +class SSLStreamAdapter : public StreamAdapterInterface { + public: + // Instantiate an SSLStreamAdapter wrapping the given stream, + // (using the selected implementation for the platform). + // Caller is responsible for freeing the returned object. + static SSLStreamAdapter* Create(StreamInterface* stream); + + explicit SSLStreamAdapter(StreamInterface* stream); + ~SSLStreamAdapter() override; + + void set_ignore_bad_cert(bool ignore) { ignore_bad_cert_ = ignore; } + bool ignore_bad_cert() const { return ignore_bad_cert_; } + + void set_client_auth_enabled(bool enabled) { client_auth_enabled_ = enabled; } + bool client_auth_enabled() const { return client_auth_enabled_; } + + // Specify our SSL identity: key and certificate. SSLStream takes ownership + // of the SSLIdentity object and will free it when appropriate. Should be + // called no more than once on a given SSLStream instance. + virtual void SetIdentity(SSLIdentity* identity) = 0; + + // Call this to indicate that we are to play the server role (or client role, + // if the default argument is replaced by SSL_CLIENT). + // The default argument is for backward compatibility. + // TODO(ekr@rtfm.com): rename this SetRole to reflect its new function + virtual void SetServerRole(SSLRole role = SSL_SERVER) = 0; + + // Do DTLS or TLS. + virtual void SetMode(SSLMode mode) = 0; + + // Set maximum supported protocol version. The highest version supported by + // both ends will be used for the connection, i.e. if one party supports + // DTLS 1.0 and the other DTLS 1.2, DTLS 1.0 will be used. + // If requested version is not supported by underlying crypto library, the + // next lower will be used. + virtual void SetMaxProtocolVersion(SSLProtocolVersion version) = 0; + + // Set the initial retransmission timeout for DTLS messages. When the timeout + // expires, the message gets retransmitted and the timeout is exponentially + // increased. + // This should only be called before StartSSL(). + virtual void SetInitialRetransmissionTimeout(int timeout_ms) = 0; + + // StartSSL starts negotiation with a peer, whose certificate is verified + // using the certificate digest. Generally, SetIdentity() and possibly + // SetServerRole() should have been called before this. + // SetPeerCertificateDigest() must also be called. It may be called after + // StartSSLWithPeer() but must be called before the underlying stream opens. + // + // Use of the stream prior to calling StartSSL will pass data in clear text. + // Calling StartSSL causes SSL negotiation to begin as soon as possible: right + // away if the underlying wrapped stream is already opened, or else as soon as + // it opens. + // + // StartSSL returns a negative error code on failure. Returning 0 means + // success so far, but negotiation is probably not complete and will continue + // asynchronously. In that case, the exposed stream will open after + // successful negotiation and verification, or an SE_CLOSE event will be + // raised if negotiation fails. + virtual int StartSSL() = 0; + + // Specify the digest of the certificate that our peer is expected to use. + // Only this certificate will be accepted during SSL verification. The + // certificate is assumed to have been obtained through some other secure + // channel (such as the signaling channel). This must specify the terminal + // certificate, not just a CA. SSLStream makes a copy of the digest value. + // + // Returns true if successful. + // |error| is optional and provides more information about the failure. + virtual bool SetPeerCertificateDigest( + const std::string& digest_alg, + const unsigned char* digest_val, + size_t digest_len, + SSLPeerCertificateDigestError* error = nullptr) = 0; + + // Retrieves the peer's X.509 certificate, if a connection has been + // established. It returns the transmitted over SSL, including the entire + // chain. + virtual std::unique_ptr GetPeerCertificate() const = 0; + + // Retrieves the IANA registration id of the cipher suite used for the + // connection (e.g. 0x2F for "TLS_RSA_WITH_AES_128_CBC_SHA"). + virtual bool GetSslCipherSuite(int* cipher_suite); + + virtual int GetSslVersion() const = 0; + + // Key Exporter interface from RFC 5705 + // Arguments are: + // label -- the exporter label. + // part of the RFC defining each exporter + // usage (IN) + // context/context_len -- a context to bind to for this connection; + // optional, can be null, 0 (IN) + // use_context -- whether to use the context value + // (needed to distinguish no context from + // zero-length ones). + // result -- where to put the computed value + // result_len -- the length of the computed value + virtual bool ExportKeyingMaterial(const std::string& label, + const uint8_t* context, + size_t context_len, + bool use_context, + uint8_t* result, + size_t result_len); + + // DTLS-SRTP interface + virtual bool SetDtlsSrtpCryptoSuites(const std::vector& crypto_suites); + virtual bool GetDtlsSrtpCryptoSuite(int* crypto_suite); + + // Returns true if a TLS connection has been established. + // The only difference between this and "GetState() == SE_OPEN" is that if + // the peer certificate digest hasn't been verified, the state will still be + // SS_OPENING but IsTlsConnected should return true. + virtual bool IsTlsConnected() = 0; + + // Capabilities testing. + // Used to have "DTLS supported", "DTLS-SRTP supported" etc. methods, but now + // that's assumed. + static bool IsBoringSsl(); + + // Returns true iff the supplied cipher is deemed to be strong. + // TODO(torbjorng): Consider removing the KeyType argument. + static bool IsAcceptableCipher(int cipher, KeyType key_type); + static bool IsAcceptableCipher(const std::string& cipher, KeyType key_type); + + // TODO(guoweis): Move this away from a static class method. Currently this is + // introduced such that any caller could depend on sslstreamadapter.h without + // depending on specific SSL implementation. + static std::string SslCipherSuiteToName(int cipher_suite); + + // Use our timeutils.h source of timing in BoringSSL, allowing us to test + // using a fake clock. + static void enable_time_callback_for_testing(); + + sigslot::signal1 SignalSSLHandshakeError; + + private: + // If true, the server certificate need not match the configured + // server_name, and in fact missing certificate authority and other + // verification errors are ignored. + bool ignore_bad_cert_; + + // If true (default), the client is required to provide a certificate during + // handshake. If no certificate is given, handshake fails. This applies to + // server mode only. + bool client_auth_enabled_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_SSLSTREAMADAPTER_H_ diff --git a/webrtc/rtc_base/sslstreamadapter_unittest.cc b/webrtc/base/sslstreamadapter_unittest.cc similarity index 100% rename from webrtc/rtc_base/sslstreamadapter_unittest.cc rename to webrtc/base/sslstreamadapter_unittest.cc diff --git a/webrtc/rtc_base/stream.cc b/webrtc/base/stream.cc similarity index 100% rename from webrtc/rtc_base/stream.cc rename to webrtc/base/stream.cc diff --git a/webrtc/base/stream.h b/webrtc/base/stream.h index 18dd865414..dbc2ad750a 100644 --- a/webrtc/base/stream.h +++ b/webrtc/base/stream.h @@ -11,9 +11,705 @@ #ifndef WEBRTC_BASE_STREAM_H_ #define WEBRTC_BASE_STREAM_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/stream.h" +#include + +#include "webrtc/base/buffer.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/criticalsection.h" +#include "webrtc/base/logging.h" +#include "webrtc/base/messagehandler.h" +#include "webrtc/base/messagequeue.h" +#include "webrtc/base/sigslot.h" + +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// +// StreamInterface is a generic asynchronous stream interface, supporting read, +// write, and close operations, and asynchronous signalling of state changes. +// The interface is designed with file, memory, and socket implementations in +// mind. Some implementations offer extended operations, such as seeking. +/////////////////////////////////////////////////////////////////////////////// + +// The following enumerations are declared outside of the StreamInterface +// class for brevity in use. + +// The SS_OPENING state indicates that the stream will signal open or closed +// in the future. +enum StreamState { SS_CLOSED, SS_OPENING, SS_OPEN }; + +// Stream read/write methods return this value to indicate various success +// and failure conditions described below. +enum StreamResult { SR_ERROR, SR_SUCCESS, SR_BLOCK, SR_EOS }; + +// StreamEvents are used to asynchronously signal state transitionss. The flags +// may be combined. +// SE_OPEN: The stream has transitioned to the SS_OPEN state +// SE_CLOSE: The stream has transitioned to the SS_CLOSED state +// SE_READ: Data is available, so Read is likely to not return SR_BLOCK +// SE_WRITE: Data can be written, so Write is likely to not return SR_BLOCK +enum StreamEvent { SE_OPEN = 1, SE_READ = 2, SE_WRITE = 4, SE_CLOSE = 8 }; + +class Thread; + +struct StreamEventData : public MessageData { + int events, error; + StreamEventData(int ev, int er) : events(ev), error(er) { } +}; + +class StreamInterface : public MessageHandler { + public: + enum { + MSG_POST_EVENT = 0xF1F1, MSG_MAX = MSG_POST_EVENT + }; + + ~StreamInterface() override; + + virtual StreamState GetState() const = 0; + + // Read attempts to fill buffer of size buffer_len. Write attempts to send + // data_len bytes stored in data. The variables read and write are set only + // on SR_SUCCESS (see below). Likewise, error is only set on SR_ERROR. + // Read and Write return a value indicating: + // SR_ERROR: an error occurred, which is returned in a non-null error + // argument. Interpretation of the error requires knowledge of the + // stream's concrete type, which limits its usefulness. + // SR_SUCCESS: some number of bytes were successfully written, which is + // returned in a non-null read/write argument. + // SR_BLOCK: the stream is in non-blocking mode, and the operation would + // block, or the stream is in SS_OPENING state. + // SR_EOS: the end-of-stream has been reached, or the stream is in the + // SS_CLOSED state. + virtual StreamResult Read(void* buffer, size_t buffer_len, + size_t* read, int* error) = 0; + virtual StreamResult Write(const void* data, size_t data_len, + size_t* written, int* error) = 0; + // Attempt to transition to the SS_CLOSED state. SE_CLOSE will not be + // signalled as a result of this call. + virtual void Close() = 0; + + // Streams may signal one or more StreamEvents to indicate state changes. + // The first argument identifies the stream on which the state change occured. + // The second argument is a bit-wise combination of StreamEvents. + // If SE_CLOSE is signalled, then the third argument is the associated error + // code. Otherwise, the value is undefined. + // Note: Not all streams will support asynchronous event signalling. However, + // SS_OPENING and SR_BLOCK returned from stream member functions imply that + // certain events will be raised in the future. + sigslot::signal3 SignalEvent; + + // Like calling SignalEvent, but posts a message to the specified thread, + // which will call SignalEvent. This helps unroll the stack and prevent + // re-entrancy. + void PostEvent(Thread* t, int events, int err); + // Like the aforementioned method, but posts to the current thread. + void PostEvent(int events, int err); + + // + // OPTIONAL OPERATIONS + // + // Not all implementations will support the following operations. In general, + // a stream will only support an operation if it reasonably efficient to do + // so. For example, while a socket could buffer incoming data to support + // seeking, it will not do so. Instead, a buffering stream adapter should + // be used. + // + // Even though several of these operations are related, you should + // always use whichever operation is most relevant. For example, you may + // be tempted to use GetSize() and GetPosition() to deduce the result of + // GetAvailable(). However, a stream which is read-once may support the + // latter operation but not the former. + // + + // The following four methods are used to avoid copying data multiple times. + + // GetReadData returns a pointer to a buffer which is owned by the stream. + // The buffer contains data_len bytes. null is returned if no data is + // available, or if the method fails. If the caller processes the data, it + // must call ConsumeReadData with the number of processed bytes. GetReadData + // does not require a matching call to ConsumeReadData if the data is not + // processed. Read and ConsumeReadData invalidate the buffer returned by + // GetReadData. + virtual const void* GetReadData(size_t* data_len); + virtual void ConsumeReadData(size_t used) {} + + // GetWriteBuffer returns a pointer to a buffer which is owned by the stream. + // The buffer has a capacity of buf_len bytes. null is returned if there is + // no buffer available, or if the method fails. The call may write data to + // the buffer, and then call ConsumeWriteBuffer with the number of bytes + // written. GetWriteBuffer does not require a matching call to + // ConsumeWriteData if no data is written. Write, ForceWrite, and + // ConsumeWriteData invalidate the buffer returned by GetWriteBuffer. + // TODO: Allow the caller to specify a minimum buffer size. If the specified + // amount of buffer is not yet available, return null and Signal SE_WRITE + // when it is available. If the requested amount is too large, return an + // error. + virtual void* GetWriteBuffer(size_t* buf_len); + virtual void ConsumeWriteBuffer(size_t used) {} + + // Write data_len bytes found in data, circumventing any throttling which + // would could cause SR_BLOCK to be returned. Returns true if all the data + // was written. Otherwise, the method is unsupported, or an unrecoverable + // error occurred, and the error value is set. This method should be used + // sparingly to write critical data which should not be throttled. A stream + // which cannot circumvent its blocking constraints should not implement this + // method. + // NOTE: This interface is being considered experimentally at the moment. It + // would be used by JUDP and BandwidthStream as a way to circumvent certain + // soft limits in writing. + //virtual bool ForceWrite(const void* data, size_t data_len, int* error) { + // if (error) *error = -1; + // return false; + //} + + // Seek to a byte offset from the beginning of the stream. Returns false if + // the stream does not support seeking, or cannot seek to the specified + // position. + virtual bool SetPosition(size_t position); + + // Get the byte offset of the current position from the start of the stream. + // Returns false if the position is not known. + virtual bool GetPosition(size_t* position) const; + + // Get the byte length of the entire stream. Returns false if the length + // is not known. + virtual bool GetSize(size_t* size) const; + + // Return the number of Read()-able bytes remaining before end-of-stream. + // Returns false if not known. + virtual bool GetAvailable(size_t* size) const; + + // Return the number of Write()-able bytes remaining before end-of-stream. + // Returns false if not known. + virtual bool GetWriteRemaining(size_t* size) const; + + // Return true if flush is successful. + virtual bool Flush(); + + // Communicates the amount of data which will be written to the stream. The + // stream may choose to preallocate memory to accomodate this data. The + // stream may return false to indicate that there is not enough room (ie, + // Write will return SR_EOS/SR_ERROR at some point). Note that calling this + // function should not affect the existing state of data in the stream. + virtual bool ReserveSize(size_t size); + + // + // CONVENIENCE METHODS + // + // These methods are implemented in terms of other methods, for convenience. + // + + // Seek to the start of the stream. + inline bool Rewind() { return SetPosition(0); } + + // WriteAll is a helper function which repeatedly calls Write until all the + // data is written, or something other than SR_SUCCESS is returned. Note that + // unlike Write, the argument 'written' is always set, and may be non-zero + // on results other than SR_SUCCESS. The remaining arguments have the + // same semantics as Write. + StreamResult WriteAll(const void* data, size_t data_len, + size_t* written, int* error); + + // Similar to ReadAll. Calls Read until buffer_len bytes have been read, or + // until a non-SR_SUCCESS result is returned. 'read' is always set. + StreamResult ReadAll(void* buffer, size_t buffer_len, + size_t* read, int* error); + + // ReadLine is a helper function which repeatedly calls Read until it hits + // the end-of-line character, or something other than SR_SUCCESS. + // TODO: this is too inefficient to keep here. Break this out into a buffered + // readline object or adapter + StreamResult ReadLine(std::string* line); + + protected: + StreamInterface(); + + // MessageHandler Interface + void OnMessage(Message* msg) override; + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(StreamInterface); +}; + +/////////////////////////////////////////////////////////////////////////////// +// StreamAdapterInterface is a convenient base-class for adapting a stream. +// By default, all operations are pass-through. Override the methods that you +// require adaptation. Streams should really be upgraded to reference-counted. +// In the meantime, use the owned flag to indicate whether the adapter should +// own the adapted stream. +/////////////////////////////////////////////////////////////////////////////// + +class StreamAdapterInterface : public StreamInterface, + public sigslot::has_slots<> { + public: + explicit StreamAdapterInterface(StreamInterface* stream, bool owned = true); + + // Core Stream Interface + StreamState GetState() const override; + StreamResult Read(void* buffer, + size_t buffer_len, + size_t* read, + int* error) override; + StreamResult Write(const void* data, + size_t data_len, + size_t* written, + int* error) override; + void Close() override; + + // Optional Stream Interface + /* Note: Many stream adapters were implemented prior to this Read/Write + interface. Therefore, a simple pass through of data in those cases may + be broken. At a later time, we should do a once-over pass of all + adapters, and make them compliant with these interfaces, after which this + code can be uncommented. + virtual const void* GetReadData(size_t* data_len) { + return stream_->GetReadData(data_len); + } + virtual void ConsumeReadData(size_t used) { + stream_->ConsumeReadData(used); + } + + virtual void* GetWriteBuffer(size_t* buf_len) { + return stream_->GetWriteBuffer(buf_len); + } + virtual void ConsumeWriteBuffer(size_t used) { + stream_->ConsumeWriteBuffer(used); + } + */ + + /* Note: This interface is currently undergoing evaluation. + virtual bool ForceWrite(const void* data, size_t data_len, int* error) { + return stream_->ForceWrite(data, data_len, error); + } + */ + + bool SetPosition(size_t position) override; + bool GetPosition(size_t* position) const override; + bool GetSize(size_t* size) const override; + bool GetAvailable(size_t* size) const override; + bool GetWriteRemaining(size_t* size) const override; + bool ReserveSize(size_t size) override; + bool Flush() override; + + void Attach(StreamInterface* stream, bool owned = true); + StreamInterface* Detach(); + + protected: + ~StreamAdapterInterface() override; + + // Note that the adapter presents itself as the origin of the stream events, + // since users of the adapter may not recognize the adapted object. + virtual void OnEvent(StreamInterface* stream, int events, int err); + StreamInterface* stream() { return stream_; } + + private: + StreamInterface* stream_; + bool owned_; + RTC_DISALLOW_COPY_AND_ASSIGN(StreamAdapterInterface); +}; + +/////////////////////////////////////////////////////////////////////////////// +// StreamTap is a non-modifying, pass-through adapter, which copies all data +// in either direction to the tap. Note that errors or blocking on writing to +// the tap will prevent further tap writes from occurring. +/////////////////////////////////////////////////////////////////////////////// + +class StreamTap : public StreamAdapterInterface { + public: + explicit StreamTap(StreamInterface* stream, StreamInterface* tap); + ~StreamTap() override; + + void AttachTap(StreamInterface* tap); + StreamInterface* DetachTap(); + StreamResult GetTapResult(int* error); + + // StreamAdapterInterface Interface + StreamResult Read(void* buffer, + size_t buffer_len, + size_t* read, + int* error) override; + StreamResult Write(const void* data, + size_t data_len, + size_t* written, + int* error) override; + + private: + std::unique_ptr tap_; + StreamResult tap_result_; + int tap_error_; + RTC_DISALLOW_COPY_AND_ASSIGN(StreamTap); +}; + +/////////////////////////////////////////////////////////////////////////////// +// NullStream gives errors on read, and silently discards all written data. +/////////////////////////////////////////////////////////////////////////////// + +class NullStream : public StreamInterface { + public: + NullStream(); + ~NullStream() override; + + // StreamInterface Interface + StreamState GetState() const override; + StreamResult Read(void* buffer, + size_t buffer_len, + size_t* read, + int* error) override; + StreamResult Write(const void* data, + size_t data_len, + size_t* written, + int* error) override; + void Close() override; +}; + +/////////////////////////////////////////////////////////////////////////////// +// FileStream is a simple implementation of a StreamInterface, which does not +// support asynchronous notification. +/////////////////////////////////////////////////////////////////////////////// + +class FileStream : public StreamInterface { + public: + FileStream(); + ~FileStream() override; + + // The semantics of filename and mode are the same as stdio's fopen + virtual bool Open(const std::string& filename, const char* mode, int* error); + virtual bool OpenShare(const std::string& filename, const char* mode, + int shflag, int* error); + + // By default, reads and writes are buffered for efficiency. Disabling + // buffering causes writes to block until the bytes on disk are updated. + virtual bool DisableBuffering(); + + StreamState GetState() const override; + StreamResult Read(void* buffer, + size_t buffer_len, + size_t* read, + int* error) override; + StreamResult Write(const void* data, + size_t data_len, + size_t* written, + int* error) override; + void Close() override; + bool SetPosition(size_t position) override; + bool GetPosition(size_t* position) const override; + bool GetSize(size_t* size) const override; + bool GetAvailable(size_t* size) const override; + bool ReserveSize(size_t size) override; + + bool Flush() override; + +#if defined(WEBRTC_POSIX) && !defined(__native_client__) + // Tries to aquire an exclusive lock on the file. + // Use OpenShare(...) on win32 to get similar functionality. + bool TryLock(); + bool Unlock(); +#endif + + // Note: Deprecated in favor of Filesystem::GetFileSize(). + static bool GetSize(const std::string& filename, size_t* size); + + protected: + virtual void DoClose(); + + FILE* file_; + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(FileStream); +}; + +/////////////////////////////////////////////////////////////////////////////// +// MemoryStream is a simple implementation of a StreamInterface over in-memory +// data. Data is read and written at the current seek position. Reads return +// end-of-stream when they reach the end of data. Writes actually extend the +// end of data mark. +/////////////////////////////////////////////////////////////////////////////// + +class MemoryStreamBase : public StreamInterface { + public: + StreamState GetState() const override; + StreamResult Read(void* buffer, + size_t bytes, + size_t* bytes_read, + int* error) override; + StreamResult Write(const void* buffer, + size_t bytes, + size_t* bytes_written, + int* error) override; + void Close() override; + bool SetPosition(size_t position) override; + bool GetPosition(size_t* position) const override; + bool GetSize(size_t* size) const override; + bool GetAvailable(size_t* size) const override; + bool ReserveSize(size_t size) override; + + char* GetBuffer() { return buffer_; } + const char* GetBuffer() const { return buffer_; } + + protected: + MemoryStreamBase(); + + virtual StreamResult DoReserve(size_t size, int* error); + + // Invariant: 0 <= seek_position <= data_length_ <= buffer_length_ + char* buffer_; + size_t buffer_length_; + size_t data_length_; + size_t seek_position_; + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(MemoryStreamBase); +}; + +// MemoryStream dynamically resizes to accomodate written data. + +class MemoryStream : public MemoryStreamBase { + public: + MemoryStream(); + explicit MemoryStream(const char* data); // Calls SetData(data, strlen(data)) + MemoryStream(const void* data, size_t length); // Calls SetData(data, length) + ~MemoryStream() override; + + void SetData(const void* data, size_t length); + + protected: + StreamResult DoReserve(size_t size, int* error) override; + // Memory Streams are aligned for efficiency. + static const int kAlignment = 16; + char* buffer_alloc_; +}; + +// ExternalMemoryStream adapts an external memory buffer, so writes which would +// extend past the end of the buffer will return end-of-stream. + +class ExternalMemoryStream : public MemoryStreamBase { + public: + ExternalMemoryStream(); + ExternalMemoryStream(void* data, size_t length); + ~ExternalMemoryStream() override; + + void SetData(void* data, size_t length); +}; + +// FifoBuffer allows for efficient, thread-safe buffering of data between +// writer and reader. As the data can wrap around the end of the buffer, +// MemoryStreamBase can't help us here. + +class FifoBuffer : public StreamInterface { + public: + // Creates a FIFO buffer with the specified capacity. + explicit FifoBuffer(size_t length); + // Creates a FIFO buffer with the specified capacity and owner + FifoBuffer(size_t length, Thread* owner); + ~FifoBuffer() override; + // Gets the amount of data currently readable from the buffer. + bool GetBuffered(size_t* data_len) const; + // Resizes the buffer to the specified capacity. Fails if data_length_ > size + bool SetCapacity(size_t length); + + // Read into |buffer| with an offset from the current read position, offset + // is specified in number of bytes. + // This method doesn't adjust read position nor the number of available + // bytes, user has to call ConsumeReadData() to do this. + StreamResult ReadOffset(void* buffer, size_t bytes, size_t offset, + size_t* bytes_read); + + // Write |buffer| with an offset from the current write position, offset is + // specified in number of bytes. + // This method doesn't adjust the number of buffered bytes, user has to call + // ConsumeWriteBuffer() to do this. + StreamResult WriteOffset(const void* buffer, size_t bytes, size_t offset, + size_t* bytes_written); + + // StreamInterface methods + StreamState GetState() const override; + StreamResult Read(void* buffer, + size_t bytes, + size_t* bytes_read, + int* error) override; + StreamResult Write(const void* buffer, + size_t bytes, + size_t* bytes_written, + int* error) override; + void Close() override; + const void* GetReadData(size_t* data_len) override; + void ConsumeReadData(size_t used) override; + void* GetWriteBuffer(size_t* buf_len) override; + void ConsumeWriteBuffer(size_t used) override; + bool GetWriteRemaining(size_t* size) const override; + + private: + // Helper method that implements ReadOffset. Caller must acquire a lock + // when calling this method. + StreamResult ReadOffsetLocked(void* buffer, size_t bytes, size_t offset, + size_t* bytes_read) + EXCLUSIVE_LOCKS_REQUIRED(crit_); + + // Helper method that implements WriteOffset. Caller must acquire a lock + // when calling this method. + StreamResult WriteOffsetLocked(const void* buffer, size_t bytes, + size_t offset, size_t* bytes_written) + EXCLUSIVE_LOCKS_REQUIRED(crit_); + + // keeps the opened/closed state of the stream + StreamState state_ GUARDED_BY(crit_); + // the allocated buffer + std::unique_ptr buffer_ GUARDED_BY(crit_); + // size of the allocated buffer + size_t buffer_length_ GUARDED_BY(crit_); + // amount of readable data in the buffer + size_t data_length_ GUARDED_BY(crit_); + // offset to the readable data + size_t read_position_ GUARDED_BY(crit_); + // stream callbacks are dispatched on this thread + Thread* owner_; + // object lock + CriticalSection crit_; + RTC_DISALLOW_COPY_AND_ASSIGN(FifoBuffer); +}; + +/////////////////////////////////////////////////////////////////////////////// + +class LoggingAdapter : public StreamAdapterInterface { + public: + LoggingAdapter(StreamInterface* stream, LoggingSeverity level, + const std::string& label, bool hex_mode = false); + + void set_label(const std::string& label); + + StreamResult Read(void* buffer, + size_t buffer_len, + size_t* read, + int* error) override; + StreamResult Write(const void* data, + size_t data_len, + size_t* written, + int* error) override; + void Close() override; + + protected: + void OnEvent(StreamInterface* stream, int events, int err) override; + + private: + LoggingSeverity level_; + std::string label_; + bool hex_mode_; + LogMultilineState lms_; + + RTC_DISALLOW_COPY_AND_ASSIGN(LoggingAdapter); +}; + +/////////////////////////////////////////////////////////////////////////////// +// StringStream - Reads/Writes to an external std::string +/////////////////////////////////////////////////////////////////////////////// + +class StringStream : public StreamInterface { + public: + explicit StringStream(std::string* str); + explicit StringStream(const std::string& str); + + StreamState GetState() const override; + StreamResult Read(void* buffer, + size_t buffer_len, + size_t* read, + int* error) override; + StreamResult Write(const void* data, + size_t data_len, + size_t* written, + int* error) override; + void Close() override; + bool SetPosition(size_t position) override; + bool GetPosition(size_t* position) const override; + bool GetSize(size_t* size) const override; + bool GetAvailable(size_t* size) const override; + bool ReserveSize(size_t size) override; + + private: + std::string& str_; + size_t read_pos_; + bool read_only_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// StreamReference - A reference counting stream adapter +/////////////////////////////////////////////////////////////////////////////// + +// Keep in mind that the streams and adapters defined in this file are +// not thread-safe, so this has limited uses. + +// A StreamRefCount holds the reference count and a pointer to the +// wrapped stream. It deletes the wrapped stream when there are no +// more references. We can then have multiple StreamReference +// instances pointing to one StreamRefCount, all wrapping the same +// stream. + +class StreamReference : public StreamAdapterInterface { + class StreamRefCount; + public: + // Constructor for the first reference to a stream + // Note: get more references through NewReference(). Use this + // constructor only once on a given stream. + explicit StreamReference(StreamInterface* stream); + StreamInterface* GetStream() { return stream(); } + StreamInterface* NewReference(); + ~StreamReference() override; + + private: + class StreamRefCount { + public: + explicit StreamRefCount(StreamInterface* stream) + : stream_(stream), ref_count_(1) { + } + void AddReference() { + CritScope lock(&cs_); + ++ref_count_; + } + void Release() { + int ref_count; + { // Atomic ops would have been a better fit here. + CritScope lock(&cs_); + ref_count = --ref_count_; + } + if (ref_count == 0) { + delete stream_; + delete this; + } + } + private: + StreamInterface* stream_; + int ref_count_; + CriticalSection cs_; + RTC_DISALLOW_COPY_AND_ASSIGN(StreamRefCount); + }; + + // Constructor for adding references + explicit StreamReference(StreamRefCount* stream_ref_count, + StreamInterface* stream); + + StreamRefCount* stream_ref_count_; + RTC_DISALLOW_COPY_AND_ASSIGN(StreamReference); +}; + +/////////////////////////////////////////////////////////////////////////////// + +// Flow attempts to move bytes from source to sink via buffer of size +// buffer_len. The function returns SR_SUCCESS when source reaches +// end-of-stream (returns SR_EOS), and all the data has been written successful +// to sink. Alternately, if source returns SR_BLOCK or SR_ERROR, or if sink +// returns SR_BLOCK, SR_ERROR, or SR_EOS, then the function immediately returns +// with the unexpected StreamResult value. +// data_len is the length of the valid data in buffer. in case of error +// this is the data that read from source but can't move to destination. +// as a pass in parameter, it indicates data in buffer that should move to sink +StreamResult Flow(StreamInterface* source, + char* buffer, + size_t buffer_len, + StreamInterface* sink, + size_t* data_len = nullptr); + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace rtc #endif // WEBRTC_BASE_STREAM_H_ diff --git a/webrtc/rtc_base/stream_unittest.cc b/webrtc/base/stream_unittest.cc similarity index 100% rename from webrtc/rtc_base/stream_unittest.cc rename to webrtc/base/stream_unittest.cc diff --git a/webrtc/rtc_base/string_to_number.cc b/webrtc/base/string_to_number.cc similarity index 100% rename from webrtc/rtc_base/string_to_number.cc rename to webrtc/base/string_to_number.cc diff --git a/webrtc/base/string_to_number.h b/webrtc/base/string_to_number.h index fa88ba4da3..8306f7cf89 100644 --- a/webrtc/base/string_to_number.h +++ b/webrtc/base/string_to_number.h @@ -11,9 +11,91 @@ #ifndef WEBRTC_BASE_STRING_TO_NUMBER_H_ #define WEBRTC_BASE_STRING_TO_NUMBER_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/string_to_number.h" +#include "webrtc/base/optional.h" + +namespace rtc { + +// This file declares a family of functions to parse integers from strings. +// The standard C library functions either fail to indicate errors (atoi, etc.) +// or are a hassle to work with (strtol, sscanf, etc.). The standard C++ library +// functions (std::stoi, etc.) indicate errors by throwing exceptions, which +// are disabled in WebRTC. +// +// Integers are parsed using one of the following functions: +// rtc::Optional StringToNumber(const char* str, int base = 10); +// rtc::Optional StringToNumber(const std::string& str, +// int base = 10); +// +// These functions parse a value from the beginning of a string into one of the +// fundamental integer types, or returns an empty Optional if parsing +// failed. Values outside of the range supported by the type will be +// rejected. The strings must begin with a digit or a minus sign. No leading +// space nor trailing contents are allowed. +// By setting base to 0, one of octal, decimal or hexadecimal will be +// detected from the string's prefix (0, nothing or 0x, respectively). +// If non-zero, base can be set to a value between 2 and 36 inclusively. +// +// If desired, this interface could be extended with support for floating-point +// types. + +namespace string_to_number_internal { +// These must be (unsigned) long long, to match the signature of strto(u)ll. +using unsigned_type = unsigned long long; // NOLINT(runtime/int) +using signed_type = long long; // NOLINT(runtime/int) + +rtc::Optional ParseSigned(const char* str, int base); +rtc::Optional ParseUnsigned(const char* str, int base); +} // namespace string_to_number_internal + +template +typename std::enable_if::value && std::is_signed::value, + rtc::Optional>::type +StringToNumber(const char* str, int base = 10) { + using string_to_number_internal::signed_type; + static_assert( + std::numeric_limits::max() <= + std::numeric_limits::max() && + std::numeric_limits::lowest() >= + std::numeric_limits::lowest(), + "StringToNumber only supports signed integers as large as long long int"); + rtc::Optional value = + string_to_number_internal::ParseSigned(str, base); + if (value && *value >= std::numeric_limits::lowest() && + *value <= std::numeric_limits::max()) { + return rtc::Optional(static_cast(*value)); + } + return rtc::Optional(); +} + +template +typename std::enable_if::value && + std::is_unsigned::value, + rtc::Optional>::type +StringToNumber(const char* str, int base = 10) { + using string_to_number_internal::unsigned_type; + static_assert(std::numeric_limits::max() <= + std::numeric_limits::max(), + "StringToNumber only supports unsigned integers as large as " + "unsigned long long int"); + rtc::Optional value = + string_to_number_internal::ParseUnsigned(str, base); + if (value && *value <= std::numeric_limits::max()) { + return rtc::Optional(static_cast(*value)); + } + return rtc::Optional(); +} + +// The std::string overloads only exists if there is a matching const char* +// version. +template +auto StringToNumber(const std::string& str, int base = 10) + -> decltype(StringToNumber(str.c_str(), base)) { + return StringToNumber(str.c_str(), base); +} + +} // namespace rtc #endif // WEBRTC_BASE_STRING_TO_NUMBER_H_ diff --git a/webrtc/rtc_base/string_to_number_unittest.cc b/webrtc/base/string_to_number_unittest.cc similarity index 100% rename from webrtc/rtc_base/string_to_number_unittest.cc rename to webrtc/base/string_to_number_unittest.cc diff --git a/webrtc/rtc_base/stringencode.cc b/webrtc/base/stringencode.cc similarity index 100% rename from webrtc/rtc_base/stringencode.cc rename to webrtc/base/stringencode.cc diff --git a/webrtc/base/stringencode.h b/webrtc/base/stringencode.h index 27b810ea3c..8f78ad1a64 100644 --- a/webrtc/base/stringencode.h +++ b/webrtc/base/stringencode.h @@ -11,9 +11,214 @@ #ifndef WEBRTC_BASE_STRINGENCODE_H_ #define WEBRTC_BASE_STRINGENCODE_H_ +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/stringencode.h" +#include "webrtc/base/checks.h" + +namespace rtc { + +////////////////////////////////////////////////////////////////////// +// String Encoding Utilities +////////////////////////////////////////////////////////////////////// + +// Convert an unsigned value to it's utf8 representation. Returns the length +// of the encoded string, or 0 if the encoding is longer than buflen - 1. +size_t utf8_encode(char* buffer, size_t buflen, unsigned long value); +// Decode the utf8 encoded value pointed to by source. Returns the number of +// bytes used by the encoding, or 0 if the encoding is invalid. +size_t utf8_decode(const char* source, size_t srclen, unsigned long* value); + +// Escaping prefixes illegal characters with the escape character. Compact, but +// illegal characters still appear in the string. +size_t escape(char * buffer, size_t buflen, + const char * source, size_t srclen, + const char * illegal, char escape); +// Note: in-place unescaping (buffer == source) is allowed. +size_t unescape(char * buffer, size_t buflen, + const char * source, size_t srclen, + char escape); + +// Encoding replaces illegal characters with the escape character and 2 hex +// chars, so it's a little less compact than escape, but completely removes +// illegal characters. note that hex digits should not be used as illegal +// characters. +size_t encode(char * buffer, size_t buflen, + const char * source, size_t srclen, + const char * illegal, char escape); +// Note: in-place decoding (buffer == source) is allowed. +size_t decode(char * buffer, size_t buflen, + const char * source, size_t srclen, + char escape); + +// Returns a list of characters that may be unsafe for use in the name of a +// file, suitable for passing to the 'illegal' member of escape or encode. +const char* unsafe_filename_characters(); + +// url_encode is an encode operation with a predefined set of illegal characters +// and escape character (for use in URLs, obviously). +size_t url_encode(char * buffer, size_t buflen, + const char * source, size_t srclen); +// Note: in-place decoding (buffer == source) is allowed. +size_t url_decode(char * buffer, size_t buflen, + const char * source, size_t srclen); + +// html_encode prevents data embedded in html from containing markup. +size_t html_encode(char * buffer, size_t buflen, + const char * source, size_t srclen); +// Note: in-place decoding (buffer == source) is allowed. +size_t html_decode(char * buffer, size_t buflen, + const char * source, size_t srclen); + +// xml_encode makes data suitable for inside xml attributes and values. +size_t xml_encode(char * buffer, size_t buflen, + const char * source, size_t srclen); +// Note: in-place decoding (buffer == source) is allowed. +size_t xml_decode(char * buffer, size_t buflen, + const char * source, size_t srclen); + +// Convert an unsigned value from 0 to 15 to the hex character equivalent... +char hex_encode(unsigned char val); +// ...and vice-versa. +bool hex_decode(char ch, unsigned char* val); + +// hex_encode shows the hex representation of binary data in ascii. +size_t hex_encode(char* buffer, size_t buflen, + const char* source, size_t srclen); + +// hex_encode, but separate each byte representation with a delimiter. +// |delimiter| == 0 means no delimiter +// If the buffer is too short, we return 0 +size_t hex_encode_with_delimiter(char* buffer, size_t buflen, + const char* source, size_t srclen, + char delimiter); + +// Helper functions for hex_encode. +std::string hex_encode(const std::string& str); +std::string hex_encode(const char* source, size_t srclen); +std::string hex_encode_with_delimiter(const char* source, size_t srclen, + char delimiter); + +// hex_decode converts ascii hex to binary. +size_t hex_decode(char* buffer, size_t buflen, + const char* source, size_t srclen); + +// hex_decode, assuming that there is a delimiter between every byte +// pair. +// |delimiter| == 0 means no delimiter +// If the buffer is too short or the data is invalid, we return 0. +size_t hex_decode_with_delimiter(char* buffer, size_t buflen, + const char* source, size_t srclen, + char delimiter); + +// Helper functions for hex_decode. +size_t hex_decode(char* buffer, size_t buflen, const std::string& source); +size_t hex_decode_with_delimiter(char* buffer, size_t buflen, + const std::string& source, char delimiter); + +// Apply any suitable string transform (including the ones above) to an STL +// string. Stack-allocated temporary space is used for the transformation, +// so value and source may refer to the same string. +typedef size_t (*Transform)(char * buffer, size_t buflen, + const char * source, size_t srclen); +size_t transform(std::string& value, size_t maxlen, const std::string& source, + Transform t); + +// Return the result of applying transform t to source. +std::string s_transform(const std::string& source, Transform t); + +// Convenience wrappers. +inline std::string s_url_encode(const std::string& source) { + return s_transform(source, url_encode); +} +inline std::string s_url_decode(const std::string& source) { + return s_transform(source, url_decode); +} + +// Splits the source string into multiple fields separated by delimiter, +// with duplicates of delimiter creating empty fields. +size_t split(const std::string& source, char delimiter, + std::vector* fields); + +// Splits the source string into multiple fields separated by delimiter, +// with duplicates of delimiter ignored. Trailing delimiter ignored. +size_t tokenize(const std::string& source, char delimiter, + std::vector* fields); + +// Tokenize, including the empty tokens. +size_t tokenize_with_empty_tokens(const std::string& source, + char delimiter, + std::vector* fields); + +// Tokenize and append the tokens to fields. Return the new size of fields. +size_t tokenize_append(const std::string& source, char delimiter, + std::vector* fields); + +// Splits the source string into multiple fields separated by delimiter, with +// duplicates of delimiter ignored. Trailing delimiter ignored. A substring in +// between the start_mark and the end_mark is treated as a single field. Return +// the size of fields. For example, if source is "filename +// \"/Library/Application Support/media content.txt\"", delimiter is ' ', and +// the start_mark and end_mark are '"', this method returns two fields: +// "filename" and "/Library/Application Support/media content.txt". +size_t tokenize(const std::string& source, char delimiter, char start_mark, + char end_mark, std::vector* fields); + +// Extract the first token from source as separated by delimiter, with +// duplicates of delimiter ignored. Return false if the delimiter could not be +// found, otherwise return true. +bool tokenize_first(const std::string& source, + const char delimiter, + std::string* token, + std::string* rest); + +// Safe sprintf to std::string +//void sprintf(std::string& value, size_t maxlen, const char * format, ...) +// PRINTF_FORMAT(3); + +// Convert arbitrary values to/from a string. + +template +static bool ToString(const T &t, std::string* s) { + RTC_DCHECK(s); + std::ostringstream oss; + oss << std::boolalpha << t; + *s = oss.str(); + return !oss.fail(); +} + +template +static bool FromString(const std::string& s, T* t) { + RTC_DCHECK(t); + std::istringstream iss(s); + iss >> std::boolalpha >> *t; + return !iss.fail(); +} + +// Inline versions of the string conversion routines. + +template +static inline std::string ToString(const T& val) { + std::string str; ToString(val, &str); return str; +} + +template +static inline T FromString(const std::string& str) { + T val; FromString(str, &val); return val; +} + +template +static inline T FromString(const T& defaultValue, const std::string& str) { + T val(defaultValue); FromString(str, &val); return val; +} + +// simple function to strip out characters which shouldn't be +// used in filenames +char make_char_safe_for_filename(char c); + +////////////////////////////////////////////////////////////////////// + +} // namespace rtc #endif // WEBRTC_BASE_STRINGENCODE_H__ diff --git a/webrtc/rtc_base/stringencode_unittest.cc b/webrtc/base/stringencode_unittest.cc similarity index 100% rename from webrtc/rtc_base/stringencode_unittest.cc rename to webrtc/base/stringencode_unittest.cc diff --git a/webrtc/base/stringize_macros.h b/webrtc/base/stringize_macros.h index 5f8a5b1b86..7e2f44da8a 100644 --- a/webrtc/base/stringize_macros.h +++ b/webrtc/base/stringize_macros.h @@ -18,9 +18,21 @@ #ifndef WEBRTC_BASE_STRINGIZE_MACROS_H_ #define WEBRTC_BASE_STRINGIZE_MACROS_H_ +// This is not very useful as it does not expand defined symbols if +// called directly. Use its counterpart without the _NO_EXPANSION +// suffix, below. +#define STRINGIZE_NO_EXPANSION(x) #x -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/stringize_macros.h" +// Use this to quote the provided parameter, first expanding it if it +// is a preprocessor symbol. +// +// For example, if: +// #define A FOO +// #define B(x) myobj->FunctionCall(x) +// +// Then: +// STRINGIZE(A) produces "FOO" +// STRINGIZE(B(y)) produces "myobj->FunctionCall(y)" +#define STRINGIZE(x) STRINGIZE_NO_EXPANSION(x) #endif // WEBRTC_BASE_STRINGIZE_MACROS_H_ diff --git a/webrtc/rtc_base/stringize_macros_unittest.cc b/webrtc/base/stringize_macros_unittest.cc similarity index 100% rename from webrtc/rtc_base/stringize_macros_unittest.cc rename to webrtc/base/stringize_macros_unittest.cc diff --git a/webrtc/rtc_base/stringutils.cc b/webrtc/base/stringutils.cc similarity index 100% rename from webrtc/rtc_base/stringutils.cc rename to webrtc/base/stringutils.cc diff --git a/webrtc/base/stringutils.h b/webrtc/base/stringutils.h index e3b5e07822..4c241f02de 100644 --- a/webrtc/base/stringutils.h +++ b/webrtc/base/stringutils.h @@ -8,12 +8,309 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_STRINGUTILS_H_ -#define WEBRTC_BASE_STRINGUTILS_H_ +#ifndef WEBRTC_BASE_STRINGUTILS_H__ +#define WEBRTC_BASE_STRINGUTILS_H__ +#include +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/stringutils.h" +#if defined(WEBRTC_WIN) +#include +#include +#define alloca _alloca +#endif // WEBRTC_WIN -#endif // WEBRTC_BASE_STRINGUTILS_H_ +#if defined(WEBRTC_POSIX) +#ifdef BSD +#include +#else // BSD +#include +#endif // !BSD +#endif // WEBRTC_POSIX + +#include + +/////////////////////////////////////////////////////////////////////////////// +// Generic string/memory utilities +/////////////////////////////////////////////////////////////////////////////// + +#define STACK_ARRAY(TYPE, LEN) static_cast(::alloca((LEN)*sizeof(TYPE))) + +namespace rtc { + +// Complement to memset. Verifies memory consists of count bytes of value c. +bool memory_check(const void* memory, int c, size_t count); + +// Determines whether the simple wildcard pattern matches target. +// Alpha characters in pattern match case-insensitively. +// Asterisks in pattern match 0 or more characters. +// Ex: string_match("www.TEST.GOOGLE.COM", "www.*.com") -> true +bool string_match(const char* target, const char* pattern); + +} // namespace rtc + +/////////////////////////////////////////////////////////////////////////////// +// Rename a bunch of common string functions so they are consistent across +// platforms and between char and wchar_t variants. +// Here is the full list of functions that are unified: +// strlen, strcmp, stricmp, strncmp, strnicmp +// strchr, vsnprintf, strtoul, tolowercase +// tolowercase is like tolower, but not compatible with end-of-file value +// +// It's not clear if we will ever use wchar_t strings on unix. In theory, +// all strings should be Utf8 all the time, except when interfacing with Win32 +// APIs that require Utf16. +/////////////////////////////////////////////////////////////////////////////// + +inline char tolowercase(char c) { + return static_cast(tolower(c)); +} + +#if defined(WEBRTC_WIN) + +inline size_t strlen(const wchar_t* s) { + return wcslen(s); +} +inline int strcmp(const wchar_t* s1, const wchar_t* s2) { + return wcscmp(s1, s2); +} +inline int stricmp(const wchar_t* s1, const wchar_t* s2) { + return _wcsicmp(s1, s2); +} +inline int strncmp(const wchar_t* s1, const wchar_t* s2, size_t n) { + return wcsncmp(s1, s2, n); +} +inline int strnicmp(const wchar_t* s1, const wchar_t* s2, size_t n) { + return _wcsnicmp(s1, s2, n); +} +inline const wchar_t* strchr(const wchar_t* s, wchar_t c) { + return wcschr(s, c); +} +inline const wchar_t* strstr(const wchar_t* haystack, const wchar_t* needle) { + return wcsstr(haystack, needle); +} +#ifndef vsnprintf +inline int vsnprintf(wchar_t* buf, size_t n, const wchar_t* fmt, va_list args) { + return _vsnwprintf(buf, n, fmt, args); +} +#endif // !vsnprintf +inline unsigned long strtoul(const wchar_t* snum, wchar_t** end, int base) { + return wcstoul(snum, end, base); +} +inline wchar_t tolowercase(wchar_t c) { + return static_cast(towlower(c)); +} + +#endif // WEBRTC_WIN + +#if defined(WEBRTC_POSIX) + +inline int _stricmp(const char* s1, const char* s2) { + return strcasecmp(s1, s2); +} +inline int _strnicmp(const char* s1, const char* s2, size_t n) { + return strncasecmp(s1, s2, n); +} + +#endif // WEBRTC_POSIX + +/////////////////////////////////////////////////////////////////////////////// +// Traits simplifies porting string functions to be CTYPE-agnostic +/////////////////////////////////////////////////////////////////////////////// + +namespace rtc { + +const size_t SIZE_UNKNOWN = static_cast(-1); + +template +struct Traits { + // STL string type + //typedef XXX string; + // Null-terminated string + //inline static const CTYPE* empty_str(); +}; + +/////////////////////////////////////////////////////////////////////////////// +// String utilities which work with char or wchar_t +/////////////////////////////////////////////////////////////////////////////// + +template +inline const CTYPE* nonnull(const CTYPE* str, const CTYPE* def_str = nullptr) { + return str ? str : (def_str ? def_str : Traits::empty_str()); +} + +template +const CTYPE* strchr(const CTYPE* str, const CTYPE* chs) { + for (size_t i=0; str[i]; ++i) { + for (size_t j=0; chs[j]; ++j) { + if (str[i] == chs[j]) { + return str + i; + } + } + } + return 0; +} + +template +const CTYPE* strchrn(const CTYPE* str, size_t slen, CTYPE ch) { + for (size_t i=0; i +size_t strlenn(const CTYPE* buffer, size_t buflen) { + size_t bufpos = 0; + while (buffer[bufpos] && (bufpos < buflen)) { + ++bufpos; + } + return bufpos; +} + +// Safe versions of strncpy, strncat, snprintf and vsnprintf that always +// null-terminate. + +template +size_t strcpyn(CTYPE* buffer, size_t buflen, + const CTYPE* source, size_t srclen = SIZE_UNKNOWN) { + if (buflen <= 0) + return 0; + + if (srclen == SIZE_UNKNOWN) { + srclen = strlenn(source, buflen - 1); + } else if (srclen >= buflen) { + srclen = buflen - 1; + } + memcpy(buffer, source, srclen * sizeof(CTYPE)); + buffer[srclen] = 0; + return srclen; +} + +template +size_t strcatn(CTYPE* buffer, size_t buflen, + const CTYPE* source, size_t srclen = SIZE_UNKNOWN) { + if (buflen <= 0) + return 0; + + size_t bufpos = strlenn(buffer, buflen - 1); + return bufpos + strcpyn(buffer + bufpos, buflen - bufpos, source, srclen); +} + +// Some compilers (clang specifically) require vsprintfn be defined before +// sprintfn. +template +size_t vsprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, + va_list args) { + int len = vsnprintf(buffer, buflen, format, args); + if ((len < 0) || (static_cast(len) >= buflen)) { + len = static_cast(buflen - 1); + buffer[len] = 0; + } + return len; +} + +template +size_t sprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, ...); +template +size_t sprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, ...) { + va_list args; + va_start(args, format); + size_t len = vsprintfn(buffer, buflen, format, args); + va_end(args); + return len; +} + +/////////////////////////////////////////////////////////////////////////////// +// Allow safe comparing and copying ascii (not UTF-8) with both wide and +// non-wide character strings. +/////////////////////////////////////////////////////////////////////////////// + +inline int asccmp(const char* s1, const char* s2) { + return strcmp(s1, s2); +} +inline int ascicmp(const char* s1, const char* s2) { + return _stricmp(s1, s2); +} +inline int ascncmp(const char* s1, const char* s2, size_t n) { + return strncmp(s1, s2, n); +} +inline int ascnicmp(const char* s1, const char* s2, size_t n) { + return _strnicmp(s1, s2, n); +} +inline size_t asccpyn(char* buffer, size_t buflen, + const char* source, size_t srclen = SIZE_UNKNOWN) { + return strcpyn(buffer, buflen, source, srclen); +} + +#if defined(WEBRTC_WIN) + +typedef wchar_t(*CharacterTransformation)(wchar_t); +inline wchar_t identity(wchar_t c) { return c; } +int ascii_string_compare(const wchar_t* s1, const char* s2, size_t n, + CharacterTransformation transformation); + +inline int asccmp(const wchar_t* s1, const char* s2) { + return ascii_string_compare(s1, s2, static_cast(-1), identity); +} +inline int ascicmp(const wchar_t* s1, const char* s2) { + return ascii_string_compare(s1, s2, static_cast(-1), tolowercase); +} +inline int ascncmp(const wchar_t* s1, const char* s2, size_t n) { + return ascii_string_compare(s1, s2, n, identity); +} +inline int ascnicmp(const wchar_t* s1, const char* s2, size_t n) { + return ascii_string_compare(s1, s2, n, tolowercase); +} +size_t asccpyn(wchar_t* buffer, size_t buflen, + const char* source, size_t srclen = SIZE_UNKNOWN); + +#endif // WEBRTC_WIN + +/////////////////////////////////////////////////////////////////////////////// +// Traits specializations +/////////////////////////////////////////////////////////////////////////////// + +template<> +struct Traits { + typedef std::string string; + inline static const char* empty_str() { return ""; } +}; + +/////////////////////////////////////////////////////////////////////////////// +// Traits specializations (Windows only, currently) +/////////////////////////////////////////////////////////////////////////////// + +#if defined(WEBRTC_WIN) + +template<> +struct Traits { + typedef std::wstring string; + inline static const wchar_t* empty_str() { return L""; } +}; + +#endif // WEBRTC_WIN + +// Replaces all occurrences of "search" with "replace". +void replace_substrs(const char *search, + size_t search_len, + const char *replace, + size_t replace_len, + std::string *s); + +// True iff s1 starts with s2. +bool starts_with(const char *s1, const char *s2); + +// True iff s1 ends with s2. +bool ends_with(const char *s1, const char *s2); + +// Remove leading and trailing whitespaces. +std::string string_trim(const std::string& s); + +} // namespace rtc + +#endif // WEBRTC_BASE_STRINGUTILS_H__ diff --git a/webrtc/rtc_base/stringutils_unittest.cc b/webrtc/base/stringutils_unittest.cc similarity index 100% rename from webrtc/rtc_base/stringutils_unittest.cc rename to webrtc/base/stringutils_unittest.cc diff --git a/webrtc/base/swap_queue.h b/webrtc/base/swap_queue.h index 711114748f..acb16b49a0 100644 --- a/webrtc/base/swap_queue.h +++ b/webrtc/base/swap_queue.h @@ -11,9 +11,201 @@ #ifndef WEBRTC_BASE_SWAP_QUEUE_H_ #define WEBRTC_BASE_SWAP_QUEUE_H_ +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/swap_queue.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/criticalsection.h" + +namespace webrtc { + +namespace internal { + +// (Internal; please don't use outside this file.) +template +bool NoopSwapQueueItemVerifierFunction(const T&) { + return true; +} + +} // namespace internal + +// Functor to use when supplying a verifier function for the queue. +template +class SwapQueueItemVerifier { + public: + bool operator()(const T& t) const { return QueueItemVerifierFunction(t); } +}; + +// This class is a fixed-size queue. A producer calls Insert() to insert +// an element of type T at the back of the queue, and a consumer calls +// Remove() to remove an element from the front of the queue. It's safe +// for the producer(s) and the consumer(s) to access the queue +// concurrently, from different threads. +// +// To avoid the construction, copying, and destruction of Ts that a naive +// queue implementation would require, for each "full" T passed from +// producer to consumer, SwapQueue passes an "empty" T in the other +// direction (an "empty" T is one that contains nothing of value for the +// consumer). This bidirectional movement is implemented with swap(). +// +// // Create queue: +// Bottle proto(568); // Prepare an empty Bottle. Heap allocates space for +// // 568 ml. +// SwapQueue q(N, proto); // Init queue with N copies of proto. +// // Each copy allocates on the heap. +// // Producer pseudo-code: +// Bottle b(568); // Prepare an empty Bottle. Heap allocates space for 568 ml. +// loop { +// b.Fill(amount); // Where amount <= 568 ml. +// q.Insert(&b); // Swap our full Bottle for an empty one from q. +// } +// +// // Consumer pseudo-code: +// Bottle b(568); // Prepare an empty Bottle. Heap allocates space for 568 ml. +// loop { +// q.Remove(&b); // Swap our empty Bottle for the next-in-line full Bottle. +// Drink(&b); +// } +// +// For a well-behaved Bottle class, there are no allocations in the +// producer, since it just fills an empty Bottle that's already large +// enough; no deallocations in the consumer, since it returns each empty +// Bottle to the queue after having drunk it; and no copies along the +// way, since the queue uses swap() everywhere to move full Bottles in +// one direction and empty ones in the other. +template > +class SwapQueue { + public: + // Creates a queue of size size and fills it with default constructed Ts. + explicit SwapQueue(size_t size) : queue_(size) { + RTC_DCHECK(VerifyQueueSlots()); + } + + // Same as above and accepts an item verification functor. + SwapQueue(size_t size, const QueueItemVerifier& queue_item_verifier) + : queue_item_verifier_(queue_item_verifier), queue_(size) { + RTC_DCHECK(VerifyQueueSlots()); + } + + // Creates a queue of size size and fills it with copies of prototype. + SwapQueue(size_t size, const T& prototype) : queue_(size, prototype) { + RTC_DCHECK(VerifyQueueSlots()); + } + + // Same as above and accepts an item verification functor. + SwapQueue(size_t size, + const T& prototype, + const QueueItemVerifier& queue_item_verifier) + : queue_item_verifier_(queue_item_verifier), queue_(size, prototype) { + RTC_DCHECK(VerifyQueueSlots()); + } + + // Resets the queue to have zero content wile maintaining the queue size. + void Clear() { + rtc::CritScope cs(&crit_queue_); + next_write_index_ = 0; + next_read_index_ = 0; + num_elements_ = 0; + } + + // Inserts a "full" T at the back of the queue by swapping *input with an + // "empty" T from the queue. + // Returns true if the item was inserted or false if not (the queue was full). + // When specified, the T given in *input must pass the ItemVerifier() test. + // The contents of *input after the call are then also guaranteed to pass the + // ItemVerifier() test. + bool Insert(T* input) RTC_WARN_UNUSED_RESULT { + RTC_DCHECK(input); + + rtc::CritScope cs(&crit_queue_); + + RTC_DCHECK(queue_item_verifier_(*input)); + + if (num_elements_ == queue_.size()) { + return false; + } + + using std::swap; + swap(*input, queue_[next_write_index_]); + + ++next_write_index_; + if (next_write_index_ == queue_.size()) { + next_write_index_ = 0; + } + + ++num_elements_; + + RTC_DCHECK_LT(next_write_index_, queue_.size()); + RTC_DCHECK_LE(num_elements_, queue_.size()); + + return true; + } + + // Removes the frontmost "full" T from the queue by swapping it with + // the "empty" T in *output. + // Returns true if an item could be removed or false if not (the queue was + // empty). When specified, The T given in *output must pass the ItemVerifier() + // test and the contents of *output after the call are then also guaranteed to + // pass the ItemVerifier() test. + bool Remove(T* output) RTC_WARN_UNUSED_RESULT { + RTC_DCHECK(output); + + rtc::CritScope cs(&crit_queue_); + + RTC_DCHECK(queue_item_verifier_(*output)); + + if (num_elements_ == 0) { + return false; + } + + using std::swap; + swap(*output, queue_[next_read_index_]); + + ++next_read_index_; + if (next_read_index_ == queue_.size()) { + next_read_index_ = 0; + } + + --num_elements_; + + RTC_DCHECK_LT(next_read_index_, queue_.size()); + RTC_DCHECK_LE(num_elements_, queue_.size()); + + return true; + } + + private: + // Verify that the queue slots complies with the ItemVerifier test. + bool VerifyQueueSlots() { + rtc::CritScope cs(&crit_queue_); + for (const auto& v : queue_) { + RTC_DCHECK(queue_item_verifier_(v)); + } + return true; + } + + rtc::CriticalSection crit_queue_; + + // TODO(peah): Change this to use std::function() once we can use C++11 std + // lib. + QueueItemVerifier queue_item_verifier_ GUARDED_BY(crit_queue_); + + // (next_read_index_ + num_elements_) % queue_.size() = + // next_write_index_ + size_t next_write_index_ GUARDED_BY(crit_queue_) = 0; + size_t next_read_index_ GUARDED_BY(crit_queue_) = 0; + size_t num_elements_ GUARDED_BY(crit_queue_) = 0; + + // queue_.size() is constant. + std::vector queue_ GUARDED_BY(crit_queue_); + + RTC_DISALLOW_COPY_AND_ASSIGN(SwapQueue); +}; + +} // namespace webrtc #endif // WEBRTC_BASE_SWAP_QUEUE_H_ diff --git a/webrtc/rtc_base/swap_queue_unittest.cc b/webrtc/base/swap_queue_unittest.cc similarity index 100% rename from webrtc/rtc_base/swap_queue_unittest.cc rename to webrtc/base/swap_queue_unittest.cc diff --git a/webrtc/base/task_queue.h b/webrtc/base/task_queue.h index 12f5cbbf9f..15b31aa717 100644 --- a/webrtc/base/task_queue.h +++ b/webrtc/base/task_queue.h @@ -11,9 +11,296 @@ #ifndef WEBRTC_BASE_TASK_QUEUE_H_ #define WEBRTC_BASE_TASK_QUEUE_H_ +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/task_queue.h" +#if defined(WEBRTC_MAC) && !defined(WEBRTC_BUILD_LIBEVENT) +#include +#endif + +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/criticalsection.h" + +#if defined(WEBRTC_WIN) || defined(WEBRTC_BUILD_LIBEVENT) +#include "webrtc/base/platform_thread.h" +#endif + +#if defined(WEBRTC_BUILD_LIBEVENT) +#include "webrtc/base/refcountedobject.h" +#include "webrtc/base/scoped_ref_ptr.h" + +struct event_base; +struct event; +#endif + +namespace rtc { + +// Base interface for asynchronously executed tasks. +// The interface basically consists of a single function, Run(), that executes +// on the target queue. For more details see the Run() method and TaskQueue. +class QueuedTask { + public: + QueuedTask() {} + virtual ~QueuedTask() {} + + // Main routine that will run when the task is executed on the desired queue. + // The task should return |true| to indicate that it should be deleted or + // |false| to indicate that the queue should consider ownership of the task + // having been transferred. Returning |false| can be useful if a task has + // re-posted itself to a different queue or is otherwise being re-used. + virtual bool Run() = 0; + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(QueuedTask); +}; + +// Simple implementation of QueuedTask for use with rtc::Bind and lambdas. +template +class ClosureTask : public QueuedTask { + public: + explicit ClosureTask(const Closure& closure) : closure_(closure) {} + + private: + bool Run() override { + closure_(); + return true; + } + + Closure closure_; +}; + +// Extends ClosureTask to also allow specifying cleanup code. +// This is useful when using lambdas if guaranteeing cleanup, even if a task +// was dropped (queue is too full), is required. +template +class ClosureTaskWithCleanup : public ClosureTask { + public: + ClosureTaskWithCleanup(const Closure& closure, Cleanup cleanup) + : ClosureTask(closure), cleanup_(cleanup) {} + ~ClosureTaskWithCleanup() { cleanup_(); } + + private: + Cleanup cleanup_; +}; + +// Convenience function to construct closures that can be passed directly +// to methods that support std::unique_ptr but not template +// based parameters. +template +static std::unique_ptr NewClosure(const Closure& closure) { + return std::unique_ptr(new ClosureTask(closure)); +} + +template +static std::unique_ptr NewClosure(const Closure& closure, + const Cleanup& cleanup) { + return std::unique_ptr( + new ClosureTaskWithCleanup(closure, cleanup)); +} + +// Implements a task queue that asynchronously executes tasks in a way that +// guarantees that they're executed in FIFO order and that tasks never overlap. +// Tasks may always execute on the same worker thread and they may not. +// To DCHECK that tasks are executing on a known task queue, use IsCurrent(). +// +// Here are some usage examples: +// +// 1) Asynchronously running a lambda: +// +// class MyClass { +// ... +// TaskQueue queue_("MyQueue"); +// }; +// +// void MyClass::StartWork() { +// queue_.PostTask([]() { Work(); }); +// ... +// +// 2) Doing work asynchronously on a worker queue and providing a notification +// callback on the current queue, when the work has been done: +// +// void MyClass::StartWorkAndLetMeKnowWhenDone( +// std::unique_ptr callback) { +// DCHECK(TaskQueue::Current()) << "Need to be running on a queue"; +// queue_.PostTaskAndReply([]() { Work(); }, std::move(callback)); +// } +// ... +// my_class->StartWorkAndLetMeKnowWhenDone( +// NewClosure([]() { LOG(INFO) << "The work is done!";})); +// +// 3) Posting a custom task on a timer. The task posts itself again after +// every running: +// +// class TimerTask : public QueuedTask { +// public: +// TimerTask() {} +// private: +// bool Run() override { +// ++count_; +// TaskQueue::Current()->PostDelayedTask( +// std::unique_ptr(this), 1000); +// // Ownership has been transferred to the next occurance, +// // so return false to prevent from being deleted now. +// return false; +// } +// int count_ = 0; +// }; +// ... +// queue_.PostDelayedTask( +// std::unique_ptr(new TimerTask()), 1000); +// +// For more examples, see task_queue_unittests.cc. +// +// A note on destruction: +// +// When a TaskQueue is deleted, pending tasks will not be executed but they will +// be deleted. The deletion of tasks may happen asynchronously after the +// TaskQueue itself has been deleted or it may happen synchronously while the +// TaskQueue instance is being deleted. This may vary from one OS to the next +// so assumptions about lifetimes of pending tasks should not be made. +class LOCKABLE TaskQueue { + public: + // TaskQueue priority levels. On some platforms these will map to thread + // priorities, on others such as Mac and iOS, GCD queue priorities. + enum class Priority { + NORMAL = 0, + HIGH, + LOW, + }; + + explicit TaskQueue(const char* queue_name, + Priority priority = Priority::NORMAL); + ~TaskQueue(); + + static TaskQueue* Current(); + + // Used for DCHECKing the current queue. + static bool IsCurrent(const char* queue_name); + bool IsCurrent() const; + + // TODO(tommi): For better debuggability, implement RTC_FROM_HERE. + + // Ownership of the task is passed to PostTask. + void PostTask(std::unique_ptr task); + void PostTaskAndReply(std::unique_ptr task, + std::unique_ptr reply, + TaskQueue* reply_queue); + void PostTaskAndReply(std::unique_ptr task, + std::unique_ptr reply); + + // Schedules a task to execute a specified number of milliseconds from when + // the call is made. The precision should be considered as "best effort" + // and in some cases, such as on Windows when all high precision timers have + // been used up, can be off by as much as 15 millseconds (although 8 would be + // more likely). This can be mitigated by limiting the use of delayed tasks. + void PostDelayedTask(std::unique_ptr task, uint32_t milliseconds); + + template + void PostTask(const Closure& closure) { + PostTask(std::unique_ptr(new ClosureTask(closure))); + } + + // See documentation above for performance expectations. + template + void PostDelayedTask(const Closure& closure, uint32_t milliseconds) { + PostDelayedTask( + std::unique_ptr(new ClosureTask(closure)), + milliseconds); + } + + template + void PostTaskAndReply(const Closure1& task, + const Closure2& reply, + TaskQueue* reply_queue) { + PostTaskAndReply( + std::unique_ptr(new ClosureTask(task)), + std::unique_ptr(new ClosureTask(reply)), + reply_queue); + } + + template + void PostTaskAndReply(std::unique_ptr task, + const Closure& reply) { + PostTaskAndReply(std::move(task), std::unique_ptr( + new ClosureTask(reply))); + } + + template + void PostTaskAndReply(const Closure& task, + std::unique_ptr reply) { + PostTaskAndReply( + std::unique_ptr(new ClosureTask(task)), + std::move(reply)); + } + + template + void PostTaskAndReply(const Closure1& task, const Closure2& reply) { + PostTaskAndReply( + std::unique_ptr(new ClosureTask(task)), + std::unique_ptr(new ClosureTask(reply))); + } + + private: +#if defined(WEBRTC_BUILD_LIBEVENT) + static void ThreadMain(void* context); + static void OnWakeup(int socket, short flags, void* context); // NOLINT + static void RunTask(int fd, short flags, void* context); // NOLINT + static void RunTimer(int fd, short flags, void* context); // NOLINT + + class ReplyTaskOwner; + class PostAndReplyTask; + class SetTimerTask; + + typedef RefCountedObject ReplyTaskOwnerRef; + + void PrepareReplyTask(scoped_refptr reply_task); + + struct QueueContext; + + int wakeup_pipe_in_ = -1; + int wakeup_pipe_out_ = -1; + event_base* event_base_; + std::unique_ptr wakeup_event_; + PlatformThread thread_; + rtc::CriticalSection pending_lock_; + std::list> pending_ GUARDED_BY(pending_lock_); + std::list> pending_replies_ + GUARDED_BY(pending_lock_); +#elif defined(WEBRTC_MAC) + struct QueueContext; + struct TaskContext; + struct PostTaskAndReplyContext; + dispatch_queue_t queue_; + QueueContext* const context_; +#elif defined(WEBRTC_WIN) + class ThreadState; + void RunPendingTasks(); + static void ThreadMain(void* context); + + class WorkerThread : public PlatformThread { + public: + WorkerThread(ThreadRunFunction func, + void* obj, + const char* thread_name, + ThreadPriority priority) + : PlatformThread(func, obj, thread_name, priority) {} + + bool QueueAPC(PAPCFUNC apc_function, ULONG_PTR data) { + return PlatformThread::QueueAPC(apc_function, data); + } + }; + WorkerThread thread_; + rtc::CriticalSection pending_lock_; + std::queue> pending_ GUARDED_BY(pending_lock_); + HANDLE in_queue_; +#else +#error not supported. +#endif + + RTC_DISALLOW_COPY_AND_ASSIGN(TaskQueue); +}; + +} // namespace rtc #endif // WEBRTC_BASE_TASK_QUEUE_H_ diff --git a/webrtc/rtc_base/task_queue_gcd.cc b/webrtc/base/task_queue_gcd.cc similarity index 100% rename from webrtc/rtc_base/task_queue_gcd.cc rename to webrtc/base/task_queue_gcd.cc diff --git a/webrtc/rtc_base/task_queue_libevent.cc b/webrtc/base/task_queue_libevent.cc similarity index 100% rename from webrtc/rtc_base/task_queue_libevent.cc rename to webrtc/base/task_queue_libevent.cc diff --git a/webrtc/rtc_base/task_queue_posix.cc b/webrtc/base/task_queue_posix.cc similarity index 100% rename from webrtc/rtc_base/task_queue_posix.cc rename to webrtc/base/task_queue_posix.cc diff --git a/webrtc/base/task_queue_posix.h b/webrtc/base/task_queue_posix.h index 6cb51a03c6..b677b78a38 100644 --- a/webrtc/base/task_queue_posix.h +++ b/webrtc/base/task_queue_posix.h @@ -11,9 +11,26 @@ #ifndef WEBRTC_BASE_TASK_QUEUE_POSIX_H_ #define WEBRTC_BASE_TASK_QUEUE_POSIX_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/task_queue_posix.h" +namespace rtc { + +class TaskQueue; + +namespace internal { + +class AutoSetCurrentQueuePtr { + public: + explicit AutoSetCurrentQueuePtr(TaskQueue* q); + ~AutoSetCurrentQueuePtr(); + + private: + TaskQueue* const prev_; +}; + +pthread_key_t GetQueuePtrTls(); + +} // namespace internal +} // namespace rtc #endif // WEBRTC_BASE_TASK_QUEUE_POSIX_H_ diff --git a/webrtc/rtc_base/task_queue_unittest.cc b/webrtc/base/task_queue_unittest.cc similarity index 100% rename from webrtc/rtc_base/task_queue_unittest.cc rename to webrtc/base/task_queue_unittest.cc diff --git a/webrtc/rtc_base/task_queue_win.cc b/webrtc/base/task_queue_win.cc similarity index 100% rename from webrtc/rtc_base/task_queue_win.cc rename to webrtc/base/task_queue_win.cc diff --git a/webrtc/base/template_util.h b/webrtc/base/template_util.h index 9a05643ddc..f3565a4c91 100644 --- a/webrtc/base/template_util.h +++ b/webrtc/base/template_util.h @@ -13,9 +13,115 @@ #ifndef WEBRTC_BASE_TEMPLATE_UTIL_H_ #define WEBRTC_BASE_TEMPLATE_UTIL_H_ +#include // For size_t. -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/template_util.h" +namespace rtc { + +// Template definitions from tr1. + +template +struct integral_constant { + static const T value = v; + typedef T value_type; + typedef integral_constant type; +}; + +template const T integral_constant::value; + +typedef integral_constant true_type; +typedef integral_constant false_type; + +template struct is_pointer : false_type {}; +template struct is_pointer : true_type {}; + +template struct is_same : public false_type {}; +template struct is_same : true_type {}; + +template struct is_array : public false_type {}; +template struct is_array : public true_type {}; +template struct is_array : public true_type {}; + +template struct is_non_const_reference : false_type {}; +template struct is_non_const_reference : true_type {}; +template struct is_non_const_reference : false_type {}; + +template struct is_void : false_type {}; +template <> struct is_void : true_type {}; + +// Helper useful for converting a tuple to variadic template function +// arguments. +// +// sequence_generator<3>::type will be sequence<0, 1, 2>. +template +struct sequence {}; +template +struct sequence_generator : sequence_generator {}; +template +struct sequence_generator<0, S...> { + typedef sequence type; +}; + +namespace internal { + +// Types YesType and NoType are guaranteed such that sizeof(YesType) < +// sizeof(NoType). +typedef char YesType; + +struct NoType { + YesType dummy[2]; +}; + +// This class is an implementation detail for is_convertible, and you +// don't need to know how it works to use is_convertible. For those +// who care: we declare two different functions, one whose argument is +// of type To and one with a variadic argument list. We give them +// return types of different size, so we can use sizeof to trick the +// compiler into telling us which function it would have chosen if we +// had called it with an argument of type From. See Alexandrescu's +// _Modern C++ Design_ for more details on this sort of trick. + +struct ConvertHelper { + template + static YesType Test(To); + + template + static NoType Test(...); + + template + static From& Create(); +}; + +// Used to determine if a type is a struct/union/class. Inspired by Boost's +// is_class type_trait implementation. +struct IsClassHelper { + template + static YesType Test(void(C::*)(void)); + + template + static NoType Test(...); +}; + +} // namespace internal + +// Inherits from true_type if From is convertible to To, false_type otherwise. +// +// Note that if the type is convertible, this will be a true_type REGARDLESS +// of whether or not the conversion would emit a warning. +template +struct is_convertible + : integral_constant( + internal::ConvertHelper::Create())) == + sizeof(internal::YesType)> { +}; + +template +struct is_class + : integral_constant(0)) == + sizeof(internal::YesType)> { +}; + +} // namespace rtc #endif // WEBRTC_BASE_TEMPLATE_UTIL_H_ diff --git a/webrtc/base/testbase64.h b/webrtc/base/testbase64.h index fc9846f1d8..39dd00ce38 100644 --- a/webrtc/base/testbase64.h +++ b/webrtc/base/testbase64.h @@ -1,19 +1,5 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ +/* This file was generated by googleclient/talk/binary2header.sh */ -#ifndef WEBRTC_BASE_TESTBASE64_H_ -#define WEBRTC_BASE_TESTBASE64_H_ - - -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/testbase64.h" - -#endif // WEBRTC_BASE_TESTBASE64_H_ +static unsigned char testbase64[] = { +0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xe1, 0x0d, 0x07, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x4d, 0x4d, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x01, 0x0e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x9e, 0x01, 0x0f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xbe, 0x01, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0xc3, 0x01, 0x12, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xcc, 0x01, 0x1b, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x28, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x01, 0x31, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x32, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x3c, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x04, 0x02, 0x13, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x87, 0x69, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x14, 0x00, 0x00, 0x02, 0xc4, 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, 0x20, 0x00, 0x53, 0x4f, 0x4e, 0x59, 0x00, 0x44, 0x53, 0x43, 0x2d, 0x50, 0x32, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x20, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x20, 0x37, 0x2e, 0x30, 0x00, 0x32, 0x30, 0x30, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x33, 0x30, 0x20, 0x32, 0x33, 0x3a, 0x31, 0x30, 0x3a, 0x30, 0x34, 0x00, 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58, 0x20, 0x31, 0x30, 0x2e, 0x34, 0x2e, 0x38, 0x00, 0x00, 0x1c, 0x82, 0x9a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x6a, 0x82, 0x9d, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x72, 0x88, 0x22, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x88, 0x27, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x64, 0x00, 0x00, 0x90, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x30, 0x32, 0x32, 0x30, 0x90, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02, 0x7a, 0x90, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02, 0x8e, 0x91, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x01, 0x02, 0x03, 0x00, 0x91, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xa2, 0x92, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xaa, 0x92, 0x05, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xb2, 0x92, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x92, 0x08, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x92, 0x09, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x92, 0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xba, 0xa0, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x30, 0x31, 0x30, 0x30, 0xa0, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0xa0, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0xa3, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x06, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x08, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x09, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x30, 0x30, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x32, 0x30, 0x20, 0x32, 0x33, 0x3a, 0x30, 0x35, 0x3a, 0x35, 0x32, 0x00, 0x32, 0x30, 0x30, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x32, 0x30, 0x20, 0x32, 0x33, 0x3a, 0x30, 0x35, 0x3a, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x12, 0x01, 0x1b, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x1a, 0x01, 0x28, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x02, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x22, 0x02, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x09, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xed, 0x00, 0x0c, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x5f, 0x43, 0x4d, 0x00, 0x02, 0xff, 0xee, 0x00, 0x0e, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x00, 0x64, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0c, 0x08, 0x08, 0x08, 0x09, 0x08, 0x0c, 0x09, 0x09, 0x0c, 0x11, 0x0b, 0x0a, 0x0b, 0x11, 0x15, 0x0f, 0x0c, 0x0c, 0x0f, 0x15, 0x18, 0x13, 0x13, 0x15, 0x13, 0x13, 0x18, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x01, 0x0d, 0x0b, 0x0b, 0x0d, 0x0e, 0x0d, 0x10, 0x0e, 0x0e, 0x10, 0x14, 0x0e, 0x0e, 0x0e, 0x14, 0x14, 0x0e, 0x0e, 0x0e, 0x0e, 0x14, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x64, 0x00, 0x64, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xdd, 0x00, 0x04, 0x00, 0x07, 0xff, 0xc4, 0x01, 0x3f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x01, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x01, 0x04, 0x01, 0x03, 0x02, 0x04, 0x02, 0x05, 0x07, 0x06, 0x08, 0x05, 0x03, 0x0c, 0x33, 0x01, 0x00, 0x02, 0x11, 0x03, 0x04, 0x21, 0x12, 0x31, 0x05, 0x41, 0x51, 0x61, 0x13, 0x22, 0x71, 0x81, 0x32, 0x06, 0x14, 0x91, 0xa1, 0xb1, 0x42, 0x23, 0x24, 0x15, 0x52, 0xc1, 0x62, 0x33, 0x34, 0x72, 0x82, 0xd1, 0x43, 0x07, 0x25, 0x92, 0x53, 0xf0, 0xe1, 0xf1, 0x63, 0x73, 0x35, 0x16, 0xa2, 0xb2, 0x83, 0x26, 0x44, 0x93, 0x54, 0x64, 0x45, 0xc2, 0xa3, 0x74, 0x36, 0x17, 0xd2, 0x55, 0xe2, 0x65, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x27, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x11, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x06, 0x05, 0x35, 0x01, 0x00, 0x02, 0x11, 0x03, 0x21, 0x31, 0x12, 0x04, 0x41, 0x51, 0x61, 0x71, 0x22, 0x13, 0x05, 0x32, 0x81, 0x91, 0x14, 0xa1, 0xb1, 0x42, 0x23, 0xc1, 0x52, 0xd1, 0xf0, 0x33, 0x24, 0x62, 0xe1, 0x72, 0x82, 0x92, 0x43, 0x53, 0x15, 0x63, 0x73, 0x34, 0xf1, 0x25, 0x06, 0x16, 0xa2, 0xb2, 0x83, 0x07, 0x26, 0x35, 0xc2, 0xd2, 0x44, 0x93, 0x54, 0xa3, 0x17, 0x64, 0x45, 0x55, 0x36, 0x74, 0x65, 0xe2, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xf2, 0xed, 0xb2, 0x8d, 0x4d, 0x45, 0xcd, 0x2f, 0x3f, 0x44, 0x68, 0x93, 0xc3, 0x58, 0xc8, 0xf1, 0x1f, 0x8a, 0x33, 0x86, 0xda, 0x58, 0xc1, 0xa0, 0x02, 0x4f, 0xc4, 0xa1, 0x69, 0xa5, 0x9b, 0x5b, 0x4b, 0x84, 0x73, 0xdf, 0xc9, 0x15, 0xf8, 0xe3, 0xd1, 0x0e, 0x07, 0x93, 0xf3, 0xd1, 0x0f, 0x1c, 0x17, 0xef, 0x2e, 0x3b, 0x5b, 0xdc, 0xff, 0x00, 0xdf, 0x42, 0xbf, 0x8f, 0x8e, 0xdc, 0x82, 0xca, 0xd8, 0x37, 0x11, 0xa9, 0x3d, 0x82, 0x69, 0x2b, 0xc4, 0x6d, 0xc9, 0x75, 0x25, 0xbc, 0xf7, 0xec, 0xa1, 0xb5, 0x74, 0x19, 0x5d, 0x2e, 0x8a, 0x9a, 0x4b, 0x89, 0x7d, 0xc4, 0x68, 0xc6, 0xf6, 0xfe, 0xb2, 0xa0, 0x30, 0x1d, 0x60, 0x86, 0x88, 0x8d, 0x49, 0x3e, 0x01, 0x11, 0x20, 0xa3, 0x8c, 0xb9, 0xb1, 0xaa, 0x62, 0xad, 0xbf, 0x18, 0x97, 0x43, 0x47, 0x1d, 0xd2, 0xaf, 0x04, 0xd9, 0xb8, 0xc8, 0x0d, 0x68, 0xe4, 0xf7, 0x3e, 0x48, 0xf1, 0x05, 0xbc, 0x25, 0xaa, 0x07, 0x71, 0xd9, 0x14, 0x78, 0xf6, 0x49, 0xb5, 0x90, 0xfd, 0xa7, 0xc6, 0x14, 0xfd, 0x1b, 0x1c, 0xff, 0x00, 0x4d, 0x8d, 0x2e, 0x73, 0x8c, 0x35, 0xa3, 0x52, 0x4f, 0x92, 0x48, 0xa6, 0x1a, 0x24, 0xb6, 0x2a, 0xfa, 0xa5, 0x9e, 0x60, 0x64, 0x39, 0x94, 0x13, 0xcb, 0x27, 0x73, 0x80, 0xf3, 0x0c, 0xf6, 0xff, 0x00, 0xd2, 0x5a, 0x78, 0xbf, 0x53, 0x71, 0xf6, 0x01, 0x75, 0xb6, 0x97, 0x6a, 0x25, 0xa1, 0xad, 0x1f, 0xf4, 0xb7, 0x23, 0x48, 0xb7, 0x94, 0x84, 0x97, 0x5b, 0xff, 0x00, 0x32, 0xa9, 0xdd, 0xfc, 0xed, 0x9b, 0x7e, 0x0d, 0x9e, 0x52, 0x4a, 0x95, 0x61, 0xff, 0xd0, 0xf3, 0x3b, 0xa7, 0x70, 0xee, 0x01, 0x8f, 0xb9, 0x59, 0xfa, 0x7e, 0xdf, 0xe4, 0xc8, 0xf9, 0x2a, 0xc2, 0x5c, 0x63, 0xc3, 0x54, 0x67, 0x87, 0x6e, 0x10, 0x35, 0x68, 0xd4, 0x79, 0x1e, 0x53, 0x4a, 0xe0, 0xdc, 0xe9, 0xb8, 0x1f, 0x6a, 0xda, 0x6c, 0x25, 0x94, 0x37, 0xb0, 0xd0, 0xb8, 0xad, 0x67, 0xe4, 0x55, 0x8a, 0x5b, 0x8b, 0x82, 0xc0, 0x6f, 0x76, 0x80, 0x34, 0x49, 0x05, 0x2e, 0x9e, 0xc6, 0x1c, 0x66, 0x31, 0xba, 0x10, 0x23, 0xe0, 0xaf, 0xe1, 0x61, 0x53, 0x43, 0x8d, 0x81, 0xb3, 0x67, 0xef, 0x9e, 0x49, 0x2a, 0x12, 0x6c, 0xb6, 0x63, 0x1a, 0x0c, 0x31, 0xba, 0x55, 0xcd, 0xac, 0xfa, 0x8e, 0xdf, 0x91, 0x6e, 0x91, 0xd9, 0xb3, 0xc9, 0x73, 0x90, 0x7a, 0xab, 0x6a, 0xc2, 0xa4, 0x60, 0xe2, 0x8f, 0xd2, 0x38, 0x03, 0x7d, 0x9e, 0x0d, 0xff, 0x00, 0xcc, 0xd6, 0xd3, 0x6b, 0x71, 0x67, 0xd2, 0x3e, 0x64, 0x72, 0xab, 0xdb, 0x8d, 0x54, 0x39, 0xc5, 0x83, 0x6b, 0x3d, 0xee, 0x2e, 0xd4, 0x92, 0x3c, 0x4a, 0x56, 0xba, 0xb4, 0x79, 0x5c, 0xf7, 0xb2, 0x96, 0x6c, 0x8d, 0xaf, 0x80, 0x48, 0x3c, 0xf0, 0xb2, 0x1f, 0x63, 0x9c, 0xe9, 0x3f, 0x24, 0x5c, 0xdb, 0xdd, 0x76, 0x43, 0xde, 0xfd, 0x5c, 0xe3, 0x24, 0xfc, 0x50, 0x00, 0x93, 0x0a, 0x78, 0x8a, 0x0d, 0x49, 0xca, 0xcf, 0x93, 0x63, 0x1b, 0x7d, 0xd7, 0x57, 0x50, 0xd5, 0xef, 0x70, 0x6b, 0x4f, 0xc7, 0x45, 0xdb, 0x74, 0x9e, 0x8d, 0x5e, 0x33, 0x83, 0xd8, 0x37, 0xdd, 0xc3, 0xac, 0x3d, 0xbf, 0x92, 0xc5, 0x5b, 0xea, 0xbf, 0xd5, 0x62, 0xc0, 0xdc, 0xbc, 0xbd, 0x2d, 0x22, 0x5a, 0xcf, 0xdd, 0x69, 0xff, 0x00, 0xd1, 0x8e, 0x5d, 0xa5, 0x38, 0xb5, 0xb0, 0x00, 0xc6, 0xc4, 0x24, 0x4a, 0xd6, 0x8d, 0x18, 0x04, 0x49, 0x88, 0x9e, 0x55, 0xd6, 0x61, 0xb0, 0xc1, 0x70, 0x32, 0xdd, 0x3c, 0x95, 0xda, 0xf1, 0xfe, 0xf5, 0x62, 0xbc, 0x76, 0x8e, 0x75, 0x28, 0x02, 0xa2, 0xe7, 0x7d, 0x92, 0xb9, 0x84, 0x96, 0x96, 0xda, 0xf7, 0x70, 0x12, 0x4e, 0x5a, 0xff, 0x00, 0xff, 0xd1, 0xf3, 0x7a, 0x21, 0xaf, 0xde, 0xef, 0xa2, 0x22, 0x55, 0xfc, 0x5a, 0xbd, 0x42, 0xfb, 0x08, 0xfa, 0x67, 0x4f, 0x82, 0xcd, 0x6d, 0x85, 0xc0, 0x56, 0x3b, 0x90, 0xb7, 0xf0, 0x2a, 0x0e, 0x63, 0x58, 0x3b, 0xf2, 0xa3, 0x9e, 0x8c, 0xb8, 0x86, 0xbe, 0x49, 0xf1, 0x2c, 0x0c, 0x86, 0xb4, 0x4c, 0x69, 0xe4, 0xaf, 0x6e, 0xcc, 0x6b, 0x7d, 0x46, 0xb3, 0x70, 0xec, 0x38, 0x51, 0x7d, 0x02, 0x8a, 0xc7, 0xa6, 0xd9, 0x20, 0x68, 0x0f, 0x8f, 0x8a, 0xcf, 0xc9, 0xc2, 0xea, 0x59, 0x5b, 0x48, 0xb0, 0x91, 0xae, 0xe6, 0xc9, 0x03, 0xc9, 0x30, 0x51, 0x66, 0xd4, 0x0d, 0xad, 0xbd, 0x5f, 0x53, 0xcc, 0x6b, 0xb6, 0x90, 0x5a, 0x3b, 0x83, 0x0b, 0x43, 0x17, 0x31, 0xd6, 0xc3, 0x6e, 0x12, 0x3b, 0x79, 0xac, 0xc1, 0x89, 0x47, 0xd9, 0xe8, 0x63, 0x98, 0x45, 0xed, 0x6c, 0x5a, 0xf1, 0xa0, 0x27, 0xc5, 0x5b, 0xc3, 0x6f, 0xa6, 0xe0, 0x1c, 0x7d, 0xb3, 0xa2, 0x69, 0x34, 0x7b, 0xae, 0x1a, 0x8d, 0x45, 0x17, 0x9d, 0xeb, 0xfd, 0x21, 0xd8, 0xb9, 0xae, 0xb5, 0x80, 0xbb, 0x1e, 0xd2, 0x5c, 0xd7, 0x78, 0x13, 0xf9, 0xae, 0x4b, 0xea, 0xc7, 0x4a, 0x39, 0xbd, 0x55, 0xb3, 0xed, 0x66, 0x38, 0xf5, 0x09, 0x22, 0x41, 0x23, 0xe8, 0x37, 0xfb, 0x4b, 0xa1, 0xeb, 0xd6, 0xfe, 0x88, 0x31, 0xbf, 0x41, 0xc0, 0xee, 0xd2, 0x74, 0x02, 0x78, 0x53, 0xfa, 0x97, 0x43, 0x19, 0x85, 0x65, 0xff, 0x00, 0x9d, 0x71, 0x33, 0xe4, 0x1a, 0x7d, 0x8d, 0x53, 0x42, 0x56, 0x35, 0x6b, 0xe5, 0x80, 0x06, 0xc7, 0x57, 0xa7, 0xc4, 0xa9, 0xdb, 0xb6, 0x81, 0x1f, 0xeb, 0xd9, 0x69, 0x56, 0xc2, 0xd0, 0x00, 0xe5, 0x55, 0xc0, 0x12, 0xc2, 0xd7, 0x4e, 0xa2, 0x5a, 0x7c, 0x0a, 0xd0, 0x63, 0x9a, 0xd1, 0xaf, 0xd2, 0xe2, 0x3c, 0x12, 0x62, 0x66, 0xc6, 0x42, 0x23, 0x5a, 0x49, 0x8f, 0x10, 0xa2, 0xd2, 0x3e, 0x28, 0x9d, 0xc4, 0x88, 0x09, 0x29, 0x16, 0xc3, 0x3c, 0x24, 0x8d, 0xe6, 0x92, 0x72, 0x1f, 0xff, 0xd2, 0xf3, 0xbb, 0xb0, 0xfe, 0xcb, 0x99, 0xe9, 0xce, 0xf6, 0x88, 0x2d, 0x77, 0x91, 0x5b, 0x3d, 0x3d, 0xd0, 0xe6, 0x90, 0xa9, 0x65, 0x57, 0x38, 0x95, 0xdd, 0xcb, 0x9a, 0x7d, 0xce, 0xf2, 0x3f, 0x44, 0x23, 0x60, 0x58, 0x76, 0xe9, 0xca, 0x8c, 0xea, 0x1b, 0x31, 0x02, 0x32, 0x23, 0xea, 0xee, 0xb1, 0xcd, 0xb0, 0xc7, 0x87, 0x74, 0x7a, 0xeb, 0x70, 0x1a, 0x71, 0xe1, 0xfe, 0xe4, 0x1c, 0x1d, 0xae, 0xe5, 0x69, 0xd8, 0xfa, 0x99, 0x50, 0x0d, 0x1a, 0xf7, 0x2a, 0x3a, 0x0c, 0xf4, 0x1a, 0x8e, 0xc7, 0x27, 0x5d, 0xbf, 0x18, 0x41, 0xdc, 0xc2, 0xf0, 0x7f, 0x74, 0xf6, 0x3a, 0x22, 0x66, 0xdb, 0x68, 0xc6, 0x80, 0x48, 0x6b, 0x88, 0x06, 0x39, 0x0d, 0xee, 0xaa, 0x1f, 0xb3, 0xd5, 0x1b, 0x83, 0xd8, 0x3b, 0x38, 0x8f, 0x69, 0xfe, 0xdf, 0xd1, 0x4d, 0x29, 0xa1, 0x4c, 0x7a, 0xf4, 0xbf, 0xa7, 0x92, 0xcf, 0xa5, 0x20, 0x08, 0xf3, 0xf6, 0xff, 0x00, 0x15, 0xbb, 0xd1, 0x31, 0xd9, 0x5e, 0x3d, 0x75, 0x56, 0x36, 0x88, 0x00, 0x81, 0xe0, 0x16, 0x5e, 0x55, 0x74, 0x3f, 0x00, 0x9d, 0xe0, 0xcc, 0x69, 0xe7, 0x3a, 0x2d, 0xbe, 0x90, 0x00, 0xa9, 0xae, 0xef, 0x1f, 0x95, 0x4b, 0x0d, 0x9a, 0xdc, 0xc7, 0x45, 0xfe, 0xb1, 0x7d, 0x60, 0xa7, 0xa1, 0xe0, 0x1f, 0x4e, 0x1d, 0x99, 0x69, 0x02, 0x9a, 0xcf, 0x1f, 0xca, 0x7b, 0xbf, 0x90, 0xc5, 0xc2, 0xb3, 0xeb, 0x57, 0xd6, 0x03, 0x6b, 0xae, 0x39, 0xb6, 0x82, 0xe3, 0x31, 0xa1, 0x68, 0xf2, 0x6b, 0x5c, 0x12, 0xfa, 0xe1, 0x91, 0x66, 0x47, 0x5d, 0xb8, 0x3b, 0x4f, 0x44, 0x36, 0xb6, 0x8f, 0x28, 0xdd, 0xff, 0x00, 0x7e, 0x46, 0xab, 0x12, 0x2b, 0x65, 0x55, 0x32, 0xa7, 0x62, 0xb6, 0xbd, 0xf7, 0x64, 0x10, 0xdb, 0x03, 0x9f, 0x1b, 0x9e, 0xc7, 0xd9, 0xb8, 0x3b, 0x1f, 0x67, 0xf3, 0x6c, 0x52, 0x80, 0xd7, 0x7d, 0x0f, 0xea, 0x7f, 0x5d, 0x1d, 0x67, 0xa6, 0x0b, 0x1e, 0x47, 0xda, 0x69, 0x3b, 0x2e, 0x03, 0xc7, 0xf3, 0x5f, 0x1f, 0xf0, 0x8b, 0xa1, 0x02, 0x46, 0xba, 0x79, 0xaf, 0x32, 0xff, 0x00, 0x16, 0xad, 0xca, 0x1d, 0x57, 0x2a, 0xdc, 0x79, 0x18, 0x41, 0xb0, 0xf6, 0x9e, 0xe4, 0x9f, 0xd0, 0x8f, 0xeb, 0x31, 0xab, 0xd2, 0x83, 0xa4, 0xcb, 0x8c, 0xb8, 0xa0, 0x42, 0x12, 0x7b, 0x67, 0x9f, 0x2f, 0xf5, 0x09, 0x26, 0x96, 0xc4, 0xce, 0xa9, 0x20, 0xa7, 0xff, 0xd3, 0xf3, 0x2f, 0xb4, 0x5d, 0xe9, 0x0a, 0xb7, 0x9f, 0x4c, 0x19, 0xdb, 0x3a, 0x2d, 0x5e, 0x94, 0xfd, 0xc4, 0xb7, 0xc5, 0x62, 0xf9, 0x2b, 0xfd, 0x2e, 0xe3, 0x5d, 0xe0, 0x7c, 0x13, 0x48, 0xd1, 0x92, 0x12, 0xa9, 0x0b, 0x7a, 0xbc, 0x2d, 0xc2, 0x7f, 0x92, 0x60, 0xab, 0x4e, 0x79, 0x2e, 0x00, 0xf0, 0xaa, 0xe1, 0xda, 0x3d, 0x43, 0xfc, 0xad, 0x55, 0xbb, 0x80, 0x79, 0x81, 0xa0, 0xe6, 0x54, 0x32, 0x6d, 0x02, 0xbe, 0xf3, 0x61, 0x81, 0xa8, 0x44, 0x14, 0x03, 0x59, 0x0e, 0x1c, 0xf6, 0x1f, 0xdc, 0xb2, 0xec, 0xa3, 0x23, 0x77, 0xe8, 0x6e, 0x70, 0xf2, 0x25, 0x1f, 0x1f, 0x17, 0xa9, 0x6d, 0x71, 0x36, 0x97, 0x47, 0x00, 0xa4, 0x02, 0xe0, 0x2c, 0x7c, 0xc1, 0xab, 0xd5, 0x31, 0x85, 0x35, 0xd4, 0xe6, 0x13, 0x02, 0xd6, 0x4b, 0x67, 0x48, 0x2b, 0xa9, 0xe9, 0x2e, 0x02, 0xb6, 0x4f, 0x82, 0xe5, 0x7a, 0x95, 0x19, 0xc6, 0x87, 0x3d, 0xfb, 0xa2, 0xb8, 0x79, 0x1e, 0x4d, 0x3b, 0x96, 0xcf, 0x4f, 0xbd, 0xcd, 0xa2, 0xa2, 0x1f, 0xa0, 0x82, 0xd3, 0xfc, 0x97, 0x05, 0x24, 0x36, 0x6b, 0xf3, 0x31, 0xa2, 0x35, 0x79, 0xef, 0xad, 0xf8, 0xae, 0xaf, 0xaf, 0xd8, 0xf2, 0xd8, 0x6d, 0xed, 0x6b, 0xda, 0x7b, 0x18, 0x1b, 0x5d, 0xff, 0x00, 0x52, 0xb1, 0x6d, 0xf0, 0x81, 0x31, 0xca, 0xf4, 0x6e, 0xb1, 0x80, 0xce, 0xb1, 0x84, 0xc0, 0x21, 0xb7, 0xd6, 0x77, 0x31, 0xd1, 0x27, 0xc1, 0xcd, 0xfe, 0xd2, 0xe3, 0xec, 0xe8, 0x1d, 0x45, 0x96, 0xb0, 0x9a, 0xb7, 0x87, 0x3f, 0x68, 0x2d, 0xf7, 0x01, 0x1f, 0xbe, 0xd1, 0xf4, 0x7f, 0xb4, 0xa4, 0x0d, 0x77, 0xbb, 0xfa, 0x8f, 0x80, 0x3a, 0x7f, 0x43, 0xaa, 0xe2, 0xdf, 0xd2, 0x65, 0x7e, 0x95, 0xe4, 0x0f, 0x1f, 0xa1, 0xfe, 0x6b, 0x16, 0x9f, 0x52, 0xfa, 0xc1, 0xd3, 0xba, 0x6d, 0x26, 0xdc, 0xac, 0x86, 0xd4, 0xd9, 0x0d, 0x31, 0x2e, 0x74, 0x9e, 0xdb, 0x59, 0x2e, 0x55, 0xe8, 0xc9, 0xb2, 0x96, 0xd5, 0x4b, 0x9f, 0xb8, 0x6d, 0xda, 0x1c, 0x04, 0x09, 0x03, 0xfe, 0x8a, 0xc6, 0xfa, 0xd3, 0xf5, 0x6a, 0xbe, 0xbb, 0x5b, 0x2e, 0xc6, 0xb5, 0x94, 0xe6, 0xd5, 0x20, 0x97, 0x7d, 0x1b, 0x1b, 0xf9, 0xad, 0x7c, 0x7d, 0x17, 0xb7, 0xf3, 0x1e, 0x92, 0x1b, 0x7f, 0xf8, 0xe0, 0x7d, 0x59, 0xdd, 0xfd, 0x32, 0xd8, 0x8f, 0xa5, 0xe8, 0x3a, 0x12, 0x5c, 0x3f, 0xfc, 0xc4, 0xfa, 0xc3, 0xb3, 0x77, 0xa7, 0x56, 0xed, 0xdb, 0x76, 0x7a, 0x8d, 0xdd, 0x1f, 0xbf, 0xfd, 0x44, 0x92, 0x56, 0x8f, 0xff, 0xd4, 0xf2, 0xe8, 0x86, 0x17, 0x1e, 0xfa, 0x04, 0x56, 0x4b, 0x43, 0x6c, 0x6f, 0x2d, 0xe5, 0x46, 0x01, 0x64, 0x2b, 0x14, 0x32, 0x5b, 0xb4, 0xa0, 0x52, 0x1d, 0xde, 0x9b, 0x94, 0xdb, 0xab, 0x6b, 0x81, 0xf7, 0x05, 0xb0, 0xd7, 0x07, 0xb2, 0x27, 0x55, 0xc6, 0x57, 0x65, 0xd8, 0x76, 0x6e, 0x64, 0xed, 0xee, 0x16, 0xce, 0x27, 0x57, 0x63, 0xda, 0x0c, 0xc2, 0x8e, 0x51, 0x67, 0x84, 0xfa, 0x1d, 0xdd, 0x62, 0xc7, 0x07, 0xe9, 0xf7, 0xa3, 0xd6, 0x6c, 0x02, 0x41, 0x55, 0x31, 0xf3, 0x2b, 0xb3, 0xba, 0x2b, 0x2e, 0x68, 0x24, 0x1d, 0x47, 0x64, 0xca, 0xa6, 0x50, 0x41, 0x65, 0x90, 0x6c, 0xb1, 0xa5, 0xae, 0x33, 0x23, 0x51, 0xe4, 0xab, 0x7d, 0x5d, 0xcb, 0xb6, 0xcc, 0x37, 0xd0, 0x40, 0x73, 0x71, 0xde, 0x58, 0x09, 0xe7, 0x6f, 0x2c, 0x44, 0xc9, 0xc9, 0xae, 0xba, 0x9d, 0x63, 0x88, 0x01, 0xa0, 0x95, 0x9d, 0xf5, 0x3f, 0x2a, 0xe6, 0x67, 0xdb, 0x50, 0x83, 0x55, 0xad, 0x36, 0x3e, 0x78, 0x10, 0x74, 0x77, 0xfd, 0x2d, 0xaa, 0x4c, 0x7d, 0x58, 0x73, 0x91, 0xa0, 0x0f, 0x51, 0x45, 0xb7, 0x33, 0xdd, 0x58, 0x69, 0x1d, 0xd8, 0x0c, 0x9f, 0x96, 0x88, 0x19, 0x99, 0x19, 0xac, 0xcf, 0xa3, 0xd2, 0xad, 0xb5, 0xdb, 0x76, 0x8f, 0xad, 0xc4, 0xea, 0xcf, 0xdf, 0x7e, 0xdf, 0xdd, 0xfc, 0xd5, 0xa3, 0x5e, 0x43, 0x2b, 0x6b, 0xb2, 0xad, 0x3b, 0x6a, 0xa4, 0x13, 0xa7, 0x04, 0xac, 0x7a, 0x6f, 0xb3, 0x23, 0x26, 0xcc, 0xfb, 0xb4, 0x75, 0x8e, 0x01, 0x83, 0xf7, 0x58, 0x3e, 0x8b, 0x53, 0xa7, 0x2a, 0x1a, 0x31, 0x42, 0x36, 0x5d, 0x4c, 0x9a, 0xf2, 0xdc, 0xc6, 0xfe, 0x98, 0xb4, 0x34, 0xcb, 0x48, 0x0a, 0x8f, 0xdb, 0xb2, 0xeb, 0x76, 0xd6, 0x07, 0x5c, 0x59, 0xc9, 0x64, 0x8f, 0x93, 0xa7, 0x73, 0x16, 0x83, 0xaf, 0x0e, 0xa4, 0x33, 0xef, 0x50, 0xc5, 0x0c, 0xda, 0x59, 0x10, 0x06, 0x8a, 0x2e, 0x29, 0x0e, 0xac, 0xc2, 0x31, 0x3d, 0x36, 0x69, 0x7e, 0xd6, 0xcc, 0xf5, 0x3d, 0x6f, 0xb3, 0xeb, 0x1b, 0x76, 0xef, 0x3b, 0xa3, 0xfa, 0xc9, 0x2b, 0x5f, 0x66, 0x6f, 0xa9, 0x1e, 0x73, 0xf2, 0x49, 0x2e, 0x39, 0xf7, 0x4f, 0xb7, 0x8d, 0xff, 0xd5, 0xf3, 0x26, 0xfe, 0x0a, 0xc5, 0x1b, 0xa7, 0xcb, 0xb2, 0xcf, 0x49, 0x03, 0xb2, 0x46, 0xee, 0xd9, 0xd9, 0xb3, 0xf4, 0x9f, 0x25, 0x4a, 0xdf, 0x4b, 0x77, 0xe8, 0x27, 0xd4, 0xef, 0x1c, 0x2a, 0x29, 0x26, 0xc5, 0x7c, 0x9d, 0x6c, 0x7f, 0xb7, 0x6e, 0x1b, 0x26, 0x7f, 0x05, 0xa3, 0xfe, 0x53, 0x8d, 0x62, 0x57, 0x30, 0x92, 0x12, 0xfa, 0x2f, 0x86, 0xdf, 0xa4, 0xec, 0x67, 0xfe, 0xd0, 0xf4, 0xff, 0x00, 0x4d, 0xfc, 0xdf, 0x78, 0xe1, 0x68, 0x7d, 0x54, 0x99, 0xbf, 0x6f, 0xf3, 0xbe, 0xdf, 0x8e, 0xdd, 0x7f, 0xef, 0xeb, 0x97, 0x49, 0x3e, 0x3b, 0x7f, 0x06, 0x2c, 0x9f, 0x37, 0x5f, 0xf0, 0x9f, 0x4c, 0xeb, 0x7b, 0xbf, 0x67, 0x55, 0xe8, 0xff, 0x00, 0x31, 0xbc, 0x7a, 0x9e, 0x31, 0xdb, 0xfe, 0x92, 0xae, 0x37, 0x7a, 0x4d, 0xdb, 0xe2, 0x17, 0x9d, 0xa4, 0xa3, 0xc9, 0xba, 0xfc, 0x7b, 0x7d, 0x5f, 0x52, 0xa7, 0x7e, 0xd1, 0x28, 0xf8, 0xf3, 0xb0, 0xc7, 0x32, 0xbc, 0x99, 0x24, 0xc5, 0xe3, 0xab, 0xeb, 0x1f, 0xa4, 0xf5, 0xfc, 0xe1, 0x25, 0xe4, 0xe9, 0x24, 0x97, 0xff, 0xd9, 0xff, 0xed, 0x2e, 0x1c, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x20, 0x33, 0x2e, 0x30, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x1c, 0x02, 0x00, 0x00, 0x02, 0x00, 0x02, 0x1c, 0x02, 0x78, 0x00, 0x1f, 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, 0x20, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xfb, 0x09, 0xa6, 0xbd, 0x07, 0x4c, 0x2a, 0x36, 0x9d, 0x8f, 0xe2, 0xcc, 0x57, 0xa9, 0xac, 0x85, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xea, 0x00, 0x00, 0x00, 0x00, 0x1d, 0xb0, 0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x22, 0x55, 0x54, 0x46, 0x2d, 0x38, 0x22, 0x3f, 0x3e, 0x0a, 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x22, 0x2d, 0x2f, 0x2f, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x2f, 0x44, 0x54, 0x44, 0x20, 0x50, 0x4c, 0x49, 0x53, 0x54, 0x20, 0x31, 0x2e, 0x30, 0x2f, 0x2f, 0x45, 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x54, 0x44, 0x73, 0x2f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x2d, 0x31, 0x2e, 0x30, 0x2e, 0x64, 0x74, 0x64, 0x22, 0x3e, 0x0a, 0x3c, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x3e, 0x0a, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x48, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x48, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x32, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x31, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x31, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x32, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x31, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x73, 0x75, 0x62, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x61, 0x70, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x33, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x37, 0x36, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x37, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x39, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x6e, 0x61, 0x2d, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x33, 0x2d, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x54, 0x31, 0x37, 0x3a, 0x34, 0x39, 0x3a, 0x33, 0x36, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x31, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x33, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x37, 0x36, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x37, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x39, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x70, 0x64, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x70, 0x64, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x55, 0x53, 0x20, 0x4c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x33, 0x2d, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x54, 0x31, 0x37, 0x3a, 0x34, 0x39, 0x3a, 0x33, 0x36, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x31, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x41, 0x50, 0x49, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x30, 0x30, 0x2e, 0x32, 0x30, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x63, 0x6b, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2f, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x41, 0x50, 0x49, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x30, 0x30, 0x2e, 0x32, 0x30, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x63, 0x6b, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2f, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x3c, 0x2f, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x3e, 0x0a, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x02, 0xde, 0x02, 0x40, 0xff, 0xee, 0xff, 0xee, 0x03, 0x06, 0x02, 0x52, 0x03, 0x67, 0x05, 0x28, 0x03, 0xfc, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x02, 0xd8, 0x02, 0x28, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x01, 0x7f, 0xff, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x08, 0x00, 0x19, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xed, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1e, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1e, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x2f, 0x66, 0x66, 0x00, 0x01, 0x00, 0x6c, 0x66, 0x66, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x2f, 0x66, 0x66, 0x00, 0x01, 0x00, 0xa1, 0x99, 0x9a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x35, 0x00, 0x00, 0x00, 0x01, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x03, 0x45, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x08, 0x00, 0x44, 0x00, 0x53, 0x00, 0x43, 0x00, 0x30, 0x00, 0x32, 0x00, 0x33, 0x00, 0x32, 0x00, 0x35, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x75, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x4f, 0x62, 0x6a, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x63, 0x74, 0x31, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x54, 0x6f, 0x70, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x65, 0x66, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x74, 0x6f, 0x6d, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x52, 0x67, 0x68, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x06, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x73, 0x56, 0x6c, 0x4c, 0x73, 0x00, 0x00, 0x00, 0x01, 0x4f, 0x62, 0x6a, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x07, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x49, 0x44, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x0d, 0x61, 0x75, 0x74, 0x6f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, 0x54, 0x79, 0x70, 0x65, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0a, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00, 0x00, 0x49, 0x6d, 0x67, 0x20, 0x00, 0x00, 0x00, 0x06, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x4f, 0x62, 0x6a, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x63, 0x74, 0x31, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x54, 0x6f, 0x70, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x65, 0x66, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x74, 0x6f, 0x6d, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x52, 0x67, 0x68, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x03, 0x75, 0x72, 0x6c, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x75, 0x6c, 0x6c, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x73, 0x67, 0x65, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x61, 0x6c, 0x74, 0x54, 0x61, 0x67, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x63, 0x65, 0x6c, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x49, 0x73, 0x48, 0x54, 0x4d, 0x4c, 0x62, 0x6f, 0x6f, 0x6c, 0x01, 0x00, 0x00, 0x00, 0x08, 0x63, 0x65, 0x6c, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x68, 0x6f, 0x72, 0x7a, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0f, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x48, 0x6f, 0x72, 0x7a, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x00, 0x00, 0x00, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x00, 0x00, 0x09, 0x76, 0x65, 0x72, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0f, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x00, 0x00, 0x00, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x00, 0x00, 0x0b, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x11, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x42, 0x47, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x09, 0x74, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x6c, 0x65, 0x66, 0x74, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x72, 0x69, 0x67, 0x68, 0x74, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x09, 0xf9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0x09, 0xdd, 0x00, 0x18, 0x00, 0x01, 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xed, 0x00, 0x0c, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x5f, 0x43, 0x4d, 0x00, 0x02, 0xff, 0xee, 0x00, 0x0e, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x00, 0x64, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0c, 0x08, 0x08, 0x08, 0x09, 0x08, 0x0c, 0x09, 0x09, 0x0c, 0x11, 0x0b, 0x0a, 0x0b, 0x11, 0x15, 0x0f, 0x0c, 0x0c, 0x0f, 0x15, 0x18, 0x13, 0x13, 0x15, 0x13, 0x13, 0x18, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x01, 0x0d, 0x0b, 0x0b, 0x0d, 0x0e, 0x0d, 0x10, 0x0e, 0x0e, 0x10, 0x14, 0x0e, 0x0e, 0x0e, 0x14, 0x14, 0x0e, 0x0e, 0x0e, 0x0e, 0x14, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x64, 0x00, 0x64, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xdd, 0x00, 0x04, 0x00, 0x07, 0xff, 0xc4, 0x01, 0x3f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x01, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x01, 0x04, 0x01, 0x03, 0x02, 0x04, 0x02, 0x05, 0x07, 0x06, 0x08, 0x05, 0x03, 0x0c, 0x33, 0x01, 0x00, 0x02, 0x11, 0x03, 0x04, 0x21, 0x12, 0x31, 0x05, 0x41, 0x51, 0x61, 0x13, 0x22, 0x71, 0x81, 0x32, 0x06, 0x14, 0x91, 0xa1, 0xb1, 0x42, 0x23, 0x24, 0x15, 0x52, 0xc1, 0x62, 0x33, 0x34, 0x72, 0x82, 0xd1, 0x43, 0x07, 0x25, 0x92, 0x53, 0xf0, 0xe1, 0xf1, 0x63, 0x73, 0x35, 0x16, 0xa2, 0xb2, 0x83, 0x26, 0x44, 0x93, 0x54, 0x64, 0x45, 0xc2, 0xa3, 0x74, 0x36, 0x17, 0xd2, 0x55, 0xe2, 0x65, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x27, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x11, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x06, 0x05, 0x35, 0x01, 0x00, 0x02, 0x11, 0x03, 0x21, 0x31, 0x12, 0x04, 0x41, 0x51, 0x61, 0x71, 0x22, 0x13, 0x05, 0x32, 0x81, 0x91, 0x14, 0xa1, 0xb1, 0x42, 0x23, 0xc1, 0x52, 0xd1, 0xf0, 0x33, 0x24, 0x62, 0xe1, 0x72, 0x82, 0x92, 0x43, 0x53, 0x15, 0x63, 0x73, 0x34, 0xf1, 0x25, 0x06, 0x16, 0xa2, 0xb2, 0x83, 0x07, 0x26, 0x35, 0xc2, 0xd2, 0x44, 0x93, 0x54, 0xa3, 0x17, 0x64, 0x45, 0x55, 0x36, 0x74, 0x65, 0xe2, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xf2, 0xed, 0xb2, 0x8d, 0x4d, 0x45, 0xcd, 0x2f, 0x3f, 0x44, 0x68, 0x93, 0xc3, 0x58, 0xc8, 0xf1, 0x1f, 0x8a, 0x33, 0x86, 0xda, 0x58, 0xc1, 0xa0, 0x02, 0x4f, 0xc4, 0xa1, 0x69, 0xa5, 0x9b, 0x5b, 0x4b, 0x84, 0x73, 0xdf, 0xc9, 0x15, 0xf8, 0xe3, 0xd1, 0x0e, 0x07, 0x93, 0xf3, 0xd1, 0x0f, 0x1c, 0x17, 0xef, 0x2e, 0x3b, 0x5b, 0xdc, 0xff, 0x00, 0xdf, 0x42, 0xbf, 0x8f, 0x8e, 0xdc, 0x82, 0xca, 0xd8, 0x37, 0x11, 0xa9, 0x3d, 0x82, 0x69, 0x2b, 0xc4, 0x6d, 0xc9, 0x75, 0x25, 0xbc, 0xf7, 0xec, 0xa1, 0xb5, 0x74, 0x19, 0x5d, 0x2e, 0x8a, 0x9a, 0x4b, 0x89, 0x7d, 0xc4, 0x68, 0xc6, 0xf6, 0xfe, 0xb2, 0xa0, 0x30, 0x1d, 0x60, 0x86, 0x88, 0x8d, 0x49, 0x3e, 0x01, 0x11, 0x20, 0xa3, 0x8c, 0xb9, 0xb1, 0xaa, 0x62, 0xad, 0xbf, 0x18, 0x97, 0x43, 0x47, 0x1d, 0xd2, 0xaf, 0x04, 0xd9, 0xb8, 0xc8, 0x0d, 0x68, 0xe4, 0xf7, 0x3e, 0x48, 0xf1, 0x05, 0xbc, 0x25, 0xaa, 0x07, 0x71, 0xd9, 0x14, 0x78, 0xf6, 0x49, 0xb5, 0x90, 0xfd, 0xa7, 0xc6, 0x14, 0xfd, 0x1b, 0x1c, 0xff, 0x00, 0x4d, 0x8d, 0x2e, 0x73, 0x8c, 0x35, 0xa3, 0x52, 0x4f, 0x92, 0x48, 0xa6, 0x1a, 0x24, 0xb6, 0x2a, 0xfa, 0xa5, 0x9e, 0x60, 0x64, 0x39, 0x94, 0x13, 0xcb, 0x27, 0x73, 0x80, 0xf3, 0x0c, 0xf6, 0xff, 0x00, 0xd2, 0x5a, 0x78, 0xbf, 0x53, 0x71, 0xf6, 0x01, 0x75, 0xb6, 0x97, 0x6a, 0x25, 0xa1, 0xad, 0x1f, 0xf4, 0xb7, 0x23, 0x48, 0xb7, 0x94, 0x84, 0x97, 0x5b, 0xff, 0x00, 0x32, 0xa9, 0xdd, 0xfc, 0xed, 0x9b, 0x7e, 0x0d, 0x9e, 0x52, 0x4a, 0x95, 0x61, 0xff, 0xd0, 0xf3, 0x3b, 0xa7, 0x70, 0xee, 0x01, 0x8f, 0xb9, 0x59, 0xfa, 0x7e, 0xdf, 0xe4, 0xc8, 0xf9, 0x2a, 0xc2, 0x5c, 0x63, 0xc3, 0x54, 0x67, 0x87, 0x6e, 0x10, 0x35, 0x68, 0xd4, 0x79, 0x1e, 0x53, 0x4a, 0xe0, 0xdc, 0xe9, 0xb8, 0x1f, 0x6a, 0xda, 0x6c, 0x25, 0x94, 0x37, 0xb0, 0xd0, 0xb8, 0xad, 0x67, 0xe4, 0x55, 0x8a, 0x5b, 0x8b, 0x82, 0xc0, 0x6f, 0x76, 0x80, 0x34, 0x49, 0x05, 0x2e, 0x9e, 0xc6, 0x1c, 0x66, 0x31, 0xba, 0x10, 0x23, 0xe0, 0xaf, 0xe1, 0x61, 0x53, 0x43, 0x8d, 0x81, 0xb3, 0x67, 0xef, 0x9e, 0x49, 0x2a, 0x12, 0x6c, 0xb6, 0x63, 0x1a, 0x0c, 0x31, 0xba, 0x55, 0xcd, 0xac, 0xfa, 0x8e, 0xdf, 0x91, 0x6e, 0x91, 0xd9, 0xb3, 0xc9, 0x73, 0x90, 0x7a, 0xab, 0x6a, 0xc2, 0xa4, 0x60, 0xe2, 0x8f, 0xd2, 0x38, 0x03, 0x7d, 0x9e, 0x0d, 0xff, 0x00, 0xcc, 0xd6, 0xd3, 0x6b, 0x71, 0x67, 0xd2, 0x3e, 0x64, 0x72, 0xab, 0xdb, 0x8d, 0x54, 0x39, 0xc5, 0x83, 0x6b, 0x3d, 0xee, 0x2e, 0xd4, 0x92, 0x3c, 0x4a, 0x56, 0xba, 0xb4, 0x79, 0x5c, 0xf7, 0xb2, 0x96, 0x6c, 0x8d, 0xaf, 0x80, 0x48, 0x3c, 0xf0, 0xb2, 0x1f, 0x63, 0x9c, 0xe9, 0x3f, 0x24, 0x5c, 0xdb, 0xdd, 0x76, 0x43, 0xde, 0xfd, 0x5c, 0xe3, 0x24, 0xfc, 0x50, 0x00, 0x93, 0x0a, 0x78, 0x8a, 0x0d, 0x49, 0xca, 0xcf, 0x93, 0x63, 0x1b, 0x7d, 0xd7, 0x57, 0x50, 0xd5, 0xef, 0x70, 0x6b, 0x4f, 0xc7, 0x45, 0xdb, 0x74, 0x9e, 0x8d, 0x5e, 0x33, 0x83, 0xd8, 0x37, 0xdd, 0xc3, 0xac, 0x3d, 0xbf, 0x92, 0xc5, 0x5b, 0xea, 0xbf, 0xd5, 0x62, 0xc0, 0xdc, 0xbc, 0xbd, 0x2d, 0x22, 0x5a, 0xcf, 0xdd, 0x69, 0xff, 0x00, 0xd1, 0x8e, 0x5d, 0xa5, 0x38, 0xb5, 0xb0, 0x00, 0xc6, 0xc4, 0x24, 0x4a, 0xd6, 0x8d, 0x18, 0x04, 0x49, 0x88, 0x9e, 0x55, 0xd6, 0x61, 0xb0, 0xc1, 0x70, 0x32, 0xdd, 0x3c, 0x95, 0xda, 0xf1, 0xfe, 0xf5, 0x62, 0xbc, 0x76, 0x8e, 0x75, 0x28, 0x02, 0xa2, 0xe7, 0x7d, 0x92, 0xb9, 0x84, 0x96, 0x96, 0xda, 0xf7, 0x70, 0x12, 0x4e, 0x5a, 0xff, 0x00, 0xff, 0xd1, 0xf3, 0x7a, 0x21, 0xaf, 0xde, 0xef, 0xa2, 0x22, 0x55, 0xfc, 0x5a, 0xbd, 0x42, 0xfb, 0x08, 0xfa, 0x67, 0x4f, 0x82, 0xcd, 0x6d, 0x85, 0xc0, 0x56, 0x3b, 0x90, 0xb7, 0xf0, 0x2a, 0x0e, 0x63, 0x58, 0x3b, 0xf2, 0xa3, 0x9e, 0x8c, 0xb8, 0x86, 0xbe, 0x49, 0xf1, 0x2c, 0x0c, 0x86, 0xb4, 0x4c, 0x69, 0xe4, 0xaf, 0x6e, 0xcc, 0x6b, 0x7d, 0x46, 0xb3, 0x70, 0xec, 0x38, 0x51, 0x7d, 0x02, 0x8a, 0xc7, 0xa6, 0xd9, 0x20, 0x68, 0x0f, 0x8f, 0x8a, 0xcf, 0xc9, 0xc2, 0xea, 0x59, 0x5b, 0x48, 0xb0, 0x91, 0xae, 0xe6, 0xc9, 0x03, 0xc9, 0x30, 0x51, 0x66, 0xd4, 0x0d, 0xad, 0xbd, 0x5f, 0x53, 0xcc, 0x6b, 0xb6, 0x90, 0x5a, 0x3b, 0x83, 0x0b, 0x43, 0x17, 0x31, 0xd6, 0xc3, 0x6e, 0x12, 0x3b, 0x79, 0xac, 0xc1, 0x89, 0x47, 0xd9, 0xe8, 0x63, 0x98, 0x45, 0xed, 0x6c, 0x5a, 0xf1, 0xa0, 0x27, 0xc5, 0x5b, 0xc3, 0x6f, 0xa6, 0xe0, 0x1c, 0x7d, 0xb3, 0xa2, 0x69, 0x34, 0x7b, 0xae, 0x1a, 0x8d, 0x45, 0x17, 0x9d, 0xeb, 0xfd, 0x21, 0xd8, 0xb9, 0xae, 0xb5, 0x80, 0xbb, 0x1e, 0xd2, 0x5c, 0xd7, 0x78, 0x13, 0xf9, 0xae, 0x4b, 0xea, 0xc7, 0x4a, 0x39, 0xbd, 0x55, 0xb3, 0xed, 0x66, 0x38, 0xf5, 0x09, 0x22, 0x41, 0x23, 0xe8, 0x37, 0xfb, 0x4b, 0xa1, 0xeb, 0xd6, 0xfe, 0x88, 0x31, 0xbf, 0x41, 0xc0, 0xee, 0xd2, 0x74, 0x02, 0x78, 0x53, 0xfa, 0x97, 0x43, 0x19, 0x85, 0x65, 0xff, 0x00, 0x9d, 0x71, 0x33, 0xe4, 0x1a, 0x7d, 0x8d, 0x53, 0x42, 0x56, 0x35, 0x6b, 0xe5, 0x80, 0x06, 0xc7, 0x57, 0xa7, 0xc4, 0xa9, 0xdb, 0xb6, 0x81, 0x1f, 0xeb, 0xd9, 0x69, 0x56, 0xc2, 0xd0, 0x00, 0xe5, 0x55, 0xc0, 0x12, 0xc2, 0xd7, 0x4e, 0xa2, 0x5a, 0x7c, 0x0a, 0xd0, 0x63, 0x9a, 0xd1, 0xaf, 0xd2, 0xe2, 0x3c, 0x12, 0x62, 0x66, 0xc6, 0x42, 0x23, 0x5a, 0x49, 0x8f, 0x10, 0xa2, 0xd2, 0x3e, 0x28, 0x9d, 0xc4, 0x88, 0x09, 0x29, 0x16, 0xc3, 0x3c, 0x24, 0x8d, 0xe6, 0x92, 0x72, 0x1f, 0xff, 0xd2, 0xf3, 0xbb, 0xb0, 0xfe, 0xcb, 0x99, 0xe9, 0xce, 0xf6, 0x88, 0x2d, 0x77, 0x91, 0x5b, 0x3d, 0x3d, 0xd0, 0xe6, 0x90, 0xa9, 0x65, 0x57, 0x38, 0x95, 0xdd, 0xcb, 0x9a, 0x7d, 0xce, 0xf2, 0x3f, 0x44, 0x23, 0x60, 0x58, 0x76, 0xe9, 0xca, 0x8c, 0xea, 0x1b, 0x31, 0x02, 0x32, 0x23, 0xea, 0xee, 0xb1, 0xcd, 0xb0, 0xc7, 0x87, 0x74, 0x7a, 0xeb, 0x70, 0x1a, 0x71, 0xe1, 0xfe, 0xe4, 0x1c, 0x1d, 0xae, 0xe5, 0x69, 0xd8, 0xfa, 0x99, 0x50, 0x0d, 0x1a, 0xf7, 0x2a, 0x3a, 0x0c, 0xf4, 0x1a, 0x8e, 0xc7, 0x27, 0x5d, 0xbf, 0x18, 0x41, 0xdc, 0xc2, 0xf0, 0x7f, 0x74, 0xf6, 0x3a, 0x22, 0x66, 0xdb, 0x68, 0xc6, 0x80, 0x48, 0x6b, 0x88, 0x06, 0x39, 0x0d, 0xee, 0xaa, 0x1f, 0xb3, 0xd5, 0x1b, 0x83, 0xd8, 0x3b, 0x38, 0x8f, 0x69, 0xfe, 0xdf, 0xd1, 0x4d, 0x29, 0xa1, 0x4c, 0x7a, 0xf4, 0xbf, 0xa7, 0x92, 0xcf, 0xa5, 0x20, 0x08, 0xf3, 0xf6, 0xff, 0x00, 0x15, 0xbb, 0xd1, 0x31, 0xd9, 0x5e, 0x3d, 0x75, 0x56, 0x36, 0x88, 0x00, 0x81, 0xe0, 0x16, 0x5e, 0x55, 0x74, 0x3f, 0x00, 0x9d, 0xe0, 0xcc, 0x69, 0xe7, 0x3a, 0x2d, 0xbe, 0x90, 0x00, 0xa9, 0xae, 0xef, 0x1f, 0x95, 0x4b, 0x0d, 0x9a, 0xdc, 0xc7, 0x45, 0xfe, 0xb1, 0x7d, 0x60, 0xa7, 0xa1, 0xe0, 0x1f, 0x4e, 0x1d, 0x99, 0x69, 0x02, 0x9a, 0xcf, 0x1f, 0xca, 0x7b, 0xbf, 0x90, 0xc5, 0xc2, 0xb3, 0xeb, 0x57, 0xd6, 0x03, 0x6b, 0xae, 0x39, 0xb6, 0x82, 0xe3, 0x31, 0xa1, 0x68, 0xf2, 0x6b, 0x5c, 0x12, 0xfa, 0xe1, 0x91, 0x66, 0x47, 0x5d, 0xb8, 0x3b, 0x4f, 0x44, 0x36, 0xb6, 0x8f, 0x28, 0xdd, 0xff, 0x00, 0x7e, 0x46, 0xab, 0x12, 0x2b, 0x65, 0x55, 0x32, 0xa7, 0x62, 0xb6, 0xbd, 0xf7, 0x64, 0x10, 0xdb, 0x03, 0x9f, 0x1b, 0x9e, 0xc7, 0xd9, 0xb8, 0x3b, 0x1f, 0x67, 0xf3, 0x6c, 0x52, 0x80, 0xd7, 0x7d, 0x0f, 0xea, 0x7f, 0x5d, 0x1d, 0x67, 0xa6, 0x0b, 0x1e, 0x47, 0xda, 0x69, 0x3b, 0x2e, 0x03, 0xc7, 0xf3, 0x5f, 0x1f, 0xf0, 0x8b, 0xa1, 0x02, 0x46, 0xba, 0x79, 0xaf, 0x32, 0xff, 0x00, 0x16, 0xad, 0xca, 0x1d, 0x57, 0x2a, 0xdc, 0x79, 0x18, 0x41, 0xb0, 0xf6, 0x9e, 0xe4, 0x9f, 0xd0, 0x8f, 0xeb, 0x31, 0xab, 0xd2, 0x83, 0xa4, 0xcb, 0x8c, 0xb8, 0xa0, 0x42, 0x12, 0x7b, 0x67, 0x9f, 0x2f, 0xf5, 0x09, 0x26, 0x96, 0xc4, 0xce, 0xa9, 0x20, 0xa7, 0xff, 0xd3, 0xf3, 0x2f, 0xb4, 0x5d, 0xe9, 0x0a, 0xb7, 0x9f, 0x4c, 0x19, 0xdb, 0x3a, 0x2d, 0x5e, 0x94, 0xfd, 0xc4, 0xb7, 0xc5, 0x62, 0xf9, 0x2b, 0xfd, 0x2e, 0xe3, 0x5d, 0xe0, 0x7c, 0x13, 0x48, 0xd1, 0x92, 0x12, 0xa9, 0x0b, 0x7a, 0xbc, 0x2d, 0xc2, 0x7f, 0x92, 0x60, 0xab, 0x4e, 0x79, 0x2e, 0x00, 0xf0, 0xaa, 0xe1, 0xda, 0x3d, 0x43, 0xfc, 0xad, 0x55, 0xbb, 0x80, 0x79, 0x81, 0xa0, 0xe6, 0x54, 0x32, 0x6d, 0x02, 0xbe, 0xf3, 0x61, 0x81, 0xa8, 0x44, 0x14, 0x03, 0x59, 0x0e, 0x1c, 0xf6, 0x1f, 0xdc, 0xb2, 0xec, 0xa3, 0x23, 0x77, 0xe8, 0x6e, 0x70, 0xf2, 0x25, 0x1f, 0x1f, 0x17, 0xa9, 0x6d, 0x71, 0x36, 0x97, 0x47, 0x00, 0xa4, 0x02, 0xe0, 0x2c, 0x7c, 0xc1, 0xab, 0xd5, 0x31, 0x85, 0x35, 0xd4, 0xe6, 0x13, 0x02, 0xd6, 0x4b, 0x67, 0x48, 0x2b, 0xa9, 0xe9, 0x2e, 0x02, 0xb6, 0x4f, 0x82, 0xe5, 0x7a, 0x95, 0x19, 0xc6, 0x87, 0x3d, 0xfb, 0xa2, 0xb8, 0x79, 0x1e, 0x4d, 0x3b, 0x96, 0xcf, 0x4f, 0xbd, 0xcd, 0xa2, 0xa2, 0x1f, 0xa0, 0x82, 0xd3, 0xfc, 0x97, 0x05, 0x24, 0x36, 0x6b, 0xf3, 0x31, 0xa2, 0x35, 0x79, 0xef, 0xad, 0xf8, 0xae, 0xaf, 0xaf, 0xd8, 0xf2, 0xd8, 0x6d, 0xed, 0x6b, 0xda, 0x7b, 0x18, 0x1b, 0x5d, 0xff, 0x00, 0x52, 0xb1, 0x6d, 0xf0, 0x81, 0x31, 0xca, 0xf4, 0x6e, 0xb1, 0x80, 0xce, 0xb1, 0x84, 0xc0, 0x21, 0xb7, 0xd6, 0x77, 0x31, 0xd1, 0x27, 0xc1, 0xcd, 0xfe, 0xd2, 0xe3, 0xec, 0xe8, 0x1d, 0x45, 0x96, 0xb0, 0x9a, 0xb7, 0x87, 0x3f, 0x68, 0x2d, 0xf7, 0x01, 0x1f, 0xbe, 0xd1, 0xf4, 0x7f, 0xb4, 0xa4, 0x0d, 0x77, 0xbb, 0xfa, 0x8f, 0x80, 0x3a, 0x7f, 0x43, 0xaa, 0xe2, 0xdf, 0xd2, 0x65, 0x7e, 0x95, 0xe4, 0x0f, 0x1f, 0xa1, 0xfe, 0x6b, 0x16, 0x9f, 0x52, 0xfa, 0xc1, 0xd3, 0xba, 0x6d, 0x26, 0xdc, 0xac, 0x86, 0xd4, 0xd9, 0x0d, 0x31, 0x2e, 0x74, 0x9e, 0xdb, 0x59, 0x2e, 0x55, 0xe8, 0xc9, 0xb2, 0x96, 0xd5, 0x4b, 0x9f, 0xb8, 0x6d, 0xda, 0x1c, 0x04, 0x09, 0x03, 0xfe, 0x8a, 0xc6, 0xfa, 0xd3, 0xf5, 0x6a, 0xbe, 0xbb, 0x5b, 0x2e, 0xc6, 0xb5, 0x94, 0xe6, 0xd5, 0x20, 0x97, 0x7d, 0x1b, 0x1b, 0xf9, 0xad, 0x7c, 0x7d, 0x17, 0xb7, 0xf3, 0x1e, 0x92, 0x1b, 0x7f, 0xf8, 0xe0, 0x7d, 0x59, 0xdd, 0xfd, 0x32, 0xd8, 0x8f, 0xa5, 0xe8, 0x3a, 0x12, 0x5c, 0x3f, 0xfc, 0xc4, 0xfa, 0xc3, 0xb3, 0x77, 0xa7, 0x56, 0xed, 0xdb, 0x76, 0x7a, 0x8d, 0xdd, 0x1f, 0xbf, 0xfd, 0x44, 0x92, 0x56, 0x8f, 0xff, 0xd4, 0xf2, 0xe8, 0x86, 0x17, 0x1e, 0xfa, 0x04, 0x56, 0x4b, 0x43, 0x6c, 0x6f, 0x2d, 0xe5, 0x46, 0x01, 0x64, 0x2b, 0x14, 0x32, 0x5b, 0xb4, 0xa0, 0x52, 0x1d, 0xde, 0x9b, 0x94, 0xdb, 0xab, 0x6b, 0x81, 0xf7, 0x05, 0xb0, 0xd7, 0x07, 0xb2, 0x27, 0x55, 0xc6, 0x57, 0x65, 0xd8, 0x76, 0x6e, 0x64, 0xed, 0xee, 0x16, 0xce, 0x27, 0x57, 0x63, 0xda, 0x0c, 0xc2, 0x8e, 0x51, 0x67, 0x84, 0xfa, 0x1d, 0xdd, 0x62, 0xc7, 0x07, 0xe9, 0xf7, 0xa3, 0xd6, 0x6c, 0x02, 0x41, 0x55, 0x31, 0xf3, 0x2b, 0xb3, 0xba, 0x2b, 0x2e, 0x68, 0x24, 0x1d, 0x47, 0x64, 0xca, 0xa6, 0x50, 0x41, 0x65, 0x90, 0x6c, 0xb1, 0xa5, 0xae, 0x33, 0x23, 0x51, 0xe4, 0xab, 0x7d, 0x5d, 0xcb, 0xb6, 0xcc, 0x37, 0xd0, 0x40, 0x73, 0x71, 0xde, 0x58, 0x09, 0xe7, 0x6f, 0x2c, 0x44, 0xc9, 0xc9, 0xae, 0xba, 0x9d, 0x63, 0x88, 0x01, 0xa0, 0x95, 0x9d, 0xf5, 0x3f, 0x2a, 0xe6, 0x67, 0xdb, 0x50, 0x83, 0x55, 0xad, 0x36, 0x3e, 0x78, 0x10, 0x74, 0x77, 0xfd, 0x2d, 0xaa, 0x4c, 0x7d, 0x58, 0x73, 0x91, 0xa0, 0x0f, 0x51, 0x45, 0xb7, 0x33, 0xdd, 0x58, 0x69, 0x1d, 0xd8, 0x0c, 0x9f, 0x96, 0x88, 0x19, 0x99, 0x19, 0xac, 0xcf, 0xa3, 0xd2, 0xad, 0xb5, 0xdb, 0x76, 0x8f, 0xad, 0xc4, 0xea, 0xcf, 0xdf, 0x7e, 0xdf, 0xdd, 0xfc, 0xd5, 0xa3, 0x5e, 0x43, 0x2b, 0x6b, 0xb2, 0xad, 0x3b, 0x6a, 0xa4, 0x13, 0xa7, 0x04, 0xac, 0x7a, 0x6f, 0xb3, 0x23, 0x26, 0xcc, 0xfb, 0xb4, 0x75, 0x8e, 0x01, 0x83, 0xf7, 0x58, 0x3e, 0x8b, 0x53, 0xa7, 0x2a, 0x1a, 0x31, 0x42, 0x36, 0x5d, 0x4c, 0x9a, 0xf2, 0xdc, 0xc6, 0xfe, 0x98, 0xb4, 0x34, 0xcb, 0x48, 0x0a, 0x8f, 0xdb, 0xb2, 0xeb, 0x76, 0xd6, 0x07, 0x5c, 0x59, 0xc9, 0x64, 0x8f, 0x93, 0xa7, 0x73, 0x16, 0x83, 0xaf, 0x0e, 0xa4, 0x33, 0xef, 0x50, 0xc5, 0x0c, 0xda, 0x59, 0x10, 0x06, 0x8a, 0x2e, 0x29, 0x0e, 0xac, 0xc2, 0x31, 0x3d, 0x36, 0x69, 0x7e, 0xd6, 0xcc, 0xf5, 0x3d, 0x6f, 0xb3, 0xeb, 0x1b, 0x76, 0xef, 0x3b, 0xa3, 0xfa, 0xc9, 0x2b, 0x5f, 0x66, 0x6f, 0xa9, 0x1e, 0x73, 0xf2, 0x49, 0x2e, 0x39, 0xf7, 0x4f, 0xb7, 0x8d, 0xff, 0xd5, 0xf3, 0x26, 0xfe, 0x0a, 0xc5, 0x1b, 0xa7, 0xcb, 0xb2, 0xcf, 0x49, 0x03, 0xb2, 0x46, 0xee, 0xd9, 0xd9, 0xb3, 0xf4, 0x9f, 0x25, 0x4a, 0xdf, 0x4b, 0x77, 0xe8, 0x27, 0xd4, 0xef, 0x1c, 0x2a, 0x29, 0x26, 0xc5, 0x7c, 0x9d, 0x6c, 0x7f, 0xb7, 0x6e, 0x1b, 0x26, 0x7f, 0x05, 0xa3, 0xfe, 0x53, 0x8d, 0x62, 0x57, 0x30, 0x92, 0x12, 0xfa, 0x2f, 0x86, 0xdf, 0xa4, 0xec, 0x67, 0xfe, 0xd0, 0xf4, 0xff, 0x00, 0x4d, 0xfc, 0xdf, 0x78, 0xe1, 0x68, 0x7d, 0x54, 0x99, 0xbf, 0x6f, 0xf3, 0xbe, 0xdf, 0x8e, 0xdd, 0x7f, 0xef, 0xeb, 0x97, 0x49, 0x3e, 0x3b, 0x7f, 0x06, 0x2c, 0x9f, 0x37, 0x5f, 0xf0, 0x9f, 0x4c, 0xeb, 0x7b, 0xbf, 0x67, 0x55, 0xe8, 0xff, 0x00, 0x31, 0xbc, 0x7a, 0x9e, 0x31, 0xdb, 0xfe, 0x92, 0xae, 0x37, 0x7a, 0x4d, 0xdb, 0xe2, 0x17, 0x9d, 0xa4, 0xa3, 0xc9, 0xba, 0xfc, 0x7b, 0x7d, 0x5f, 0x52, 0xa7, 0x7e, 0xd1, 0x28, 0xf8, 0xf3, 0xb0, 0xc7, 0x32, 0xbc, 0x99, 0x24, 0xc5, 0xe3, 0xab, 0xeb, 0x1f, 0xa4, 0xf5, 0xfc, 0xe1, 0x25, 0xe4, 0xe9, 0x24, 0x97, 0xff, 0xd9, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x41, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x62, 0x00, 0x65, 0x00, 0x20, 0x00, 0x50, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x00, 0x00, 0x13, 0x00, 0x41, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x62, 0x00, 0x65, 0x00, 0x20, 0x00, 0x50, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x20, 0x00, 0x37, 0x00, 0x2e, 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xff, 0xe1, 0x15, 0x67, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x61, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x00, 0x3c, 0x3f, 0x78, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x3d, 0x27, 0xef, 0xbb, 0xbf, 0x27, 0x20, 0x69, 0x64, 0x3d, 0x27, 0x57, 0x35, 0x4d, 0x30, 0x4d, 0x70, 0x43, 0x65, 0x68, 0x69, 0x48, 0x7a, 0x72, 0x65, 0x53, 0x7a, 0x4e, 0x54, 0x63, 0x7a, 0x6b, 0x63, 0x39, 0x64, 0x27, 0x3f, 0x3e, 0x0a, 0x3c, 0x3f, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2d, 0x78, 0x61, 0x70, 0x2d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x20, 0x65, 0x73, 0x63, 0x3d, 0x22, 0x43, 0x52, 0x22, 0x3f, 0x3e, 0x0a, 0x3c, 0x78, 0x3a, 0x78, 0x61, 0x70, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x78, 0x3d, 0x27, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x3a, 0x6e, 0x73, 0x3a, 0x6d, 0x65, 0x74, 0x61, 0x2f, 0x27, 0x20, 0x78, 0x3a, 0x78, 0x61, 0x70, 0x74, 0x6b, 0x3d, 0x27, 0x58, 0x4d, 0x50, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x6b, 0x69, 0x74, 0x20, 0x32, 0x2e, 0x38, 0x2e, 0x32, 0x2d, 0x33, 0x33, 0x2c, 0x20, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x31, 0x2e, 0x35, 0x27, 0x3e, 0x0a, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x52, 0x44, 0x46, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x72, 0x64, 0x66, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x77, 0x33, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x31, 0x39, 0x39, 0x39, 0x2f, 0x30, 0x32, 0x2f, 0x32, 0x32, 0x2d, 0x72, 0x64, 0x66, 0x2d, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2d, 0x6e, 0x73, 0x23, 0x27, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x69, 0x58, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x58, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x27, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x70, 0x64, 0x66, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x64, 0x66, 0x2f, 0x31, 0x2e, 0x33, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x70, 0x64, 0x66, 0x3a, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x3a, 0x43, 0x61, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x78, 0x61, 0x70, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x61, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x78, 0x61, 0x70, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x78, 0x61, 0x70, 0x4d, 0x4d, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x61, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x6d, 0x6d, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x78, 0x61, 0x70, 0x4d, 0x4d, 0x3a, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x3e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x3a, 0x64, 0x6f, 0x63, 0x69, 0x64, 0x3a, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x36, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x3c, 0x2f, 0x78, 0x61, 0x70, 0x4d, 0x4d, 0x3a, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x64, 0x63, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x70, 0x75, 0x72, 0x6c, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x64, 0x63, 0x2f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x31, 0x2e, 0x31, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x64, 0x63, 0x3a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x41, 0x6c, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x6c, 0x69, 0x20, 0x78, 0x6d, 0x6c, 0x3a, 0x6c, 0x61, 0x6e, 0x67, 0x3d, 0x27, 0x78, 0x2d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x27, 0x3e, 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, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x6c, 0x69, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x41, 0x6c, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x2f, 0x64, 0x63, 0x3a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x52, 0x44, 0x46, 0x3e, 0x0a, 0x3c, 0x2f, 0x78, 0x3a, 0x78, 0x61, 0x70, 0x6d, 0x65, 0x74, 0x61, 0x3e, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x3c, 0x3f, 0x78, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x65, 0x6e, 0x64, 0x3d, 0x27, 0x77, 0x27, 0x3f, 0x3e, 0xff, 0xee, 0x00, 0x0e, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x00, 0x64, 0x40, 0x00, 0x00, 0x00, 0x01, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x04, 0x06, 0x04, 0x03, 0x04, 0x06, 0x07, 0x05, 0x04, 0x04, 0x05, 0x07, 0x08, 0x06, 0x06, 0x07, 0x06, 0x06, 0x08, 0x0a, 0x08, 0x09, 0x09, 0x09, 0x09, 0x08, 0x0a, 0x0a, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0a, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x01, 0x04, 0x05, 0x05, 0x08, 0x07, 0x08, 0x0f, 0x0a, 0x0a, 0x0f, 0x14, 0x0e, 0x0e, 0x0e, 0x14, 0x14, 0x0e, 0x0e, 0x0e, 0x0e, 0x14, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x64, 0x00, 0x64, 0x03, 0x01, 0x11, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xdd, 0x00, 0x04, 0x00, 0x0d, 0xff, 0xc4, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x03, 0x02, 0x06, 0x01, 0x00, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x01, 0x00, 0x02, 0x02, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x02, 0x06, 0x07, 0x03, 0x04, 0x02, 0x06, 0x02, 0x73, 0x01, 0x02, 0x03, 0x11, 0x04, 0x00, 0x05, 0x21, 0x12, 0x31, 0x41, 0x51, 0x06, 0x13, 0x61, 0x22, 0x71, 0x81, 0x14, 0x32, 0x91, 0xa1, 0x07, 0x15, 0xb1, 0x42, 0x23, 0xc1, 0x52, 0xd1, 0xe1, 0x33, 0x16, 0x62, 0xf0, 0x24, 0x72, 0x82, 0xf1, 0x25, 0x43, 0x34, 0x53, 0x92, 0xa2, 0xb2, 0x63, 0x73, 0xc2, 0x35, 0x44, 0x27, 0x93, 0xa3, 0xb3, 0x36, 0x17, 0x54, 0x64, 0x74, 0xc3, 0xd2, 0xe2, 0x08, 0x26, 0x83, 0x09, 0x0a, 0x18, 0x19, 0x84, 0x94, 0x45, 0x46, 0xa4, 0xb4, 0x56, 0xd3, 0x55, 0x28, 0x1a, 0xf2, 0xe3, 0xf3, 0xc4, 0xd4, 0xe4, 0xf4, 0x65, 0x75, 0x85, 0x95, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x38, 0x48, 0x58, 0x68, 0x78, 0x88, 0x98, 0xa8, 0xb8, 0xc8, 0xd8, 0xe8, 0xf8, 0x29, 0x39, 0x49, 0x59, 0x69, 0x79, 0x89, 0x99, 0xa9, 0xb9, 0xc9, 0xd9, 0xe9, 0xf9, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa, 0x11, 0x00, 0x02, 0x02, 0x01, 0x02, 0x03, 0x05, 0x05, 0x04, 0x05, 0x06, 0x04, 0x08, 0x03, 0x03, 0x6d, 0x01, 0x00, 0x02, 0x11, 0x03, 0x04, 0x21, 0x12, 0x31, 0x41, 0x05, 0x51, 0x13, 0x61, 0x22, 0x06, 0x71, 0x81, 0x91, 0x32, 0xa1, 0xb1, 0xf0, 0x14, 0xc1, 0xd1, 0xe1, 0x23, 0x42, 0x15, 0x52, 0x62, 0x72, 0xf1, 0x33, 0x24, 0x34, 0x43, 0x82, 0x16, 0x92, 0x53, 0x25, 0xa2, 0x63, 0xb2, 0xc2, 0x07, 0x73, 0xd2, 0x35, 0xe2, 0x44, 0x83, 0x17, 0x54, 0x93, 0x08, 0x09, 0x0a, 0x18, 0x19, 0x26, 0x36, 0x45, 0x1a, 0x27, 0x64, 0x74, 0x55, 0x37, 0xf2, 0xa3, 0xb3, 0xc3, 0x28, 0x29, 0xd3, 0xe3, 0xf3, 0x84, 0x94, 0xa4, 0xb4, 0xc4, 0xd4, 0xe4, 0xf4, 0x65, 0x75, 0x85, 0x95, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x46, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x38, 0x48, 0x58, 0x68, 0x78, 0x88, 0x98, 0xa8, 0xb8, 0xc8, 0xd8, 0xe8, 0xf8, 0x39, 0x49, 0x59, 0x69, 0x79, 0x89, 0x99, 0xa9, 0xb9, 0xc9, 0xd9, 0xe9, 0xf9, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xf0, 0x67, 0xa6, 0x5c, 0x0f, 0x01, 0xd4, 0x7e, 0x18, 0x12, 0x98, 0xe9, 0xd6, 0x2d, 0x34, 0x6d, 0x70, 0xdf, 0xdc, 0xa1, 0xe3, 0xec, 0x5b, 0xfb, 0x32, 0x24, 0xb2, 0x01, 0x1f, 0x15, 0xa4, 0x52, 0x4a, 0x82, 0x31, 0xf1, 0xfe, 0xd1, 0x3d, 0x14, 0x64, 0x49, 0x64, 0x22, 0x98, 0xcf, 0xa5, 0x46, 0x6c, 0x16, 0x55, 0x71, 0x56, 0x62, 0x28, 0x07, 0xc5, 0x45, 0x15, 0xa0, 0xc8, 0x89, 0x33, 0xe1, 0x63, 0xd2, 0xd8, 0x34, 0x44, 0x17, 0xa0, 0x2c, 0x4d, 0x16, 0xbb, 0xed, 0xdc, 0xf8, 0x64, 0xc1, 0x6b, 0x31, 0x42, 0x18, 0x8e, 0xc7, 0xb5, 0x2a, 0x7d, 0xb2, 0x56, 0xc5, 0x61, 0x8c, 0xf2, 0xa0, 0x1b, 0x1e, 0x83, 0x0d, 0xa1, 0x63, 0x50, 0x1f, 0x97, 0x7c, 0x2a, 0xa9, 0x1a, 0x9a, 0x86, 0x4f, 0xb4, 0xb4, 0x38, 0x0a, 0xa6, 0x0b, 0xb8, 0x0c, 0x05, 0x14, 0xf8, 0x76, 0x3e, 0x19, 0x14, 0xb6, 0x78, 0xf8, 0x8c, 0x2a, 0xd5, 0x01, 0xdc, 0x6f, 0x8a, 0x1a, 0xe3, 0x8d, 0xab, 0xff, 0xd0, 0xf0, 0xec, 0xe9, 0x15, 0xb5, 0xb9, 0x5a, 0x7c, 0x4c, 0xa2, 0x9e, 0x24, 0xf5, 0xca, 0xc6, 0xe5, 0x99, 0xd9, 0x34, 0x99, 0x04, 0x3a, 0x7d, 0xb5, 0xba, 0xd5, 0x51, 0x63, 0x0e, 0xc7, 0xc5, 0x9b, 0x73, 0xf8, 0xe4, 0x6f, 0x76, 0xca, 0xd9, 0xda, 0x54, 0x6d, 0x72, 0x2e, 0x1a, 0x57, 0x11, 0x44, 0x40, 0x0d, 0x27, 0x7a, 0x0f, 0xd9, 0x5f, 0x12, 0x69, 0x4c, 0x84, 0xcd, 0x36, 0xe3, 0x85, 0xb2, 0xcd, 0x2f, 0x4a, 0x8b, 0x58, 0x36, 0xf6, 0x76, 0xa8, 0x64, 0x64, 0x3c, 0xa4, 0x93, 0xaa, 0x25, 0x3c, 0x49, 0xda, 0xa4, 0xe5, 0x26, 0x54, 0xe4, 0x8c, 0x7c, 0x5c, 0x93, 0x4d, 0x67, 0xc9, 0x3a, 0x6e, 0x9f, 0x13, 0xb4, 0xce, 0xf7, 0x3a, 0x9b, 0xad, 0x52, 0xd6, 0x2a, 0xd1, 0x49, 0xee, 0xc7, 0xf8, 0x64, 0x46, 0x42, 0x4e, 0xcd, 0x92, 0xc2, 0x00, 0xdd, 0x8a, 0x47, 0xe5, 0x69, 0x6e, 0xd4, 0xa4, 0x08, 0x16, 0x83, 0x9c, 0x8c, 0xdd, 0x95, 0x6b, 0xb9, 0xf6, 0xef, 0x97, 0x78, 0x94, 0xe3, 0x78, 0x04, 0xa4, 0xf3, 0xe8, 0xee, 0x64, 0xe1, 0x12, 0x10, 0x05, 0x6a, 0xc7, 0xc0, 0x6f, 0x53, 0xf3, 0xc9, 0x89, 0xb4, 0x9c, 0x4e, 0xb4, 0xf2, 0xd3, 0xde, 0x7a, 0xd2, 0x19, 0x16, 0x38, 0x61, 0x5d, 0xd9, 0x88, 0x05, 0x9c, 0xf4, 0x0a, 0x0f, 0x5f, 0x73, 0x84, 0xe4, 0xa4, 0xc7, 0x0d, 0xa5, 0xf1, 0x59, 0xba, 0x5c, 0x08, 0x98, 0x6f, 0xc8, 0x20, 0xfa, 0x4e, 0x4e, 0xf6, 0x69, 0xe1, 0xa2, 0x89, 0xfd, 0x1f, 0x77, 0x2c, 0xe6, 0xce, 0xd6, 0x17, 0x9a, 0x69, 0xdb, 0xd3, 0x86, 0x18, 0xc1, 0x67, 0x77, 0x26, 0x80, 0x28, 0x1b, 0x93, 0x88, 0x41, 0x0f, 0x40, 0xb0, 0xfc, 0x87, 0xf3, 0x43, 0x98, 0xd7, 0x58, 0x96, 0xdb, 0x4d, 0x91, 0x88, 0xe5, 0x6c, 0x58, 0xdc, 0x5c, 0x2a, 0xf7, 0x2c, 0xb1, 0xfc, 0x20, 0x8f, 0x02, 0xd9, 0x65, 0x06, 0xbe, 0x26, 0x6f, 0xa2, 0x7f, 0xce, 0x3d, 0x69, 0x26, 0xdd, 0x13, 0x52, 0xbf, 0xbd, 0x92, 0x62, 0x59, 0x4c, 0x90, 0xac, 0x50, 0x45, 0x5e, 0xbb, 0x09, 0x03, 0x12, 0x29, 0x84, 0x00, 0xc4, 0xc9, 0x11, 0xff, 0x00, 0x42, 0xe7, 0xa7, 0x7a, 0xd4, 0xfd, 0x21, 0x79, 0xe9, 0x78, 0x71, 0x8b, 0x95, 0x39, 0x75, 0xaf, 0x4e, 0x98, 0x78, 0x42, 0x38, 0xdf, 0xff, 0xd1, 0xf0, 0xe6, 0xa0, 0x58, 0xc8, 0x84, 0x9a, 0xaa, 0x30, 0x55, 0xf9, 0x0a, 0x6f, 0x90, 0x0c, 0xca, 0x72, 0x48, 0xb8, 0x1e, 0x89, 0xa7, 0x23, 0x17, 0x24, 0xff, 0x00, 0x61, 0xb6, 0x54, 0x76, 0x6e, 0x1b, 0xa7, 0xbe, 0x50, 0xf2, 0xc1, 0xd7, 0x4c, 0x52, 0x5e, 0x33, 0x5b, 0xe9, 0x10, 0xf4, 0x54, 0x3c, 0x5e, 0x77, 0xee, 0x49, 0xec, 0x2b, 0xb6, 0x63, 0xe4, 0xc9, 0xc3, 0xef, 0x73, 0xf0, 0xe1, 0x32, 0x1b, 0xf2, 0x7a, 0x05, 0xce, 0xad, 0x65, 0xa1, 0x98, 0xb4, 0x0f, 0x2a, 0x5b, 0x23, 0xeb, 0x12, 0x00, 0x88, 0xb0, 0xa8, 0x66, 0x46, 0x3d, 0xea, 0x7b, 0xfb, 0x9e, 0x99, 0x89, 0xbc, 0x8d, 0x97, 0x3a, 0x34, 0x05, 0x32, 0x5d, 0x1f, 0xc9, 0x1a, 0x8c, 0x36, 0x8c, 0x6f, 0x66, 0xfa, 0xc6, 0xb7, 0x7d, 0xf0, 0x94, 0x04, 0xf0, 0x88, 0xc9, 0xd5, 0x9d, 0x8d, 0x4b, 0x11, 0xd4, 0x9f, 0xbb, 0x25, 0xc5, 0xdc, 0xa2, 0x03, 0x99, 0x4b, 0xbc, 0xf3, 0x0d, 0x97, 0x96, 0x74, 0xe5, 0xf2, 0xb6, 0x80, 0x95, 0xbd, 0x99, 0x15, 0xf5, 0x4b, 0xd2, 0x37, 0x58, 0x46, 0xd4, 0x27, 0xc5, 0xce, 0xc1, 0x7c, 0x30, 0x8e, 0x68, 0x94, 0x7b, 0x9e, 0x6d, 0xe6, 0x7b, 0x9b, 0x5d, 0x3a, 0xd8, 0xdb, 0x32, 0xfa, 0x77, 0x65, 0x15, 0xe4, 0x57, 0xa7, 0x21, 0x55, 0x04, 0x57, 0xef, 0xd8, 0x66, 0x56, 0x38, 0x19, 0x1b, 0xe8, 0xe0, 0x67, 0x98, 0xc7, 0x1a, 0x1c, 0xde, 0x71, 0x71, 0x79, 0x2c, 0xf2, 0xfa, 0x8c, 0x48, 0xec, 0xb5, 0x24, 0x9a, 0x0c, 0xce, 0x75, 0x29, 0xae, 0x8c, 0x67, 0xd4, 0xb5, 0x0b, 0x4b, 0x04, 0x05, 0xef, 0x2e, 0x66, 0x8e, 0x18, 0x08, 0x15, 0xdd, 0x8f, 0x11, 0xb0, 0xeb, 0x4c, 0x04, 0x5b, 0x21, 0x2a, 0x7d, 0x41, 0xe4, 0x4f, 0xcb, 0xcb, 0x5d, 0x12, 0x45, 0xb8, 0xb7, 0x53, 0x71, 0xaa, 0x9f, 0x86, 0x5b, 0xd6, 0x50, 0x4a, 0xed, 0xba, 0x46, 0x77, 0x00, 0x13, 0xd4, 0x8c, 0x85, 0xd3, 0x12, 0x6d, 0xeb, 0x1a, 0x67, 0x95, 0xd9, 0x39, 0x39, 0x50, 0xac, 0xff, 0x00, 0x6f, 0xc4, 0xff, 0x00, 0x1c, 0x81, 0x92, 0xb2, 0x6b, 0x6d, 0x02, 0xdd, 0xbd, 0x36, 0x92, 0x36, 0x2d, 0x1f, 0xc0, 0x2a, 0x0b, 0x28, 0x1b, 0x91, 0x41, 0xf4, 0x9c, 0xb6, 0x25, 0x81, 0x46, 0xfe, 0x81, 0xb5, 0xad, 0x3d, 0xba, 0x57, 0xb7, 0xf9, 0xf6, 0xc9, 0xb0, 0x7f, 0xff, 0xd2, 0xf0, 0xe2, 0x86, 0x95, 0xc4, 0x67, 0x7e, 0x3f, 0x11, 0xf7, 0xa8, 0x19, 0x06, 0x69, 0x8d, 0xca, 0xca, 0x24, 0x8f, 0xd3, 0x52, 0x24, 0x89, 0x47, 0x25, 0x1f, 0xcb, 0x20, 0xf8, 0xb2, 0xb2, 0x76, 0x6e, 0x88, 0x36, 0xf6, 0x6f, 0x2a, 0xc1, 0x6e, 0xfa, 0x45, 0xad, 0xbc, 0x3f, 0x0b, 0x46, 0x81, 0x4d, 0x46, 0xea, 0x7a, 0x9a, 0x83, 0x9a, 0xa9, 0xdd, 0xbb, 0xec, 0x7b, 0x06, 0x5b, 0xe5, 0xcf, 0x2e, 0x69, 0xfa, 0x5c, 0xcd, 0x7b, 0x14, 0x5e, 0xa5, 0xee, 0xf5, 0xb8, 0x7d, 0xdd, 0x99, 0xba, 0xef, 0x91, 0x16, 0x5b, 0x36, 0xb6, 0x65, 0x0d, 0xac, 0xb2, 0x5b, 0xed, 0x34, 0x81, 0x7a, 0xbb, 0x46, 0x40, 0x6a, 0x9e, 0xb4, 0x39, 0x31, 0x13, 0x49, 0xda, 0xd2, 0x9b, 0xed, 0x1e, 0xc4, 0x24, 0xb3, 0x35, 0xb2, 0x88, 0x60, 0x06, 0xe6, 0x56, 0x98, 0x96, 0x79, 0x1e, 0x31, 0x51, 0xc9, 0x8f, 0xcb, 0x00, 0xe6, 0xb3, 0xe4, 0xf9, 0x2b, 0xcc, 0x7a, 0x94, 0xda, 0x96, 0xa9, 0x71, 0x77, 0x70, 0x79, 0xcd, 0x33, 0x97, 0x76, 0x3f, 0xcc, 0xc6, 0xa6, 0x9f, 0x2e, 0x99, 0xb9, 0xc6, 0x2a, 0x21, 0xe6, 0x73, 0xca, 0xe6, 0x4a, 0x51, 0x1a, 0x99, 0x1c, 0x28, 0x04, 0x93, 0xd0, 0x0e, 0xa4, 0xe4, 0xda, 0x5f, 0x50, 0xfe, 0x4a, 0xfe, 0x48, 0xb5, 0xb2, 0xc1, 0xe6, 0x1f, 0x31, 0x7e, 0xef, 0x52, 0x91, 0x43, 0xc3, 0x6e, 0x77, 0xf4, 0x22, 0x6d, 0xbf, 0xe4, 0x63, 0x0e, 0xbf, 0xca, 0x36, 0xeb, 0x5c, 0x84, 0xa5, 0x48, 0x7d, 0x3b, 0x61, 0xa1, 0xdb, 0x5b, 0x2c, 0x71, 0xda, 0x45, 0xc4, 0x28, 0x00, 0x81, 0xdb, 0x31, 0xc9, 0xb4, 0xb2, 0x3b, 0x5d, 0x27, 0xa5, 0x05, 0x1b, 0xc7, 0xdb, 0x10, 0xa9, 0xbd, 0xa6, 0x93, 0x0c, 0x75, 0xe4, 0x39, 0x35, 0x41, 0x3d, 0xc5, 0x06, 0xdb, 0x8e, 0xfd, 0x46, 0x5b, 0x1d, 0x98, 0x95, 0x4f, 0x46, 0xdb, 0xd5, 0xfb, 0x29, 0x5e, 0x9d, 0x0d, 0x32, 0xeb, 0x61, 0x4f, 0xff, 0xd3, 0xf1, 0x46, 0x9a, 0x16, 0x1b, 0x91, 0x71, 0x28, 0xac, 0x4a, 0x14, 0x30, 0x3e, 0x19, 0x54, 0xb9, 0x36, 0xc7, 0x9b, 0x2d, 0xd1, 0x6c, 0x45, 0xe3, 0xdc, 0xde, 0xc8, 0x95, 0x5b, 0x87, 0xf8, 0x41, 0x1d, 0x10, 0x54, 0x01, 0x98, 0x79, 0x25, 0xd1, 0xda, 0xe9, 0xe1, 0xb5, 0x9e, 0xac, 0xeb, 0x42, 0xba, 0x8e, 0xdf, 0x8c, 0x31, 0x21, 0x70, 0xb4, 0x5d, 0xbe, 0xc5, 0x7c, 0x2b, 0xed, 0xe1, 0x94, 0x18, 0xb9, 0x51, 0x3d, 0x03, 0x2c, 0x13, 0x6b, 0xf1, 0x42, 0x6e, 0xe2, 0xb7, 0x12, 0xa0, 0xdd, 0x50, 0x9f, 0x4f, 0x6f, 0xa7, 0x6f, 0xc7, 0x03, 0x61, 0xa0, 0x83, 0xb5, 0xf3, 0x97, 0x98, 0x20, 0x9c, 0x44, 0xea, 0xd0, 0xad, 0x48, 0x64, 0x90, 0x21, 0xd8, 0x9f, 0xa7, 0xa6, 0x44, 0xca, 0x99, 0xc6, 0x36, 0xcb, 0x74, 0x5d, 0x7e, 0x5b, 0xfe, 0x31, 0x6a, 0x31, 0xf3, 0x8c, 0xd0, 0xad, 0x40, 0xa3, 0x1f, 0x7c, 0x44, 0xd6, 0x51, 0xd9, 0xe0, 0x5f, 0x9a, 0x7e, 0x41, 0x9f, 0x40, 0xf3, 0x14, 0xba, 0x85, 0xba, 0x34, 0xba, 0x2d, 0xfb, 0x34, 0xd0, 0xcf, 0x4f, 0xb0, 0xce, 0x6a, 0x51, 0xe9, 0xb0, 0x20, 0xf4, 0xf1, 0x19, 0xb2, 0xc3, 0x90, 0x11, 0x4e, 0x97, 0x55, 0x80, 0x83, 0xc4, 0x17, 0x7e, 0x4c, 0x79, 0x19, 0xfc, 0xd1, 0xe7, 0x78, 0x4b, 0x91, 0x1d, 0xae, 0x92, 0xa6, 0xf6, 0x46, 0x75, 0xe4, 0xad, 0x22, 0x1f, 0xdd, 0xa1, 0x07, 0xb3, 0x1e, 0xfe, 0xd9, 0x92, 0xeb, 0x4b, 0xed, 0xfd, 0x0a, 0xc2, 0x63, 0x27, 0xa4, 0x88, 0x17, 0x60, 0x49, 0x35, 0xdc, 0x8e, 0xa5, 0x7d, 0xab, 0xd3, 0x28, 0x90, 0x50, 0xcd, 0xed, 0x2d, 0xda, 0x15, 0x55, 0x51, 0xf1, 0x1a, 0x0a, 0xf7, 0x39, 0x5d, 0xaa, 0x77, 0x6f, 0x01, 0x8e, 0xa7, 0x7d, 0xfa, 0xff, 0x00, 0x66, 0x10, 0xa8, 0xb8, 0x63, 0x76, 0x90, 0xa8, 0x20, 0x06, 0x56, 0xdb, 0x61, 0xda, 0xbd, 0x4f, 0xcb, 0x24, 0x15, 0x0f, 0xf5, 0x66, 0xe5, 0x5f, 0x4c, 0x53, 0xc3, 0xb7, 0xce, 0x99, 0x6b, 0x17, 0xff, 0xd4, 0xf0, 0xec, 0x57, 0x6f, 0x32, 0xa5, 0xa4, 0x43, 0x76, 0x75, 0xa9, 0xf1, 0x03, 0xfa, 0x64, 0x08, 0x6c, 0x8e, 0xfb, 0x3d, 0x7f, 0xcb, 0x16, 0x2b, 0x3d, 0xbc, 0x16, 0xa3, 0x66, 0x6d, 0x98, 0xfb, 0x1e, 0xb9, 0xac, 0xc8, 0x77, 0xb7, 0x7d, 0x01, 0xb3, 0x37, 0xb8, 0xd3, 0x46, 0x95, 0x68, 0x86, 0xd2, 0x2e, 0x4e, 0xab, 0xf0, 0x23, 0x11, 0x4e, 0x5f, 0xcd, 0x98, 0xe7, 0x25, 0x96, 0x71, 0x83, 0x0f, 0xd6, 0x3c, 0xb9, 0xe7, 0x0d, 0x7c, 0x41, 0x22, 0x5e, 0xb3, 0x20, 0x0c, 0x65, 0x80, 0xc8, 0x63, 0x8e, 0xbb, 0x95, 0xa5, 0x07, 0xeb, 0xcc, 0xac, 0x73, 0x83, 0x4e, 0x5c, 0x59, 0x09, 0xd8, 0xec, 0xc8, 0x57, 0x41, 0xd3, 0x4e, 0x95, 0xa5, 0x5b, 0x4b, 0x6a, 0xcb, 0xab, 0x43, 0x10, 0x4b, 0xeb, 0x85, 0xa2, 0x2c, 0x8e, 0x3f, 0x68, 0x54, 0xf5, 0x00, 0xd3, 0x97, 0x7a, 0x65, 0x79, 0xa6, 0x24, 0x76, 0x6f, 0xd3, 0x62, 0x96, 0x30, 0x78, 0xcb, 0x21, 0xf2, 0xf4, 0x22, 0xce, 0x54, 0x8e, 0x46, 0x26, 0x10, 0x7e, 0x0a, 0xf5, 0xd8, 0xf5, 0x1f, 0x31, 0x98, 0x83, 0x73, 0xb3, 0x91, 0xcd, 0x67, 0xe6, 0x7d, 0xe8, 0x16, 0x69, 0x6f, 0x10, 0x1f, 0x54, 0x9a, 0x37, 0xf5, 0x41, 0x5e, 0x7f, 0x0a, 0x29, 0x62, 0x02, 0xf8, 0x9c, 0xc8, 0x8c, 0x77, 0x6a, 0x99, 0xa0, 0x89, 0xff, 0x00, 0x9c, 0x74, 0xd2, 0xed, 0xed, 0xfc, 0xbb, 0x7b, 0xaa, 0x9a, 0x7d, 0x62, 0xfe, 0x46, 0x2d, 0xfe, 0x4c, 0x51, 0x31, 0x11, 0xa9, 0xf6, 0xef, 0x9b, 0x30, 0x5e, 0x7b, 0x38, 0xdd, 0xf4, 0x7f, 0x95, 0x94, 0xbc, 0x12, 0x43, 0x30, 0x6a, 0xb2, 0xf3, 0x86, 0x40, 0x3e, 0xcb, 0xd7, 0x6a, 0xd7, 0xb1, 0xe9, 0x8f, 0x37, 0x19, 0x97, 0x41, 0x2c, 0x71, 0x20, 0xf5, 0x36, 0x9c, 0x55, 0x78, 0x1d, 0x8a, 0x91, 0xd7, 0x11, 0x14, 0x5a, 0x3e, 0x19, 0x03, 0x10, 0x6b, 0xca, 0xbd, 0x86, 0xf8, 0x9d, 0x95, 0x18, 0x36, 0x65, 0x2e, 0xbc, 0x54, 0x1f, 0xa2, 0x99, 0x00, 0x59, 0x2a, 0x6f, 0x5e, 0x55, 0x15, 0xe9, 0x5f, 0xc3, 0x2f, 0xb6, 0x14, 0xff, 0x00, 0xff, 0xd5, 0xf1, 0x95, 0xfe, 0x80, 0x74, 0x0d, 0x7c, 0xd9, 0x89, 0x3d, 0x78, 0x57, 0x8b, 0xc5, 0x28, 0xe8, 0x55, 0xf7, 0x1f, 0x48, 0xca, 0x38, 0xb8, 0x83, 0x9f, 0x93, 0x07, 0x85, 0x3a, 0x7a, 0x6f, 0x95, 0x66, 0x2b, 0x2c, 0x4c, 0x0d, 0x14, 0x00, 0x3e, 0x9c, 0xc3, 0x98, 0x76, 0xb8, 0x45, 0xbd, 0x02, 0xde, 0x48, 0xee, 0xdc, 0xa0, 0x15, 0xe2, 0x2b, 0xc8, 0x8a, 0x8a, 0xfd, 0x3b, 0x66, 0x3f, 0x00, 0x73, 0x84, 0x2d, 0x36, 0xb5, 0xb5, 0x9e, 0x35, 0x1c, 0x29, 0xc4, 0xfe, 0xc8, 0x04, 0x7f, 0xc4, 0x69, 0x91, 0xe1, 0x67, 0x2c, 0x4a, 0xd2, 0xe9, 0x4e, 0xe3, 0xd4, 0xf4, 0x81, 0x5a, 0x12, 0xc5, 0x41, 0x3f, 0x79, 0x38, 0x9b, 0x60, 0x20, 0x07, 0x34, 0xb0, 0xc9, 0x03, 0x5c, 0x23, 0x03, 0x53, 0x13, 0x56, 0x88, 0xdf, 0x09, 0xda, 0x9b, 0xd3, 0xb6, 0x52, 0x0e, 0xec, 0xe4, 0x29, 0x24, 0xfc, 0xd0, 0xe7, 0x75, 0xe5, 0x57, 0x6b, 0x61, 0xfb, 0xf0, 0xca, 0xaa, 0x57, 0xa8, 0xe6, 0x78, 0x1a, 0x7d, 0xf9, 0x95, 0x8a, 0x5e, 0xa0, 0xe3, 0x67, 0x8f, 0xa0, 0xbd, 0x5b, 0xf2, 0xdf, 0x4a, 0x82, 0xcb, 0x4a, 0xb3, 0xb0, 0xb4, 0x41, 0x0a, 0x70, 0x48, 0xd9, 0x57, 0x60, 0x51, 0x3a, 0x8f, 0xbc, 0xe6, 0x7b, 0xcb, 0xe4, 0x3b, 0xa7, 0x3f, 0x9b, 0x9f, 0x9a, 0xba, 0x77, 0xe5, 0x5f, 0x95, 0x9c, 0x59, 0x94, 0x9f, 0xcd, 0x37, 0x8c, 0xa9, 0xa6, 0xd9, 0x39, 0xaa, 0xd0, 0x7d, 0xa9, 0x1c, 0x03, 0x5e, 0x09, 0xff, 0x00, 0x0c, 0x76, 0xcb, 0x62, 0x2d, 0xa5, 0xf2, 0x85, 0xbf, 0xe7, 0x87, 0xe6, 0xa3, 0x5e, 0x4d, 0xa8, 0xc9, 0xe6, 0x8b, 0xd5, 0x69, 0x5c, 0xb0, 0x4a, 0xab, 0xc4, 0xb5, 0x35, 0x0a, 0xaa, 0xea, 0x40, 0x03, 0xa0, 0xf6, 0xcb, 0x40, 0x4d, 0x3e, 0xdb, 0xff, 0x00, 0x9c, 0x7f, 0xfc, 0xce, 0x4f, 0xcc, 0xbf, 0x26, 0x25, 0xe5, 0xd3, 0x2f, 0xe9, 0xdd, 0x3d, 0xfe, 0xab, 0xa9, 0xaa, 0xd2, 0xa6, 0x40, 0x2a, 0xb2, 0x71, 0x00, 0x01, 0xea, 0x0d, 0xe8, 0x3a, 0x64, 0x25, 0x16, 0x1c, 0x8b, 0xd9, 0x51, 0x39, 0x28, 0x12, 0x51, 0x41, 0xfd, 0xa3, 0xd2, 0xb9, 0x4f, 0x0d, 0x33, 0xb5, 0xf4, 0x87, 0x9d, 0x79, 0x0e, 0xb4, 0xaf, 0x6a, 0xf8, 0xf1, 0xf0, 0xc9, 0xda, 0xbf, 0xff, 0xd6, 0xf2, 0xc6, 0xb5, 0x68, 0x64, 0xd0, 0x6d, 0x35, 0x20, 0x39, 0xcd, 0x13, 0x0f, 0x5e, 0x61, 0xfc, 0x8f, 0x40, 0x8b, 0x5e, 0xe0, 0x66, 0x1c, 0x4f, 0xaa, 0x9d, 0xe6, 0xa6, 0x1e, 0x91, 0x2e, 0xa9, 0x87, 0x95, 0xee, 0x9c, 0xc5, 0x55, 0x34, 0x60, 0x40, 0xae, 0x57, 0x30, 0xd9, 0xa7, 0x95, 0xbd, 0x6f, 0xcb, 0x26, 0x39, 0x40, 0x0d, 0x4e, 0xc0, 0x9f, 0x9e, 0x50, 0x5d, 0xac, 0x79, 0x33, 0x8b, 0xbb, 0x9b, 0x3b, 0x6b, 0x35, 0x48, 0x54, 0x09, 0x29, 0x56, 0x7f, 0xe1, 0x86, 0x72, 0x00, 0x2c, 0x6e, 0xf7, 0x63, 0x3e, 0x63, 0xbd, 0xbd, 0x5d, 0x20, 0x2a, 0xb3, 0xa4, 0x33, 0x48, 0xab, 0x21, 0x43, 0xf1, 0x2c, 0x47, 0xed, 0x1d, 0xbc, 0x73, 0x18, 0x9b, 0x64, 0x28, 0x96, 0x3a, 0xc7, 0x49, 0xb0, 0xf4, 0xcc, 0xe9, 0x73, 0x6c, 0xb4, 0xf8, 0x67, 0x92, 0x32, 0x21, 0x70, 0x7b, 0x89, 0x05, 0x57, 0xef, 0x38, 0x28, 0x94, 0x4a, 0x7d, 0x13, 0x7d, 0x6a, 0xd3, 0x4c, 0xb8, 0xf2, 0xc3, 0xc8, 0x2e, 0x03, 0xf3, 0xe2, 0x7d, 0x33, 0xb7, 0xc5, 0xcc, 0x71, 0x03, 0xc6, 0xb9, 0x64, 0x06, 0xe2, 0x9a, 0xf2, 0x4f, 0xd2, 0x6d, 0xe9, 0xfe, 0x41, 0x45, 0x5b, 0x18, 0x66, 0xa5, 0x64, 0x09, 0xf4, 0xd5, 0xb7, 0xcd, 0x93, 0xc7, 0xcf, 0x9b, 0xe5, 0x6f, 0xf9, 0xc8, 0x0d, 0x56, 0xeb, 0x59, 0xfc, 0xce, 0xd5, 0x12, 0x61, 0xc4, 0x69, 0xe9, 0x0d, 0xa4, 0x4b, 0xfe, 0x48, 0x40, 0xd5, 0x3e, 0xe4, 0xb6, 0x64, 0x8e, 0x4c, 0x02, 0x61, 0x65, 0xa0, 0x14, 0xb4, 0xb6, 0xb0, 0xb1, 0xb6, 0xb2, 0x97, 0xcb, 0xf1, 0x5a, 0x2d, 0xc6, 0xa5, 0xac, 0xb4, 0x70, 0x5d, 0xc7, 0x3d, 0xc1, 0x51, 0x24, 0x91, 0xc9, 0x31, 0x75, 0x6b, 0x70, 0x9f, 0x14, 0x68, 0x01, 0x46, 0xe4, 0xb5, 0xa3, 0x17, 0xcb, 0x40, 0x61, 0x6f, 0x47, 0xff, 0x00, 0x9c, 0x3a, 0x8f, 0x5b, 0x4f, 0x3c, 0x6b, 0xb7, 0xfa, 0x30, 0x91, 0x3c, 0xa4, 0xb1, 0x95, 0xb9, 0x82, 0x42, 0x0a, 0xbc, 0x8e, 0xe4, 0xdb, 0xa9, 0xef, 0xc9, 0x17, 0x91, 0x24, 0x7c, 0xb2, 0x05, 0x64, 0xfb, 0x75, 0x64, 0x32, 0x39, 0x69, 0x5b, 0x9c, 0xad, 0xb9, 0xdb, 0xa7, 0xb5, 0x3b, 0x53, 0x2a, 0x21, 0x41, 0x44, 0xf3, 0x8b, 0x8f, 0x2e, 0x43, 0x9d, 0x2b, 0xd4, 0x57, 0x23, 0x41, 0x36, 0xff, 0x00, 0xff, 0xd7, 0xf0, 0xc0, 0xd5, 0xb5, 0x11, 0x64, 0xb6, 0x3f, 0x59, 0x90, 0xd9, 0xab, 0x06, 0xf4, 0x79, 0x7c, 0x3b, 0x74, 0xc8, 0x08, 0x8b, 0xb6, 0xe3, 0x96, 0x55, 0x57, 0xb3, 0x3e, 0xf2, 0x35, 0xc7, 0xd6, 0x0b, 0x45, 0x5d, 0xdc, 0x8a, 0x7d, 0xd9, 0x8d, 0x94, 0x3b, 0x3d, 0x1c, 0x9e, 0xc3, 0xe5, 0xc3, 0x2c, 0x7c, 0xc5, 0x0f, 0xee, 0xdb, 0x8b, 0x0c, 0xc4, 0x26, 0x9d, 0xa0, 0x9a, 0x7d, 0x2c, 0xe5, 0xe4, 0x55, 0x7f, 0xee, 0xc1, 0x15, 0x04, 0xd0, 0x12, 0x3c, 0x72, 0x89, 0x1b, 0x2c, 0xcc, 0xa8, 0x2a, 0x8b, 0x87, 0xbb, 0x63, 0x1a, 0x28, 0x65, 0xf0, 0xed, 0xf2, 0xc3, 0xc2, 0x0a, 0x06, 0x4a, 0x46, 0xc7, 0xa5, 0xa3, 0x59, 0xc8, 0xb2, 0xc7, 0x45, 0x22, 0x9c, 0x14, 0x54, 0x10, 0x46, 0xf5, 0x1d, 0x32, 0x5c, 0x14, 0x14, 0xe4, 0x32, 0x2f, 0x3a, 0xf3, 0xb6, 0x90, 0x9a, 0x6d, 0xae, 0x9f, 0x3d, 0xab, 0xb8, 0x8a, 0x3b, 0xf8, 0x39, 0x44, 0x58, 0xf0, 0x08, 0xd5, 0x14, 0xa5, 0x7b, 0x65, 0x98, 0x8e, 0xfb, 0xb5, 0x67, 0x87, 0xa5, 0xef, 0x5e, 0x44, 0x96, 0x35, 0xb5, 0xb6, 0x59, 0x36, 0xfd, 0xd8, 0xa0, 0xf1, 0x20, 0x53, 0x33, 0xc0, 0x79, 0x59, 0x73, 0x7c, 0xd7, 0xf9, 0xfb, 0xa2, 0xcd, 0x67, 0xf9, 0xa7, 0x7b, 0x72, 0xf1, 0x71, 0x83, 0x53, 0x86, 0x0b, 0x98, 0x24, 0x22, 0x8a, 0xcc, 0x88, 0x23, 0x7f, 0xb8, 0xae, 0xf9, 0x7c, 0x50, 0x1e, 0x5f, 0x7c, 0x48, 0x21, 0x44, 0x6b, 0xce, 0x9b, 0xb0, 0x1b, 0x9e, 0xf5, 0xaf, 0x8e, 0x4d, 0x5f, 0x7a, 0x7f, 0xce, 0x34, 0xf9, 0x5d, 0x3c, 0xa3, 0xf9, 0x69, 0x63, 0xa9, 0x3c, 0x27, 0xeb, 0xda, 0xe1, 0x37, 0xd7, 0x2e, 0xaa, 0xdb, 0x06, 0xda, 0x30, 0x49, 0xfe, 0x54, 0x03, 0x03, 0x49, 0xdc, 0xb3, 0xaf, 0x38, 0xfe, 0x6a, 0xf9, 0x47, 0xc9, 0x3a, 0x74, 0x97, 0xfa, 0xf6, 0xaf, 0x15, 0x85, 0xb8, 0x75, 0x89, 0xb8, 0x87, 0x9a, 0x72, 0xee, 0x2a, 0x14, 0x24, 0x60, 0xb1, 0xa8, 0xdf, 0x07, 0x0b, 0x2d, 0xcb, 0xcf, 0x7f, 0xe8, 0x6a, 0xff, 0x00, 0x26, 0xbd, 0x6a, 0x7f, 0x89, 0x2f, 0xf8, 0x52, 0x9e, 0xb7, 0xe8, 0xb9, 0xb8, 0x57, 0xc2, 0x95, 0xe9, 0x8f, 0x08, 0x5a, 0x2f, 0xff, 0xd0, 0xf0, 0x4d, 0x40, 0xaa, 0xd7, 0x00, 0x64, 0xcb, 0x3c, 0x97, 0xa8, 0xb5, 0x9e, 0xa3, 0x1a, 0xd6, 0x84, 0x95, 0x3f, 0x45, 0x72, 0x9c, 0xa2, 0xc3, 0x99, 0xa5, 0x9d, 0x49, 0xf4, 0x17, 0x97, 0xaf, 0x63, 0x17, 0x52, 0x6f, 0xf0, 0xc8, 0x43, 0x6f, 0x9a, 0xe9, 0x07, 0x70, 0x0e, 0xec, 0x83, 0x51, 0x44, 0xb8, 0x61, 0x1a, 0x9e, 0x11, 0xd3, 0x91, 0x60, 0x68, 0x6b, 0xd3, 0x31, 0x4f, 0x36, 0xd3, 0x4c, 0x52, 0xef, 0x4c, 0xd5, 0x0c, 0xc4, 0x69, 0xda, 0x94, 0xc8, 0x3a, 0xf0, 0x66, 0x07, 0x73, 0xe0, 0x40, 0xfd, 0x79, 0x93, 0x12, 0x1c, 0x9c, 0x32, 0xc7, 0xfc, 0x41, 0x33, 0xd2, 0xb4, 0x6f, 0x38, 0x98, 0x65, 0x76, 0xbf, 0x69, 0x42, 0xd0, 0xaa, 0xc9, 0xde, 0x95, 0xad, 0x28, 0x46, 0x4e, 0xac, 0x39, 0x77, 0x80, 0x11, 0xbf, 0xd8, 0xc7, 0x7c, 0xe1, 0xa5, 0xf9, 0x92, 0x4d, 0x32, 0x5b, 0x8b, 0x93, 0x27, 0xa7, 0x68, 0x56, 0xe2, 0x45, 0xda, 0x85, 0x61, 0x6e, 0x67, 0xad, 0x6b, 0xb0, 0x38, 0xc2, 0x81, 0xe4, 0xc7, 0x52, 0x31, 0x1c, 0x67, 0x86, 0x5b, 0xbd, 0x37, 0xca, 0x7a, 0x94, 0xb1, 0x69, 0xb6, 0x2e, 0xb7, 0x15, 0x48, 0xc2, 0xb4, 0x52, 0x53, 0xac, 0x32, 0xaf, 0xb1, 0xed, 0x9b, 0x10, 0x36, 0x78, 0x5c, 0x9f, 0x51, 0x64, 0x1f, 0x98, 0x3e, 0x58, 0xb6, 0xfc, 0xc8, 0xf2, 0xe5, 0xbc, 0x68, 0x52, 0x2d, 0x5a, 0xd1, 0x84, 0xb6, 0xf3, 0x95, 0x0e, 0xc0, 0x85, 0xe2, 0xcb, 0xd8, 0xd1, 0xbb, 0xe4, 0xc1, 0xa6, 0x97, 0xce, 0x17, 0x5f, 0x95, 0xde, 0x6d, 0xb6, 0xbe, 0xb7, 0x69, 0x34, 0xf3, 0x3c, 0x72, 0xcf, 0xe8, 0xa3, 0x45, 0x49, 0x95, 0x4a, 0x90, 0x3e, 0x35, 0x5a, 0x95, 0x1d, 0xfe, 0x21, 0x93, 0x4d, 0xbe, 0xd2, 0xd2, 0xf5, 0x8b, 0xbd, 0x32, 0x2d, 0x3f, 0x4c, 0x9a, 0xe4, 0xca, 0x9e, 0x90, 0x85, 0x65, 0x55, 0x08, 0x85, 0x91, 0x01, 0x3b, 0x0a, 0x05, 0xe9, 0xb0, 0xc0, 0x5a, 0xc3, 0xcd, 0x3f, 0x3b, 0x7f, 0x26, 0xec, 0xff, 0x00, 0x35, 0x6d, 0x6d, 0xb5, 0x3d, 0x16, 0xfe, 0x0d, 0x3b, 0xcd, 0x96, 0x01, 0x92, 0x46, 0x9e, 0xa2, 0x0b, 0xc8, 0xb7, 0x28, 0x92, 0x71, 0xfb, 0x2e, 0xa7, 0xec, 0x3d, 0x0f, 0xc2, 0x68, 0x71, 0x05, 0x95, 0xd3, 0xe7, 0x9f, 0xfa, 0x16, 0x2f, 0xcd, 0x7f, 0x43, 0xd6, 0xfa, 0xa5, 0x97, 0xab, 0xeb, 0x7a, 0x5f, 0x55, 0xfa, 0xec, 0x5e, 0xaf, 0x0f, 0xf7, 0xed, 0x2b, 0x4e, 0x15, 0xff, 0x00, 0x65, 0xdf, 0x8e, 0x14, 0xf1, 0xbf, 0xff, 0xd1, 0xf0, 0x5a, 0xa7, 0x18, 0x5e, 0x56, 0x1f, 0x68, 0x71, 0x5f, 0xa7, 0xbe, 0x2a, 0x98, 0xdb, 0xfa, 0x90, 0x24, 0x37, 0xb0, 0xfd, 0xb8, 0xa8, 0x58, 0x78, 0xae, 0x43, 0xc9, 0xb4, 0x6d, 0xbb, 0xda, 0x3c, 0xa1, 0xad, 0x43, 0xa8, 0xda, 0xc5, 0x2a, 0x3d, 0x26, 0x5a, 0x02, 0x2b, 0xbe, 0x60, 0x64, 0x8d, 0x17, 0x6f, 0x8b, 0x20, 0x90, 0x7a, 0x3c, 0x32, 0x8b, 0xa8, 0x02, 0xf3, 0xfd, 0xe0, 0x1b, 0x11, 0x98, 0x66, 0x3b, 0xb9, 0x62, 0x54, 0x83, 0x36, 0xf2, 0xa4, 0xe4, 0x29, 0x34, 0xeb, 0xc8, 0x74, 0xae, 0x0d, 0xc3, 0x65, 0x82, 0x13, 0x6b, 0x57, 0xba, 0x54, 0xe4, 0x8c, 0x41, 0x1b, 0x75, 0xa7, 0xe0, 0x72, 0x5c, 0x4c, 0x84, 0x50, 0x5a, 0xb3, 0xdd, 0xdd, 0xc3, 0x24, 0x33, 0xb1, 0x60, 0xe0, 0x86, 0x52, 0x45, 0x38, 0xd2, 0x87, 0x24, 0x26, 0x6d, 0x8c, 0xe1, 0x41, 0x25, 0xfc, 0xa3, 0xd7, 0x2f, 0x6f, 0x3c, 0xbf, 0x73, 0xa5, 0xb2, 0x2c, 0xd1, 0x69, 0x17, 0x2f, 0x6b, 0x14, 0x8c, 0x0f, 0x21, 0x0d, 0x79, 0x46, 0x09, 0x15, 0xed, 0xb7, 0x4e, 0xd9, 0xb9, 0x8b, 0xcb, 0xe4, 0xa2, 0x5e, 0xa3, 0xa6, 0xdf, 0x6a, 0x36, 0xe4, 0xcd, 0x69, 0x1c, 0x4e, 0x84, 0x7c, 0x76, 0xab, 0x21, 0x67, 0xa8, 0xa7, 0xd9, 0xf8, 0x4d, 0x2b, 0xf3, 0xc3, 0x4d, 0x49, 0x57, 0x98, 0x75, 0x6f, 0x31, 0xda, 0xf9, 0xa3, 0x4b, 0xfd, 0x1f, 0x69, 0x1d, 0xae, 0xa1, 0xa9, 0x7e, 0xee, 0xe6, 0xd2, 0x79, 0x18, 0xf3, 0xb5, 0x1f, 0xee, 0xd9, 0x0a, 0x01, 0x4e, 0x3f, 0xb3, 0x4d, 0xf2, 0x9c, 0xb9, 0x04, 0x05, 0xb7, 0xe2, 0x87, 0x1e, 0xdd, 0x19, 0x3e, 0xaf, 0x6b, 0xae, 0xcb, 0x6d, 0x13, 0x0d, 0x45, 0xa2, 0x8e, 0x06, 0xe5, 0x13, 0x2a, 0x02, 0x01, 0x5e, 0x82, 0xb5, 0x04, 0xe6, 0x11, 0xd4, 0xcd, 0xda, 0x43, 0x49, 0x8e, 0xb7, 0xdc, 0xb1, 0x51, 0xe6, 0x4d, 0x76, 0xd2, 0x61, 0x15, 0xaa, 0x4b, 0xa8, 0xc9, 0x6e, 0x49, 0x79, 0x20, 0xe6, 0x8c, 0x49, 0xad, 0x43, 0x16, 0xe4, 0xa7, 0xaf, 0x43, 0xd3, 0x26, 0x35, 0x75, 0xcd, 0xa8, 0xe8, 0x87, 0x46, 0xbf, 0xc7, 0x9a, 0xff, 0x00, 0xd6, 0xbf, 0x48, 0xfe, 0x88, 0xfd, 0xe7, 0x0f, 0xab, 0xfa, 0x3f, 0x58, 0x7f, 0x5f, 0x8d, 0x3f, 0x9f, 0xa7, 0x5e, 0xd4, 0xc3, 0xf9, 0xd1, 0x7c, 0xb6, 0x47, 0xe4, 0x3a, 0x5b, 0xff, 0xd2, 0xf0, 0xb7, 0xa6, 0x1e, 0xdf, 0xd3, 0xf6, 0xa5, 0x71, 0x54, 0xdb, 0x4b, 0x80, 0x3c, 0x42, 0x26, 0xee, 0x29, 0xbe, 0x51, 0x23, 0x4e, 0x44, 0x05, 0x84, 0x45, 0xa5, 0xd5, 0xf7, 0x97, 0x2e, 0xfd, 0x6b, 0x6a, 0x98, 0x09, 0xab, 0xc7, 0xfc, 0x46, 0x3b, 0x4c, 0x26, 0x32, 0x30, 0x3e, 0x4f, 0x49, 0xd0, 0xfc, 0xfb, 0x05, 0xd4, 0x4a, 0x7d, 0x40, 0xac, 0x3a, 0x8e, 0x84, 0x1c, 0xc5, 0x96, 0x2a, 0x73, 0xe1, 0x9c, 0x16, 0x6d, 0xa5, 0x79, 0x86, 0xd6, 0xec, 0x80, 0x5a, 0xa0, 0xf5, 0xca, 0xcc, 0x5c, 0xa1, 0x2b, 0x1b, 0x26, 0x30, 0x6a, 0x31, 0x46, 0xcf, 0x1c, 0x87, 0x94, 0x64, 0x9e, 0x3d, 0xb6, 0xf0, 0xca, 0xa8, 0x39, 0x51, 0x99, 0x42, 0x6b, 0x1a, 0xc5, 0xa5, 0xa5, 0x94, 0xf7, 0x92, 0xc8, 0xaa, 0xb1, 0x23, 0x30, 0x04, 0xf8, 0x0e, 0x9f, 0x4e, 0x4a, 0x11, 0xb2, 0xd5, 0x9b, 0x25, 0x06, 0x1b, 0xff, 0x00, 0x38, 0xfd, 0xad, 0xdf, 0xda, 0xf9, 0xa2, 0xfe, 0xc5, 0x42, 0xbe, 0x9b, 0x7f, 0x0b, 0xdd, 0xdd, 0x07, 0xaf, 0x14, 0x68, 0xd8, 0x71, 0x6d, 0xbb, 0x90, 0xfc, 0x73, 0x6e, 0xf2, 0xf2, 0xdd, 0xf4, 0xad, 0xa6, 0xab, 0x6d, 0x69, 0x14, 0xfa, 0xee, 0xa0, 0xe2, 0x0b, 0x0d, 0x39, 0x19, 0xfe, 0x11, 0xc5, 0x1a, 0x4a, 0x1d, 0x8f, 0x73, 0x4f, 0xf8, 0x96, 0x0b, 0x40, 0x8d, 0xec, 0xf3, 0x6d, 0x3f, 0x52, 0xba, 0xd6, 0x35, 0x8b, 0xbf, 0x36, 0x6a, 0x5f, 0x0d, 0xc5, 0xdc, 0xa8, 0xb6, 0xa8, 0x7a, 0xc5, 0x6c, 0x9b, 0x22, 0x0f, 0xa3, 0x73, 0x9a, 0xbc, 0xb3, 0xe2, 0x36, 0xed, 0xb1, 0x43, 0x80, 0x53, 0xd0, 0xa7, 0xd4, 0x44, 0xfa, 0x7a, 0xda, 0x83, 0xbd, 0x3e, 0x2f, 0xa7, 0x2b, 0xad, 0x9b, 0xb8, 0x8d, 0xa8, 0xe8, 0x91, 0xdb, 0xfa, 0x2d, 0x6f, 0xc3, 0x8a, 0x2d, 0x56, 0xa3, 0xad, 0x4f, 0x5c, 0xa4, 0x0d, 0xdc, 0xa3, 0xca, 0xd0, 0xbf, 0xa1, 0xe3, 0xfa, 0xe7, 0x0f, 0xf2, 0xb9, 0x57, 0xbf, 0x1a, 0xe4, 0xb8, 0x57, 0xc5, 0xdd, 0xff, 0xd3, 0xf0, 0xcc, 0x5d, 0x7b, 0x70, 0xc5, 0x53, 0x6d, 0x2f, 0xd5, 0xe4, 0x69, 0xfd, 0xdf, 0xec, 0xd7, 0xad, 0x7d, 0xb2, 0x8c, 0x8d, 0xd8, 0xed, 0x91, 0x9f, 0x43, 0xea, 0xe7, 0xeb, 0x94, 0xad, 0x3e, 0x1e, 0x95, 0xfc, 0x72, 0x81, 0x7d, 0x1c, 0x9d, 0xba, 0xb1, 0x7b, 0xdf, 0xa9, 0x7a, 0xdf, 0xee, 0x2f, 0xd4, 0xfa, 0xe7, 0xed, 0x7a, 0x7f, 0xdd, 0xff, 0x00, 0xb2, 0xae, 0x64, 0x0b, 0xea, 0xe3, 0x9a, 0xbf, 0x4a, 0x6f, 0xa4, 0xff, 0x00, 0x89, 0xbd, 0x45, 0xfa, 0xb5, 0x79, 0xf7, 0xeb, 0xc7, 0xe9, 0xae, 0x57, 0x2e, 0x17, 0x23, 0x1f, 0x89, 0xd1, 0x99, 0x8f, 0xf1, 0xa7, 0x11, 0xcf, 0xd3, 0xf5, 0x29, 0xb5, 0x6b, 0xd3, 0xe8, 0xcc, 0x7f, 0x45, 0xb9, 0xa3, 0xc5, 0x62, 0xbe, 0x68, 0xff, 0x00, 0x15, 0xfd, 0x4c, 0xfe, 0x90, 0xaf, 0xd4, 0xab, 0xf1, 0x7a, 0x7f, 0x62, 0x9d, 0xab, 0xdf, 0x32, 0xb1, 0x70, 0x5e, 0xdc, 0xdc, 0x2d, 0x47, 0x8b, 0x5e, 0xae, 0x4c, 0xbf, 0xf2, 0x37, 0x9f, 0x3d, 0x5b, 0xd2, 0xff, 0x00, 0x8e, 0x87, 0xee, 0x29, 0x5a, 0xf2, 0xf4, 0xaa, 0xd4, 0xa5, 0x36, 0xa7, 0x3a, 0x57, 0xfd, 0x8e, 0x64, 0x3a, 0xf2, 0xf6, 0xbf, 0xcc, 0x7f, 0x5b, 0xfc, 0x23, 0xa7, 0xfe, 0x8e, 0xff, 0x00, 0x8e, 0x37, 0xd6, 0x63, 0xfa, 0xe5, 0x2b, 0xcb, 0x87, 0xec, 0xd6, 0xbd, 0xb9, 0x7d, 0xac, 0xc7, 0xcd, 0x7c, 0x2d, 0xf8, 0x2b, 0x89, 0x26, 0x8f, 0xd4, 0xfa, 0x94, 0x3e, 0x85, 0x29, 0xc9, 0x69, 0xfc, 0x33, 0x58, 0x5d, 0x9c, 0x79, 0xb2, 0xbb, 0x0f, 0xac, 0x7a, 0x2b, 0xea, 0x75, 0xef, 0x92, 0x0c, 0x53, 0x3d, 0x2f, 0xd4, 0xfa, 0xbb, 0xfa, 0x74, 0xf5, 0x39, 0x9a, 0xd7, 0xe7, 0x80, 0x53, 0x79, 0xba, 0x5b, 0xfe, 0x97, 0xfa, 0x4b, 0xfc, 0xba, 0x7f, 0xb1, 0xc7, 0xab, 0x1e, 0x8f, 0xff, 0xd9 +}; diff --git a/webrtc/rtc_base/testclient.cc b/webrtc/base/testclient.cc similarity index 100% rename from webrtc/rtc_base/testclient.cc rename to webrtc/base/testclient.cc diff --git a/webrtc/base/testclient.h b/webrtc/base/testclient.h index 378e2b81d4..bd78d83b35 100644 --- a/webrtc/base/testclient.h +++ b/webrtc/base/testclient.h @@ -11,9 +11,104 @@ #ifndef WEBRTC_BASE_TESTCLIENT_H_ #define WEBRTC_BASE_TESTCLIENT_H_ +#include +#include +#include "webrtc/base/asyncudpsocket.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/criticalsection.h" +#include "webrtc/base/fakeclock.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/testclient.h" +namespace rtc { + +// A simple client that can send TCP or UDP data and check that it receives +// what it expects to receive. Useful for testing server functionality. +class TestClient : public sigslot::has_slots<> { + public: + // Records the contents of a packet that was received. + struct Packet { + Packet(const SocketAddress& a, + const char* b, + size_t s, + const PacketTime& packet_time); + Packet(const Packet& p); + virtual ~Packet(); + + SocketAddress addr; + char* buf; + size_t size; + PacketTime packet_time; + }; + + // Default timeout for NextPacket reads. + static const int kTimeoutMs = 5000; + + // Creates a client that will send and receive with the given socket and + // will post itself messages with the given thread. + explicit TestClient(std::unique_ptr socket); + // Create a test client that will use a fake clock. NextPacket needs to wait + // for a packet to be received, and thus it needs to advance the fake clock + // if the test is using one, rather than just sleeping. + TestClient(std::unique_ptr socket, FakeClock* fake_clock); + ~TestClient() override; + + SocketAddress address() const { return socket_->GetLocalAddress(); } + SocketAddress remote_address() const { return socket_->GetRemoteAddress(); } + + // Checks that the socket moves to the specified connect state. + bool CheckConnState(AsyncPacketSocket::State state); + + // Checks that the socket is connected to the remote side. + bool CheckConnected() { + return CheckConnState(AsyncPacketSocket::STATE_CONNECTED); + } + + // Sends using the clients socket. + int Send(const char* buf, size_t size); + + // Sends using the clients socket to the given destination. + int SendTo(const char* buf, size_t size, const SocketAddress& dest); + + // Returns the next packet received by the client or null if none is received + // within the specified timeout. + std::unique_ptr NextPacket(int timeout_ms); + + // Checks that the next packet has the given contents. Returns the remote + // address that the packet was sent from. + bool CheckNextPacket(const char* buf, size_t len, SocketAddress* addr); + + // Checks that no packets have arrived or will arrive in the next second. + bool CheckNoPacket(); + + int GetError(); + int SetOption(Socket::Option opt, int value); + + bool ready_to_send() const { return ready_to_send_count() > 0; } + + // How many times SignalReadyToSend has been fired. + int ready_to_send_count() const { return ready_to_send_count_; } + + private: + // Timeout for reads when no packet is expected. + static const int kNoPacketTimeoutMs = 1000; + // Workaround for the fact that AsyncPacketSocket::GetConnState doesn't exist. + Socket::ConnState GetState(); + // Slot for packets read on the socket. + void OnPacket(AsyncPacketSocket* socket, const char* buf, size_t len, + const SocketAddress& remote_addr, + const PacketTime& packet_time); + void OnReadyToSend(AsyncPacketSocket* socket); + bool CheckTimestamp(int64_t packet_timestamp); + void AdvanceTime(int ms); + + FakeClock* fake_clock_ = nullptr; + CriticalSection crit_; + std::unique_ptr socket_; + std::vector> packets_; + int ready_to_send_count_ = 0; + int64_t prev_packet_timestamp_; + RTC_DISALLOW_COPY_AND_ASSIGN(TestClient); +}; + +} // namespace rtc #endif // WEBRTC_BASE_TESTCLIENT_H_ diff --git a/webrtc/rtc_base/testclient_unittest.cc b/webrtc/base/testclient_unittest.cc similarity index 100% rename from webrtc/rtc_base/testclient_unittest.cc rename to webrtc/base/testclient_unittest.cc diff --git a/webrtc/base/testechoserver.h b/webrtc/base/testechoserver.h index 21365e2a82..97606c105c 100644 --- a/webrtc/base/testechoserver.h +++ b/webrtc/base/testechoserver.h @@ -11,9 +11,65 @@ #ifndef WEBRTC_BASE_TESTECHOSERVER_H_ #define WEBRTC_BASE_TESTECHOSERVER_H_ +#include +#include +#include "webrtc/base/asynctcpsocket.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/socketaddress.h" +#include "webrtc/base/sigslot.h" +#include "webrtc/base/thread.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/testechoserver.h" +namespace rtc { + +// A test echo server, echoes back any packets sent to it. +// Useful for unit tests. +class TestEchoServer : public sigslot::has_slots<> { + public: + TestEchoServer(Thread* thread, const SocketAddress& addr) + : server_socket_(thread->socketserver()->CreateAsyncSocket(addr.family(), + SOCK_STREAM)) { + server_socket_->Bind(addr); + server_socket_->Listen(5); + server_socket_->SignalReadEvent.connect(this, &TestEchoServer::OnAccept); + } + ~TestEchoServer() { + for (ClientList::iterator it = client_sockets_.begin(); + it != client_sockets_.end(); ++it) { + delete *it; + } + } + + SocketAddress address() const { return server_socket_->GetLocalAddress(); } + + private: + void OnAccept(AsyncSocket* socket) { + AsyncSocket* raw_socket = socket->Accept(nullptr); + if (raw_socket) { + AsyncTCPSocket* packet_socket = new AsyncTCPSocket(raw_socket, false); + packet_socket->SignalReadPacket.connect(this, &TestEchoServer::OnPacket); + packet_socket->SignalClose.connect(this, &TestEchoServer::OnClose); + client_sockets_.push_back(packet_socket); + } + } + void OnPacket(AsyncPacketSocket* socket, const char* buf, size_t size, + const SocketAddress& remote_addr, + const PacketTime& packet_time) { + rtc::PacketOptions options; + socket->Send(buf, size, options); + } + void OnClose(AsyncPacketSocket* socket, int err) { + ClientList::iterator it = + std::find(client_sockets_.begin(), client_sockets_.end(), socket); + client_sockets_.erase(it); + Thread::Current()->Dispose(socket); + } + + typedef std::list ClientList; + std::unique_ptr server_socket_; + ClientList client_sockets_; + RTC_DISALLOW_COPY_AND_ASSIGN(TestEchoServer); +}; + +} // namespace rtc #endif // WEBRTC_BASE_TESTECHOSERVER_H_ diff --git a/webrtc/base/testutils.h b/webrtc/base/testutils.h index 74f216066e..cda7a8457e 100644 --- a/webrtc/base/testutils.h +++ b/webrtc/base/testutils.h @@ -8,12 +8,559 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_TESTUTILS_H_ -#define WEBRTC_BASE_TESTUTILS_H_ +#ifndef WEBRTC_BASE_TESTUTILS_H__ +#define WEBRTC_BASE_TESTUTILS_H__ +// Utilities for testing rtc infrastructure in unittests -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/testutils.h" +#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) +#include +#include -#endif // WEBRTC_BASE_TESTUTILS_H_ +// X defines a few macros that stomp on types that gunit.h uses. +#undef None +#undef Bool +#endif + +#include +#include +#include +#include +#include "webrtc/base/arraysize.h" +#include "webrtc/base/asyncsocket.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/gunit.h" +#include "webrtc/base/nethelpers.h" +#include "webrtc/base/pathutils.h" +#include "webrtc/base/stream.h" +#include "webrtc/base/stringencode.h" +#include "webrtc/base/stringutils.h" +#include "webrtc/base/thread.h" + +namespace webrtc { +namespace testing { + +using namespace rtc; + +/////////////////////////////////////////////////////////////////////////////// +// StreamSink - Monitor asynchronously signalled events from StreamInterface +// or AsyncSocket (which should probably be a StreamInterface. +/////////////////////////////////////////////////////////////////////////////// + +// Note: Any event that is an error is treaded as SSE_ERROR instead of that +// event. + +enum StreamSinkEvent { + SSE_OPEN = SE_OPEN, + SSE_READ = SE_READ, + SSE_WRITE = SE_WRITE, + SSE_CLOSE = SE_CLOSE, + SSE_ERROR = 16 +}; + +class StreamSink : public sigslot::has_slots<> { + public: + void Monitor(StreamInterface* stream) { + stream->SignalEvent.connect(this, &StreamSink::OnEvent); + events_.erase(stream); + } + void Unmonitor(StreamInterface* stream) { + stream->SignalEvent.disconnect(this); + // In case you forgot to unmonitor a previous object with this address + events_.erase(stream); + } + bool Check(StreamInterface* stream, StreamSinkEvent event, bool reset = true) { + return DoCheck(stream, event, reset); + } + int Events(StreamInterface* stream, bool reset = true) { + return DoEvents(stream, reset); + } + + void Monitor(AsyncSocket* socket) { + socket->SignalConnectEvent.connect(this, &StreamSink::OnConnectEvent); + socket->SignalReadEvent.connect(this, &StreamSink::OnReadEvent); + socket->SignalWriteEvent.connect(this, &StreamSink::OnWriteEvent); + socket->SignalCloseEvent.connect(this, &StreamSink::OnCloseEvent); + // In case you forgot to unmonitor a previous object with this address + events_.erase(socket); + } + void Unmonitor(AsyncSocket* socket) { + socket->SignalConnectEvent.disconnect(this); + socket->SignalReadEvent.disconnect(this); + socket->SignalWriteEvent.disconnect(this); + socket->SignalCloseEvent.disconnect(this); + events_.erase(socket); + } + bool Check(AsyncSocket* socket, StreamSinkEvent event, bool reset = true) { + return DoCheck(socket, event, reset); + } + int Events(AsyncSocket* socket, bool reset = true) { + return DoEvents(socket, reset); + } + + private: + typedef std::map EventMap; + + void OnEvent(StreamInterface* stream, int events, int error) { + if (error) { + events = SSE_ERROR; + } + AddEvents(stream, events); + } + void OnConnectEvent(AsyncSocket* socket) { + AddEvents(socket, SSE_OPEN); + } + void OnReadEvent(AsyncSocket* socket) { + AddEvents(socket, SSE_READ); + } + void OnWriteEvent(AsyncSocket* socket) { + AddEvents(socket, SSE_WRITE); + } + void OnCloseEvent(AsyncSocket* socket, int error) { + AddEvents(socket, (0 == error) ? SSE_CLOSE : SSE_ERROR); + } + + void AddEvents(void* obj, int events) { + EventMap::iterator it = events_.find(obj); + if (events_.end() == it) { + events_.insert(EventMap::value_type(obj, events)); + } else { + it->second |= events; + } + } + bool DoCheck(void* obj, StreamSinkEvent event, bool reset) { + EventMap::iterator it = events_.find(obj); + if ((events_.end() == it) || (0 == (it->second & event))) { + return false; + } + if (reset) { + it->second &= ~event; + } + return true; + } + int DoEvents(void* obj, bool reset) { + EventMap::iterator it = events_.find(obj); + if (events_.end() == it) + return 0; + int events = it->second; + if (reset) { + it->second = 0; + } + return events; + } + + EventMap events_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// StreamSource - Implements stream interface and simulates asynchronous +// events on the stream, without a network. Also buffers written data. +/////////////////////////////////////////////////////////////////////////////// + +class StreamSource : public StreamInterface { +public: + StreamSource() { + Clear(); + } + + void Clear() { + readable_data_.clear(); + written_data_.clear(); + state_ = SS_CLOSED; + read_block_ = 0; + write_block_ = SIZE_UNKNOWN; + } + void QueueString(const char* data) { + QueueData(data, strlen(data)); + } + void QueueStringF(const char* format, ...) { + va_list args; + va_start(args, format); + char buffer[1024]; + size_t len = vsprintfn(buffer, sizeof(buffer), format, args); + RTC_CHECK(len < sizeof(buffer) - 1); + va_end(args); + QueueData(buffer, len); + } + void QueueData(const char* data, size_t len) { + readable_data_.insert(readable_data_.end(), data, data + len); + if ((SS_OPEN == state_) && (readable_data_.size() == len)) { + SignalEvent(this, SE_READ, 0); + } + } + std::string ReadData() { + std::string data; + // avoid accessing written_data_[0] if it is undefined + if (written_data_.size() > 0) { + data.insert(0, &written_data_[0], written_data_.size()); + } + written_data_.clear(); + return data; + } + void SetState(StreamState state) { + int events = 0; + if ((SS_OPENING == state_) && (SS_OPEN == state)) { + events |= SE_OPEN; + if (!readable_data_.empty()) { + events |= SE_READ; + } + } else if ((SS_CLOSED != state_) && (SS_CLOSED == state)) { + events |= SE_CLOSE; + } + state_ = state; + if (events) { + SignalEvent(this, events, 0); + } + } + // Will cause Read to block when there are pos bytes in the read queue. + void SetReadBlock(size_t pos) { read_block_ = pos; } + // Will cause Write to block when there are pos bytes in the write queue. + void SetWriteBlock(size_t pos) { write_block_ = pos; } + + virtual StreamState GetState() const { return state_; } + virtual StreamResult Read(void* buffer, size_t buffer_len, + size_t* read, int* error) { + if (SS_CLOSED == state_) { + if (error) *error = -1; + return SR_ERROR; + } + if ((SS_OPENING == state_) || (readable_data_.size() <= read_block_)) { + return SR_BLOCK; + } + size_t count = std::min(buffer_len, readable_data_.size() - read_block_); + memcpy(buffer, &readable_data_[0], count); + size_t new_size = readable_data_.size() - count; + // Avoid undefined access beyond the last element of the vector. + // This only happens when new_size is 0. + if (count < readable_data_.size()) { + memmove(&readable_data_[0], &readable_data_[count], new_size); + } + readable_data_.resize(new_size); + if (read) *read = count; + return SR_SUCCESS; + } + virtual StreamResult Write(const void* data, size_t data_len, + size_t* written, int* error) { + if (SS_CLOSED == state_) { + if (error) *error = -1; + return SR_ERROR; + } + if (SS_OPENING == state_) { + return SR_BLOCK; + } + if (SIZE_UNKNOWN != write_block_) { + if (written_data_.size() >= write_block_) { + return SR_BLOCK; + } + if (data_len > (write_block_ - written_data_.size())) { + data_len = write_block_ - written_data_.size(); + } + } + if (written) *written = data_len; + const char* cdata = static_cast(data); + written_data_.insert(written_data_.end(), cdata, cdata + data_len); + return SR_SUCCESS; + } + virtual void Close() { state_ = SS_CLOSED; } + +private: + typedef std::vector Buffer; + Buffer readable_data_, written_data_; + StreamState state_; + size_t read_block_, write_block_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// SocketTestClient +// Creates a simulated client for testing. Works on real and virtual networks. +/////////////////////////////////////////////////////////////////////////////// + +class SocketTestClient : public sigslot::has_slots<> { +public: + SocketTestClient() { Init(nullptr, AF_INET); } + SocketTestClient(AsyncSocket* socket) { + Init(socket, socket->GetLocalAddress().family()); + } + SocketTestClient(const SocketAddress& address) { + Init(nullptr, address.family()); + socket_->Connect(address); + } + + AsyncSocket* socket() { return socket_.get(); } + + void QueueString(const char* data) { + QueueData(data, strlen(data)); + } + void QueueStringF(const char* format, ...) { + va_list args; + va_start(args, format); + char buffer[1024]; + size_t len = vsprintfn(buffer, sizeof(buffer), format, args); + RTC_CHECK(len < sizeof(buffer) - 1); + va_end(args); + QueueData(buffer, len); + } + void QueueData(const char* data, size_t len) { + send_buffer_.insert(send_buffer_.end(), data, data + len); + if (Socket::CS_CONNECTED == socket_->GetState()) { + Flush(); + } + } + std::string ReadData() { + std::string data(&recv_buffer_[0], recv_buffer_.size()); + recv_buffer_.clear(); + return data; + } + + bool IsConnected() const { + return (Socket::CS_CONNECTED == socket_->GetState()); + } + bool IsClosed() const { + return (Socket::CS_CLOSED == socket_->GetState()); + } + +private: + typedef std::vector Buffer; + + void Init(AsyncSocket* socket, int family) { + if (!socket) { + socket = Thread::Current()->socketserver() + ->CreateAsyncSocket(family, SOCK_STREAM); + } + socket_.reset(socket); + socket_->SignalConnectEvent.connect(this, + &SocketTestClient::OnConnectEvent); + socket_->SignalReadEvent.connect(this, &SocketTestClient::OnReadEvent); + socket_->SignalWriteEvent.connect(this, &SocketTestClient::OnWriteEvent); + socket_->SignalCloseEvent.connect(this, &SocketTestClient::OnCloseEvent); + } + + void Flush() { + size_t sent = 0; + while (sent < send_buffer_.size()) { + int result = socket_->Send(&send_buffer_[sent], + send_buffer_.size() - sent); + if (result > 0) { + sent += result; + } else { + break; + } + } + size_t new_size = send_buffer_.size() - sent; + memmove(&send_buffer_[0], &send_buffer_[sent], new_size); + send_buffer_.resize(new_size); + } + + void OnConnectEvent(AsyncSocket* socket) { + if (!send_buffer_.empty()) { + Flush(); + } + } + void OnReadEvent(AsyncSocket* socket) { + char data[64 * 1024]; + int result = socket_->Recv(data, arraysize(data), nullptr); + if (result > 0) { + recv_buffer_.insert(recv_buffer_.end(), data, data + result); + } + } + void OnWriteEvent(AsyncSocket* socket) { + if (!send_buffer_.empty()) { + Flush(); + } + } + void OnCloseEvent(AsyncSocket* socket, int error) { + } + + std::unique_ptr socket_; + Buffer send_buffer_, recv_buffer_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// SocketTestServer +// Creates a simulated server for testing. Works on real and virtual networks. +/////////////////////////////////////////////////////////////////////////////// + +class SocketTestServer : public sigslot::has_slots<> { + public: + SocketTestServer(const SocketAddress& address) + : socket_(Thread::Current()->socketserver() + ->CreateAsyncSocket(address.family(), SOCK_STREAM)) + { + socket_->SignalReadEvent.connect(this, &SocketTestServer::OnReadEvent); + socket_->Bind(address); + socket_->Listen(5); + } + virtual ~SocketTestServer() { + clear(); + } + + size_t size() const { return clients_.size(); } + SocketTestClient* client(size_t index) const { return clients_[index]; } + SocketTestClient* operator[](size_t index) const { return client(index); } + + void clear() { + for (size_t i=0; i(socket_->Accept(nullptr)); + if (!accepted) + return; + clients_.push_back(new SocketTestClient(accepted)); + } + + std::unique_ptr socket_; + std::vector clients_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// Unittest predicates which are similar to STREQ, but for raw memory +/////////////////////////////////////////////////////////////////////////////// + +inline ::testing::AssertionResult CmpHelperMemEq( + const char* expected_expression, + const char* expected_length_expression, + const char* actual_expression, + const char* actual_length_expression, + const void* expected, + size_t expected_length, + const void* actual, + size_t actual_length) { + if ((expected_length == actual_length) + && (0 == memcmp(expected, actual, expected_length))) { + return ::testing::AssertionSuccess(); + } + + ::testing::Message msg; + msg << "Value of: " << actual_expression + << " [" << actual_length_expression << "]"; + if (true) { //!actual_value.Equals(actual_expression)) { + size_t buffer_size = actual_length * 2 + 1; + char* buffer = STACK_ARRAY(char, buffer_size); + hex_encode(buffer, buffer_size, + reinterpret_cast(actual), actual_length); + msg << "\n Actual: " << buffer << " [" << actual_length << "]"; + } + + msg << "\nExpected: " << expected_expression + << " [" << expected_length_expression << "]"; + if (true) { //!expected_value.Equals(expected_expression)) { + size_t buffer_size = expected_length * 2 + 1; + char* buffer = STACK_ARRAY(char, buffer_size); + hex_encode(buffer, buffer_size, + reinterpret_cast(expected), expected_length); + msg << "\nWhich is: " << buffer << " [" << expected_length << "]"; + } + + return AssertionFailure(msg); +} + +#define EXPECT_MEMEQ(expected, expected_length, actual, actual_length) \ + EXPECT_PRED_FORMAT4(::testing::CmpHelperMemEq, expected, expected_length, \ + actual, actual_length) + +#define ASSERT_MEMEQ(expected, expected_length, actual, actual_length) \ + ASSERT_PRED_FORMAT4(::testing::CmpHelperMemEq, expected, expected_length, \ + actual, actual_length) + +/////////////////////////////////////////////////////////////////////////////// +// Helpers for initializing constant memory with integers in a particular byte +// order +/////////////////////////////////////////////////////////////////////////////// + +#define BYTE_CAST(x) static_cast((x)&0xFF) + +// Declare a N-bit integer as a little-endian sequence of bytes +#define LE16(x) BYTE_CAST(((uint16_t)x) >> 0), BYTE_CAST(((uint16_t)x) >> 8) + +#define LE32(x) \ + BYTE_CAST(((uint32_t)x) >> 0), BYTE_CAST(((uint32_t)x) >> 8), \ + BYTE_CAST(((uint32_t)x) >> 16), BYTE_CAST(((uint32_t)x) >> 24) + +#define LE64(x) \ + BYTE_CAST(((uint64_t)x) >> 0), BYTE_CAST(((uint64_t)x) >> 8), \ + BYTE_CAST(((uint64_t)x) >> 16), BYTE_CAST(((uint64_t)x) >> 24), \ + BYTE_CAST(((uint64_t)x) >> 32), BYTE_CAST(((uint64_t)x) >> 40), \ + BYTE_CAST(((uint64_t)x) >> 48), BYTE_CAST(((uint64_t)x) >> 56) + +// Declare a N-bit integer as a big-endian (Internet) sequence of bytes +#define BE16(x) BYTE_CAST(((uint16_t)x) >> 8), BYTE_CAST(((uint16_t)x) >> 0) + +#define BE32(x) \ + BYTE_CAST(((uint32_t)x) >> 24), BYTE_CAST(((uint32_t)x) >> 16), \ + BYTE_CAST(((uint32_t)x) >> 8), BYTE_CAST(((uint32_t)x) >> 0) + +#define BE64(x) \ + BYTE_CAST(((uint64_t)x) >> 56), BYTE_CAST(((uint64_t)x) >> 48), \ + BYTE_CAST(((uint64_t)x) >> 40), BYTE_CAST(((uint64_t)x) >> 32), \ + BYTE_CAST(((uint64_t)x) >> 24), BYTE_CAST(((uint64_t)x) >> 16), \ + BYTE_CAST(((uint64_t)x) >> 8), BYTE_CAST(((uint64_t)x) >> 0) + +// Declare a N-bit integer as a this-endian (local machine) sequence of bytes +#ifndef BIG_ENDIAN +#define BIG_ENDIAN 1 +#endif // BIG_ENDIAN + +#if BIG_ENDIAN +#define TE16 BE16 +#define TE32 BE32 +#define TE64 BE64 +#else // !BIG_ENDIAN +#define TE16 LE16 +#define TE32 LE32 +#define TE64 LE64 +#endif // !BIG_ENDIAN + +/////////////////////////////////////////////////////////////////////////////// + +// Helpers for determining if X/screencasting is available (on linux). + +#define MAYBE_SKIP_SCREENCAST_TEST() \ + if (!testing::IsScreencastingAvailable()) { \ + LOG(LS_WARNING) << "Skipping test, since it doesn't have the requisite " \ + << "X environment for screen capture."; \ + return; \ + } \ + +#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) +struct XDisplay { + XDisplay() : display_(XOpenDisplay(nullptr)) {} + ~XDisplay() { if (display_) XCloseDisplay(display_); } + bool IsValid() const { return display_ != nullptr; } + operator Display*() { return display_; } + private: + Display* display_; +}; +#endif + +// Returns true if screencasting is available. When false, anything that uses +// screencasting features may fail. +inline bool IsScreencastingAvailable() { +#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) + XDisplay display; + if (!display.IsValid()) { + LOG(LS_WARNING) << "No X Display available."; + return false; + } + int ignored_int, major_version, minor_version; + if (!XRRQueryExtension(display, &ignored_int, &ignored_int) || + !XRRQueryVersion(display, &major_version, &minor_version) || + major_version < 1 || + (major_version < 2 && minor_version < 3)) { + LOG(LS_WARNING) << "XRandr version: " << major_version << "." + << minor_version; + LOG(LS_WARNING) << "XRandr is not supported or is too old (pre 1.3)."; + return false; + } +#endif + return true; +} + +} // namespace testing +} // namespace webrtc + +#endif // WEBRTC_BASE_TESTUTILS_H__ diff --git a/webrtc/rtc_base/thread.cc b/webrtc/base/thread.cc similarity index 100% rename from webrtc/rtc_base/thread.cc rename to webrtc/base/thread.cc diff --git a/webrtc/base/thread.h b/webrtc/base/thread.h index 6a6887aa0c..6e5da61005 100644 --- a/webrtc/base/thread.h +++ b/webrtc/base/thread.h @@ -11,9 +11,322 @@ #ifndef WEBRTC_BASE_THREAD_H_ #define WEBRTC_BASE_THREAD_H_ +#include +#include +#include +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/thread.h" +#if defined(WEBRTC_POSIX) +#include +#endif +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/event.h" +#include "webrtc/base/messagequeue.h" +#include "webrtc/base/platform_thread_types.h" + +#if defined(WEBRTC_WIN) +#include "webrtc/base/win32.h" +#endif + +namespace rtc { + +class Thread; + +class ThreadManager { + public: + static const int kForever = -1; + + // Singleton, constructor and destructor are private. + static ThreadManager* Instance(); + + Thread* CurrentThread(); + void SetCurrentThread(Thread* thread); + + // Returns a thread object with its thread_ ivar set + // to whatever the OS uses to represent the thread. + // If there already *is* a Thread object corresponding to this thread, + // this method will return that. Otherwise it creates a new Thread + // object whose wrapped() method will return true, and whose + // handle will, on Win32, be opened with only synchronization privileges - + // if you need more privilegs, rather than changing this method, please + // write additional code to adjust the privileges, or call a different + // factory method of your own devising, because this one gets used in + // unexpected contexts (like inside browser plugins) and it would be a + // shame to break it. It is also conceivable on Win32 that we won't even + // be able to get synchronization privileges, in which case the result + // will have a null handle. + Thread *WrapCurrentThread(); + void UnwrapCurrentThread(); + + bool IsMainThread(); + + private: + ThreadManager(); + ~ThreadManager(); + +#if defined(WEBRTC_POSIX) + pthread_key_t key_; +#endif + +#if defined(WEBRTC_WIN) + DWORD key_; +#endif + + // The thread to potentially autowrap. + PlatformThreadRef main_thread_ref_; + + RTC_DISALLOW_COPY_AND_ASSIGN(ThreadManager); +}; + +struct _SendMessage { + _SendMessage() {} + Thread *thread; + Message msg; + bool *ready; +}; + +class Runnable { + public: + virtual ~Runnable() {} + virtual void Run(Thread* thread) = 0; + + protected: + Runnable() {} + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(Runnable); +}; + +// WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). + +class LOCKABLE Thread : public MessageQueue { + public: + // Create a new Thread and optionally assign it to the passed SocketServer. + Thread(); + explicit Thread(SocketServer* ss); + explicit Thread(std::unique_ptr ss); + + // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or + // guarantee Stop() is explicitly called before the subclass is destroyed). + // This is required to avoid a data race between the destructor modifying the + // vtable, and the Thread::PreRun calling the virtual method Run(). + ~Thread() override; + + static std::unique_ptr CreateWithSocketServer(); + static std::unique_ptr Create(); + static Thread* Current(); + + // Used to catch performance regressions. Use this to disallow blocking calls + // (Invoke) for a given scope. If a synchronous call is made while this is in + // effect, an assert will be triggered. + // Note that this is a single threaded class. + class ScopedDisallowBlockingCalls { + public: + ScopedDisallowBlockingCalls(); + ~ScopedDisallowBlockingCalls(); + private: + Thread* const thread_; + const bool previous_state_; + }; + + bool IsCurrent() const; + + // Sleeps the calling thread for the specified number of milliseconds, during + // which time no processing is performed. Returns false if sleeping was + // interrupted by a signal (POSIX only). + static bool SleepMs(int millis); + + // Sets the thread's name, for debugging. Must be called before Start(). + // If |obj| is non-null, its value is appended to |name|. + const std::string& name() const { return name_; } + bool SetName(const std::string& name, const void* obj); + + // Starts the execution of the thread. + bool Start(Runnable* runnable = nullptr); + + // Tells the thread to stop and waits until it is joined. + // Never call Stop on the current thread. Instead use the inherited Quit + // function which will exit the base MessageQueue without terminating the + // underlying OS thread. + virtual void Stop(); + + // By default, Thread::Run() calls ProcessMessages(kForever). To do other + // work, override Run(). To receive and dispatch messages, call + // ProcessMessages occasionally. + virtual void Run(); + + virtual void Send(const Location& posted_from, + MessageHandler* phandler, + uint32_t id = 0, + MessageData* pdata = nullptr); + + // Convenience method to invoke a functor on another thread. Caller must + // provide the |ReturnT| template argument, which cannot (easily) be deduced. + // Uses Send() internally, which blocks the current thread until execution + // is complete. + // Ex: bool result = thread.Invoke(RTC_FROM_HERE, + // &MyFunctionReturningBool); + // NOTE: This function can only be called when synchronous calls are allowed. + // See ScopedDisallowBlockingCalls for details. + template + ReturnT Invoke(const Location& posted_from, const FunctorT& functor) { + FunctorMessageHandler handler(functor); + InvokeInternal(posted_from, &handler); + return handler.MoveResult(); + } + + // From MessageQueue + void Clear(MessageHandler* phandler, + uint32_t id = MQID_ANY, + MessageList* removed = nullptr) override; + void ReceiveSends() override; + + // ProcessMessages will process I/O and dispatch messages until: + // 1) cms milliseconds have elapsed (returns true) + // 2) Stop() is called (returns false) + bool ProcessMessages(int cms); + + // Returns true if this is a thread that we created using the standard + // constructor, false if it was created by a call to + // ThreadManager::WrapCurrentThread(). The main thread of an application + // is generally not owned, since the OS representation of the thread + // obviously exists before we can get to it. + // You cannot call Start on non-owned threads. + bool IsOwned(); + +#if defined(WEBRTC_WIN) + HANDLE GetHandle() const { + return thread_; + } + DWORD GetId() const { + return thread_id_; + } +#elif defined(WEBRTC_POSIX) + pthread_t GetPThread() { + return thread_; + } +#endif + + // Expose private method running() for tests. + // + // DANGER: this is a terrible public API. Most callers that might want to + // call this likely do not have enough control/knowledge of the Thread in + // question to guarantee that the returned value remains true for the duration + // of whatever code is conditionally executing because of the return value! + bool RunningForTest() { return running(); } + + // Sets the per-thread allow-blocking-calls flag and returns the previous + // value. Must be called on this thread. + bool SetAllowBlockingCalls(bool allow); + + // These functions are public to avoid injecting test hooks. Don't call them + // outside of tests. + // This method should be called when thread is created using non standard + // method, like derived implementation of rtc::Thread and it can not be + // started by calling Start(). This will set started flag to true and + // owned to false. This must be called from the current thread. + bool WrapCurrent(); + void UnwrapCurrent(); + + protected: + // Same as WrapCurrent except that it never fails as it does not try to + // acquire the synchronization access of the thread. The caller should never + // call Stop() or Join() on this thread. + void SafeWrapCurrent(); + + // Blocks the calling thread until this thread has terminated. + void Join(); + + static void AssertBlockingIsAllowedOnCurrentThread(); + + friend class ScopedDisallowBlockingCalls; + + private: + struct ThreadInit { + Thread* thread; + Runnable* runnable; + }; + +#if defined(WEBRTC_WIN) + static DWORD WINAPI PreRun(LPVOID context); +#else + static void *PreRun(void *pv); +#endif + + // ThreadManager calls this instead WrapCurrent() because + // ThreadManager::Instance() cannot be used while ThreadManager is + // being created. + // The method tries to get synchronization rights of the thread on Windows if + // |need_synchronize_access| is true. + bool WrapCurrentWithThreadManager(ThreadManager* thread_manager, + bool need_synchronize_access); + + // Return true if the thread was started and hasn't yet stopped. + bool running() { return running_.Wait(0); } + + // Processes received "Send" requests. If |source| is not null, only requests + // from |source| are processed, otherwise, all requests are processed. + void ReceiveSendsFromThread(const Thread* source); + + // If |source| is not null, pops the first "Send" message from |source| in + // |sendlist_|, otherwise, pops the first "Send" message of |sendlist_|. + // The caller must lock |crit_| before calling. + // Returns true if there is such a message. + bool PopSendMessageFromThread(const Thread* source, _SendMessage* msg); + + void InvokeInternal(const Location& posted_from, MessageHandler* handler); + + std::list<_SendMessage> sendlist_; + std::string name_; + Event running_; // Signalled means running. + +#if defined(WEBRTC_POSIX) + pthread_t thread_; +#endif + +#if defined(WEBRTC_WIN) + HANDLE thread_; + DWORD thread_id_; +#endif + + bool owned_; + bool blocking_calls_allowed_; // By default set to |true|. + + friend class ThreadManager; + + RTC_DISALLOW_COPY_AND_ASSIGN(Thread); +}; + +// AutoThread automatically installs itself at construction +// uninstalls at destruction, if a Thread object is +// _not already_ associated with the current OS thread. + +class AutoThread : public Thread { + public: + AutoThread(); + ~AutoThread() override; + + private: + RTC_DISALLOW_COPY_AND_ASSIGN(AutoThread); +}; + +// AutoSocketServerThread automatically installs itself at +// construction and uninstalls at destruction. If a Thread object is +// already associated with the current OS thread, it is temporarily +// disassociated and restored by the destructor. + +class AutoSocketServerThread : public Thread { + public: + explicit AutoSocketServerThread(SocketServer* ss); + ~AutoSocketServerThread() override; + + private: + rtc::Thread* old_thread_; + + RTC_DISALLOW_COPY_AND_ASSIGN(AutoSocketServerThread); +}; + +} // namespace rtc #endif // WEBRTC_BASE_THREAD_H_ diff --git a/webrtc/base/thread_annotations.h b/webrtc/base/thread_annotations.h index 5b94ffed85..8d5abbdc0c 100644 --- a/webrtc/base/thread_annotations.h +++ b/webrtc/base/thread_annotations.h @@ -19,9 +19,82 @@ #ifndef WEBRTC_BASE_THREAD_ANNOTATIONS_H_ #define WEBRTC_BASE_THREAD_ANNOTATIONS_H_ +#if defined(__clang__) && (!defined(SWIG)) +#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x)) +#else +#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op +#endif -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/thread_annotations.h" +// Document if a shared variable/field needs to be protected by a lock. +// GUARDED_BY allows the user to specify a particular lock that should be +// held when accessing the annotated variable, while GUARDED_VAR only +// indicates a shared variable should be guarded (by any lock). GUARDED_VAR +// is primarily used when the client cannot express the name of the lock. +#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) +#define GUARDED_VAR THREAD_ANNOTATION_ATTRIBUTE__(guarded_var) + +// Document if the memory location pointed to by a pointer should be guarded +// by a lock when dereferencing the pointer. Similar to GUARDED_VAR, +// PT_GUARDED_VAR is primarily used when the client cannot express the name +// of the lock. Note that a pointer variable to a shared memory location +// could itself be a shared variable. For example, if a shared global pointer +// q, which is guarded by mu1, points to a shared memory location that is +// guarded by mu2, q should be annotated as follows: +// int *q GUARDED_BY(mu1) PT_GUARDED_BY(mu2); +#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x)) +#define PT_GUARDED_VAR THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_var) + +// Document the acquisition order between locks that can be held +// simultaneously by a thread. For any two locks that need to be annotated +// to establish an acquisition order, only one of them needs the annotation. +// (i.e. You don't have to annotate both locks with both ACQUIRED_AFTER +// and ACQUIRED_BEFORE.) +#define ACQUIRED_AFTER(x) THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(x)) +#define ACQUIRED_BEFORE(x) THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(x)) + +// The following three annotations document the lock requirements for +// functions/methods. + +// Document if a function expects certain locks to be held before it is called +#define EXCLUSIVE_LOCKS_REQUIRED(...) \ + THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__)) + +#define SHARED_LOCKS_REQUIRED(...) \ + THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__)) + +// Document the locks acquired in the body of the function. These locks +// cannot be held when calling this function (as google3's Mutex locks are +// non-reentrant). +#define LOCKS_EXCLUDED(...) \ + THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__)) + +// Document the lock the annotated function returns without acquiring it. +#define LOCK_RETURNED(x) THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x)) + +// Document if a class/type is a lockable type (such as the Mutex class). +#define LOCKABLE THREAD_ANNOTATION_ATTRIBUTE__(lockable) + +// Document if a class is a scoped lockable type (such as the MutexLock class). +#define SCOPED_LOCKABLE THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable) + +// The following annotations specify lock and unlock primitives. +#define EXCLUSIVE_LOCK_FUNCTION(...) \ + THREAD_ANNOTATION_ATTRIBUTE__(exclusive_lock_function(__VA_ARGS__)) + +#define SHARED_LOCK_FUNCTION(...) \ + THREAD_ANNOTATION_ATTRIBUTE__(shared_lock_function(__VA_ARGS__)) + +#define EXCLUSIVE_TRYLOCK_FUNCTION(...) \ + THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__)) + +#define SHARED_TRYLOCK_FUNCTION(...) \ + THREAD_ANNOTATION_ATTRIBUTE__(shared_trylock_function(__VA_ARGS__)) + +#define UNLOCK_FUNCTION(...) \ + THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__)) + +// An escape hatch for thread safety analysis to ignore the annotated function. +#define NO_THREAD_SAFETY_ANALYSIS \ + THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis) #endif // WEBRTC_BASE_THREAD_ANNOTATIONS_H_ diff --git a/webrtc/rtc_base/thread_annotations_unittest.cc b/webrtc/base/thread_annotations_unittest.cc similarity index 100% rename from webrtc/rtc_base/thread_annotations_unittest.cc rename to webrtc/base/thread_annotations_unittest.cc diff --git a/webrtc/base/thread_checker.h b/webrtc/base/thread_checker.h index ade52564ec..5914282a57 100644 --- a/webrtc/base/thread_checker.h +++ b/webrtc/base/thread_checker.h @@ -13,9 +13,166 @@ #ifndef WEBRTC_BASE_THREAD_CHECKER_H_ #define WEBRTC_BASE_THREAD_CHECKER_H_ +// Apart from debug builds, we also enable the thread checker in +// builds with RTC_DCHECK_IS_ON so that trybots and waterfall bots +// with this define will get the same level of thread checking as +// debug bots. +#define ENABLE_THREAD_CHECKER RTC_DCHECK_IS_ON -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/thread_checker.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/thread_annotations.h" +#include "webrtc/base/thread_checker_impl.h" + +namespace rtc { + +// Do nothing implementation, for use in release mode. +// +// Note: You should almost always use the ThreadChecker class to get the +// right version for your build configuration. +class ThreadCheckerDoNothing { + public: + bool CalledOnValidThread() const { + return true; + } + + void DetachFromThread() {} +}; + +// ThreadChecker is a helper class used to help verify that some methods of a +// class are called from the same thread. It provides identical functionality to +// base::NonThreadSafe, but it is meant to be held as a member variable, rather +// than inherited from base::NonThreadSafe. +// +// While inheriting from base::NonThreadSafe may give a clear indication about +// the thread-safety of a class, it may also lead to violations of the style +// guide with regard to multiple inheritance. The choice between having a +// ThreadChecker member and inheriting from base::NonThreadSafe should be based +// on whether: +// - Derived classes need to know the thread they belong to, as opposed to +// having that functionality fully encapsulated in the base class. +// - Derived classes should be able to reassign the base class to another +// thread, via DetachFromThread. +// +// If neither of these are true, then having a ThreadChecker member and calling +// CalledOnValidThread is the preferable solution. +// +// Example: +// class MyClass { +// public: +// void Foo() { +// RTC_DCHECK(thread_checker_.CalledOnValidThread()); +// ... (do stuff) ... +// } +// +// private: +// ThreadChecker thread_checker_; +// } +// +// In Release mode, CalledOnValidThread will always return true. +#if ENABLE_THREAD_CHECKER +class LOCKABLE ThreadChecker : public ThreadCheckerImpl { +}; +#else +class LOCKABLE ThreadChecker : public ThreadCheckerDoNothing { +}; +#endif // ENABLE_THREAD_CHECKER + +#undef ENABLE_THREAD_CHECKER + +namespace internal { +class SCOPED_LOCKABLE AnnounceOnThread { + public: + template + explicit AnnounceOnThread(const ThreadLikeObject* thread_like_object) + EXCLUSIVE_LOCK_FUNCTION(thread_like_object) {} + ~AnnounceOnThread() UNLOCK_FUNCTION() {} + + template + static bool IsCurrent(const ThreadLikeObject* thread_like_object) { + return thread_like_object->IsCurrent(); + } + static bool IsCurrent(const rtc::ThreadChecker* checker) { + return checker->CalledOnValidThread(); + } + + private: + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AnnounceOnThread); +}; + +} // namespace internal +} // namespace rtc + +// RUN_ON/ACCESS_ON/RTC_DCHECK_RUN_ON macros allows to annotate variables are +// accessed from same thread/task queue. +// Using tools designed to check mutexes, it checks at compile time everywhere +// variable is access, there is a run-time dcheck thread/task queue is correct. +// +// class ExampleThread { +// public: +// void NeedVar1() { +// RTC_DCHECK_RUN_ON(network_thread_); +// transport_->Send(); +// } +// +// private: +// rtc::Thread* network_thread_; +// int transport_ ACCESS_ON(network_thread_); +// }; +// +// class ExampleThreadChecker { +// public: +// int CalledFromPacer() RUN_ON(pacer_thread_checker_) { +// return var2_; +// } +// +// void CallMeFromPacer() { +// RTC_DCHECK_RUN_ON(&pacer_thread_checker_) +// << "Should be called from pacer"; +// CalledFromPacer(); +// } +// +// private: +// int pacer_var_ ACCESS_ON(pacer_thread_checker_); +// rtc::ThreadChecker pacer_thread_checker_; +// }; +// +// class TaskQueueExample { +// public: +// class Encoder { +// public: +// rtc::TaskQueue* Queue() { return encoder_queue_; } +// void Encode() { +// RTC_DCHECK_RUN_ON(encoder_queue_); +// DoSomething(var_); +// } +// +// private: +// rtc::TaskQueue* const encoder_queue_; +// Frame var_ ACCESS_ON(encoder_queue_); +// }; +// +// void Encode() { +// // Will fail at runtime when DCHECK is enabled: +// // encoder_->Encode(); +// // Will work: +// rtc::scoped_ref_ptr encoder = encoder_; +// encoder_->Queue()->PostTask([encoder] { encoder->Encode(); }); +// } +// +// private: +// rtc::scoped_ref_ptr encoder_; +// } + +// Document if a variable/field is not shared and should be accessed from +// same thread/task queue. +#define ACCESS_ON(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) + +// Document if a function expected to be called from same thread/task queue. +#define RUN_ON(x) THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(x)) + +#define RTC_DCHECK_RUN_ON(thread_like_object) \ + rtc::internal::AnnounceOnThread thread_announcer(thread_like_object); \ + RTC_DCHECK(rtc::internal::AnnounceOnThread::IsCurrent(thread_like_object)) #endif // WEBRTC_BASE_THREAD_CHECKER_H_ diff --git a/webrtc/rtc_base/thread_checker_impl.cc b/webrtc/base/thread_checker_impl.cc similarity index 100% rename from webrtc/rtc_base/thread_checker_impl.cc rename to webrtc/base/thread_checker_impl.cc diff --git a/webrtc/base/thread_checker_impl.h b/webrtc/base/thread_checker_impl.h index 3a0a6c7315..b9867c3e7d 100644 --- a/webrtc/base/thread_checker_impl.h +++ b/webrtc/base/thread_checker_impl.h @@ -13,9 +13,36 @@ #ifndef WEBRTC_BASE_THREAD_CHECKER_IMPL_H_ #define WEBRTC_BASE_THREAD_CHECKER_IMPL_H_ +#include "webrtc/base/criticalsection.h" +#include "webrtc/base/platform_thread_types.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/thread_checker_impl.h" +namespace rtc { + +// Real implementation of ThreadChecker, for use in debug mode, or +// for temporary use in release mode (e.g. to RTC_CHECK on a threading issue +// seen only in the wild). +// +// Note: You should almost always use the ThreadChecker class to get the +// right version for your build configuration. +class ThreadCheckerImpl { + public: + ThreadCheckerImpl(); + ~ThreadCheckerImpl(); + + bool CalledOnValidThread() const; + + // Changes the thread that is checked for in CalledOnValidThread. This may + // be useful when an object may be created on one thread and then used + // exclusively on another thread. + void DetachFromThread(); + + private: + CriticalSection lock_; + // This is mutable so that CalledOnValidThread can set it. + // It's guarded by |lock_|. + mutable PlatformThreadRef valid_thread_; +}; + +} // namespace rtc #endif // WEBRTC_BASE_THREAD_CHECKER_IMPL_H_ diff --git a/webrtc/rtc_base/thread_checker_unittest.cc b/webrtc/base/thread_checker_unittest.cc similarity index 100% rename from webrtc/rtc_base/thread_checker_unittest.cc rename to webrtc/base/thread_checker_unittest.cc diff --git a/webrtc/rtc_base/thread_darwin.mm b/webrtc/base/thread_darwin.mm similarity index 100% rename from webrtc/rtc_base/thread_darwin.mm rename to webrtc/base/thread_darwin.mm diff --git a/webrtc/rtc_base/thread_unittest.cc b/webrtc/base/thread_unittest.cc similarity index 100% rename from webrtc/rtc_base/thread_unittest.cc rename to webrtc/base/thread_unittest.cc diff --git a/webrtc/base/timedelta.h b/webrtc/base/timedelta.h index f2e98a8cc2..71c7f9fc65 100644 --- a/webrtc/base/timedelta.h +++ b/webrtc/base/timedelta.h @@ -11,9 +11,119 @@ #ifndef WEBRTC_BASE_TIMEDELTA_H_ #define WEBRTC_BASE_TIMEDELTA_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/timedelta.h" +#include "webrtc/base/timeutils.h" + +// Convenience class to convert between different units of relative time. +// Stores time to precision of nanoseconds, as int64_t internally. +// Doesn't check for overflow/underflow. +// +// Based on TimeDelta in: +// https://code.google.com/p/chromium/codesearch#chromium/src/base/time/time.h +namespace rtc { + +class TimeDelta { + public: + TimeDelta() : delta_(0) {} + + // Converts units of time to TimeDeltas. + static constexpr TimeDelta FromSeconds(int64_t secs) { + return TimeDelta(secs * kNumNanosecsPerSec); + } + static constexpr TimeDelta FromMilliseconds(int64_t ms) { + return TimeDelta(ms * kNumNanosecsPerMillisec); + } + static constexpr TimeDelta FromMicroseconds(int64_t us) { + return TimeDelta(us * kNumNanosecsPerMicrosec); + } + static constexpr TimeDelta FromNanoseconds(int64_t ns) { + return TimeDelta(ns); + } + + // Returns true if the time delta is zero. + bool is_zero() const { return delta_ == 0; } + + // Converts TimeDelta to units of time. + int64_t ToSeconds() const { return delta_ / kNumNanosecsPerSec; } + int64_t ToMilliseconds() const { return delta_ / kNumNanosecsPerMillisec; } + int64_t ToMicroseconds() const { return delta_ / kNumNanosecsPerMicrosec; } + int64_t ToNanoseconds() const { return delta_; } + + TimeDelta& operator=(TimeDelta other) { + delta_ = other.delta_; + return *this; + } + + // Computations with other deltas. + TimeDelta operator+(TimeDelta other) const { + return TimeDelta(delta_ + other.delta_); + } + TimeDelta operator-(TimeDelta other) const { + return TimeDelta(delta_ + other.delta_); + } + + TimeDelta& operator+=(TimeDelta other) { return *this = (*this + other); } + TimeDelta& operator-=(TimeDelta other) { return *this = (*this - other); } + TimeDelta operator-() const { return TimeDelta(-delta_); } + + // Computations with numeric types. + template + TimeDelta operator*(T a) const { + return TimeDelta(delta_ * a); + } + template + TimeDelta operator/(T a) const { + return TimeDelta(delta_ / a); + } + template + TimeDelta& operator*=(T a) { + return *this = (*this * a); + } + template + TimeDelta& operator/=(T a) { + return *this = (*this / a); + } + + TimeDelta operator%(TimeDelta a) const { + return TimeDelta(delta_ % a.delta_); + } + + // Comparison operators. + constexpr bool operator==(TimeDelta other) const { + return delta_ == other.delta_; + } + constexpr bool operator!=(TimeDelta other) const { + return delta_ != other.delta_; + } + constexpr bool operator<(TimeDelta other) const { + return delta_ < other.delta_; + } + constexpr bool operator<=(TimeDelta other) const { + return delta_ <= other.delta_; + } + constexpr bool operator>(TimeDelta other) const { + return delta_ > other.delta_; + } + constexpr bool operator>=(TimeDelta other) const { + return delta_ >= other.delta_; + } + + private: + // Constructs a delta given the duration in nanoseconds. This is private + // to avoid confusion by callers with an integer constructor. Use + // FromSeconds, FromMilliseconds, etc. instead. + constexpr explicit TimeDelta(int64_t delta_ns) : delta_(delta_ns) {} + + // Delta in nanoseconds. + int64_t delta_; +}; + +template +inline TimeDelta operator*(T a, TimeDelta td) { + return td * a; +} + +} // namespace rtc #endif // WEBRTC_BASE_TIMEDELTA_H_ diff --git a/webrtc/rtc_base/timestampaligner.cc b/webrtc/base/timestampaligner.cc similarity index 100% rename from webrtc/rtc_base/timestampaligner.cc rename to webrtc/base/timestampaligner.cc diff --git a/webrtc/base/timestampaligner.h b/webrtc/base/timestampaligner.h index 60c36311df..9c2cc7af59 100644 --- a/webrtc/base/timestampaligner.h +++ b/webrtc/base/timestampaligner.h @@ -11,9 +11,64 @@ #ifndef WEBRTC_BASE_TIMESTAMPALIGNER_H_ #define WEBRTC_BASE_TIMESTAMPALIGNER_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/timestampaligner.h" +#include "webrtc/base/constructormagic.h" + +namespace rtc { + +// The TimestampAligner class helps translating camera timestamps into +// the same timescale as is used by rtc::TimeMicros(). Some cameras +// have built in timestamping which is more accurate than reading the +// system clock, but using a different epoch and unknown clock drift. +// Frame timestamps in webrtc should use rtc::TimeMicros (system monotonic +// time), and this class provides a filter which lets us use the +// rtc::TimeMicros timescale, and at the same time take advantage of +// higher accuracy of the camera clock. + +// This class is not thread safe, so all calls to it must be synchronized +// externally. +class TimestampAligner { + public: + TimestampAligner(); + ~TimestampAligner(); + + public: + // Translates camera timestamps to the same timescale as is used by + // rtc::TimeMicros(). |camera_time_us| is assumed to be accurate, but + // with an unknown epoch and clock drift. |system_time_us| is + // time according to rtc::TimeMicros(), preferably read as soon as + // possible when the frame is captured. It may have poor accuracy + // due to poor resolution or scheduling delays. Returns the + // translated timestamp. + int64_t TranslateTimestamp(int64_t camera_time_us, int64_t system_time_us); + + protected: + // Update the estimated offset between camera time and system monotonic time. + int64_t UpdateOffset(int64_t camera_time_us, int64_t system_time_us); + + // Clip timestamp, return value is always + // <= |system_time_us|, and + // >= min(|prev_translated_time_us_| + |kMinFrameIntervalUs|, + // |system_time_us|). + int64_t ClipTimestamp(int64_t filtered_time_us, int64_t system_time_us); + + private: + // State for the timestamp translation. + int frames_seen_; + // Estimated offset between camera time and system monotonic time. + int64_t offset_us_; + + // State for the ClipTimestamp method, applied after the filter. + // A large negative camera clock drift tends to push translated + // timestamps into the future. |clip_bias_us_| is subtracted from the + // translated timestamps, to get them back from the future. + int64_t clip_bias_us_; + // Used to ensure that translated timestamps are monotonous. + int64_t prev_translated_time_us_; + RTC_DISALLOW_COPY_AND_ASSIGN(TimestampAligner); +}; + +} // namespace rtc #endif // WEBRTC_BASE_TIMESTAMPALIGNER_H_ diff --git a/webrtc/rtc_base/timestampaligner_unittest.cc b/webrtc/base/timestampaligner_unittest.cc similarity index 100% rename from webrtc/rtc_base/timestampaligner_unittest.cc rename to webrtc/base/timestampaligner_unittest.cc diff --git a/webrtc/rtc_base/timeutils.cc b/webrtc/base/timeutils.cc similarity index 100% rename from webrtc/rtc_base/timeutils.cc rename to webrtc/base/timeutils.cc diff --git a/webrtc/base/timeutils.h b/webrtc/base/timeutils.h index 1569b58f48..735af4a9f4 100644 --- a/webrtc/base/timeutils.h +++ b/webrtc/base/timeutils.h @@ -11,9 +11,119 @@ #ifndef WEBRTC_BASE_TIMEUTILS_H_ #define WEBRTC_BASE_TIMEUTILS_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/timeutils.h" +#include + +namespace rtc { + +static const int64_t kNumMillisecsPerSec = INT64_C(1000); +static const int64_t kNumMicrosecsPerSec = INT64_C(1000000); +static const int64_t kNumNanosecsPerSec = INT64_C(1000000000); + +static const int64_t kNumMicrosecsPerMillisec = + kNumMicrosecsPerSec / kNumMillisecsPerSec; +static const int64_t kNumNanosecsPerMillisec = + kNumNanosecsPerSec / kNumMillisecsPerSec; +static const int64_t kNumNanosecsPerMicrosec = + kNumNanosecsPerSec / kNumMicrosecsPerSec; + +// TODO(honghaiz): Define a type for the time value specifically. + +class ClockInterface { + public: + virtual ~ClockInterface() {} + virtual int64_t TimeNanos() const = 0; +}; + +// Sets the global source of time. This is useful mainly for unit tests. +// +// Returns the previously set ClockInterface, or nullptr if none is set. +// +// Does not transfer ownership of the clock. SetClockForTesting(nullptr) +// should be called before the ClockInterface is deleted. +// +// This method is not thread-safe; it should only be used when no other thread +// is running (for example, at the start/end of a unit test, or start/end of +// main()). +// +// TODO(deadbeef): Instead of having functions that access this global +// ClockInterface, we may want to pass the ClockInterface into everything +// that uses it, eliminating the need for a global variable and this function. +ClockInterface* SetClockForTesting(ClockInterface* clock); + +// Returns previously set clock, or nullptr if no custom clock is being used. +ClockInterface* GetClockForTesting(); + +// Returns the actual system time, even if a clock is set for testing. +// Useful for timeouts while using a test clock, or for logging. +int64_t SystemTimeNanos(); +int64_t SystemTimeMillis(); + +// Returns the current time in milliseconds in 32 bits. +uint32_t Time32(); + +// Returns the current time in milliseconds in 64 bits. +int64_t TimeMillis(); +// Deprecated. Do not use this in any new code. +inline int64_t Time() { + return TimeMillis(); +} + +// Returns the current time in microseconds. +int64_t TimeMicros(); + +// Returns the current time in nanoseconds. +int64_t TimeNanos(); + + +// Returns a future timestamp, 'elapsed' milliseconds from now. +int64_t TimeAfter(int64_t elapsed); + +// Number of milliseconds that would elapse between 'earlier' and 'later' +// timestamps. The value is negative if 'later' occurs before 'earlier'. +int64_t TimeDiff(int64_t later, int64_t earlier); +int32_t TimeDiff32(uint32_t later, uint32_t earlier); + +// The number of milliseconds that have elapsed since 'earlier'. +inline int64_t TimeSince(int64_t earlier) { + return TimeMillis() - earlier; +} + +// The number of milliseconds that will elapse between now and 'later'. +inline int64_t TimeUntil(int64_t later) { + return later - TimeMillis(); +} + +class TimestampWrapAroundHandler { + public: + TimestampWrapAroundHandler(); + + int64_t Unwrap(uint32_t ts); + + private: + uint32_t last_ts_; + int64_t num_wrap_; +}; + +// Convert from std::tm, which is relative to 1900-01-01 00:00 to number of +// seconds from 1970-01-01 00:00 ("epoch"). Don't return time_t since that +// is still 32 bits on many systems. +int64_t TmToSeconds(const std::tm& tm); + +// Return the number of microseconds since January 1, 1970, UTC. +// Useful mainly when producing logs to be correlated with other +// devices, and when the devices in question all have properly +// synchronized clocks. +// +// Note that this function obeys the system's idea about what the time +// is. It is not guaranteed to be monotonic; it will jump in case the +// system time is changed, e.g., by some other process calling +// settimeofday. Always use rtc::TimeMicros(), not this function, for +// measuring time intervals and timeouts. +int64_t TimeUTCMicros(); + +} // namespace rtc #endif // WEBRTC_BASE_TIMEUTILS_H_ diff --git a/webrtc/rtc_base/timeutils_unittest.cc b/webrtc/base/timeutils_unittest.cc similarity index 100% rename from webrtc/rtc_base/timeutils_unittest.cc rename to webrtc/base/timeutils_unittest.cc diff --git a/webrtc/base/trace_event.h b/webrtc/base/trace_event.h index 1bea5f4db8..3e9937466c 100644 --- a/webrtc/base/trace_event.h +++ b/webrtc/base/trace_event.h @@ -6,9 +6,905 @@ #ifndef WEBRTC_BASE_TRACE_EVENT_H_ #define WEBRTC_BASE_TRACE_EVENT_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/trace_event.h" +#include "webrtc/base/event_tracer.h" + +#if defined(TRACE_EVENT0) +#error "Another copy of trace_event.h has already been included." +#endif + +// Extracted from Chromium's src/base/debug/trace_event.h. + +// This header is designed to give you trace_event macros without specifying +// how the events actually get collected and stored. If you need to expose trace +// event to some other universe, you can copy-and-paste this file, +// implement the TRACE_EVENT_API macros, and do any other necessary fixup for +// the target platform. The end result is that multiple libraries can funnel +// events through to a shared trace event collector. + +// Trace events are for tracking application performance and resource usage. +// Macros are provided to track: +// Begin and end of function calls +// Counters +// +// Events are issued against categories. Whereas LOG's +// categories are statically defined, TRACE categories are created +// implicitly with a string. For example: +// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent") +// +// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope: +// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly") +// doSomethingCostly() +// TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly") +// Note: our tools can't always determine the correct BEGIN/END pairs unless +// these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you +// need them to be in separate scopes. +// +// A common use case is to trace entire function scopes. This +// issues a trace BEGIN and END automatically: +// void doSomethingCostly() { +// TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly"); +// ... +// } +// +// Additional parameters can be associated with an event: +// void doSomethingCostly2(int howMuch) { +// TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly", +// "howMuch", howMuch); +// ... +// } +// +// The trace system will automatically add to this information the +// current process id, thread id, and a timestamp in microseconds. +// +// To trace an asynchronous procedure such as an IPC send/receive, use +// ASYNC_BEGIN and ASYNC_END: +// [single threaded sender code] +// static int send_count = 0; +// ++send_count; +// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count); +// Send(new MyMessage(send_count)); +// [receive code] +// void OnMyMessage(send_count) { +// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count); +// } +// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs. +// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process. +// Pointers can be used for the ID parameter, and they will be mangled +// internally so that the same pointer on two different processes will not +// match. For example: +// class MyTracedClass { +// public: +// MyTracedClass() { +// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this); +// } +// ~MyTracedClass() { +// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this); +// } +// } +// +// Trace event also supports counters, which is a way to track a quantity +// as it varies over time. Counters are created with the following macro: +// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue); +// +// Counters are process-specific. The macro itself can be issued from any +// thread, however. +// +// Sometimes, you want to track two counters at once. You can do this with two +// counter macros: +// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]); +// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]); +// Or you can do it with a combined macro: +// TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter", +// "bytesPinned", g_myCounterValue[0], +// "bytesAllocated", g_myCounterValue[1]); +// This indicates to the tracing UI that these counters should be displayed +// in a single graph, as a summed area chart. +// +// Since counters are in a global namespace, you may want to disembiguate with a +// unique ID, by using the TRACE_COUNTER_ID* variations. +// +// By default, trace collection is compiled in, but turned off at runtime. +// Collecting trace data is the responsibility of the embedding +// application. In Chrome's case, navigating to about:tracing will turn on +// tracing and display data collected across all active processes. +// +// +// Memory scoping note: +// Tracing copies the pointers, not the string content, of the strings passed +// in for category, name, and arg_names. Thus, the following code will +// cause problems: +// char* str = strdup("impprtantName"); +// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD! +// free(str); // Trace system now has dangling pointer +// +// To avoid this issue with the |name| and |arg_name| parameters, use the +// TRACE_EVENT_COPY_XXX overloads of the macros at additional runtime overhead. +// Notes: The category must always be in a long-lived char* (i.e. static const). +// The |arg_values|, when used, are always deep copied with the _COPY +// macros. +// +// When are string argument values copied: +// const char* arg_values are only referenced by default: +// TRACE_EVENT1("category", "name", +// "arg1", "literal string is only referenced"); +// Use TRACE_STR_COPY to force copying of a const char*: +// TRACE_EVENT1("category", "name", +// "arg1", TRACE_STR_COPY("string will be copied")); +// std::string arg_values are always copied: +// TRACE_EVENT1("category", "name", +// "arg1", std::string("string will be copied")); +// +// +// Thread Safety: +// Thread safety is provided by methods defined in event_tracer.h. See the file +// for details. + + +// By default, const char* argument values are assumed to have long-lived scope +// and will not be copied. Use this macro to force a const char* to be copied. +#define TRACE_STR_COPY(str) \ + webrtc::trace_event_internal::TraceStringWithCopy(str) + +// This will mark the trace event as disabled by default. The user will need +// to explicitly enable the event. +#define TRACE_DISABLED_BY_DEFAULT(name) "disabled-by-default-" name + +// By default, uint64 ID argument values are not mangled with the Process ID in +// TRACE_EVENT_ASYNC macros. Use this macro to force Process ID mangling. +#define TRACE_ID_MANGLE(id) \ + webrtc::trace_event_internal::TraceID::ForceMangle(id) + +// Records a pair of begin and end events called "name" for the current +// scope, with 0, 1 or 2 associated arguments. If the category is not +// enabled, then this does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT0(category, name) \ + INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name) +#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, arg1_name, arg1_val) +#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) + +// Same as TRACE_EVENT except that they are not included in official builds. +#ifdef OFFICIAL_BUILD +#define UNSHIPPED_TRACE_EVENT0(category, name) (void)0 +#define UNSHIPPED_TRACE_EVENT1(category, name, arg1_name, arg1_val) (void)0 +#define UNSHIPPED_TRACE_EVENT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) (void)0 +#define UNSHIPPED_TRACE_EVENT_INSTANT0(category, name) (void)0 +#define UNSHIPPED_TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ + (void)0 +#define UNSHIPPED_TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) (void)0 +#else +#define UNSHIPPED_TRACE_EVENT0(category, name) \ + TRACE_EVENT0(category, name) +#define UNSHIPPED_TRACE_EVENT1(category, name, arg1_name, arg1_val) \ + TRACE_EVENT1(category, name, arg1_name, arg1_val) +#define UNSHIPPED_TRACE_EVENT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) +#define UNSHIPPED_TRACE_EVENT_INSTANT0(category, name) \ + TRACE_EVENT_INSTANT0(category, name) +#define UNSHIPPED_TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ + TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) +#define UNSHIPPED_TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) +#endif + +// Records a single event called "name" immediately, with 0, 1 or 2 +// associated arguments. If the category is not enabled, then this +// does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT_INSTANT0(category, name) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category, name, TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) +#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ + arg2_name, arg2_val) +#define TRACE_EVENT_COPY_INSTANT0(category, name) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category, name, TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_INSTANT1(category, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) +#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ + arg2_name, arg2_val) + +// Records a single BEGIN event called "name" immediately, with 0, 1 or 2 +// associated arguments. If the category is not enabled, then this +// does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT_BEGIN0(category, name) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category, name, TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) +#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ + arg2_name, arg2_val) +#define TRACE_EVENT_COPY_BEGIN0(category, name) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category, name, TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) +#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ + arg2_name, arg2_val) + +// Records a single END event for "name" immediately. If the category +// is not enabled, then this does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT_END0(category, name) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category, name, TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) +#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ + arg2_name, arg2_val) +#define TRACE_EVENT_COPY_END0(category, name) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category, name, TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) +#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ + arg2_name, arg2_val) + +// Records the value of a counter called "name" immediately. Value +// must be representable as a 32 bit integer. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_COUNTER1(category, name, value) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ + category, name, TRACE_EVENT_FLAG_NONE, \ + "value", static_cast(value)) +#define TRACE_COPY_COUNTER1(category, name, value) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ + category, name, TRACE_EVENT_FLAG_COPY, \ + "value", static_cast(value)) + +// Records the values of a multi-parted counter called "name" immediately. +// The UI will treat value1 and value2 as parts of a whole, displaying their +// values as a stacked-bar chart. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_COUNTER2(category, name, value1_name, value1_val, \ + value2_name, value2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ + category, name, TRACE_EVENT_FLAG_NONE, \ + value1_name, static_cast(value1_val), \ + value2_name, static_cast(value2_val)) +#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \ + value2_name, value2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ + category, name, TRACE_EVENT_FLAG_COPY, \ + value1_name, static_cast(value1_val), \ + value2_name, static_cast(value2_val)) + +// Records the value of a counter called "name" immediately. Value +// must be representable as a 32 bit integer. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +// - |id| is used to disambiguate counters with the same name. It must either +// be a pointer or an integer value up to 64 bits. If it's a pointer, the bits +// will be xored with a hash of the process ID so that the same pointer on +// two different processes will not collide. +#define TRACE_COUNTER_ID1(category, name, id, value) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ + category, name, id, TRACE_EVENT_FLAG_NONE, \ + "value", static_cast(value)) +#define TRACE_COPY_COUNTER_ID1(category, name, id, value) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ + category, name, id, TRACE_EVENT_FLAG_COPY, \ + "value", static_cast(value)) + +// Records the values of a multi-parted counter called "name" immediately. +// The UI will treat value1 and value2 as parts of a whole, displaying their +// values as a stacked-bar chart. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +// - |id| is used to disambiguate counters with the same name. It must either +// be a pointer or an integer value up to 64 bits. If it's a pointer, the bits +// will be xored with a hash of the process ID so that the same pointer on +// two different processes will not collide. +#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \ + value2_name, value2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ + category, name, id, TRACE_EVENT_FLAG_NONE, \ + value1_name, static_cast(value1_val), \ + value2_name, static_cast(value2_val)) +#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, value1_val, \ + value2_name, value2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ + category, name, id, TRACE_EVENT_FLAG_COPY, \ + value1_name, static_cast(value1_val), \ + value2_name, static_cast(value2_val)) + + +// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2 +// associated arguments. If the category is not enabled, then this +// does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event. ASYNC +// events are considered to match if their category, name and id values all +// match. |id| must either be a pointer or an integer value up to 64 bits. If +// it's a pointer, the bits will be xored with a hash of the process ID so +// that the same pointer on two different processes will not collide. +// An asynchronous operation can consist of multiple phases. The first phase is +// defined by the ASYNC_BEGIN calls. Additional phases can be defined using the +// ASYNC_STEP macros. When the operation completes, call ASYNC_END. +// An ASYNC trace typically occur on a single thread (if not, they will only be +// drawn on the thread defined in the ASYNC_BEGIN event), but all events in that +// operation must use the same |name| and |id|. Each event can have its own +// args. +#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) +#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_NONE, \ + arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_COPY, \ + arg1_name, arg1_val) +#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_COPY, \ + arg1_name, arg1_val, arg2_name, arg2_val) + +// Records a single ASYNC_STEP event for |step| immediately. If the category +// is not enabled, then this does nothing. The |name| and |id| must match the +// ASYNC_BEGIN event above. The |step| param identifies this step within the +// async event. This should be called at the beginning of the next phase of an +// asynchronous operation. +#define TRACE_EVENT_ASYNC_STEP0(category, name, id, step) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ + category, name, id, TRACE_EVENT_FLAG_NONE, "step", step) +#define TRACE_EVENT_ASYNC_STEP1(category, name, id, step, \ + arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ + category, name, id, TRACE_EVENT_FLAG_NONE, "step", step, \ + arg1_name, arg1_val) +#define TRACE_EVENT_COPY_ASYNC_STEP0(category, name, id, step) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ + category, name, id, TRACE_EVENT_FLAG_COPY, "step", step) +#define TRACE_EVENT_COPY_ASYNC_STEP1(category, name, id, step, \ + arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ + category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, \ + arg1_name, arg1_val) + +// Records a single ASYNC_END event for "name" immediately. If the category +// is not enabled, then this does nothing. +#define TRACE_EVENT_ASYNC_END0(category, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category, name, id, TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) +#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category, name, id, TRACE_EVENT_FLAG_NONE, \ + arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category, name, id, TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category, name, id, TRACE_EVENT_FLAG_COPY, \ + arg1_name, arg1_val) +#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category, name, id, TRACE_EVENT_FLAG_COPY, \ + arg1_name, arg1_val, arg2_name, arg2_val) + + +// Records a single FLOW_BEGIN event called "name" immediately, with 0, 1 or 2 +// associated arguments. If the category is not enabled, then this +// does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +// - |id| is used to match the FLOW_BEGIN event with the FLOW_END event. FLOW +// events are considered to match if their category, name and id values all +// match. |id| must either be a pointer or an integer value up to 64 bits. If +// it's a pointer, the bits will be xored with a hash of the process ID so +// that the same pointer on two different processes will not collide. +// FLOW events are different from ASYNC events in how they are drawn by the +// tracing UI. A FLOW defines asynchronous data flow, such as posting a task +// (FLOW_BEGIN) and later executing that task (FLOW_END). Expect FLOWs to be +// drawn as lines or arrows from FLOW_BEGIN scopes to FLOW_END scopes. Similar +// to ASYNC, a FLOW can consist of multiple phases. The first phase is defined +// by the FLOW_BEGIN calls. Additional phases can be defined using the FLOW_STEP +// macros. When the operation completes, call FLOW_END. An async operation can +// span threads and processes, but all events in that operation must use the +// same |name| and |id|. Each event can have its own args. +#define TRACE_EVENT_FLOW_BEGIN0(category, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_FLOW_BEGIN1(category, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) +#define TRACE_EVENT_FLOW_BEGIN2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_NONE, \ + arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_COPY_FLOW_BEGIN0(category, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_FLOW_BEGIN1(category, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_COPY, \ + arg1_name, arg1_val) +#define TRACE_EVENT_COPY_FLOW_BEGIN2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category, name, id, TRACE_EVENT_FLAG_COPY, \ + arg1_name, arg1_val, arg2_name, arg2_val) + +// Records a single FLOW_STEP event for |step| immediately. If the category +// is not enabled, then this does nothing. The |name| and |id| must match the +// FLOW_BEGIN event above. The |step| param identifies this step within the +// async event. This should be called at the beginning of the next phase of an +// asynchronous operation. +#define TRACE_EVENT_FLOW_STEP0(category, name, id, step) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ + category, name, id, TRACE_EVENT_FLAG_NONE, "step", step) +#define TRACE_EVENT_FLOW_STEP1(category, name, id, step, \ + arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ + category, name, id, TRACE_EVENT_FLAG_NONE, "step", step, \ + arg1_name, arg1_val) +#define TRACE_EVENT_COPY_FLOW_STEP0(category, name, id, step) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ + category, name, id, TRACE_EVENT_FLAG_COPY, "step", step) +#define TRACE_EVENT_COPY_FLOW_STEP1(category, name, id, step, \ + arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ + category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, \ + arg1_name, arg1_val) + +// Records a single FLOW_END event for "name" immediately. If the category +// is not enabled, then this does nothing. +#define TRACE_EVENT_FLOW_END0(category, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category, name, id, TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_FLOW_END1(category, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) +#define TRACE_EVENT_FLOW_END2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category, name, id, TRACE_EVENT_FLAG_NONE, \ + arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_COPY_FLOW_END0(category, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category, name, id, TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_FLOW_END1(category, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category, name, id, TRACE_EVENT_FLAG_COPY, \ + arg1_name, arg1_val) +#define TRACE_EVENT_COPY_FLOW_END2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category, name, id, TRACE_EVENT_FLAG_COPY, \ + arg1_name, arg1_val, arg2_name, arg2_val) + + +//////////////////////////////////////////////////////////////////////////////// +// Implementation specific tracing API definitions. + +// Get a pointer to the enabled state of the given trace category. Only +// long-lived literal strings should be given as the category name. The returned +// pointer can be held permanently in a local static for example. If the +// unsigned char is non-zero, tracing is enabled. If tracing is enabled, +// TRACE_EVENT_API_ADD_TRACE_EVENT can be called. It's OK if tracing is disabled +// between the load of the tracing state and the call to +// TRACE_EVENT_API_ADD_TRACE_EVENT, because this flag only provides an early out +// for best performance when tracing is disabled. +// const unsigned char* +// TRACE_EVENT_API_GET_CATEGORY_ENABLED(const char* category_name) +#define TRACE_EVENT_API_GET_CATEGORY_ENABLED \ + webrtc::EventTracer::GetCategoryEnabled + +// Add a trace event to the platform tracing system. +// void TRACE_EVENT_API_ADD_TRACE_EVENT( +// char phase, +// const unsigned char* category_enabled, +// const char* name, +// unsigned long long id, +// int num_args, +// const char** arg_names, +// const unsigned char* arg_types, +// const unsigned long long* arg_values, +// unsigned char flags) +#define TRACE_EVENT_API_ADD_TRACE_EVENT webrtc::EventTracer::AddTraceEvent + +//////////////////////////////////////////////////////////////////////////////// + +// Implementation detail: trace event macros create temporary variables +// to keep instrumentation overhead low. These macros give each temporary +// variable a unique name based on the line number to prevent name collissions. +#define INTERNAL_TRACE_EVENT_UID3(a,b) \ + trace_event_unique_##a##b +#define INTERNAL_TRACE_EVENT_UID2(a,b) \ + INTERNAL_TRACE_EVENT_UID3(a,b) +#define INTERNAL_TRACE_EVENT_UID(name_prefix) \ + INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__) + +// Implementation detail: internal macro to create static category. +#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category) \ + static const unsigned char* INTERNAL_TRACE_EVENT_UID(catstatic) = \ + TRACE_EVENT_API_GET_CATEGORY_ENABLED(category); + +// Implementation detail: internal macro to create static category and add +// event if the category is enabled. +#define INTERNAL_TRACE_EVENT_ADD(phase, category, name, flags, ...) \ + do { \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ + if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ + webrtc::trace_event_internal::AddTraceEvent( \ + phase, INTERNAL_TRACE_EVENT_UID(catstatic), name, \ + webrtc::trace_event_internal::kNoEventId, flags, ##__VA_ARGS__); \ + } \ + } while (0) + +// Implementation detail: internal macro to create static category and add begin +// event if the category is enabled. Also adds the end event when the scope +// ends. +#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, ...) \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ + webrtc::trace_event_internal::TraceEndOnScopeClose \ + INTERNAL_TRACE_EVENT_UID(profileScope); \ + if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ + webrtc::trace_event_internal::AddTraceEvent( \ + TRACE_EVENT_PHASE_BEGIN, \ + INTERNAL_TRACE_EVENT_UID(catstatic), \ + name, webrtc::trace_event_internal::kNoEventId, \ + TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__); \ + INTERNAL_TRACE_EVENT_UID(profileScope).Initialize( \ + INTERNAL_TRACE_EVENT_UID(catstatic), name); \ + } + +// Implementation detail: internal macro to create static category and add +// event if the category is enabled. +#define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category, name, id, flags, \ + ...) \ + do { \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ + if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ + unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ + webrtc::trace_event_internal::TraceID trace_event_trace_id( \ + id, &trace_event_flags); \ + webrtc::trace_event_internal::AddTraceEvent( \ + phase, INTERNAL_TRACE_EVENT_UID(catstatic), \ + name, trace_event_trace_id.data(), trace_event_flags, \ + ##__VA_ARGS__); \ + } \ + } while (0) + +// Notes regarding the following definitions: +// New values can be added and propagated to third party libraries, but existing +// definitions must never be changed, because third party libraries may use old +// definitions. + +// Phase indicates the nature of an event entry. E.g. part of a begin/end pair. +#define TRACE_EVENT_PHASE_BEGIN ('B') +#define TRACE_EVENT_PHASE_END ('E') +#define TRACE_EVENT_PHASE_INSTANT ('I') +#define TRACE_EVENT_PHASE_ASYNC_BEGIN ('S') +#define TRACE_EVENT_PHASE_ASYNC_STEP ('T') +#define TRACE_EVENT_PHASE_ASYNC_END ('F') +#define TRACE_EVENT_PHASE_FLOW_BEGIN ('s') +#define TRACE_EVENT_PHASE_FLOW_STEP ('t') +#define TRACE_EVENT_PHASE_FLOW_END ('f') +#define TRACE_EVENT_PHASE_METADATA ('M') +#define TRACE_EVENT_PHASE_COUNTER ('C') + +// Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. +#define TRACE_EVENT_FLAG_NONE (static_cast(0)) +#define TRACE_EVENT_FLAG_COPY (static_cast(1 << 0)) +#define TRACE_EVENT_FLAG_HAS_ID (static_cast(1 << 1)) +#define TRACE_EVENT_FLAG_MANGLE_ID (static_cast(1 << 2)) + +// Type values for identifying types in the TraceValue union. +#define TRACE_VALUE_TYPE_BOOL (static_cast(1)) +#define TRACE_VALUE_TYPE_UINT (static_cast(2)) +#define TRACE_VALUE_TYPE_INT (static_cast(3)) +#define TRACE_VALUE_TYPE_DOUBLE (static_cast(4)) +#define TRACE_VALUE_TYPE_POINTER (static_cast(5)) +#define TRACE_VALUE_TYPE_STRING (static_cast(6)) +#define TRACE_VALUE_TYPE_COPY_STRING (static_cast(7)) + +namespace webrtc { +namespace trace_event_internal { + +// Specify these values when the corresponding argument of AddTraceEvent is not +// used. +const int kZeroNumArgs = 0; +const unsigned long long kNoEventId = 0; + +// TraceID encapsulates an ID that can either be an integer or pointer. Pointers +// are mangled with the Process ID so that they are unlikely to collide when the +// same pointer is used on different processes. +class TraceID { + public: + class ForceMangle { + public: + explicit ForceMangle(unsigned long long id) : data_(id) {} + explicit ForceMangle(unsigned long id) : data_(id) {} + explicit ForceMangle(unsigned int id) : data_(id) {} + explicit ForceMangle(unsigned short id) : data_(id) {} + explicit ForceMangle(unsigned char id) : data_(id) {} + explicit ForceMangle(long long id) + : data_(static_cast(id)) {} + explicit ForceMangle(long id) + : data_(static_cast(id)) {} + explicit ForceMangle(int id) + : data_(static_cast(id)) {} + explicit ForceMangle(short id) + : data_(static_cast(id)) {} + explicit ForceMangle(signed char id) + : data_(static_cast(id)) {} + + unsigned long long data() const { return data_; } + + private: + unsigned long long data_; + }; + + explicit TraceID(const void* id, unsigned char* flags) + : data_(static_cast( + reinterpret_cast(id))) { + *flags |= TRACE_EVENT_FLAG_MANGLE_ID; + } + explicit TraceID(ForceMangle id, unsigned char* flags) : data_(id.data()) { + *flags |= TRACE_EVENT_FLAG_MANGLE_ID; + } + explicit TraceID(unsigned long long id, unsigned char* flags) + : data_(id) { (void)flags; } + explicit TraceID(unsigned long id, unsigned char* flags) + : data_(id) { (void)flags; } + explicit TraceID(unsigned int id, unsigned char* flags) + : data_(id) { (void)flags; } + explicit TraceID(unsigned short id, unsigned char* flags) + : data_(id) { (void)flags; } + explicit TraceID(unsigned char id, unsigned char* flags) + : data_(id) { (void)flags; } + explicit TraceID(long long id, unsigned char* flags) + : data_(static_cast(id)) { (void)flags; } + explicit TraceID(long id, unsigned char* flags) + : data_(static_cast(id)) { (void)flags; } + explicit TraceID(int id, unsigned char* flags) + : data_(static_cast(id)) { (void)flags; } + explicit TraceID(short id, unsigned char* flags) + : data_(static_cast(id)) { (void)flags; } + explicit TraceID(signed char id, unsigned char* flags) + : data_(static_cast(id)) { (void)flags; } + + unsigned long long data() const { return data_; } + + private: + unsigned long long data_; +}; + +// Simple union to store various types as unsigned long long. +union TraceValueUnion { + bool as_bool; + unsigned long long as_uint; + long long as_int; + double as_double; + const void* as_pointer; + const char* as_string; +}; + +// Simple container for const char* that should be copied instead of retained. +class TraceStringWithCopy { + public: + explicit TraceStringWithCopy(const char* str) : str_(str) {} + operator const char* () const { return str_; } + private: + const char* str_; +}; + +// Define SetTraceValue for each allowed type. It stores the type and +// value in the return arguments. This allows this API to avoid declaring any +// structures so that it is portable to third_party libraries. +#define INTERNAL_DECLARE_SET_TRACE_VALUE(actual_type, \ + union_member, \ + value_type_id) \ + static inline void SetTraceValue(actual_type arg, \ + unsigned char* type, \ + unsigned long long* value) { \ + TraceValueUnion type_value; \ + type_value.union_member = arg; \ + *type = value_type_id; \ + *value = type_value.as_uint; \ + } +// Simpler form for int types that can be safely casted. +#define INTERNAL_DECLARE_SET_TRACE_VALUE_INT(actual_type, \ + value_type_id) \ + static inline void SetTraceValue(actual_type arg, \ + unsigned char* type, \ + unsigned long long* value) { \ + *type = value_type_id; \ + *value = static_cast(arg); \ + } + +INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned long long, TRACE_VALUE_TYPE_UINT) +INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned long, TRACE_VALUE_TYPE_UINT) +INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned int, TRACE_VALUE_TYPE_UINT) +INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned short, TRACE_VALUE_TYPE_UINT) +INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned char, TRACE_VALUE_TYPE_UINT) +INTERNAL_DECLARE_SET_TRACE_VALUE_INT(long long, TRACE_VALUE_TYPE_INT) +INTERNAL_DECLARE_SET_TRACE_VALUE_INT(long, TRACE_VALUE_TYPE_INT) +INTERNAL_DECLARE_SET_TRACE_VALUE_INT(int, TRACE_VALUE_TYPE_INT) +INTERNAL_DECLARE_SET_TRACE_VALUE_INT(short, TRACE_VALUE_TYPE_INT) +INTERNAL_DECLARE_SET_TRACE_VALUE_INT(signed char, TRACE_VALUE_TYPE_INT) +INTERNAL_DECLARE_SET_TRACE_VALUE(bool, as_bool, TRACE_VALUE_TYPE_BOOL) +INTERNAL_DECLARE_SET_TRACE_VALUE(double, as_double, TRACE_VALUE_TYPE_DOUBLE) +INTERNAL_DECLARE_SET_TRACE_VALUE(const void*, as_pointer, + TRACE_VALUE_TYPE_POINTER) +INTERNAL_DECLARE_SET_TRACE_VALUE(const char*, as_string, + TRACE_VALUE_TYPE_STRING) +INTERNAL_DECLARE_SET_TRACE_VALUE(const TraceStringWithCopy&, as_string, + TRACE_VALUE_TYPE_COPY_STRING) + +#undef INTERNAL_DECLARE_SET_TRACE_VALUE +#undef INTERNAL_DECLARE_SET_TRACE_VALUE_INT + +// std::string version of SetTraceValue so that trace arguments can be strings. +static inline void SetTraceValue(const std::string& arg, + unsigned char* type, + unsigned long long* value) { + TraceValueUnion type_value; + type_value.as_string = arg.c_str(); + *type = TRACE_VALUE_TYPE_COPY_STRING; + *value = type_value.as_uint; +} + +// These AddTraceEvent template functions are defined here instead of in the +// macro, because the arg_values could be temporary objects, such as +// std::string. In order to store pointers to the internal c_str and pass +// through to the tracing API, the arg_values must live throughout +// these procedures. + +static inline void AddTraceEvent(char phase, + const unsigned char* category_enabled, + const char* name, + unsigned long long id, + unsigned char flags) { + TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_enabled, name, id, + kZeroNumArgs, nullptr, nullptr, nullptr, + flags); +} + +template +static inline void AddTraceEvent(char phase, + const unsigned char* category_enabled, + const char* name, + unsigned long long id, + unsigned char flags, + const char* arg1_name, + const ARG1_TYPE& arg1_val) { + const int num_args = 1; + unsigned char arg_types[1]; + unsigned long long arg_values[1]; + SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); + TRACE_EVENT_API_ADD_TRACE_EVENT( + phase, category_enabled, name, id, + num_args, &arg1_name, arg_types, arg_values, + flags); +} + +template +static inline void AddTraceEvent(char phase, + const unsigned char* category_enabled, + const char* name, + unsigned long long id, + unsigned char flags, + const char* arg1_name, + const ARG1_TYPE& arg1_val, + const char* arg2_name, + const ARG2_TYPE& arg2_val) { + const int num_args = 2; + const char* arg_names[2] = { arg1_name, arg2_name }; + unsigned char arg_types[2]; + unsigned long long arg_values[2]; + SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); + SetTraceValue(arg2_val, &arg_types[1], &arg_values[1]); + TRACE_EVENT_API_ADD_TRACE_EVENT( + phase, category_enabled, name, id, + num_args, arg_names, arg_types, arg_values, + flags); +} + +// Used by TRACE_EVENTx macro. Do not use directly. +class TraceEndOnScopeClose { + public: + // Note: members of data_ intentionally left uninitialized. See Initialize. + TraceEndOnScopeClose() : p_data_(nullptr) {} + ~TraceEndOnScopeClose() { + if (p_data_) + AddEventIfEnabled(); + } + + void Initialize(const unsigned char* category_enabled, + const char* name) { + data_.category_enabled = category_enabled; + data_.name = name; + p_data_ = &data_; + } + + private: + // Add the end event if the category is still enabled. + void AddEventIfEnabled() { + // Only called when p_data_ is non-null. + if (*p_data_->category_enabled) { + TRACE_EVENT_API_ADD_TRACE_EVENT(TRACE_EVENT_PHASE_END, + p_data_->category_enabled, p_data_->name, + kNoEventId, kZeroNumArgs, nullptr, + nullptr, nullptr, TRACE_EVENT_FLAG_NONE); + } + } + + // This Data struct workaround is to avoid initializing all the members + // in Data during construction of this object, since this object is always + // constructed, even when tracing is disabled. If the members of Data were + // members of this class instead, compiler warnings occur about potential + // uninitialized accesses. + struct Data { + const unsigned char* category_enabled; + const char* name; + }; + Data* p_data_; + Data data_; +}; + +} // namespace trace_event_internal +} // namespace webrtc #endif // WEBRTC_BASE_TRACE_EVENT_H_ diff --git a/webrtc/rtc_base/transformadapter.cc b/webrtc/base/transformadapter.cc similarity index 100% rename from webrtc/rtc_base/transformadapter.cc rename to webrtc/base/transformadapter.cc diff --git a/webrtc/base/transformadapter.h b/webrtc/base/transformadapter.h index 3d9c86bb26..290d5605ff 100644 --- a/webrtc/base/transformadapter.h +++ b/webrtc/base/transformadapter.h @@ -8,12 +8,77 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_TRANSFORMADAPTER_H_ -#define WEBRTC_BASE_TRANSFORMADAPTER_H_ +#ifndef WEBRTC_BASE_TRANSFORMADAPTER_H__ +#define WEBRTC_BASE_TRANSFORMADAPTER_H__ +#include "webrtc/base/stream.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/transformadapter.h" +namespace rtc { +/////////////////////////////////////////////////////////////////////////////// -#endif // WEBRTC_BASE_TRANSFORMADAPTER_H_ +class TransformInterface { +public: + virtual ~TransformInterface() { } + + // Transform should convert the in_len bytes of input into the out_len-sized + // output buffer. If flush is true, there will be no more data following + // input. + // After the transformation, in_len contains the number of bytes consumed, and + // out_len contains the number of bytes ready in output. + // Note: Transform should not return SR_BLOCK, as there is no asynchronous + // notification available. + virtual StreamResult Transform(const void * input, size_t * in_len, + void * output, size_t * out_len, + bool flush) = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// + +// TransformAdapter causes all data passed through to be transformed by the +// supplied TransformInterface object, which may apply compression, encryption, +// etc. + +class TransformAdapter : public StreamAdapterInterface { +public: + // Note that the transformation is unidirectional, in the direction specified + // by the constructor. Operations in the opposite direction result in SR_EOS. + TransformAdapter(StreamInterface * stream, + TransformInterface * transform, + bool direction_read); + ~TransformAdapter() override; + + StreamResult Read(void* buffer, + size_t buffer_len, + size_t* read, + int* error) override; + StreamResult Write(const void* data, + size_t data_len, + size_t* written, + int* error) override; + void Close() override; + + // Apriori, we can't tell what the transformation does to the stream length. + bool GetAvailable(size_t* size) const override; + bool ReserveSize(size_t size) override; + + // Transformations might not be restartable + virtual bool Rewind(); + +private: + enum State { ST_PROCESSING, ST_FLUSHING, ST_COMPLETE, ST_ERROR }; + enum { BUFFER_SIZE = 1024 }; + + TransformInterface * transform_; + bool direction_read_; + State state_; + int error_; + + char buffer_[BUFFER_SIZE]; + size_t len_; +}; + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace rtc + +#endif // WEBRTC_BASE_TRANSFORMADAPTER_H__ diff --git a/webrtc/base/type_traits.h b/webrtc/base/type_traits.h index 6a4ac8d24e..a57bead6c1 100644 --- a/webrtc/base/type_traits.h +++ b/webrtc/base/type_traits.h @@ -11,9 +11,130 @@ #ifndef WEBRTC_BASE_TYPE_TRAITS_H_ #define WEBRTC_BASE_TYPE_TRAITS_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/type_traits.h" +namespace rtc { + +// Determines if the given class has zero-argument .data() and .size() methods +// whose return values are convertible to T* and size_t, respectively. +template +class HasDataAndSize { + private: + template < + typename C, + typename std::enable_if< + std::is_convertible().data()), T*>::value && + std::is_convertible().size()), + std::size_t>::value>::type* = nullptr> + static int Test(int); + + template + static char Test(...); + + public: + static constexpr bool value = std::is_same(0)), int>::value; +}; + +namespace test_has_data_and_size { + +template +struct Test1 { + DR data(); + SR size(); +}; +static_assert(HasDataAndSize, int>::value, ""); +static_assert(HasDataAndSize, const int>::value, ""); +static_assert(HasDataAndSize, const int>::value, ""); +static_assert(!HasDataAndSize, int>::value, + "implicit cast of const int* to int*"); +static_assert(!HasDataAndSize, int>::value, + "implicit cast of char* to int*"); + +struct Test2 { + int* data; + size_t size; +}; +static_assert(!HasDataAndSize::value, + ".data and .size aren't functions"); + +struct Test3 { + int* data(); +}; +static_assert(!HasDataAndSize::value, ".size() is missing"); + +class Test4 { + int* data(); + size_t size(); +}; +static_assert(!HasDataAndSize::value, + ".data() and .size() are private"); + +} // namespace test_has_data_and_size + +namespace type_traits_impl { + +// Determines if the given type is an enum that converts implicitly to +// an integral type. +template +struct IsIntEnum { + private: + // This overload is used if the type is an enum, and unary plus + // compiles and turns it into an integral type. + template ::value && + std::is_integral())>::value>::type* = + nullptr> + static int Test(int); + + // Otherwise, this overload is used. + template + static char Test(...); + + public: + static constexpr bool value = + std::is_same::type>(0)), + int>::value; +}; + +} // namespace type_traits_impl + +// Determines if the given type is integral, or an enum that +// converts implicitly to an integral type. +template +struct IsIntlike { + private: + using X = typename std::remove_reference::type; + + public: + static constexpr bool value = + std::is_integral::value || type_traits_impl::IsIntEnum::value; +}; + +namespace test_enum_intlike { + +enum E1 { e1 }; +enum { e2 }; +enum class E3 { e3 }; +struct S {}; + +static_assert(type_traits_impl::IsIntEnum::value, ""); +static_assert(type_traits_impl::IsIntEnum::value, ""); +static_assert(!type_traits_impl::IsIntEnum::value, ""); +static_assert(!type_traits_impl::IsIntEnum::value, ""); +static_assert(!type_traits_impl::IsIntEnum::value, ""); +static_assert(!type_traits_impl::IsIntEnum::value, ""); + +static_assert(IsIntlike::value, ""); +static_assert(IsIntlike::value, ""); +static_assert(!IsIntlike::value, ""); +static_assert(IsIntlike::value, ""); +static_assert(!IsIntlike::value, ""); +static_assert(!IsIntlike::value, ""); + +} // test_enum_intlike + +} // namespace rtc #endif // WEBRTC_BASE_TYPE_TRAITS_H_ diff --git a/webrtc/rtc_base/unittest_main.cc b/webrtc/base/unittest_main.cc similarity index 100% rename from webrtc/rtc_base/unittest_main.cc rename to webrtc/base/unittest_main.cc diff --git a/webrtc/rtc_base/unixfilesystem.cc b/webrtc/base/unixfilesystem.cc similarity index 100% rename from webrtc/rtc_base/unixfilesystem.cc rename to webrtc/base/unixfilesystem.cc diff --git a/webrtc/base/unixfilesystem.h b/webrtc/base/unixfilesystem.h index 7a182055af..742f4c23a3 100644 --- a/webrtc/base/unixfilesystem.h +++ b/webrtc/base/unixfilesystem.h @@ -11,9 +11,79 @@ #ifndef WEBRTC_BASE_UNIXFILESYSTEM_H_ #define WEBRTC_BASE_UNIXFILESYSTEM_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/unixfilesystem.h" +#include "webrtc/base/fileutils.h" + +namespace rtc { + +class UnixFilesystem : public FilesystemInterface { + public: + UnixFilesystem(); + ~UnixFilesystem() override; + +#if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC) + // Android does not have a native code API to fetch the app data or temp + // folders. That needs to be passed into this class from Java. Similarly, iOS + // only supports an Objective-C API for fetching the folder locations, so that + // needs to be passed in here from Objective-C. Or at least that used to be + // the case; now the ctor will do the work if necessary and possible. + // TODO(fischman): add an Android version that uses JNI and drop the + // SetApp*Folder() APIs once external users stop using them. + static void SetAppDataFolder(const std::string& folder); + static void SetAppTempFolder(const std::string& folder); +#endif + + // This will attempt to delete the file located at filename. + // It will fail with VERIY if you pass it a non-existant file, or a directory. + bool DeleteFile(const Pathname& filename) override; + + // Creates a directory. This will call itself recursively to create /foo/bar + // even if /foo does not exist. All created directories are created with the + // given mode. + // Returns TRUE if function succeeds + virtual bool CreateFolder(const Pathname &pathname, mode_t mode); + + // As above, with mode = 0755. + bool CreateFolder(const Pathname& pathname) override; + + // This moves a file from old_path to new_path, where "file" can be a plain + // file or directory, which will be moved recursively. + // Returns true if function succeeds. + bool MoveFile(const Pathname& old_path, const Pathname& new_path) override; + + // Returns true if a pathname is a directory + bool IsFolder(const Pathname& pathname) override; + + // Returns true of pathname represents an existing file + bool IsFile(const Pathname& pathname) override; + + // Returns true if pathname refers to no filesystem object, every parent + // directory either exists, or is also absent. + bool IsAbsent(const Pathname& pathname) override; + + std::string TempFilename(const Pathname& dir, + const std::string& prefix) override; + + // A folder appropriate for storing temporary files (Contents are + // automatically deleted when the program exists) + bool GetTemporaryFolder(Pathname& path, + bool create, + const std::string* append) override; + + bool GetFileSize(const Pathname& path, size_t* size) override; + + private: +#if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC) + static char* provided_app_data_folder_; + static char* provided_app_temp_folder_; +#else + static char* app_temp_path_; +#endif + + static char* CopyString(const std::string& str); +}; + +} // namespace rtc #endif // WEBRTC_BASE_UNIXFILESYSTEM_H_ diff --git a/webrtc/rtc_base/virtualsocket_unittest.cc b/webrtc/base/virtualsocket_unittest.cc similarity index 100% rename from webrtc/rtc_base/virtualsocket_unittest.cc rename to webrtc/base/virtualsocket_unittest.cc diff --git a/webrtc/rtc_base/virtualsocketserver.cc b/webrtc/base/virtualsocketserver.cc similarity index 100% rename from webrtc/rtc_base/virtualsocketserver.cc rename to webrtc/base/virtualsocketserver.cc diff --git a/webrtc/base/virtualsocketserver.h b/webrtc/base/virtualsocketserver.h index 31ce96d2e0..0ab2af29fb 100644 --- a/webrtc/base/virtualsocketserver.h +++ b/webrtc/base/virtualsocketserver.h @@ -11,9 +11,390 @@ #ifndef WEBRTC_BASE_VIRTUALSOCKETSERVER_H_ #define WEBRTC_BASE_VIRTUALSOCKETSERVER_H_ +#include +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/virtualsocketserver.h" +#include "webrtc/base/checks.h" +#include "webrtc/base/constructormagic.h" +#include "webrtc/base/event.h" +#include "webrtc/base/fakeclock.h" +#include "webrtc/base/messagequeue.h" +#include "webrtc/base/socketserver.h" + +namespace rtc { + +class Packet; +class VirtualSocket; +class SocketAddressPair; + +// Simulates a network in the same manner as a loopback interface. The +// interface can create as many addresses as you want. All of the sockets +// created by this network will be able to communicate with one another, unless +// they are bound to addresses from incompatible families. +class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> { + public: + VirtualSocketServer(); + // This constructor needs to be used if the test uses a fake clock and + // ProcessMessagesUntilIdle, since ProcessMessagesUntilIdle needs a way of + // advancing time. + explicit VirtualSocketServer(FakeClock* fake_clock); + ~VirtualSocketServer() override; + + // The default route indicates which local address to use when a socket is + // bound to the 'any' address, e.g. 0.0.0.0. + IPAddress GetDefaultRoute(int family); + void SetDefaultRoute(const IPAddress& from_addr); + + // Limits the network bandwidth (maximum bytes per second). Zero means that + // all sends occur instantly. Defaults to 0. + uint32_t bandwidth() const { return bandwidth_; } + void set_bandwidth(uint32_t bandwidth) { bandwidth_ = bandwidth; } + + // Limits the amount of data which can be in flight on the network without + // packet loss (on a per sender basis). Defaults to 64 KB. + uint32_t network_capacity() const { return network_capacity_; } + void set_network_capacity(uint32_t capacity) { network_capacity_ = capacity; } + + // The amount of data which can be buffered by tcp on the sender's side + uint32_t send_buffer_capacity() const { return send_buffer_capacity_; } + void set_send_buffer_capacity(uint32_t capacity) { + send_buffer_capacity_ = capacity; + } + + // The amount of data which can be buffered by tcp on the receiver's side + uint32_t recv_buffer_capacity() const { return recv_buffer_capacity_; } + void set_recv_buffer_capacity(uint32_t capacity) { + recv_buffer_capacity_ = capacity; + } + + // Controls the (transit) delay for packets sent in the network. This does + // not inclue the time required to sit in the send queue. Both of these + // values are measured in milliseconds. Defaults to no delay. + uint32_t delay_mean() const { return delay_mean_; } + uint32_t delay_stddev() const { return delay_stddev_; } + uint32_t delay_samples() const { return delay_samples_; } + void set_delay_mean(uint32_t delay_mean) { delay_mean_ = delay_mean; } + void set_delay_stddev(uint32_t delay_stddev) { delay_stddev_ = delay_stddev; } + void set_delay_samples(uint32_t delay_samples) { + delay_samples_ = delay_samples; + } + + // If the (transit) delay parameters are modified, this method should be + // called to recompute the new distribution. + void UpdateDelayDistribution(); + + // Controls the (uniform) probability that any sent packet is dropped. This + // is separate from calculations to drop based on queue size. + double drop_probability() { return drop_prob_; } + void set_drop_probability(double drop_prob) { + RTC_DCHECK_GE(drop_prob, 0.0); + RTC_DCHECK_LE(drop_prob, 1.0); + drop_prob_ = drop_prob; + } + + // If |blocked| is true, subsequent attempts to send will result in -1 being + // returned, with the socket error set to EWOULDBLOCK. + // + // If this method is later called with |blocked| set to false, any sockets + // that previously failed to send with EWOULDBLOCK will emit SignalWriteEvent. + // + // This can be used to simulate the send buffer on a network interface being + // full, and test functionality related to EWOULDBLOCK/SignalWriteEvent. + void SetSendingBlocked(bool blocked); + + // SocketFactory: + Socket* CreateSocket(int type) override; + Socket* CreateSocket(int family, int type) override; + + AsyncSocket* CreateAsyncSocket(int type) override; + AsyncSocket* CreateAsyncSocket(int family, int type) override; + + // SocketServer: + void SetMessageQueue(MessageQueue* queue) override; + bool Wait(int cms, bool process_io) override; + void WakeUp() override; + + void SetDelayOnAddress(const rtc::SocketAddress& address, int delay_ms) { + delay_by_ip_[address.ipaddr()] = delay_ms; + } + + typedef std::pair Point; + typedef std::vector Function; + + static Function* CreateDistribution(uint32_t mean, + uint32_t stddev, + uint32_t samples); + + // Similar to Thread::ProcessMessages, but it only processes messages until + // there are no immediate messages or pending network traffic. Returns false + // if Thread::Stop() was called. + bool ProcessMessagesUntilIdle(); + + // Sets the next port number to use for testing. + void SetNextPortForTesting(uint16_t port); + + // Close a pair of Tcp connections by addresses. Both connections will have + // its own OnClose invoked. + bool CloseTcpConnections(const SocketAddress& addr_local, + const SocketAddress& addr_remote); + + // For testing purpose only. Fired when a client socket is created. + sigslot::signal1 SignalSocketCreated; + + protected: + // Returns a new IP not used before in this network. + IPAddress GetNextIP(int family); + uint16_t GetNextPort(); + + VirtualSocket* CreateSocketInternal(int family, int type); + + // Binds the given socket to addr, assigning and IP and Port if necessary + int Bind(VirtualSocket* socket, SocketAddress* addr); + + // Binds the given socket to the given (fully-defined) address. + int Bind(VirtualSocket* socket, const SocketAddress& addr); + + // Find the socket bound to the given address + VirtualSocket* LookupBinding(const SocketAddress& addr); + + int Unbind(const SocketAddress& addr, VirtualSocket* socket); + + // Adds a mapping between this socket pair and the socket. + void AddConnection(const SocketAddress& client, + const SocketAddress& server, + VirtualSocket* socket); + + // Find the socket pair corresponding to this server address. + VirtualSocket* LookupConnection(const SocketAddress& client, + const SocketAddress& server); + + void RemoveConnection(const SocketAddress& client, + const SocketAddress& server); + + // Connects the given socket to the socket at the given address + int Connect(VirtualSocket* socket, const SocketAddress& remote_addr, + bool use_delay); + + // Sends a disconnect message to the socket at the given address + bool Disconnect(VirtualSocket* socket); + + // Sends the given packet to the socket at the given address (if one exists). + int SendUdp(VirtualSocket* socket, const char* data, size_t data_size, + const SocketAddress& remote_addr); + + // Moves as much data as possible from the sender's buffer to the network + void SendTcp(VirtualSocket* socket); + + // Places a packet on the network. + void AddPacketToNetwork(VirtualSocket* socket, + VirtualSocket* recipient, + int64_t cur_time, + const char* data, + size_t data_size, + size_t header_size, + bool ordered); + + // Removes stale packets from the network + void PurgeNetworkPackets(VirtualSocket* socket, int64_t cur_time); + + // Computes the number of milliseconds required to send a packet of this size. + uint32_t SendDelay(uint32_t size); + + // If the delay has been set for the address of the socket, returns the set + // delay. Otherwise, returns a random transit delay chosen from the + // appropriate distribution. + uint32_t GetTransitDelay(Socket* socket); + + // Basic operations on functions. Those that return a function also take + // ownership of the function given (and hence, may modify or delete it). + static Function* Accumulate(Function* f); + static Function* Invert(Function* f); + static Function* Resample(Function* f, + double x1, + double x2, + uint32_t samples); + static double Evaluate(Function* f, double x); + + // Null out our message queue if it goes away. Necessary in the case where + // our lifetime is greater than that of the thread we are using, since we + // try to send Close messages for all connected sockets when we shutdown. + void OnMessageQueueDestroyed() { msg_queue_ = nullptr; } + + // Determine if two sockets should be able to communicate. + // We don't (currently) specify an address family for sockets; instead, + // the currently bound address is used to infer the address family. + // Any socket that is not explicitly bound to an IPv4 address is assumed to be + // dual-stack capable. + // This function tests if two addresses can communicate, as well as the + // sockets to which they may be bound (the addresses may or may not yet be + // bound to the sockets). + // First the addresses are tested (after normalization): + // If both have the same family, then communication is OK. + // If only one is IPv4 then false, unless the other is bound to ::. + // This applies even if the IPv4 address is 0.0.0.0. + // The socket arguments are optional; the sockets are checked to see if they + // were explicitly bound to IPv6-any ('::'), and if so communication is + // permitted. + // NB: This scheme doesn't permit non-dualstack IPv6 sockets. + static bool CanInteractWith(VirtualSocket* local, VirtualSocket* remote); + + private: + friend class VirtualSocket; + + // Sending was previously blocked, but now isn't. + sigslot::signal0<> SignalReadyToSend; + + typedef std::map AddressMap; + typedef std::map ConnectionMap; + + // May be null if the test doesn't use a fake clock, or it does but doesn't + // use ProcessMessagesUntilIdle. + FakeClock* fake_clock_ = nullptr; + + // Used to implement Wait/WakeUp. + Event wakeup_; + MessageQueue* msg_queue_; + bool stop_on_idle_; + in_addr next_ipv4_; + in6_addr next_ipv6_; + uint16_t next_port_; + AddressMap* bindings_; + ConnectionMap* connections_; + + IPAddress default_route_v4_; + IPAddress default_route_v6_; + + uint32_t bandwidth_; + uint32_t network_capacity_; + uint32_t send_buffer_capacity_; + uint32_t recv_buffer_capacity_; + uint32_t delay_mean_; + uint32_t delay_stddev_; + uint32_t delay_samples_; + + std::map delay_by_ip_; + std::unique_ptr delay_dist_; + + CriticalSection delay_crit_; + + double drop_prob_; + bool sending_blocked_ = false; + RTC_DISALLOW_COPY_AND_ASSIGN(VirtualSocketServer); +}; + +// Implements the socket interface using the virtual network. Packets are +// passed as messages using the message queue of the socket server. +class VirtualSocket : public AsyncSocket, + public MessageHandler, + public sigslot::has_slots<> { + public: + VirtualSocket(VirtualSocketServer* server, int family, int type, bool async); + ~VirtualSocket() override; + + SocketAddress GetLocalAddress() const override; + SocketAddress GetRemoteAddress() const override; + + // Used by TurnPortTest to mimic a case where proxy returns local host address + // instead of the original one TurnPort was bound against. Please see WebRTC + // issue 3927 for more detail. + void SetAlternativeLocalAddress(const SocketAddress& addr); + + int Bind(const SocketAddress& addr) override; + int Connect(const SocketAddress& addr) override; + int Close() override; + int Send(const void* pv, size_t cb) override; + int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; + int Recv(void* pv, size_t cb, int64_t* timestamp) override; + int RecvFrom(void* pv, + size_t cb, + SocketAddress* paddr, + int64_t* timestamp) override; + int Listen(int backlog) override; + VirtualSocket* Accept(SocketAddress* paddr) override; + + int GetError() const override; + void SetError(int error) override; + ConnState GetState() const override; + int GetOption(Option opt, int* value) override; + int SetOption(Option opt, int value) override; + void OnMessage(Message* pmsg) override; + + bool was_any() { return was_any_; } + void set_was_any(bool was_any) { was_any_ = was_any; } + + // For testing purpose only. Fired when client socket is bound to an address. + sigslot::signal2 SignalAddressReady; + + private: + struct NetworkEntry { + size_t size; + int64_t done_time; + }; + + typedef std::deque ListenQueue; + typedef std::deque NetworkQueue; + typedef std::vector SendBuffer; + typedef std::list RecvBuffer; + typedef std::map OptionsMap; + + int InitiateConnect(const SocketAddress& addr, bool use_delay); + void CompleteConnect(const SocketAddress& addr, bool notify); + int SendUdp(const void* pv, size_t cb, const SocketAddress& addr); + int SendTcp(const void* pv, size_t cb); + + // Used by server sockets to set the local address without binding. + void SetLocalAddress(const SocketAddress& addr); + + void OnSocketServerReadyToSend(); + + VirtualSocketServer* server_; + int type_; + bool async_; + ConnState state_; + int error_; + SocketAddress local_addr_; + SocketAddress alternative_local_addr_; + SocketAddress remote_addr_; + + // Pending sockets which can be Accepted + ListenQueue* listen_queue_; + + // Data which tcp has buffered for sending + SendBuffer send_buffer_; + // Set to false if the last attempt to send resulted in EWOULDBLOCK. + // Set back to true when the socket can send again. + bool ready_to_send_ = true; + + // Critical section to protect the recv_buffer and queue_ + CriticalSection crit_; + + // Network model that enforces bandwidth and capacity constraints + NetworkQueue network_; + size_t network_size_; + // The scheduled delivery time of the last packet sent on this socket. + // It is used to ensure ordered delivery of packets sent on this socket. + int64_t last_delivery_time_ = 0; + + // Data which has been received from the network + RecvBuffer recv_buffer_; + // The amount of data which is in flight or in recv_buffer_ + size_t recv_buffer_size_; + + // Is this socket bound? + bool bound_; + + // When we bind a socket to Any, VSS's Bind gives it another address. For + // dual-stack sockets, we want to distinguish between sockets that were + // explicitly given a particular address and sockets that had one picked + // for them by VSS. + bool was_any_; + + // Store the options that are set + OptionsMap options_map_; + + friend class VirtualSocketServer; +}; + +} // namespace rtc #endif // WEBRTC_BASE_VIRTUALSOCKETSERVER_H_ diff --git a/webrtc/rtc_base/weak_ptr.cc b/webrtc/base/weak_ptr.cc similarity index 100% rename from webrtc/rtc_base/weak_ptr.cc rename to webrtc/base/weak_ptr.cc diff --git a/webrtc/base/weak_ptr.h b/webrtc/base/weak_ptr.h index 282a551628..28789d014b 100644 --- a/webrtc/base/weak_ptr.h +++ b/webrtc/base/weak_ptr.h @@ -11,9 +11,262 @@ #ifndef WEBRTC_BASE_WEAK_PTR_H_ #define WEBRTC_BASE_WEAK_PTR_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/weak_ptr.h" +#include + +#include "webrtc/base/refcount.h" +#include "webrtc/base/scoped_ref_ptr.h" +#include "webrtc/base/sequenced_task_checker.h" + +// The implementation is borrowed from chromium except that it does not +// implement SupportsWeakPtr. + +// Weak pointers are pointers to an object that do not affect its lifetime, +// and which may be invalidated (i.e. reset to nullptr) by the object, or its +// owner, at any time, most commonly when the object is about to be deleted. + +// Weak pointers are useful when an object needs to be accessed safely by one +// or more objects other than its owner, and those callers can cope with the +// object vanishing and e.g. tasks posted to it being silently dropped. +// Reference-counting such an object would complicate the ownership graph and +// make it harder to reason about the object's lifetime. + +// EXAMPLE: +// +// class Controller { +// public: +// Controller() : weak_factory_(this) {} +// void SpawnWorker() { Worker::StartNew(weak_factory_.GetWeakPtr()); } +// void WorkComplete(const Result& result) { ... } +// private: +// // Member variables should appear before the WeakPtrFactory, to ensure +// // that any WeakPtrs to Controller are invalidated before its members +// // variable's destructors are executed, rendering them invalid. +// WeakPtrFactory weak_factory_; +// }; +// +// class Worker { +// public: +// static void StartNew(const WeakPtr& controller) { +// Worker* worker = new Worker(controller); +// // Kick off asynchronous processing... +// } +// private: +// Worker(const WeakPtr& controller) +// : controller_(controller) {} +// void DidCompleteAsynchronousProcessing(const Result& result) { +// if (controller_) +// controller_->WorkComplete(result); +// } +// WeakPtr controller_; +// }; +// +// With this implementation a caller may use SpawnWorker() to dispatch multiple +// Workers and subsequently delete the Controller, without waiting for all +// Workers to have completed. + +// ------------------------- IMPORTANT: Thread-safety ------------------------- + +// Weak pointers may be passed safely between threads, but must always be +// dereferenced and invalidated on the same TaskQueue or thread, otherwise +// checking the pointer would be racey. +// +// To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory +// is dereferenced, the factory and its WeakPtrs become bound to the calling +// TaskQueue/thread, and cannot be dereferenced or +// invalidated on any other TaskQueue/thread. Bound WeakPtrs can still be handed +// off to other TaskQueues, e.g. to use to post tasks back to object on the +// bound sequence. +// +// Thus, at least one WeakPtr object must exist and have been dereferenced on +// the correct thread to enforce that other WeakPtr objects will enforce they +// are used on the desired thread. + +namespace rtc { + +namespace internal { + +class WeakReference { + public: + // Although Flag is bound to a specific sequence, it may be + // deleted from another via base::WeakPtr::~WeakPtr(). + class Flag : public RefCountInterface { + public: + Flag(); + + void Invalidate(); + bool IsValid() const; + + private: + friend class RefCountedObject; + + ~Flag() override; + + SequencedTaskChecker checker_; + bool is_valid_; + }; + + WeakReference(); + explicit WeakReference(const Flag* flag); + ~WeakReference(); + + WeakReference(WeakReference&& other); + WeakReference(const WeakReference& other); + WeakReference& operator=(WeakReference&& other) = default; + WeakReference& operator=(const WeakReference& other) = default; + + bool is_valid() const; + + private: + scoped_refptr flag_; +}; + +class WeakReferenceOwner { + public: + WeakReferenceOwner(); + ~WeakReferenceOwner(); + + WeakReference GetRef() const; + + bool HasRefs() const { return flag_.get() && !flag_->HasOneRef(); } + + void Invalidate(); + + private: + SequencedTaskChecker checker_; + mutable scoped_refptr> flag_; +}; + +// This class simplifies the implementation of WeakPtr's type conversion +// constructor by avoiding the need for a public accessor for ref_. A +// WeakPtr cannot access the private members of WeakPtr, so this +// base class gives us a way to access ref_ in a protected fashion. +class WeakPtrBase { + public: + WeakPtrBase(); + ~WeakPtrBase(); + + WeakPtrBase(const WeakPtrBase& other) = default; + WeakPtrBase(WeakPtrBase&& other) = default; + WeakPtrBase& operator=(const WeakPtrBase& other) = default; + WeakPtrBase& operator=(WeakPtrBase&& other) = default; + + protected: + explicit WeakPtrBase(const WeakReference& ref); + + WeakReference ref_; +}; + +} // namespace internal + +template +class WeakPtrFactory; + +template +class WeakPtr : public internal::WeakPtrBase { + public: + WeakPtr() : ptr_(nullptr) {} + + // Allow conversion from U to T provided U "is a" T. Note that this + // is separate from the (implicit) copy and move constructors. + template + WeakPtr(const WeakPtr& other) + : internal::WeakPtrBase(other), ptr_(other.ptr_) {} + template + WeakPtr(WeakPtr&& other) + : internal::WeakPtrBase(std::move(other)), ptr_(other.ptr_) {} + + T* get() const { return ref_.is_valid() ? ptr_ : nullptr; } + + T& operator*() const { + RTC_DCHECK(get() != nullptr); + return *get(); + } + T* operator->() const { + RTC_DCHECK(get() != nullptr); + return get(); + } + + void reset() { + ref_ = internal::WeakReference(); + ptr_ = nullptr; + } + + // Allow conditionals to test validity, e.g. if (weak_ptr) {...}; + explicit operator bool() const { return get() != nullptr; } + + private: + template + friend class WeakPtr; + friend class WeakPtrFactory; + + WeakPtr(const internal::WeakReference& ref, T* ptr) + : internal::WeakPtrBase(ref), ptr_(ptr) {} + + // This pointer is only valid when ref_.is_valid() is true. Otherwise, its + // value is undefined (as opposed to nullptr). + T* ptr_; +}; + +// Allow callers to compare WeakPtrs against nullptr to test validity. +template +bool operator!=(const WeakPtr& weak_ptr, std::nullptr_t) { + return !(weak_ptr == nullptr); +} +template +bool operator!=(std::nullptr_t, const WeakPtr& weak_ptr) { + return weak_ptr != nullptr; +} +template +bool operator==(const WeakPtr& weak_ptr, std::nullptr_t) { + return weak_ptr.get() == nullptr; +} +template +bool operator==(std::nullptr_t, const WeakPtr& weak_ptr) { + return weak_ptr == nullptr; +} + +// A class may be composed of a WeakPtrFactory and thereby +// control how it exposes weak pointers to itself. This is helpful if you only +// need weak pointers within the implementation of a class. This class is also +// useful when working with primitive types. For example, you could have a +// WeakPtrFactory that is used to pass around a weak reference to a bool. + +// Note that GetWeakPtr must be called on one and only one TaskQueue or thread +// and the WeakPtr must only be dereferenced and invalidated on that same +// TaskQueue/thread. A WeakPtr instance can be copied and posted to other +// sequences though as long as it is not dereferenced (WeakPtr::get()). +template +class WeakPtrFactory { + public: + explicit WeakPtrFactory(T* ptr) : ptr_(ptr) {} + + ~WeakPtrFactory() { ptr_ = nullptr; } + + WeakPtr GetWeakPtr() { + RTC_DCHECK(ptr_); + return WeakPtr(weak_reference_owner_.GetRef(), ptr_); + } + + // Call this method to invalidate all existing weak pointers. + void InvalidateWeakPtrs() { + RTC_DCHECK(ptr_); + weak_reference_owner_.Invalidate(); + } + + // Call this method to determine if any weak pointers exist. + bool HasWeakPtrs() const { + RTC_DCHECK(ptr_); + return weak_reference_owner_.HasRefs(); + } + + private: + internal::WeakReferenceOwner weak_reference_owner_; + T* ptr_; + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WeakPtrFactory); +}; + +} // namespace rtc #endif // WEBRTC_BASE_WEAK_PTR_H_ diff --git a/webrtc/rtc_base/weak_ptr_unittest.cc b/webrtc/base/weak_ptr_unittest.cc similarity index 100% rename from webrtc/rtc_base/weak_ptr_unittest.cc rename to webrtc/base/weak_ptr_unittest.cc diff --git a/webrtc/rtc_base/win32.cc b/webrtc/base/win32.cc similarity index 100% rename from webrtc/rtc_base/win32.cc rename to webrtc/base/win32.cc diff --git a/webrtc/base/win32.h b/webrtc/base/win32.h index 413bd11cab..ad8a43d453 100644 --- a/webrtc/base/win32.h +++ b/webrtc/base/win32.h @@ -11,9 +11,118 @@ #ifndef WEBRTC_BASE_WIN32_H_ #define WEBRTC_BASE_WIN32_H_ +#if defined(WEBRTC_WIN) -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/win32.h" +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +// Make sure we don't get min/max macros +#ifndef NOMINMAX +#define NOMINMAX +#endif + +#include +#include + +#ifndef SECURITY_MANDATORY_LABEL_AUTHORITY +// Add defines that we use if we are compiling against older sdks +#define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L) +#define TokenIntegrityLevel static_cast(0x19) +typedef struct _TOKEN_MANDATORY_LABEL { + SID_AND_ATTRIBUTES Label; +} TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL; +#endif // SECURITY_MANDATORY_LABEL_AUTHORITY + +#undef SetPort + +#include + +#include "webrtc/base/stringutils.h" +#include "webrtc/base/basictypes.h" + +namespace rtc { + +const char* win32_inet_ntop(int af, const void *src, char* dst, socklen_t size); +int win32_inet_pton(int af, const char* src, void *dst); + +inline std::wstring ToUtf16(const char* utf8, size_t len) { + int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast(len), + nullptr, 0); + wchar_t* ws = STACK_ARRAY(wchar_t, len16); + ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast(len), ws, len16); + return std::wstring(ws, len16); +} + +inline std::wstring ToUtf16(const std::string& str) { + return ToUtf16(str.data(), str.length()); +} + +inline std::string ToUtf8(const wchar_t* wide, size_t len) { + int len8 = ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast(len), + nullptr, 0, nullptr, nullptr); + char* ns = STACK_ARRAY(char, len8); + ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast(len), ns, len8, + nullptr, nullptr); + return std::string(ns, len8); +} + +inline std::string ToUtf8(const wchar_t* wide) { + return ToUtf8(wide, wcslen(wide)); +} + +inline std::string ToUtf8(const std::wstring& wstr) { + return ToUtf8(wstr.data(), wstr.length()); +} + +// Convert FILETIME to time_t +void FileTimeToUnixTime(const FILETIME& ft, time_t* ut); + +// Convert time_t to FILETIME +void UnixTimeToFileTime(const time_t& ut, FILETIME * ft); + +// Convert a Utf8 path representation to a non-length-limited Unicode pathname. +bool Utf8ToWindowsFilename(const std::string& utf8, std::wstring* filename); + +// Convert a FILETIME to a UInt64 +inline uint64_t ToUInt64(const FILETIME& ft) { + ULARGE_INTEGER r = {{ft.dwLowDateTime, ft.dwHighDateTime}}; + return r.QuadPart; +} + +enum WindowsMajorVersions { + kWindows2000 = 5, + kWindowsVista = 6, +}; +bool GetOsVersion(int* major, int* minor, int* build); + +inline bool IsWindowsVistaOrLater() { + int major; + return (GetOsVersion(&major, nullptr, nullptr) && major >= kWindowsVista); +} + +inline bool IsWindowsXpOrLater() { + int major, minor; + return (GetOsVersion(&major, &minor, nullptr) && + (major >= kWindowsVista || (major == kWindows2000 && minor >= 1))); +} + +inline bool IsWindows8OrLater() { + int major, minor; + return (GetOsVersion(&major, &minor, nullptr) && + (major > kWindowsVista || (major == kWindowsVista && minor >= 2))); +} + +// Determine the current integrity level of the process. +bool GetCurrentProcessIntegrityLevel(int* level); + +inline bool IsCurrentProcessLowIntegrity() { + int level; + return (GetCurrentProcessIntegrityLevel(&level) && + level < SECURITY_MANDATORY_MEDIUM_RID); +} + +} // namespace rtc + +#endif // WEBRTC_WIN #endif // WEBRTC_BASE_WIN32_H_ diff --git a/webrtc/rtc_base/win32_unittest.cc b/webrtc/base/win32_unittest.cc similarity index 100% rename from webrtc/rtc_base/win32_unittest.cc rename to webrtc/base/win32_unittest.cc diff --git a/webrtc/rtc_base/win32filesystem.cc b/webrtc/base/win32filesystem.cc similarity index 100% rename from webrtc/rtc_base/win32filesystem.cc rename to webrtc/base/win32filesystem.cc diff --git a/webrtc/base/win32filesystem.h b/webrtc/base/win32filesystem.h index d647c440f0..566cbaff9f 100644 --- a/webrtc/base/win32filesystem.h +++ b/webrtc/base/win32filesystem.h @@ -8,12 +8,57 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_BASE_WIN32FILESYSTEM_H_ -#define WEBRTC_BASE_WIN32FILESYSTEM_H_ +#ifndef _WEBRTC_BASE_WIN32FILESYSTEM_H__ +#define _WEBRTC_BASE_WIN32FILESYSTEM_H__ +#include "fileutils.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/win32filesystem.h" +namespace rtc { -#endif // WEBRTC_BASE_WIN32FILESYSTEM_H_ +class Win32Filesystem : public FilesystemInterface { + public: + // This will attempt to delete the path located at filename. + // If the path points to a folder, it will fail with VERIFY + bool DeleteFile(const Pathname& filename) override; + + // Creates a directory. This will call itself recursively to create /foo/bar even if + // /foo does not exist. + // Returns TRUE if function succeeds + bool CreateFolder(const Pathname& pathname) override; + + // This moves a file from old_path to new_path. If the new path is on a + // different volume than the old, it will attempt to copy and then delete + // the folder + // Returns true if the file is successfully moved + bool MoveFile(const Pathname& old_path, const Pathname& new_path) override; + + // Returns true if a pathname is a directory + bool IsFolder(const Pathname& pathname) override; + + // Returns true if a file exists at path + bool IsFile(const Pathname& path) override; + + // Returns true if pathname refers to no filesystem object, every parent + // directory either exists, or is also absent. + bool IsAbsent(const Pathname& pathname) override; + + // All of the following functions set pathname and return true if successful. + // Returned paths always include a trailing backslash. + // If create is true, the path will be recursively created. + // If append is non-null, it will be appended (and possibly created). + + std::string TempFilename(const Pathname& dir, + const std::string& prefix) override; + + bool GetFileSize(const Pathname& path, size_t* size) override; + + // A folder appropriate for storing temporary files (Contents are + // automatically deleted when the program exists) + bool GetTemporaryFolder(Pathname& path, + bool create, + const std::string* append) override; +}; + +} // namespace rtc + +#endif // WEBRTC_WINFILESYSTEM_H__ diff --git a/webrtc/rtc_base/win32securityerrors.cc b/webrtc/base/win32securityerrors.cc similarity index 100% rename from webrtc/rtc_base/win32securityerrors.cc rename to webrtc/base/win32securityerrors.cc diff --git a/webrtc/rtc_base/win32socketinit.cc b/webrtc/base/win32socketinit.cc similarity index 100% rename from webrtc/rtc_base/win32socketinit.cc rename to webrtc/base/win32socketinit.cc diff --git a/webrtc/base/win32socketinit.h b/webrtc/base/win32socketinit.h index d7017e1387..46d27cba05 100644 --- a/webrtc/base/win32socketinit.h +++ b/webrtc/base/win32socketinit.h @@ -11,9 +11,10 @@ #ifndef WEBRTC_BASE_WIN32SOCKETINIT_H_ #define WEBRTC_BASE_WIN32SOCKETINIT_H_ +namespace rtc { -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/win32socketinit.h" +void EnsureWinsockInit(); + +} // namespace rtc #endif // WEBRTC_BASE_WIN32SOCKETINIT_H_ diff --git a/webrtc/rtc_base/win32socketserver.cc b/webrtc/base/win32socketserver.cc similarity index 100% rename from webrtc/rtc_base/win32socketserver.cc rename to webrtc/base/win32socketserver.cc diff --git a/webrtc/base/win32socketserver.h b/webrtc/base/win32socketserver.h index c14369295b..146b4e2e6a 100644 --- a/webrtc/base/win32socketserver.h +++ b/webrtc/base/win32socketserver.h @@ -11,9 +11,152 @@ #ifndef WEBRTC_BASE_WIN32SOCKETSERVER_H_ #define WEBRTC_BASE_WIN32SOCKETSERVER_H_ +#if defined(WEBRTC_WIN) +#include "webrtc/base/asyncsocket.h" +#include "webrtc/base/criticalsection.h" +#include "webrtc/base/messagequeue.h" +#include "webrtc/base/socketserver.h" +#include "webrtc/base/socketfactory.h" +#include "webrtc/base/socket.h" +#include "webrtc/base/thread.h" +#include "webrtc/base/win32window.h" -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/win32socketserver.h" +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// +// Win32Socket +/////////////////////////////////////////////////////////////////////////////// + +class Win32Socket : public AsyncSocket { + public: + Win32Socket(); + virtual ~Win32Socket(); + + bool CreateT(int family, int type); + + int Attach(SOCKET s); + void SetTimeout(int ms); + + // AsyncSocket Interface + virtual SocketAddress GetLocalAddress() const; + virtual SocketAddress GetRemoteAddress() const; + virtual int Bind(const SocketAddress& addr); + virtual int Connect(const SocketAddress& addr); + virtual int Send(const void *buffer, size_t length); + virtual int SendTo(const void *buffer, size_t length, const SocketAddress& addr); + virtual int Recv(void* buffer, size_t length, int64_t* timestamp); + virtual int RecvFrom(void* buffer, + size_t length, + SocketAddress* out_addr, + int64_t* timestamp); + virtual int Listen(int backlog); + virtual Win32Socket *Accept(SocketAddress *out_addr); + virtual int Close(); + virtual int GetError() const; + virtual void SetError(int error); + virtual ConnState GetState() const; + virtual int GetOption(Option opt, int* value); + virtual int SetOption(Option opt, int value); + + private: + void CreateSink(); + bool SetAsync(int events); + int DoConnect(const SocketAddress& addr); + bool HandleClosed(int close_error); + void PostClosed(); + void UpdateLastError(); + static int TranslateOption(Option opt, int* slevel, int* sopt); + + void OnSocketNotify(SOCKET socket, int event, int error); + void OnDnsNotify(HANDLE task, int error); + + SOCKET socket_; + int error_; + ConnState state_; + SocketAddress addr_; // address that we connected to (see DoConnect) + uint32_t connect_time_; + bool closing_; + int close_error_; + + class EventSink; + friend class EventSink; + EventSink * sink_; + + struct DnsLookup; + DnsLookup * dns_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// Win32SocketServer +/////////////////////////////////////////////////////////////////////////////// + +class Win32SocketServer : public SocketServer { + public: + Win32SocketServer(); + virtual ~Win32SocketServer(); + + void set_modeless_dialog(HWND hdlg) { + hdlg_ = hdlg; + } + + // SocketServer Interface + virtual Socket* CreateSocket(int type); + virtual Socket* CreateSocket(int family, int type); + + virtual AsyncSocket* CreateAsyncSocket(int type); + virtual AsyncSocket* CreateAsyncSocket(int family, int type); + + virtual void SetMessageQueue(MessageQueue* queue); + virtual bool Wait(int cms, bool process_io); + virtual void WakeUp(); + + void Pump(); + + HWND handle() { return wnd_.handle(); } + + private: + class MessageWindow : public Win32Window { + public: + explicit MessageWindow(Win32SocketServer* ss) : ss_(ss) {} + private: + virtual bool OnMessage(UINT msg, WPARAM wp, LPARAM lp, LRESULT& result); + Win32SocketServer* ss_; + }; + + static const TCHAR kWindowName[]; + MessageQueue *message_queue_; + MessageWindow wnd_; + CriticalSection cs_; + bool posted_; + HWND hdlg_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// Win32Thread. Automatically pumps Windows messages. +/////////////////////////////////////////////////////////////////////////////// + +class Win32Thread : public Thread { + public: + explicit Win32Thread(SocketServer* ss) : Thread(ss), id_(0) {} + virtual ~Win32Thread() { + Stop(); + } + virtual void Run() { + id_ = GetCurrentThreadId(); + Thread::Run(); + id_ = 0; + } + virtual void Quit() { + PostThreadMessage(id_, WM_QUIT, 0, 0); + } + private: + DWORD id_; +}; + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace rtc + +#endif // WEBRTC_WIN #endif // WEBRTC_BASE_WIN32SOCKETSERVER_H_ diff --git a/webrtc/rtc_base/win32socketserver_unittest.cc b/webrtc/base/win32socketserver_unittest.cc similarity index 100% rename from webrtc/rtc_base/win32socketserver_unittest.cc rename to webrtc/base/win32socketserver_unittest.cc diff --git a/webrtc/rtc_base/win32window.cc b/webrtc/base/win32window.cc similarity index 100% rename from webrtc/rtc_base/win32window.cc rename to webrtc/base/win32window.cc diff --git a/webrtc/base/win32window.h b/webrtc/base/win32window.h index ffffdf9aa7..c0ba6b23d2 100644 --- a/webrtc/base/win32window.h +++ b/webrtc/base/win32window.h @@ -11,9 +11,50 @@ #ifndef WEBRTC_BASE_WIN32WINDOW_H_ #define WEBRTC_BASE_WIN32WINDOW_H_ +#if defined(WEBRTC_WIN) -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/win32window.h" +#include "webrtc/base/win32.h" + +namespace rtc { + +/////////////////////////////////////////////////////////////////////////////// +// Win32Window +/////////////////////////////////////////////////////////////////////////////// + +class Win32Window { + public: + Win32Window(); + virtual ~Win32Window(); + + HWND handle() const { return wnd_; } + + bool Create(HWND parent, const wchar_t* title, DWORD style, DWORD exstyle, + int x, int y, int cx, int cy); + void Destroy(); + + // Call this when your DLL unloads. + static void Shutdown(); + + protected: + virtual bool OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, + LRESULT& result); + + virtual bool OnClose() { return true; } + virtual void OnNcDestroy() { } + + private: + static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, + LPARAM lParam); + + HWND wnd_; + static HINSTANCE instance_; + static ATOM window_class_; +}; + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace rtc + +#endif // WEBRTC_WIN #endif // WEBRTC_BASE_WIN32WINDOW_H_ diff --git a/webrtc/rtc_base/win32window_unittest.cc b/webrtc/base/win32window_unittest.cc similarity index 100% rename from webrtc/rtc_base/win32window_unittest.cc rename to webrtc/base/win32window_unittest.cc diff --git a/webrtc/base/window.h b/webrtc/base/window.h index d515f7c829..a4a9aa4465 100644 --- a/webrtc/base/window.h +++ b/webrtc/base/window.h @@ -11,9 +11,68 @@ #ifndef WEBRTC_BASE_WINDOW_H_ #define WEBRTC_BASE_WINDOW_H_ +#include -// This header is deprecated and is just left here temporarily during -// refactoring. See https://bugs.webrtc.org/7634 for more details. -#include "webrtc/rtc_base/window.h" +#include "webrtc/base/stringencode.h" + +// Define platform specific window types. +#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) +typedef unsigned long Window; // Avoid include . +#elif defined(WEBRTC_WIN) +// We commonly include win32.h in webrtc/base so just include it here. +#include "webrtc/base/win32.h" // Include HWND, HMONITOR. +#elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) +typedef unsigned int CGWindowID; +typedef unsigned int CGDirectDisplayID; +#endif + +namespace rtc { + +class WindowId { + public: + // Define WindowT for each platform. +#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) + typedef Window WindowT; +#elif defined(WEBRTC_WIN) + typedef HWND WindowT; +#elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) + typedef CGWindowID WindowT; +#else + typedef unsigned int WindowT; +#endif + + static WindowId Cast(uint64_t id) { +#if defined(WEBRTC_WIN) + return WindowId(reinterpret_cast(id)); +#else + return WindowId(static_cast(id)); +#endif + } + + static uint64_t Format(const WindowT& id) { +#if defined(WEBRTC_WIN) + return static_cast(reinterpret_cast(id)); +#else + return static_cast(id); +#endif + } + + WindowId() : id_(0) {} + WindowId(const WindowT& id) : id_(id) {} // NOLINT + const WindowT& id() const { return id_; } + bool IsValid() const { return id_ != 0; } + bool Equals(const WindowId& other) const { + return id_ == other.id(); + } + + private: + WindowT id_; +}; + +inline std::string ToString(const WindowId& window) { + return ToString(window.id()); +} + +} // namespace rtc #endif // WEBRTC_BASE_WINDOW_H_ diff --git a/webrtc/examples/BUILD.gn b/webrtc/examples/BUILD.gn index ccdc21e232..de0e8c158c 100644 --- a/webrtc/examples/BUILD.gn +++ b/webrtc/examples/BUILD.gn @@ -58,7 +58,7 @@ if (is_android) { ":AppRTCMobile_javalib", ":AppRTCMobile_resources", "//base:base_java", - "//webrtc/rtc_base:base_java", + "//webrtc/base:base_java", ] shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ] @@ -94,9 +94,9 @@ if (is_android) { deps = [ ":AppRTCMobile_resources", + "//webrtc/base:base_java", "//webrtc/examples/androidapp/third_party/autobanh:autobanh_java", "//webrtc/modules/audio_device:audio_device_java", - "//webrtc/rtc_base:base_java", "//webrtc/sdk/android:libjingle_peerconnection_java", "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java", ] diff --git a/webrtc/modules/audio_device/BUILD.gn b/webrtc/modules/audio_device/BUILD.gn index c565165192..c737ac3cd5 100644 --- a/webrtc/modules/audio_device/BUILD.gn +++ b/webrtc/modules/audio_device/BUILD.gn @@ -355,7 +355,7 @@ if (!build_with_chromium && is_android) { "android/java/src/org/webrtc/voiceengine/WebRtcAudioUtils.java", ] deps = [ - "//webrtc/rtc_base:base_java", + "//webrtc/base:base_java", ] } } diff --git a/webrtc/rtc_base/BUILD.gn b/webrtc/rtc_base/BUILD.gn index 851973b15a..3f88717e96 100644 --- a/webrtc/rtc_base/BUILD.gn +++ b/webrtc/rtc_base/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. +# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source @@ -6,1035 +6,28 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. -import("//build/config/crypto.gni") -import("//build/config/ui.gni") import("../webrtc.gni") if (is_android) { import("//build/config/android/config.gni") import("//build/config/android/rules.gni") } -if (is_win) { - import("//build/config/clang/clang.gni") -} -group("base") { - public_deps = [ - ":rtc_base", - ":rtc_base_approved", - ":rtc_task_queue", - ":sequenced_task_checker", - ":weak_ptr", - ] +group("rtc_base") { + public_deps = [] if (is_android) { public_deps += [ ":base_java" ] } } -config("rtc_base_approved_all_dependent_config") { - if (is_mac && !build_with_chromium) { - libs = [ "Foundation.framework" ] # needed for logging_mac.mm - } -} - -config("rtc_base_chromium_config") { - defines = [ "NO_MAIN_THREAD_WRAPPING" ] -} - -config("rtc_base_all_dependent_config") { - if (is_ios) { - libs = [ - "CFNetwork.framework", - "Security.framework", - "SystemConfiguration.framework", - "UIKit.framework", - ] - } - if (is_mac) { - libs = [ - "Cocoa.framework", - "Foundation.framework", - "IOKit.framework", - "Security.framework", - "SystemConfiguration.framework", - ] - } -} - -if (!rtc_build_ssl) { - config("external_ssl_library") { - assert(rtc_ssl_root != "", - "You must specify rtc_ssl_root when rtc_build_ssl==0.") - include_dirs = [ rtc_ssl_root ] - } -} - -source_set("protobuf_utils") { - sources = [ - "protobuf_utils.h", - ] - if (rtc_enable_protobuf) { - public_deps = [ - "//third_party/protobuf:protobuf_lite", - ] - } -} - -source_set("compile_assert_c") { - sources = [ - "compile_assert_c.h", - ] -} - -# The subset of rtc_base approved for use outside of libjingle. -rtc_static_library("rtc_base_approved") { - # TODO(kjellander): Remove (bugs.webrtc.org/7480) - # Enabling GN check triggers a cyclic dependency caused by rate_limiter.cc: - # :rtc_base_approved -> //webrtc/system_wrappers -> :rtc_base_approved - check_includes = false - defines = [] - libs = [] - deps = [] - all_dependent_configs = [ ":rtc_base_approved_all_dependent_config" ] - - sources = [ - "array_view.h", - "arraysize.h", - "atomicops.h", - "base64.cc", - "base64.h", - "basictypes.h", - "bind.h", - "bitbuffer.cc", - "bitbuffer.h", - "buffer.h", - "bufferqueue.cc", - "bufferqueue.h", - "bytebuffer.cc", - "bytebuffer.h", - "byteorder.h", - "checks.cc", - "checks.h", - "constructormagic.h", - "copyonwritebuffer.cc", - "copyonwritebuffer.h", - "criticalsection.cc", - "criticalsection.h", - "deprecation.h", - "event.cc", - "event.h", - "event_tracer.cc", - "event_tracer.h", - "file.cc", - "file.h", - "flags.cc", - "flags.h", - "format_macros.h", - "function_view.h", - "ignore_wundef.h", - "location.cc", - "location.h", - "mod_ops.h", - "onetimeevent.h", - "optional.cc", - "optional.h", - "pathutils.cc", - "pathutils.h", - "platform_file.cc", - "platform_file.h", - "platform_thread.cc", - "platform_thread.h", - "platform_thread_types.h", - "ptr_util.h", - "race_checker.cc", - "race_checker.h", - "random.cc", - "random.h", - "rate_limiter.cc", - "rate_limiter.h", - "rate_statistics.cc", - "rate_statistics.h", - "ratetracker.cc", - "ratetracker.h", - "refcount.h", - "refcountedobject.h", - "safe_compare.h", - "safe_conversions.h", - "safe_conversions_impl.h", - "safe_minmax.h", - "sanitizer.h", - "scoped_ref_ptr.h", - "string_to_number.cc", - "string_to_number.h", - "stringencode.cc", - "stringencode.h", - "stringize_macros.h", - "stringutils.cc", - "stringutils.h", - "swap_queue.h", - "template_util.h", - "thread_annotations.h", - "thread_checker.h", - "thread_checker_impl.cc", - "thread_checker_impl.h", - "timestampaligner.cc", - "timestampaligner.h", - "timeutils.cc", - "timeutils.h", - "trace_event.h", - "type_traits.h", - ] - - deps += [ "..:webrtc_common" ] - - if (is_android) { - libs += [ "log" ] - } - - if (is_posix) { - sources += [ "file_posix.cc" ] - } - - if (is_win) { - sources += [ "file_win.cc" ] - } - - if (build_with_chromium) { - # Dependency on chromium's logging (in //base). - deps += [ "//base:base" ] - sources += [ - "../../webrtc_overrides/webrtc/base/logging.cc", - "../../webrtc_overrides/webrtc/base/logging.h", - ] - } else { - sources += [ - "logging.cc", - "logging.h", - "logging_mac.mm", - ] - } - if (is_component_build && is_win) { - # Copy the VS runtime DLLs into the isolate so that they don't have to be - # preinstalled on the target machine. The debug runtimes have a "d" at - # the end. - # This is a copy of https://codereview.chromium.org/1783973002. - # TODO(ehmaldonado): We'd like Chromium to make this changes easier to use, - # so we don't have to copy their changes and risk breakages. - # See http://crbug.com/653569 - if (is_debug) { - vcrt_suffix = "d" - } else { - vcrt_suffix = "" - } - - # These runtime files are copied to the output directory by the - # vs_toolchain script that runs as part of toolchain configuration. - data = [ - "$root_out_dir/msvcp140${vcrt_suffix}.dll", - "$root_out_dir/vccorlib140${vcrt_suffix}.dll", - "$root_out_dir/vcruntime140${vcrt_suffix}.dll", - - # Universal Windows 10 CRT files - "$root_out_dir/api-ms-win-core-console-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-datetime-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-debug-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-errorhandling-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-file-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-file-l1-2-0.dll", - "$root_out_dir/api-ms-win-core-file-l2-1-0.dll", - "$root_out_dir/api-ms-win-core-handle-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-heap-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-interlocked-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-libraryloader-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-localization-l1-2-0.dll", - "$root_out_dir/api-ms-win-core-memory-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-namedpipe-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-processenvironment-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-processthreads-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-processthreads-l1-1-1.dll", - "$root_out_dir/api-ms-win-core-profile-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-rtlsupport-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-string-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-synch-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-synch-l1-2-0.dll", - "$root_out_dir/api-ms-win-core-sysinfo-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-timezone-l1-1-0.dll", - "$root_out_dir/api-ms-win-core-util-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-conio-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-convert-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-environment-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-filesystem-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-heap-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-locale-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-math-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-multibyte-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-private-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-process-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-runtime-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-stdio-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-string-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-time-l1-1-0.dll", - "$root_out_dir/api-ms-win-crt-utility-l1-1-0.dll", - "$root_out_dir/ucrtbase${vcrt_suffix}.dll", - ] - if (is_asan) { - if (current_cpu == "x64") { - data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-x86_64.dll" ] - } else { - data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-i386.dll" ] - } - } - } - if (is_nacl) { - deps += [ "//native_client_sdk/src/libraries/nacl_io" ] - } -} - -config("enable_libevent_config") { - defines = [ "WEBRTC_BUILD_LIBEVENT" ] -} - -rtc_static_library("rtc_task_queue") { - public_deps = [ - ":rtc_base_approved", - ] - - if (build_with_chromium) { - sources = [ - "../../webrtc_overrides/webrtc/base/task_queue.cc", - "../../webrtc_overrides/webrtc/base/task_queue.h", - ] - } else { - sources = [ - "task_queue.h", - "task_queue_posix.h", - ] - if (rtc_build_libevent) { - deps = [ - "//base/third_party/libevent", - ] - } - - if (rtc_enable_libevent) { - sources += [ - "task_queue_libevent.cc", - "task_queue_posix.cc", - ] - all_dependent_configs = [ ":enable_libevent_config" ] - } else { - if (is_mac || is_ios) { - sources += [ - "task_queue_gcd.cc", - "task_queue_posix.cc", - ] - } - if (is_win) { - sources += [ "task_queue_win.cc" ] - } - } - } -} - -rtc_static_library("sequenced_task_checker") { - sources = [ - "sequenced_task_checker.h", - "sequenced_task_checker_impl.cc", - "sequenced_task_checker_impl.h", - ] - deps = [ - ":rtc_task_queue", - ] -} - -rtc_static_library("weak_ptr") { - sources = [ - "weak_ptr.cc", - "weak_ptr.h", - ] - deps = [ - ":rtc_base_approved", - ":sequenced_task_checker", - ] -} - -rtc_static_library("rtc_numerics") { - sources = [ - "numerics/exp_filter.cc", - "numerics/exp_filter.h", - "numerics/percentile_filter.h", - ] - deps = [ - ":rtc_base_approved", - ] -} - -config("rtc_base_warnings_config") { - if (is_win && is_clang) { - cflags = [ - # Disable warnings failing when compiling with Clang on Windows. - # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 - "-Wno-sign-compare", - "-Wno-missing-braces", - ] - } -} - -rtc_source_set("rtc_json") { - defines = [] - sources = [ - "json.cc", - "json.h", - ] - if (rtc_build_json) { - public_deps = [ - "//third_party/jsoncpp", - ] - } else { - include_dirs = [ "$rtc_jsoncpp_root" ] - - # When defined changes the include path for json.h to where it is - # expected to be when building json outside of the standalone build. - defines += [ "WEBRTC_EXTERNAL_JSON" ] - } -} - -rtc_static_library("rtc_base") { - cflags = [] - cflags_cc = [] - libs = [] - defines = [] - deps = [ - "..:webrtc_common", - ] - public_deps = [ - ":rtc_base_approved", - ] - public_configs = [] - - all_dependent_configs = [ ":rtc_base_all_dependent_config" ] - - sources = [ - "applefilesystem.mm", - "asyncinvoker-inl.h", - "asyncinvoker.cc", - "asyncinvoker.h", - "asyncpacketsocket.cc", - "asyncpacketsocket.h", - "asyncresolverinterface.cc", - "asyncresolverinterface.h", - "asyncsocket.cc", - "asyncsocket.h", - "asynctcpsocket.cc", - "asynctcpsocket.h", - "asyncudpsocket.cc", - "asyncudpsocket.h", - "crc32.cc", - "crc32.h", - "cryptstring.cc", - "cryptstring.h", - "filerotatingstream.cc", - "filerotatingstream.h", - "fileutils.cc", - "fileutils.h", - "gunit_prod.h", - "helpers.cc", - "helpers.h", - "httpbase.cc", - "httpbase.h", - "httpcommon-inl.h", - "httpcommon.cc", - "httpcommon.h", - "ipaddress.cc", - "ipaddress.h", - "messagedigest.cc", - "messagedigest.h", - "messagehandler.cc", - "messagehandler.h", - "messagequeue.cc", - "messagequeue.h", - "nethelpers.cc", - "nethelpers.h", - "network.cc", - "network.h", - "networkmonitor.cc", - "networkmonitor.h", - "nullsocketserver.cc", - "nullsocketserver.h", - "openssl.h", - "openssladapter.cc", - "openssladapter.h", - "openssldigest.cc", - "openssldigest.h", - "opensslidentity.cc", - "opensslidentity.h", - "opensslstreamadapter.cc", - "opensslstreamadapter.h", - "physicalsocketserver.cc", - "physicalsocketserver.h", - "proxyinfo.cc", - "proxyinfo.h", - "ratelimiter.cc", - "ratelimiter.h", - "rtccertificate.cc", - "rtccertificate.h", - "rtccertificategenerator.cc", - "rtccertificategenerator.h", - "signalthread.cc", - "signalthread.h", - "sigslot.cc", - "sigslot.h", - "socket.h", - "socketadapters.cc", - "socketadapters.h", - "socketaddress.cc", - "socketaddress.h", - "socketaddresspair.cc", - "socketaddresspair.h", - "socketfactory.h", - "socketserver.h", - "socketstream.cc", - "socketstream.h", - "ssladapter.cc", - "ssladapter.h", - "sslfingerprint.cc", - "sslfingerprint.h", - "sslidentity.cc", - "sslidentity.h", - "sslstreamadapter.cc", - "sslstreamadapter.h", - "stream.cc", - "stream.h", - "thread.cc", - "thread.h", - ] - - # TODO(henrike): issue 3307, make rtc_base build with the Chromium default - # compiler settings. - suppressed_configs += [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - if (!is_win) { - cflags += [ "-Wno-uninitialized" ] - } - - if (build_with_chromium) { - if (is_win) { - sources += [ "../../webrtc_overrides/webrtc/base/win32socketinit.cc" ] - } - include_dirs = [ "../../boringssl/src/include" ] - public_configs += [ ":rtc_base_chromium_config" ] - } else { - configs += [ ":rtc_base_warnings_config" ] - sources += [ - "callback.h", - "logsinks.cc", - "logsinks.h", - "mathutils.h", - "optionsfile.cc", - "optionsfile.h", - "rollingaccumulator.h", - "sslroots.h", - "transformadapter.cc", - "transformadapter.h", - "window.h", - ] - - if (is_win) { - sources += [ - "win32socketinit.cc", - "win32socketinit.h", - "win32socketserver.cc", - "win32socketserver.h", - ] - } - } # !build_with_chromium - - if (rtc_build_ssl) { - deps += [ "//third_party/boringssl" ] - } else { - configs += [ ":external_ssl_library" ] - } - - if (is_android) { - sources += [ - "ifaddrs-android.cc", - "ifaddrs-android.h", - ] - - libs += [ - "log", - "GLESv2", - ] - } - - if (is_ios || is_mac) { - sources += [ - "macifaddrs_converter.cc", - "thread_darwin.mm", - ] - } - - if (use_x11) { - libs += [ - "dl", - "rt", - "Xext", - "X11", - "Xcomposite", - "Xrender", - ] - } - - if (is_linux) { - libs += [ - "dl", - "rt", - ] - } - - if (is_mac) { - sources += [ - "macutils.cc", - "macutils.h", - ] - libs += [ - # For ProcessInformationCopyDictionary in unixfilesystem.cc. - "ApplicationServices.framework", - ] - } - - if (is_win) { - sources += [ - "win32.cc", - "win32.h", - "win32filesystem.cc", - "win32filesystem.h", - "win32securityerrors.cc", - "win32window.cc", - "win32window.h", - ] - - libs += [ - "crypt32.lib", - "iphlpapi.lib", - "secur32.lib", - ] - - cflags += [ - # Suppress warnings about WIN32_LEAN_AND_MEAN. - "/wd4005", - "/wd4703", - ] - - defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ] - } - - if (is_posix) { - sources += [ - "ifaddrs_converter.cc", - "ifaddrs_converter.h", - "unixfilesystem.cc", - "unixfilesystem.h", - ] - } - - if (is_nacl) { - deps += [ "//native_client_sdk/src/libraries/nacl_io" ] - defines += [ "timezone=_timezone" ] - sources -= [ "ifaddrs_converter.cc" ] - } - if (is_win && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } -} - -rtc_source_set("gtest_prod") { - sources = [ - "gtest_prod_util.h", - ] -} - -config("rtc_base_tests_utils_exported_config") { - defines = [ "GTEST_RELATIVE_PATH" ] -} - -config("rtc_base_tests_utils_warnings_config") { - if (is_win && is_clang) { - cflags = [ - # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6270 - "-Wno-reorder", - "-Wno-sign-compare", - ] - } -} - -rtc_source_set("rtc_base_tests_utils") { - testonly = true - sources = [ - # Also use this as a convenient dumping ground for misc files that are - # included by multiple targets below. - "cpu_time.cc", - "cpu_time.h", - "fakeclock.cc", - "fakeclock.h", - "fakenetwork.h", - "fakesslidentity.h", - "firewallsocketserver.cc", - "firewallsocketserver.h", - "gunit.h", - "httpserver.cc", - "httpserver.h", - "md5.cc", - "md5.h", - "md5digest.cc", - "md5digest.h", - "memory_usage.cc", - "memory_usage.h", - "natserver.cc", - "natserver.h", - "natsocketfactory.cc", - "natsocketfactory.h", - "nattypes.cc", - "nattypes.h", - "proxyserver.cc", - "proxyserver.h", - "sha1.cc", - "sha1.h", - "sha1digest.cc", - "sha1digest.h", - "sigslottester.h", - "sigslottester.h.pump", - "testbase64.h", - "testclient.cc", - "testclient.h", - "testechoserver.h", - "testutils.h", - "timedelta.h", - "virtualsocketserver.cc", - "virtualsocketserver.h", - ] - configs += [ ":rtc_base_tests_utils_warnings_config" ] - public_configs = [ ":rtc_base_tests_utils_exported_config" ] - deps = [ - ":rtc_base", - "../test:field_trial", - "../test:test_support", - ] - public_deps = [ - "//testing/gmock", - "//testing/gtest", - ] - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } -} - -if (rtc_include_tests) { - rtc_source_set("rtc_base_tests_main") { - testonly = true - sources = [ - "unittest_main.cc", - ] - public_configs = [ ":rtc_base_tests_utils_exported_config" ] - deps = [ - ":rtc_base", - ":rtc_base_approved", - ":rtc_base_tests_utils", - "../test:field_trial", - "../test:test_support", - ] - - public_deps = [ - "//testing/gmock", - "//testing/gtest", - ] - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - } - - rtc_source_set("rtc_base_nonparallel_tests") { - testonly = true - - # Skip restricting visibility on mobile platforms since the tests on those - # gets additional generated targets which would require many lines here to - # cover (which would be confusing to read and hard to maintain). - if (!is_android && !is_ios) { - # TODO(kjellander): Reenable after finishing https://bugs.webrtc.org/7634. - #visibility = [ "//webrtc:webrtc_nonparallel_tests" ] - } - sources = [ - "cpu_time_unittest.cc", - "filerotatingstream_unittest.cc", - "nullsocketserver_unittest.cc", - "physicalsocketserver_unittest.cc", - "socket_unittest.cc", - "socket_unittest.h", - "socketaddress_unittest.cc", - ] - deps = [ - ":rtc_base", - ":rtc_base_tests_main", - ":rtc_base_tests_utils", - "../system_wrappers:system_wrappers", - "../test:test_support", - "//testing/gtest", - ] - if (is_win) { - sources += [ "win32socketserver_unittest.cc" ] - } - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - } - - rtc_source_set("rtc_base_approved_unittests") { - testonly = true - - # Skip restricting visibility on mobile platforms since the tests on those - # gets additional generated targets which would require many lines here to - # cover (which would be confusing to read and hard to maintain). - if (!is_android && !is_ios) { - # TODO(kjellander): Reenable after finishing https://bugs.webrtc.org/7634. - #visibility = [ "//webrtc:rtc_unittests" ] - } - sources = [ - "array_view_unittest.cc", - "atomicops_unittest.cc", - "base64_unittest.cc", - "basictypes_unittest.cc", - "bind_unittest.cc", - "bitbuffer_unittest.cc", - "buffer_unittest.cc", - "bufferqueue_unittest.cc", - "bytebuffer_unittest.cc", - "byteorder_unittest.cc", - "copyonwritebuffer_unittest.cc", - "criticalsection_unittest.cc", - "event_tracer_unittest.cc", - "event_unittest.cc", - "file_unittest.cc", - "function_view_unittest.cc", - "logging_unittest.cc", - "md5digest_unittest.cc", - "mod_ops_unittest.cc", - "onetimeevent_unittest.cc", - "optional_unittest.cc", - "pathutils_unittest.cc", - "platform_thread_unittest.cc", - "random_unittest.cc", - "rate_limiter_unittest.cc", - "rate_statistics_unittest.cc", - "ratetracker_unittest.cc", - "refcountedobject_unittest.cc", - "safe_compare_unittest.cc", - "safe_minmax_unittest.cc", - "string_to_number_unittest.cc", - "stringencode_unittest.cc", - "stringize_macros_unittest.cc", - "stringutils_unittest.cc", - "swap_queue_unittest.cc", - "thread_annotations_unittest.cc", - "thread_checker_unittest.cc", - "timestampaligner_unittest.cc", - "timeutils_unittest.cc", - "virtualsocket_unittest.cc", - ] - deps = [ - ":rtc_base", - ":rtc_base_approved", - ":rtc_base_tests_main", - ":rtc_base_tests_utils", - ":rtc_task_queue", - "../system_wrappers:system_wrappers", - "../test:test_support", - ] - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - } - - rtc_source_set("rtc_task_queue_unittests") { - testonly = true - - # Skip restricting visibility on mobile platforms since the tests on those - # gets additional generated targets which would require many lines here to - # cover (which would be confusing to read and hard to maintain). - if (!is_android && !is_ios) { - # TODO(kjellander): Reenable after finishing https://bugs.webrtc.org/7634. - #visibility = [ "//webrtc:rtc_unittests" ] - } - sources = [ - "task_queue_unittest.cc", - ] - deps = [ - ":rtc_base_tests_main", - ":rtc_base_tests_utils", - ":rtc_task_queue", - "../test:test_support", - ] - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - } - - rtc_source_set("sequenced_task_checker_unittests") { - testonly = true - - # Skip restricting visibility on mobile platforms since the tests on those - # gets additional generated targets which would require many lines here to - # cover (which would be confusing to read and hard to maintain). - if (!is_android && !is_ios) { - # TODO(kjellander): Reenable after finishing https://bugs.webrtc.org/7634. - #visibility = [ "//webrtc:rtc_unittests" ] - } - sources = [ - "sequenced_task_checker_unittest.cc", - ] - deps = [ - ":rtc_base_approved", - ":rtc_base_tests_main", - ":rtc_task_queue", - ":sequenced_task_checker", - "../test:test_support", - ] - } - - rtc_source_set("weak_ptr_unittests") { - testonly = true - - # Skip restricting visibility on mobile platforms since the tests on those - # gets additional generated targets which would require many lines here to - # cover (which would be confusing to read and hard to maintain). - if (!is_android && !is_ios) { - # TODO(kjellander): Reenable after finishing https://bugs.webrtc.org/7634. - #visibility = [ "//webrtc:rtc_unittests" ] - } - sources = [ - "weak_ptr_unittest.cc", - ] - deps = [ - ":rtc_base_tests_main", - ":rtc_base_tests_utils", - ":rtc_task_queue", - ":weak_ptr", - "../test:test_support", - ] - } - - rtc_source_set("rtc_numerics_unittests") { - testonly = true - - # Skip restricting visibility on mobile platforms since the tests on those - # gets additional generated targets which would require many lines here to - # cover (which would be confusing to read and hard to maintain). - if (!is_android && !is_ios) { - # TODO(kjellander): Reenable after finishing https://bugs.webrtc.org/7634. - #visibility = [ "//webrtc:rtc_unittests" ] - } - sources = [ - "numerics/exp_filter_unittest.cc", - "numerics/percentile_filter_unittest.cc", - ] - deps = [ - ":rtc_base_approved", - ":rtc_base_tests_main", - ":rtc_numerics", - "../test:test_support", - ] - } - - config("rtc_base_unittests_config") { - if (is_clang) { - cflags = [ "-Wno-unused-const-variable" ] - } - } - rtc_source_set("rtc_base_unittests") { - testonly = true - - # Skip restricting visibility on mobile platforms since the tests on those - # gets additional generated targets which would require many lines here to - # cover (which would be confusing to read and hard to maintain). - if (!is_android && !is_ios) { - # TODO(kjellander): Reenable after finishing https://bugs.webrtc.org/7634. - #visibility = [ "//webrtc:rtc_unittests" ] - } - sources = [ - "callback_unittest.cc", - "crc32_unittest.cc", - "fileutils_unittest.cc", - "helpers_unittest.cc", - "httpbase_unittest.cc", - "httpcommon_unittest.cc", - "httpserver_unittest.cc", - "ipaddress_unittest.cc", - "memory_usage_unittest.cc", - "messagedigest_unittest.cc", - "messagequeue_unittest.cc", - "nat_unittest.cc", - "network_unittest.cc", - "optionsfile_unittest.cc", - "proxy_unittest.cc", - "ptr_util_unittest.cc", - "ratelimiter_unittest.cc", - "rollingaccumulator_unittest.cc", - "rtccertificate_unittest.cc", - "rtccertificategenerator_unittest.cc", - "sha1digest_unittest.cc", - "signalthread_unittest.cc", - "sigslot_unittest.cc", - "sigslottester_unittest.cc", - "stream_unittest.cc", - "testclient_unittest.cc", - "thread_unittest.cc", - ] - if (is_win) { - sources += [ - "win32_unittest.cc", - "win32window_unittest.cc", - ] - } - if (is_mac) { - sources += [ "macutils_unittest.cc" ] - } - if (is_posix) { - sources += [ - "ssladapter_unittest.cc", - "sslidentity_unittest.cc", - "sslstreamadapter_unittest.cc", - ] - } - deps = [ - ":rtc_base_tests_main", - ":rtc_base_tests_utils", - "../test:test_support", - ] - public_deps = [ - ":rtc_base", - ] - configs += [ ":rtc_base_unittests_config" ] - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - } -} - if (is_android) { android_library("base_java") { - java_files = [ - "java/src/org/webrtc/ContextUtils.java", - "java/src/org/webrtc/Logging.java", - "java/src/org/webrtc/Size.java", - "java/src/org/webrtc/ThreadUtils.java", - ] + # TODO(kjellander): android_library hits an assert during GN generation + # unless java_files is set and contains at least one file. + # This will be cleaned up after the rename migration is completed. + # This target currently exists only so downstream projects can migrate + # to depend on both the old and the new target. + # See https://bugs.webrtc.org/7634 for more details. + java_files = [ "Dummy.java" ] } } diff --git a/webrtc/rtc_base/array_view.h b/webrtc/rtc_base/array_view.h deleted file mode 100644 index 0f0e3f3790..0000000000 --- a/webrtc/rtc_base/array_view.h +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ARRAY_VIEW_H_ -#define WEBRTC_RTC_BASE_ARRAY_VIEW_H_ - -#include "webrtc/base/checks.h" -#include "webrtc/base/type_traits.h" - -namespace rtc { - -// Many functions read from or write to arrays. The obvious way to do this is -// to use two arguments, a pointer to the first element and an element count: -// -// bool Contains17(const int* arr, size_t size) { -// for (size_t i = 0; i < size; ++i) { -// if (arr[i] == 17) -// return true; -// } -// return false; -// } -// -// This is flexible, since it doesn't matter how the array is stored (C array, -// std::vector, rtc::Buffer, ...), but it's error-prone because the caller has -// to correctly specify the array length: -// -// Contains17(arr, arraysize(arr)); // C array -// Contains17(arr.data(), arr.size()); // std::vector -// Contains17(arr, size); // pointer + size -// ... -// -// It's also kind of messy to have two separate arguments for what is -// conceptually a single thing. -// -// Enter rtc::ArrayView. It contains a T pointer (to an array it doesn't -// own) and a count, and supports the basic things you'd expect, such as -// indexing and iteration. It allows us to write our function like this: -// -// bool Contains17(rtc::ArrayView arr) { -// for (auto e : arr) { -// if (e == 17) -// return true; -// } -// return false; -// } -// -// And even better, because a bunch of things will implicitly convert to -// ArrayView, we can call it like this: -// -// Contains17(arr); // C array -// Contains17(arr); // std::vector -// Contains17(rtc::ArrayView(arr, size)); // pointer + size -// Contains17(nullptr); // nullptr -> empty ArrayView -// ... -// -// ArrayView stores both a pointer and a size, but you may also use -// ArrayView, which has a size that's fixed at compile time (which means -// it only has to store the pointer). -// -// One important point is that ArrayView and ArrayView are -// different types, which allow and don't allow mutation of the array elements, -// respectively. The implicit conversions work just like you'd hope, so that -// e.g. vector will convert to either ArrayView or ArrayView, but const vector will convert only to ArrayView. -// (ArrayView itself can be the source type in such conversions, so -// ArrayView will convert to ArrayView.) -// -// Note: ArrayView is tiny (just a pointer and a count if variable-sized, just -// a pointer if fix-sized) and trivially copyable, so it's probably cheaper to -// pass it by value than by const reference. - -namespace impl { - -// Magic constant for indicating that the size of an ArrayView is variable -// instead of fixed. -enum : std::ptrdiff_t { kArrayViewVarSize = -4711 }; - -// Base class for ArrayViews of fixed nonzero size. -template -class ArrayViewBase { - static_assert(Size > 0, "ArrayView size must be variable or non-negative"); - - public: - ArrayViewBase(T* data, size_t size) : data_(data) {} - - static constexpr size_t size() { return Size; } - static constexpr bool empty() { return false; } - T* data() const { return data_; } - - protected: - static constexpr bool fixed_size() { return true; } - - private: - T* data_; -}; - -// Specialized base class for ArrayViews of fixed zero size. -template -class ArrayViewBase { - public: - explicit ArrayViewBase(T* data, size_t size) {} - - static constexpr size_t size() { return 0; } - static constexpr bool empty() { return true; } - T* data() const { return nullptr; } - - protected: - static constexpr bool fixed_size() { return true; } -}; - -// Specialized base class for ArrayViews of variable size. -template -class ArrayViewBase { - public: - ArrayViewBase(T* data, size_t size) - : data_(size == 0 ? nullptr : data), size_(size) {} - - size_t size() const { return size_; } - bool empty() const { return size_ == 0; } - T* data() const { return data_; } - - protected: - static constexpr bool fixed_size() { return false; } - - private: - T* data_; - size_t size_; -}; - -} // namespace impl - -template -class ArrayView final : public impl::ArrayViewBase { - public: - using value_type = T; - using const_iterator = const T*; - - // Construct an ArrayView from a pointer and a length. - template - ArrayView(U* data, size_t size) - : impl::ArrayViewBase::ArrayViewBase(data, size) { - RTC_DCHECK_EQ(size == 0 ? nullptr : data, this->data()); - RTC_DCHECK_EQ(size, this->size()); - RTC_DCHECK_EQ(!this->data(), - this->size() == 0); // data is null iff size == 0. - } - - // Construct an empty ArrayView. Note that fixed-size ArrayViews of size > 0 - // cannot be empty. - ArrayView() : ArrayView(nullptr, 0) {} - ArrayView(std::nullptr_t) : ArrayView() {} - ArrayView(std::nullptr_t, size_t size) - : ArrayView(static_cast(nullptr), size) { - static_assert(Size == 0 || Size == impl::kArrayViewVarSize, ""); - RTC_DCHECK_EQ(0, size); - } - - // Construct an ArrayView from an array. - template - ArrayView(U (&array)[N]) : ArrayView(array, N) { - static_assert(Size == N || Size == impl::kArrayViewVarSize, - "Array size must match ArrayView size"); - } - - // (Only if size is fixed.) Construct an ArrayView from any type U that has a - // static constexpr size() method whose return value is equal to Size, and a - // data() method whose return value converts implicitly to T*. In particular, - // this means we allow conversion from ArrayView to ArrayView, but not the other way around. We also don't allow conversion from - // ArrayView to ArrayView, or from ArrayView to ArrayView when M != N. - template ::value>::type* = nullptr> - ArrayView(U& u) : ArrayView(u.data(), u.size()) { - static_assert(U::size() == Size, "Sizes must match exactly"); - } - - // (Only if size is variable.) Construct an ArrayView from any type U that - // has a size() method whose return value converts implicitly to size_t, and - // a data() method whose return value converts implicitly to T*. In - // particular, this means we allow conversion from ArrayView to - // ArrayView, but not the other way around. Other allowed - // conversions include - // ArrayView to ArrayView or ArrayView, - // std::vector to ArrayView or ArrayView, - // const std::vector to ArrayView, - // rtc::Buffer to ArrayView or ArrayView, and - // const rtc::Buffer to ArrayView. - template < - typename U, - typename std::enable_if::value>::type* = nullptr> - ArrayView(U& u) : ArrayView(u.data(), u.size()) {} - - // Indexing and iteration. These allow mutation even if the ArrayView is - // const, because the ArrayView doesn't own the array. (To prevent mutation, - // use a const element type.) - T& operator[](size_t idx) const { - RTC_DCHECK_LT(idx, this->size()); - RTC_DCHECK(this->data()); - return this->data()[idx]; - } - T* begin() const { return this->data(); } - T* end() const { return this->data() + this->size(); } - const T* cbegin() const { return this->data(); } - const T* cend() const { return this->data() + this->size(); } - - ArrayView subview(size_t offset, size_t size) const { - return offset < this->size() - ? ArrayView(this->data() + offset, - std::min(size, this->size() - offset)) - : ArrayView(); - } - ArrayView subview(size_t offset) const { - return subview(offset, this->size()); - } -}; - -// Comparing two ArrayViews compares their (pointer,size) pairs; it does *not* -// dereference the pointers. -template -bool operator==(const ArrayView& a, const ArrayView& b) { - return a.data() == b.data() && a.size() == b.size(); -} -template -bool operator!=(const ArrayView& a, const ArrayView& b) { - return !(a == b); -} - -// Variable-size ArrayViews are the size of two pointers; fixed-size ArrayViews -// are the size of one pointer. (And as a special case, fixed-size ArrayViews -// of size 0 require no storage.) -static_assert(sizeof(ArrayView) == 2 * sizeof(int*), ""); -static_assert(sizeof(ArrayView) == sizeof(int*), ""); -static_assert(std::is_empty>::value, ""); - -template -inline ArrayView MakeArrayView(T* data, size_t size) { - return ArrayView(data, size); -} - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_ARRAY_VIEW_H_ diff --git a/webrtc/rtc_base/arraysize.h b/webrtc/rtc_base/arraysize.h deleted file mode 100644 index f395514e5d..0000000000 --- a/webrtc/rtc_base/arraysize.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ARRAYSIZE_H_ -#define WEBRTC_RTC_BASE_ARRAYSIZE_H_ - -#include - -// This file defines the arraysize() macro and is derived from Chromium's -// base/macros.h. - -// The arraysize(arr) macro returns the # of elements in an array arr. -// The expression is a compile-time constant, and therefore can be -// used in defining new arrays, for example. If you use arraysize on -// a pointer by mistake, you will get a compile-time error. - -// This template function declaration is used in defining arraysize. -// Note that the function doesn't need an implementation, as we only -// use its type. -template char (&ArraySizeHelper(T (&array)[N]))[N]; - -#define arraysize(array) (sizeof(ArraySizeHelper(array))) - -#endif // WEBRTC_RTC_BASE_ARRAYSIZE_H_ diff --git a/webrtc/rtc_base/asyncinvoker-inl.h b/webrtc/rtc_base/asyncinvoker-inl.h deleted file mode 100644 index 427d76df38..0000000000 --- a/webrtc/rtc_base/asyncinvoker-inl.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2014 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ASYNCINVOKER_INL_H_ -#define WEBRTC_RTC_BASE_ASYNCINVOKER_INL_H_ - -#include "webrtc/base/atomicops.h" -#include "webrtc/base/bind.h" -#include "webrtc/base/criticalsection.h" -#include "webrtc/base/messagehandler.h" -#include "webrtc/base/sigslot.h" -#include "webrtc/base/thread.h" -#include "webrtc/base/thread_annotations.h" - -namespace rtc { - -class AsyncInvoker; - -// Helper class for AsyncInvoker. Runs a task and triggers a callback -// on the calling thread if necessary. -class AsyncClosure { - public: - explicit AsyncClosure(AsyncInvoker* invoker) : invoker_(invoker) {} - virtual ~AsyncClosure(); - // Runs the asynchronous task, and triggers a callback to the calling - // thread if needed. Should be called from the target thread. - virtual void Execute() = 0; - - protected: - AsyncInvoker* invoker_; -}; - -// Simple closure that doesn't trigger a callback for the calling thread. -template -class FireAndForgetAsyncClosure : public AsyncClosure { - public: - explicit FireAndForgetAsyncClosure(AsyncInvoker* invoker, - const FunctorT& functor) - : AsyncClosure(invoker), functor_(functor) {} - virtual void Execute() { - functor_(); - } - private: - FunctorT functor_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_ASYNCINVOKER_INL_H_ diff --git a/webrtc/rtc_base/asyncinvoker.h b/webrtc/rtc_base/asyncinvoker.h deleted file mode 100644 index 03e5724f09..0000000000 --- a/webrtc/rtc_base/asyncinvoker.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright 2014 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ASYNCINVOKER_H_ -#define WEBRTC_RTC_BASE_ASYNCINVOKER_H_ - -#include -#include - -#include "webrtc/base/asyncinvoker-inl.h" -#include "webrtc/base/bind.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/event.h" -#include "webrtc/base/sigslot.h" -#include "webrtc/base/thread.h" - -namespace rtc { - -// Invokes function objects (aka functors) asynchronously on a Thread, and -// owns the lifetime of calls (ie, when this object is destroyed, calls in -// flight are cancelled). AsyncInvoker can optionally execute a user-specified -// function when the asynchronous call is complete, or operates in -// fire-and-forget mode otherwise. -// -// AsyncInvoker does not own the thread it calls functors on. -// -// A note about async calls and object lifetimes: users should -// be mindful of object lifetimes when calling functions asynchronously and -// ensure objects used by the function _cannot_ be deleted between the -// invocation and execution of the functor. AsyncInvoker is designed to -// help: any calls in flight will be cancelled when the AsyncInvoker used to -// make the call is destructed, and any calls executing will be allowed to -// complete before AsyncInvoker destructs. -// -// The easiest way to ensure lifetimes are handled correctly is to create a -// class that owns the Thread and AsyncInvoker objects, and then call its -// methods asynchronously as needed. -// -// Example: -// class MyClass { -// public: -// void FireAsyncTaskWithResult(Thread* thread, int x) { -// // Specify a callback to get the result upon completion. -// invoker_.AsyncInvoke(RTC_FROM_HERE, -// thread, Bind(&MyClass::AsyncTaskWithResult, this, x), -// &MyClass::OnTaskComplete, this); -// } -// void FireAnotherAsyncTask(Thread* thread) { -// // No callback specified means fire-and-forget. -// invoker_.AsyncInvoke(RTC_FROM_HERE, -// thread, Bind(&MyClass::AnotherAsyncTask, this)); -// -// private: -// int AsyncTaskWithResult(int x) { -// // Some long running process... -// return x * x; -// } -// void AnotherAsyncTask() { -// // Some other long running process... -// } -// void OnTaskComplete(int result) { result_ = result; } -// -// AsyncInvoker invoker_; -// int result_; -// }; -class AsyncInvoker : public MessageHandler { - public: - AsyncInvoker(); - ~AsyncInvoker() override; - - // Call |functor| asynchronously on |thread|, with no callback upon - // completion. Returns immediately. - template - void AsyncInvoke(const Location& posted_from, - Thread* thread, - const FunctorT& functor, - uint32_t id = 0) { - std::unique_ptr closure( - new FireAndForgetAsyncClosure(this, functor)); - DoInvoke(posted_from, thread, std::move(closure), id); - } - - // Call |functor| asynchronously on |thread| with |delay_ms|, with no callback - // upon completion. Returns immediately. - template - void AsyncInvokeDelayed(const Location& posted_from, - Thread* thread, - const FunctorT& functor, - uint32_t delay_ms, - uint32_t id = 0) { - std::unique_ptr closure( - new FireAndForgetAsyncClosure(this, functor)); - DoInvokeDelayed(posted_from, thread, std::move(closure), delay_ms, id); - } - - // Synchronously execute on |thread| all outstanding calls we own - // that are pending on |thread|, and wait for calls to complete - // before returning. Optionally filter by message id. - // The destructor will not wait for outstanding calls, so if that - // behavior is desired, call Flush() before destroying this object. - void Flush(Thread* thread, uint32_t id = MQID_ANY); - - private: - void OnMessage(Message* msg) override; - void DoInvoke(const Location& posted_from, - Thread* thread, - std::unique_ptr closure, - uint32_t id); - void DoInvokeDelayed(const Location& posted_from, - Thread* thread, - std::unique_ptr closure, - uint32_t delay_ms, - uint32_t id); - volatile int pending_invocations_ = 0; - Event invocation_complete_; - bool destroying_ = false; - friend class AsyncClosure; - - RTC_DISALLOW_COPY_AND_ASSIGN(AsyncInvoker); -}; - -// Similar to AsyncInvoker, but guards against the Thread being destroyed while -// there are outstanding dangling pointers to it. It will connect to the current -// thread in the constructor, and will get notified when that thread is -// destroyed. After GuardedAsyncInvoker is constructed, it can be used from -// other threads to post functors to the thread it was constructed on. If that -// thread dies, any further calls to AsyncInvoke() will be safely ignored. -class GuardedAsyncInvoker : public sigslot::has_slots<> { - public: - GuardedAsyncInvoker(); - ~GuardedAsyncInvoker() override; - - // Synchronously execute all outstanding calls we own, and wait for calls to - // complete before returning. Optionally filter by message id. The destructor - // will not wait for outstanding calls, so if that behavior is desired, call - // Flush() first. Returns false if the thread has died. - bool Flush(uint32_t id = MQID_ANY); - - // Call |functor| asynchronously with no callback upon completion. Returns - // immediately. Returns false if the thread has died. - template - bool AsyncInvoke(const Location& posted_from, - const FunctorT& functor, - uint32_t id = 0) { - rtc::CritScope cs(&crit_); - if (thread_ == nullptr) - return false; - invoker_.AsyncInvoke(posted_from, thread_, functor, id); - return true; - } - - // Call |functor| asynchronously with |delay_ms|, with no callback upon - // completion. Returns immediately. Returns false if the thread has died. - template - bool AsyncInvokeDelayed(const Location& posted_from, - const FunctorT& functor, - uint32_t delay_ms, - uint32_t id = 0) { - rtc::CritScope cs(&crit_); - if (thread_ == nullptr) - return false; - invoker_.AsyncInvokeDelayed(posted_from, thread_, - functor, delay_ms, id); - return true; - } - - // Call |functor| asynchronously, calling |callback| when done. Returns false - // if the thread has died. - template - bool AsyncInvoke(const Location& posted_from, - const Location& callback_posted_from, - const FunctorT& functor, - void (HostT::*callback)(ReturnT), - HostT* callback_host, - uint32_t id = 0) { - rtc::CritScope cs(&crit_); - if (thread_ == nullptr) - return false; - invoker_.AsyncInvoke( - posted_from, callback_posted_from, thread_, functor, callback, - callback_host, id); - return true; - } - - // Call |functor| asynchronously calling |callback| when done. Overloaded for - // void return. Returns false if the thread has died. - template - bool AsyncInvoke(const Location& posted_from, - const Location& callback_posted_from, - const FunctorT& functor, - void (HostT::*callback)(), - HostT* callback_host, - uint32_t id = 0) { - rtc::CritScope cs(&crit_); - if (thread_ == nullptr) - return false; - invoker_.AsyncInvoke( - posted_from, callback_posted_from, thread_, functor, callback, - callback_host, id); - return true; - } - - private: - // Callback when |thread_| is destroyed. - void ThreadDestroyed(); - - CriticalSection crit_; - Thread* thread_ GUARDED_BY(crit_); - AsyncInvoker invoker_ GUARDED_BY(crit_); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_ASYNCINVOKER_H_ diff --git a/webrtc/rtc_base/asyncpacketsocket.h b/webrtc/rtc_base/asyncpacketsocket.h deleted file mode 100644 index 5a6c97ec78..0000000000 --- a/webrtc/rtc_base/asyncpacketsocket.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ASYNCPACKETSOCKET_H_ -#define WEBRTC_RTC_BASE_ASYNCPACKETSOCKET_H_ - -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/dscp.h" -#include "webrtc/base/sigslot.h" -#include "webrtc/base/socket.h" -#include "webrtc/base/timeutils.h" - -namespace rtc { - -// This structure holds the info needed to update the packet send time header -// extension, including the information needed to update the authentication tag -// after changing the value. -struct PacketTimeUpdateParams { - PacketTimeUpdateParams(); - ~PacketTimeUpdateParams(); - - int rtp_sendtime_extension_id; // extension header id present in packet. - std::vector srtp_auth_key; // Authentication key. - int srtp_auth_tag_len; // Authentication tag length. - int64_t srtp_packet_index; // Required for Rtp Packet authentication. -}; - -// This structure holds meta information for the packet which is about to send -// over network. -struct PacketOptions { - PacketOptions() : dscp(DSCP_NO_CHANGE), packet_id(-1) {} - explicit PacketOptions(DiffServCodePoint dscp) : dscp(dscp), packet_id(-1) {} - - DiffServCodePoint dscp; - int packet_id; // 16 bits, -1 represents "not set". - PacketTimeUpdateParams packet_time_params; -}; - -// This structure will have the information about when packet is actually -// received by socket. -struct PacketTime { - PacketTime() : timestamp(-1), not_before(-1) {} - PacketTime(int64_t timestamp, int64_t not_before) - : timestamp(timestamp), not_before(not_before) {} - - int64_t timestamp; // Receive time after socket delivers the data. - - // Earliest possible time the data could have arrived, indicating the - // potential error in the |timestamp| value, in case the system, is busy. For - // example, the time of the last select() call. - // If unknown, this value will be set to zero. - int64_t not_before; -}; - -inline PacketTime CreatePacketTime(int64_t not_before) { - return PacketTime(TimeMicros(), not_before); -} - -// Provides the ability to receive packets asynchronously. Sends are not -// buffered since it is acceptable to drop packets under high load. -class AsyncPacketSocket : public sigslot::has_slots<> { - public: - enum State { - STATE_CLOSED, - STATE_BINDING, - STATE_BOUND, - STATE_CONNECTING, - STATE_CONNECTED - }; - - AsyncPacketSocket(); - ~AsyncPacketSocket() override; - - // Returns current local address. Address may be set to null if the - // socket is not bound yet (GetState() returns STATE_BINDING). - virtual SocketAddress GetLocalAddress() const = 0; - - // Returns remote address. Returns zeroes if this is not a client TCP socket. - virtual SocketAddress GetRemoteAddress() const = 0; - - // Send a packet. - virtual int Send(const void *pv, size_t cb, const PacketOptions& options) = 0; - virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr, - const PacketOptions& options) = 0; - - // Close the socket. - virtual int Close() = 0; - - // Returns current state of the socket. - virtual State GetState() const = 0; - - // Get/set options. - virtual int GetOption(Socket::Option opt, int* value) = 0; - virtual int SetOption(Socket::Option opt, int value) = 0; - - // Get/Set current error. - // TODO: Remove SetError(). - virtual int GetError() const = 0; - virtual void SetError(int error) = 0; - - // Emitted each time a packet is read. Used only for UDP and - // connected TCP sockets. - sigslot::signal5 SignalReadPacket; - - // Emitted each time a packet is sent. - sigslot::signal2 SignalSentPacket; - - // Emitted when the socket is currently able to send. - sigslot::signal1 SignalReadyToSend; - - // Emitted after address for the socket is allocated, i.e. binding - // is finished. State of the socket is changed from BINDING to BOUND - // (for UDP and server TCP sockets) or CONNECTING (for client TCP - // sockets). - sigslot::signal2 SignalAddressReady; - - // Emitted for client TCP sockets when state is changed from - // CONNECTING to CONNECTED. - sigslot::signal1 SignalConnect; - - // Emitted for client TCP sockets when state is changed from - // CONNECTED to CLOSED. - sigslot::signal2 SignalClose; - - // Used only for listening TCP sockets. - sigslot::signal2 SignalNewConnection; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(AsyncPacketSocket); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_ASYNCPACKETSOCKET_H_ diff --git a/webrtc/rtc_base/asyncresolverinterface.h b/webrtc/rtc_base/asyncresolverinterface.h deleted file mode 100644 index 1784019c92..0000000000 --- a/webrtc/rtc_base/asyncresolverinterface.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2013 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ASYNCRESOLVERINTERFACE_H_ -#define WEBRTC_RTC_BASE_ASYNCRESOLVERINTERFACE_H_ - -#include "webrtc/base/sigslot.h" -#include "webrtc/base/socketaddress.h" - -namespace rtc { - -// This interface defines the methods to resolve the address asynchronously. -class AsyncResolverInterface { - public: - AsyncResolverInterface(); - virtual ~AsyncResolverInterface(); - - // Start address resolve process. - virtual void Start(const SocketAddress& addr) = 0; - // Returns top most resolved address of |family| - virtual bool GetResolvedAddress(int family, SocketAddress* addr) const = 0; - // Returns error from resolver. - virtual int GetError() const = 0; - // Delete the resolver. - virtual void Destroy(bool wait) = 0; - // Returns top most resolved IPv4 address if address is resolved successfully. - // Otherwise returns address set in SetAddress. - SocketAddress address() const { - SocketAddress addr; - GetResolvedAddress(AF_INET, &addr); - return addr; - } - - // This signal is fired when address resolve process is completed. - sigslot::signal1 SignalDone; -}; - -} // namespace rtc - -#endif diff --git a/webrtc/rtc_base/asyncsocket.h b/webrtc/rtc_base/asyncsocket.h deleted file mode 100644 index 3aa5d76a89..0000000000 --- a/webrtc/rtc_base/asyncsocket.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ASYNCSOCKET_H_ -#define WEBRTC_RTC_BASE_ASYNCSOCKET_H_ - -#include "webrtc/base/sigslot.h" -#include "webrtc/base/socket.h" - -namespace rtc { - -// TODO: Remove Socket and rename AsyncSocket to Socket. - -// Provides the ability to perform socket I/O asynchronously. -class AsyncSocket : public Socket { - public: - AsyncSocket(); - ~AsyncSocket() override; - - AsyncSocket* Accept(SocketAddress* paddr) override = 0; - - // SignalReadEvent and SignalWriteEvent use multi_threaded_local to allow - // access concurrently from different thread. - // For example SignalReadEvent::connect will be called in AsyncUDPSocket ctor - // but at the same time the SocketDispatcher maybe signaling the read event. - // ready to read - sigslot::signal1 SignalReadEvent; - // ready to write - sigslot::signal1 SignalWriteEvent; - sigslot::signal1 SignalConnectEvent; // connected - sigslot::signal2 SignalCloseEvent; // closed -}; - -class AsyncSocketAdapter : public AsyncSocket, public sigslot::has_slots<> { - public: - // The adapted socket may explicitly be null, and later assigned using Attach. - // However, subclasses which support detached mode must override any methods - // that will be called during the detached period (usually GetState()), to - // avoid dereferencing a null pointer. - explicit AsyncSocketAdapter(AsyncSocket* socket); - ~AsyncSocketAdapter() override; - void Attach(AsyncSocket* socket); - SocketAddress GetLocalAddress() const override; - SocketAddress GetRemoteAddress() const override; - int Bind(const SocketAddress& addr) override; - int Connect(const SocketAddress& addr) override; - int Send(const void* pv, size_t cb) override; - int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; - int Recv(void* pv, size_t cb, int64_t* timestamp) override; - int RecvFrom(void* pv, - size_t cb, - SocketAddress* paddr, - int64_t* timestamp) override; - int Listen(int backlog) override; - AsyncSocket* Accept(SocketAddress* paddr) override; - int Close() override; - int GetError() const override; - void SetError(int error) override; - ConnState GetState() const override; - int GetOption(Option opt, int* value) override; - int SetOption(Option opt, int value) override; - - protected: - virtual void OnConnectEvent(AsyncSocket* socket); - virtual void OnReadEvent(AsyncSocket* socket); - virtual void OnWriteEvent(AsyncSocket* socket); - virtual void OnCloseEvent(AsyncSocket* socket, int err); - - AsyncSocket* socket_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_ASYNCSOCKET_H_ diff --git a/webrtc/rtc_base/asynctcpsocket.h b/webrtc/rtc_base/asynctcpsocket.h deleted file mode 100644 index cf764560fc..0000000000 --- a/webrtc/rtc_base/asynctcpsocket.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ASYNCTCPSOCKET_H_ -#define WEBRTC_RTC_BASE_ASYNCTCPSOCKET_H_ - -#include - -#include "webrtc/base/asyncpacketsocket.h" -#include "webrtc/base/buffer.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/socketfactory.h" - -namespace rtc { - -// Simulates UDP semantics over TCP. Send and Recv packet sizes -// are preserved, and drops packets silently on Send, rather than -// buffer them in user space. -class AsyncTCPSocketBase : public AsyncPacketSocket { - public: - AsyncTCPSocketBase(AsyncSocket* socket, bool listen, size_t max_packet_size); - ~AsyncTCPSocketBase() override; - - // Pure virtual methods to send and recv data. - int Send(const void *pv, size_t cb, - const rtc::PacketOptions& options) override = 0; - virtual void ProcessInput(char* data, size_t* len) = 0; - // Signals incoming connection. - virtual void HandleIncomingConnection(AsyncSocket* socket) = 0; - - SocketAddress GetLocalAddress() const override; - SocketAddress GetRemoteAddress() const override; - int SendTo(const void* pv, - size_t cb, - const SocketAddress& addr, - const rtc::PacketOptions& options) override; - int Close() override; - - State GetState() const override; - int GetOption(Socket::Option opt, int* value) override; - int SetOption(Socket::Option opt, int value) override; - int GetError() const override; - void SetError(int error) override; - - protected: - // Binds and connects |socket| and creates AsyncTCPSocket for - // it. Takes ownership of |socket|. Returns null if bind() or - // connect() fail (|socket| is destroyed in that case). - static AsyncSocket* ConnectSocket(AsyncSocket* socket, - const SocketAddress& bind_address, - const SocketAddress& remote_address); - virtual int SendRaw(const void* pv, size_t cb); - int FlushOutBuffer(); - // Add data to |outbuf_|. - void AppendToOutBuffer(const void* pv, size_t cb); - - // Helper methods for |outpos_|. - bool IsOutBufferEmpty() const { return outbuf_.size() == 0; } - void ClearOutBuffer() { outbuf_.Clear(); } - - private: - // Called by the underlying socket - void OnConnectEvent(AsyncSocket* socket); - void OnReadEvent(AsyncSocket* socket); - void OnWriteEvent(AsyncSocket* socket); - void OnCloseEvent(AsyncSocket* socket, int error); - - std::unique_ptr socket_; - bool listen_; - Buffer inbuf_; - Buffer outbuf_; - size_t max_insize_; - size_t max_outsize_; - - RTC_DISALLOW_COPY_AND_ASSIGN(AsyncTCPSocketBase); -}; - -class AsyncTCPSocket : public AsyncTCPSocketBase { - public: - // Binds and connects |socket| and creates AsyncTCPSocket for - // it. Takes ownership of |socket|. Returns null if bind() or - // connect() fail (|socket| is destroyed in that case). - static AsyncTCPSocket* Create(AsyncSocket* socket, - const SocketAddress& bind_address, - const SocketAddress& remote_address); - AsyncTCPSocket(AsyncSocket* socket, bool listen); - ~AsyncTCPSocket() override {} - - int Send(const void* pv, - size_t cb, - const rtc::PacketOptions& options) override; - void ProcessInput(char* data, size_t* len) override; - void HandleIncomingConnection(AsyncSocket* socket) override; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(AsyncTCPSocket); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_ASYNCTCPSOCKET_H_ diff --git a/webrtc/rtc_base/asyncudpsocket.h b/webrtc/rtc_base/asyncudpsocket.h deleted file mode 100644 index bff70f14e6..0000000000 --- a/webrtc/rtc_base/asyncudpsocket.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ASYNCUDPSOCKET_H_ -#define WEBRTC_RTC_BASE_ASYNCUDPSOCKET_H_ - -#include - -#include "webrtc/base/asyncpacketsocket.h" -#include "webrtc/base/socketfactory.h" - -namespace rtc { - -// Provides the ability to receive packets asynchronously. Sends are not -// buffered since it is acceptable to drop packets under high load. -class AsyncUDPSocket : public AsyncPacketSocket { - public: - // Binds |socket| and creates AsyncUDPSocket for it. Takes ownership - // of |socket|. Returns null if bind() fails (|socket| is destroyed - // in that case). - static AsyncUDPSocket* Create(AsyncSocket* socket, - const SocketAddress& bind_address); - // Creates a new socket for sending asynchronous UDP packets using an - // asynchronous socket from the given factory. - static AsyncUDPSocket* Create(SocketFactory* factory, - const SocketAddress& bind_address); - explicit AsyncUDPSocket(AsyncSocket* socket); - ~AsyncUDPSocket() override; - - SocketAddress GetLocalAddress() const override; - SocketAddress GetRemoteAddress() const override; - int Send(const void* pv, - size_t cb, - const rtc::PacketOptions& options) override; - int SendTo(const void* pv, - size_t cb, - const SocketAddress& addr, - const rtc::PacketOptions& options) override; - int Close() override; - - State GetState() const override; - int GetOption(Socket::Option opt, int* value) override; - int SetOption(Socket::Option opt, int value) override; - int GetError() const override; - void SetError(int error) override; - - private: - // Called when the underlying socket is ready to be read from. - void OnReadEvent(AsyncSocket* socket); - // Called when the underlying socket is ready to send. - void OnWriteEvent(AsyncSocket* socket); - - std::unique_ptr socket_; - char* buf_; - size_t size_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_ASYNCUDPSOCKET_H_ diff --git a/webrtc/rtc_base/atomicops.h b/webrtc/rtc_base/atomicops.h deleted file mode 100644 index c9e1a9390d..0000000000 --- a/webrtc/rtc_base/atomicops.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2011 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ATOMICOPS_H_ -#define WEBRTC_RTC_BASE_ATOMICOPS_H_ - -#if defined(WEBRTC_WIN) -// Include winsock2.h before including to maintain consistency with -// win32.h. We can't include win32.h directly here since it pulls in -// headers such as basictypes.h which causes problems in Chromium where webrtc -// exists as two separate projects, webrtc and libjingle. -#include -#include -#endif // defined(WEBRTC_WIN) - -namespace rtc { -class AtomicOps { - public: -#if defined(WEBRTC_WIN) - // Assumes sizeof(int) == sizeof(LONG), which it is on Win32 and Win64. - static int Increment(volatile int* i) { - return ::InterlockedIncrement(reinterpret_cast(i)); - } - static int Decrement(volatile int* i) { - return ::InterlockedDecrement(reinterpret_cast(i)); - } - static int AcquireLoad(volatile const int* i) { - return *i; - } - static void ReleaseStore(volatile int* i, int value) { - *i = value; - } - static int CompareAndSwap(volatile int* i, int old_value, int new_value) { - return ::InterlockedCompareExchange(reinterpret_cast(i), - new_value, - old_value); - } - // Pointer variants. - template - static T* AcquireLoadPtr(T* volatile* ptr) { - return *ptr; - } - template - static T* CompareAndSwapPtr(T* volatile* ptr, T* old_value, T* new_value) { - return static_cast(::InterlockedCompareExchangePointer( - reinterpret_cast(ptr), new_value, old_value)); - } -#else - static int Increment(volatile int* i) { - return __sync_add_and_fetch(i, 1); - } - static int Decrement(volatile int* i) { - return __sync_sub_and_fetch(i, 1); - } - static int AcquireLoad(volatile const int* i) { - return __atomic_load_n(i, __ATOMIC_ACQUIRE); - } - static void ReleaseStore(volatile int* i, int value) { - __atomic_store_n(i, value, __ATOMIC_RELEASE); - } - static int CompareAndSwap(volatile int* i, int old_value, int new_value) { - return __sync_val_compare_and_swap(i, old_value, new_value); - } - // Pointer variants. - template - static T* AcquireLoadPtr(T* volatile* ptr) { - return __atomic_load_n(ptr, __ATOMIC_ACQUIRE); - } - template - static T* CompareAndSwapPtr(T* volatile* ptr, T* old_value, T* new_value) { - return __sync_val_compare_and_swap(ptr, old_value, new_value); - } -#endif -}; - - - -} - -#endif // WEBRTC_RTC_BASE_ATOMICOPS_H_ diff --git a/webrtc/rtc_base/base64.h b/webrtc/rtc_base/base64.h deleted file mode 100644 index 80f65c18e1..0000000000 --- a/webrtc/rtc_base/base64.h +++ /dev/null @@ -1,123 +0,0 @@ - -//********************************************************************* -//* C_Base64 - a simple base64 encoder and decoder. -//* -//* Copyright (c) 1999, Bob Withers - bwit@pobox.com -//* -//* This code may be freely used for any purpose, either personal -//* or commercial, provided the authors copyright notice remains -//* intact. -//********************************************************************* - -#ifndef WEBRTC_RTC_BASE_BASE64_H_ -#define WEBRTC_RTC_BASE_BASE64_H_ - -#include -#include - -namespace rtc { - -class Base64 { - public: - enum DecodeOption { - DO_PARSE_STRICT = 1, // Parse only base64 characters - DO_PARSE_WHITE = 2, // Parse only base64 and whitespace characters - DO_PARSE_ANY = 3, // Parse all characters - DO_PARSE_MASK = 3, - - DO_PAD_YES = 4, // Padding is required - DO_PAD_ANY = 8, // Padding is optional - DO_PAD_NO = 12, // Padding is disallowed - DO_PAD_MASK = 12, - - DO_TERM_BUFFER = 16, // Must termiante at end of buffer - DO_TERM_CHAR = 32, // May terminate at any character boundary - DO_TERM_ANY = 48, // May terminate at a sub-character bit offset - DO_TERM_MASK = 48, - - // Strictest interpretation - DO_STRICT = DO_PARSE_STRICT | DO_PAD_YES | DO_TERM_BUFFER, - - DO_LAX = DO_PARSE_ANY | DO_PAD_ANY | DO_TERM_CHAR, - }; - typedef int DecodeFlags; - - static bool IsBase64Char(char ch); - - // Get the char next to the |ch| from the Base64Table. - // If the |ch| is the last one in the Base64Table then returns - // the first one from the table. - // Expects the |ch| be a base64 char. - // The result will be saved in |next_ch|. - // Returns true on success. - static bool GetNextBase64Char(char ch, char* next_ch); - - // Determines whether the given string consists entirely of valid base64 - // encoded characters. - static bool IsBase64Encoded(const std::string& str); - - static void EncodeFromArray(const void* data, - size_t len, - std::string* result); - static bool DecodeFromArray(const char* data, - size_t len, - DecodeFlags flags, - std::string* result, - size_t* data_used); - static bool DecodeFromArray(const char* data, - size_t len, - DecodeFlags flags, - std::vector* result, - size_t* data_used); - static bool DecodeFromArray(const char* data, - size_t len, - DecodeFlags flags, - std::vector* result, - size_t* data_used); - - // Convenience Methods - static inline std::string Encode(const std::string& data) { - std::string result; - EncodeFromArray(data.data(), data.size(), &result); - return result; - } - static inline std::string Decode(const std::string& data, DecodeFlags flags) { - std::string result; - DecodeFromArray(data.data(), data.size(), flags, &result, nullptr); - return result; - } - static inline bool Decode(const std::string& data, - DecodeFlags flags, - std::string* result, - size_t* data_used) { - return DecodeFromArray(data.data(), data.size(), flags, result, data_used); - } - static inline bool Decode(const std::string& data, - DecodeFlags flags, - std::vector* result, - size_t* data_used) { - return DecodeFromArray(data.data(), data.size(), flags, result, data_used); - } - - private: - static const char Base64Table[]; - static const unsigned char DecodeTable[]; - - static size_t GetNextQuantum(DecodeFlags parse_flags, - bool illegal_pads, - const char* data, - size_t len, - size_t* dpos, - unsigned char qbuf[4], - bool* padded); - template - static bool DecodeFromArrayTemplate(const char* data, - size_t len, - DecodeFlags flags, - T* result, - size_t* data_used); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_BASE64_H_ diff --git a/webrtc/rtc_base/basictypes.h b/webrtc/rtc_base/basictypes.h deleted file mode 100644 index d76dbf9a46..0000000000 --- a/webrtc/rtc_base/basictypes.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_BASICTYPES_H_ -#define WEBRTC_RTC_BASE_BASICTYPES_H_ - -#include // for NULL, size_t -#include // for uintptr_t and (u)int_t types. - -// Detect compiler is for x86 or x64. -#if defined(__x86_64__) || defined(_M_X64) || \ - defined(__i386__) || defined(_M_IX86) -#define CPU_X86 1 -#endif - -// Detect compiler is for arm. -#if defined(__arm__) || defined(_M_ARM) -#define CPU_ARM 1 -#endif - -#if defined(CPU_X86) && defined(CPU_ARM) -#error CPU_X86 and CPU_ARM both defined. -#endif - -#if !defined(RTC_ARCH_CPU_BIG_ENDIAN) && !defined(RTC_ARCH_CPU_LITTLE_ENDIAN) -// x86, arm or GCC provided __BYTE_ORDER__ macros -#if defined(CPU_X86) || defined(CPU_ARM) || \ - (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) -#define RTC_ARCH_CPU_LITTLE_ENDIAN -#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define RTC_ARCH_CPU_BIG_ENDIAN -#else -#error RTC_ARCH_CPU_BIG_ENDIAN or RTC_ARCH_CPU_LITTLE_ENDIAN should be defined. -#endif -#endif - -#if defined(RTC_ARCH_CPU_BIG_ENDIAN) && defined(RTC_ARCH_CPU_LITTLE_ENDIAN) -#error RTC_ARCH_CPU_BIG_ENDIAN and RTC_ARCH_CPU_LITTLE_ENDIAN both defined. -#endif - -#if defined(WEBRTC_WIN) -typedef int socklen_t; -#endif - -// The following only works for C++ -#ifdef __cplusplus - -#ifndef ALIGNP -#define ALIGNP(p, t) \ - (reinterpret_cast(((reinterpret_cast(p) + \ - ((t) - 1)) & ~((t) - 1)))) -#endif - -#define RTC_IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1))) - -// Use these to declare and define a static local variable that gets leaked so -// that its destructors are not called at exit. -#define RTC_DEFINE_STATIC_LOCAL(type, name, arguments) \ - static type& name = *new type arguments - -#endif // __cplusplus - -#endif // WEBRTC_RTC_BASE_BASICTYPES_H_ diff --git a/webrtc/rtc_base/bind.h b/webrtc/rtc_base/bind.h deleted file mode 100644 index 975a5e0aa2..0000000000 --- a/webrtc/rtc_base/bind.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright 2012 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Bind() is an overloaded function that converts method calls into function -// objects (aka functors). The method object is captured as a scoped_refptr<> if -// possible, and as a raw pointer otherwise. Any arguments to the method are -// captured by value. The return value of Bind is a stateful, nullary function -// object. Care should be taken about the lifetime of objects captured by -// Bind(); the returned functor knows nothing about the lifetime of a non -// ref-counted method object or any arguments passed by pointer, and calling the -// functor with a destroyed object will surely do bad things. -// -// To prevent the method object from being captured as a scoped_refptr<>, you -// can use Unretained. But this should only be done when absolutely necessary, -// and when the caller knows the extra reference isn't needed. -// -// Example usage: -// struct Foo { -// int Test1() { return 42; } -// int Test2() const { return 52; } -// int Test3(int x) { return x*x; } -// float Test4(int x, float y) { return x + y; } -// }; -// -// int main() { -// Foo foo; -// cout << rtc::Bind(&Foo::Test1, &foo)() << endl; -// cout << rtc::Bind(&Foo::Test2, &foo)() << endl; -// cout << rtc::Bind(&Foo::Test3, &foo, 3)() << endl; -// cout << rtc::Bind(&Foo::Test4, &foo, 7, 8.5f)() << endl; -// } -// -// Example usage of ref counted objects: -// struct Bar { -// int AddRef(); -// int Release(); -// -// void Test() {} -// void BindThis() { -// // The functor passed to AsyncInvoke() will keep this object alive. -// invoker.AsyncInvoke(RTC_FROM_HERE,rtc::Bind(&Bar::Test, this)); -// } -// }; -// -// int main() { -// rtc::scoped_refptr bar = new rtc::RefCountedObject(); -// auto functor = rtc::Bind(&Bar::Test, bar); -// bar = nullptr; -// // The functor stores an internal scoped_refptr, so this is safe. -// functor(); -// } -// - -#ifndef WEBRTC_RTC_BASE_BIND_H_ -#define WEBRTC_RTC_BASE_BIND_H_ - -#include -#include - -#include "webrtc/base/scoped_ref_ptr.h" -#include "webrtc/base/template_util.h" - -#define NONAME - -namespace rtc { -namespace detail { -// This is needed because the template parameters in Bind can't be resolved -// if they're used both as parameters of the function pointer type and as -// parameters to Bind itself: the function pointer parameters are exact -// matches to the function prototype, but the parameters to bind have -// references stripped. This trick allows the compiler to dictate the Bind -// parameter types rather than deduce them. -template struct identity { typedef T type; }; - -// IsRefCounted::value will be true for types that can be used in -// rtc::scoped_refptr, i.e. types that implements nullary functions AddRef() -// and Release(), regardless of their return types. AddRef() and Release() can -// be defined in T or any superclass of T. -template -class IsRefCounted { - // This is a complex implementation detail done with SFINAE. - - // Define types such that sizeof(Yes) != sizeof(No). - struct Yes { char dummy[1]; }; - struct No { char dummy[2]; }; - // Define two overloaded template functions with return types of different - // size. This way, we can use sizeof() on the return type to determine which - // function the compiler would have chosen. One function will be preferred - // over the other if it is possible to create it without compiler errors, - // otherwise the compiler will simply remove it, and default to the less - // preferred function. - template - static Yes test(R* r, decltype(r->AddRef(), r->Release(), 42)); - template static No test(...); - -public: - // Trick the compiler to tell if it's possible to call AddRef() and Release(). - static const bool value = sizeof(test((T*)nullptr, 42)) == sizeof(Yes); -}; - -// TernaryTypeOperator is a helper class to select a type based on a static bool -// value. -template -struct TernaryTypeOperator {}; - -template -struct TernaryTypeOperator { - typedef IfTrueT type; -}; - -template -struct TernaryTypeOperator { - typedef IfFalseT type; -}; - -// PointerType::type will be scoped_refptr for ref counted types, and T* -// otherwise. -template -struct PointerType { - typedef typename TernaryTypeOperator::value, - scoped_refptr, - T*>::type type; -}; - -template -class UnretainedWrapper { - public: - explicit UnretainedWrapper(T* o) : ptr_(o) {} - T* get() const { return ptr_; } - - private: - T* ptr_; -}; - -} // namespace detail - -template -static inline detail::UnretainedWrapper Unretained(T* o) { - return detail::UnretainedWrapper(o); -} - -template -class MethodFunctor { - public: - MethodFunctor(MethodT method, ObjectT* object, Args... args) - : method_(method), object_(object), args_(args...) {} - R operator()() const { - return CallMethod(typename sequence_generator::type()); - } - - private: - // Use sequence_generator (see template_util.h) to expand a MethodFunctor - // with 2 arguments to (std::get<0>(args_), std::get<1>(args_)), for - // instance. - template - R CallMethod(sequence) const { - return (object_->*method_)(std::get(args_)...); - } - - MethodT method_; - typename detail::PointerType::type object_; - typename std::tuple::type...> args_; -}; - -template -class UnretainedMethodFunctor { - public: - UnretainedMethodFunctor(MethodT method, - detail::UnretainedWrapper object, - Args... args) - : method_(method), object_(object.get()), args_(args...) {} - R operator()() const { - return CallMethod(typename sequence_generator::type()); - } - - private: - // Use sequence_generator (see template_util.h) to expand an - // UnretainedMethodFunctor with 2 arguments to (std::get<0>(args_), - // std::get<1>(args_)), for instance. - template - R CallMethod(sequence) const { - return (object_->*method_)(std::get(args_)...); - } - - MethodT method_; - ObjectT* object_; - typename std::tuple::type...> args_; -}; - -template -class Functor { - public: - Functor(const FunctorT& functor, Args... args) - : functor_(functor), args_(args...) {} - R operator()() const { - return CallFunction(typename sequence_generator::type()); - } - - private: - // Use sequence_generator (see template_util.h) to expand a Functor - // with 2 arguments to (std::get<0>(args_), std::get<1>(args_)), for - // instance. - template - R CallFunction(sequence) const { - return functor_(std::get(args_)...); - } - - FunctorT functor_; - typename std::tuple::type...> args_; -}; - -#define FP_T(x) R (ObjectT::*x)(Args...) - -template -MethodFunctor Bind( - FP_T(method), - ObjectT* object, - typename detail::identity::type... args) { - return MethodFunctor(method, object, - args...); -} - -template -MethodFunctor Bind( - FP_T(method), - const scoped_refptr& object, - typename detail::identity::type... args) { - return MethodFunctor(method, object.get(), - args...); -} - -template -UnretainedMethodFunctor Bind( - FP_T(method), - detail::UnretainedWrapper object, - typename detail::identity::type... args) { - return UnretainedMethodFunctor( - method, object, args...); -} - -#undef FP_T -#define FP_T(x) R (ObjectT::*x)(Args...) const - -template -MethodFunctor Bind( - FP_T(method), - const ObjectT* object, - typename detail::identity::type... args) { - return MethodFunctor(method, object, - args...); -} -template -UnretainedMethodFunctor Bind( - FP_T(method), - detail::UnretainedWrapper object, - typename detail::identity::type... args) { - return UnretainedMethodFunctor( - method, object, args...); -} - -#undef FP_T -#define FP_T(x) R (*x)(Args...) - -template -Functor Bind( - FP_T(function), - typename detail::identity::type... args) { - return Functor(function, args...); -} - -#undef FP_T - -} // namespace rtc - -#undef NONAME - -#endif // WEBRTC_RTC_BASE_BIND_H_ diff --git a/webrtc/rtc_base/bitbuffer.h b/webrtc/rtc_base/bitbuffer.h deleted file mode 100644 index bd5e5f84cc..0000000000 --- a/webrtc/rtc_base/bitbuffer.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_BITBUFFER_H_ -#define WEBRTC_RTC_BASE_BITBUFFER_H_ - -#include // For integer types. -#include // For size_t. - -#include "webrtc/base/constructormagic.h" - -namespace rtc { - -// A class, similar to ByteBuffer, that can parse bit-sized data out of a set of -// bytes. Has a similar API to ByteBuffer, plus methods for reading bit-sized -// and exponential golomb encoded data. For a writable version, use -// BitBufferWriter. Unlike ByteBuffer, this class doesn't make a copy of the -// source bytes, so it can be used on read-only data. -// Sizes/counts specify bits/bytes, for clarity. -// Byte order is assumed big-endian/network. -class BitBuffer { - public: - BitBuffer(const uint8_t* bytes, size_t byte_count); - - // Gets the current offset, in bytes/bits, from the start of the buffer. The - // bit offset is the offset into the current byte, in the range [0,7]. - void GetCurrentOffset(size_t* out_byte_offset, size_t* out_bit_offset); - - // The remaining bits in the byte buffer. - uint64_t RemainingBitCount() const; - - // Reads byte-sized values from the buffer. Returns false if there isn't - // enough data left for the specified type. - bool ReadUInt8(uint8_t* val); - bool ReadUInt16(uint16_t* val); - bool ReadUInt32(uint32_t* val); - - // Reads bit-sized values from the buffer. Returns false if there isn't enough - // data left for the specified bit count.. - bool ReadBits(uint32_t* val, size_t bit_count); - - // Peeks bit-sized values from the buffer. Returns false if there isn't enough - // data left for the specified number of bits. Doesn't move the current - // offset. - bool PeekBits(uint32_t* val, size_t bit_count); - - // Reads the exponential golomb encoded value at the current offset. - // Exponential golomb values are encoded as: - // 1) x = source val + 1 - // 2) In binary, write [countbits(x) - 1] 0s, then x - // To decode, we count the number of leading 0 bits, read that many + 1 bits, - // and increment the result by 1. - // Returns false if there isn't enough data left for the specified type, or if - // the value wouldn't fit in a uint32_t. - bool ReadExponentialGolomb(uint32_t* val); - // Reads signed exponential golomb values at the current offset. Signed - // exponential golomb values are just the unsigned values mapped to the - // sequence 0, 1, -1, 2, -2, etc. in order. - bool ReadSignedExponentialGolomb(int32_t* val); - - // Moves current position |byte_count| bytes forward. Returns false if - // there aren't enough bytes left in the buffer. - bool ConsumeBytes(size_t byte_count); - // Moves current position |bit_count| bits forward. Returns false if - // there aren't enough bits left in the buffer. - bool ConsumeBits(size_t bit_count); - - // Sets the current offset to the provied byte/bit offsets. The bit - // offset is from the given byte, in the range [0,7]. - bool Seek(size_t byte_offset, size_t bit_offset); - - protected: - const uint8_t* const bytes_; - // The total size of |bytes_|. - size_t byte_count_; - // The current offset, in bytes, from the start of |bytes_|. - size_t byte_offset_; - // The current offset, in bits, into the current byte. - size_t bit_offset_; - - RTC_DISALLOW_COPY_AND_ASSIGN(BitBuffer); -}; - -// A BitBuffer API for write operations. Supports symmetric write APIs to the -// reading APIs of BitBuffer. Note that the read/write offset is shared with the -// BitBuffer API, so both reading and writing will consume bytes/bits. -class BitBufferWriter : public BitBuffer { - public: - // Constructs a bit buffer for the writable buffer of |bytes|. - BitBufferWriter(uint8_t* bytes, size_t byte_count); - - // Writes byte-sized values from the buffer. Returns false if there isn't - // enough data left for the specified type. - bool WriteUInt8(uint8_t val); - bool WriteUInt16(uint16_t val); - bool WriteUInt32(uint32_t val); - - // Writes bit-sized values to the buffer. Returns false if there isn't enough - // room left for the specified number of bits. - bool WriteBits(uint64_t val, size_t bit_count); - - // Writes the exponential golomb encoded version of the supplied value. - // Returns false if there isn't enough room left for the value. - bool WriteExponentialGolomb(uint32_t val); - // Writes the signed exponential golomb version of the supplied value. - // Signed exponential golomb values are just the unsigned values mapped to the - // sequence 0, 1, -1, 2, -2, etc. in order. - bool WriteSignedExponentialGolomb(int32_t val); - - private: - // The buffer, as a writable array. - uint8_t* const writable_bytes_; - - RTC_DISALLOW_COPY_AND_ASSIGN(BitBufferWriter); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_BITBUFFER_H_ diff --git a/webrtc/rtc_base/buffer.h b/webrtc/rtc_base/buffer.h deleted file mode 100644 index 171d1ea242..0000000000 --- a/webrtc/rtc_base/buffer.h +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_BUFFER_H_ -#define WEBRTC_RTC_BASE_BUFFER_H_ - -#include -#include -#include -#include -#include - -#include "webrtc/base/array_view.h" -#include "webrtc/base/checks.h" -#include "webrtc/base/type_traits.h" - -namespace rtc { - -namespace internal { - -// (Internal; please don't use outside this file.) Determines if elements of -// type U are compatible with a BufferT. For most types, we just ignore -// top-level const and forbid top-level volatile and require T and U to be -// otherwise equal, but all byte-sized integers (notably char, int8_t, and -// uint8_t) are compatible with each other. (Note: We aim to get rid of this -// behavior, and treat all types the same.) -template -struct BufferCompat { - static constexpr bool value = - !std::is_volatile::value && - ((std::is_integral::value && sizeof(T) == 1) - ? (std::is_integral::value && sizeof(U) == 1) - : (std::is_same::type>::value)); -}; - -} // namespace internal - -// Basic buffer class, can be grown and shrunk dynamically. -// Unlike std::string/vector, does not initialize data when increasing size. -template -class BufferT { - // We want T's destructor and default constructor to be trivial, i.e. perform - // no action, so that we don't have to touch the memory we allocate and - // deallocate. And we want T to be trivially copyable, so that we can copy T - // instances with std::memcpy. This is precisely the definition of a trivial - // type. - static_assert(std::is_trivial::value, "T must be a trivial type."); - - // This class relies heavily on being able to mutate its data. - static_assert(!std::is_const::value, "T may not be const"); - - public: - using value_type = T; - - // An empty BufferT. - BufferT() : size_(0), capacity_(0), data_(nullptr) { - RTC_DCHECK(IsConsistent()); - } - - // Disable copy construction and copy assignment, since copying a buffer is - // expensive enough that we want to force the user to be explicit about it. - BufferT(const BufferT&) = delete; - BufferT& operator=(const BufferT&) = delete; - - BufferT(BufferT&& buf) - : size_(buf.size()), - capacity_(buf.capacity()), - data_(std::move(buf.data_)) { - RTC_DCHECK(IsConsistent()); - buf.OnMovedFrom(); - } - - // Construct a buffer with the specified number of uninitialized elements. - explicit BufferT(size_t size) : BufferT(size, size) {} - - BufferT(size_t size, size_t capacity) - : size_(size), - capacity_(std::max(size, capacity)), - data_(new T[capacity_]) { - RTC_DCHECK(IsConsistent()); - } - - // Construct a buffer and copy the specified number of elements into it. - template ::value>::type* = nullptr> - BufferT(const U* data, size_t size) : BufferT(data, size, size) {} - - template ::value>::type* = nullptr> - BufferT(U* data, size_t size, size_t capacity) : BufferT(size, capacity) { - static_assert(sizeof(T) == sizeof(U), ""); - std::memcpy(data_.get(), data, size * sizeof(U)); - } - - // Construct a buffer from the contents of an array. - template ::value>::type* = nullptr> - BufferT(U (&array)[N]) : BufferT(array, N) {} - - // Get a pointer to the data. Just .data() will give you a (const) T*, but if - // T is a byte-sized integer, you may also use .data() for any other - // byte-sized integer U. - template ::value>::type* = nullptr> - const U* data() const { - RTC_DCHECK(IsConsistent()); - return reinterpret_cast(data_.get()); - } - - template ::value>::type* = nullptr> - U* data() { - RTC_DCHECK(IsConsistent()); - return reinterpret_cast(data_.get()); - } - - bool empty() const { - RTC_DCHECK(IsConsistent()); - return size_ == 0; - } - - size_t size() const { - RTC_DCHECK(IsConsistent()); - return size_; - } - - size_t capacity() const { - RTC_DCHECK(IsConsistent()); - return capacity_; - } - - BufferT& operator=(BufferT&& buf) { - RTC_DCHECK(IsConsistent()); - RTC_DCHECK(buf.IsConsistent()); - size_ = buf.size_; - capacity_ = buf.capacity_; - data_ = std::move(buf.data_); - buf.OnMovedFrom(); - return *this; - } - - bool operator==(const BufferT& buf) const { - RTC_DCHECK(IsConsistent()); - if (size_ != buf.size_) { - return false; - } - if (std::is_integral::value) { - // Optimization. - return std::memcmp(data_.get(), buf.data_.get(), size_ * sizeof(T)) == 0; - } - for (size_t i = 0; i < size_; ++i) { - if (data_[i] != buf.data_[i]) { - return false; - } - } - return true; - } - - bool operator!=(const BufferT& buf) const { return !(*this == buf); } - - T& operator[](size_t index) { - RTC_DCHECK_LT(index, size_); - return data()[index]; - } - - T operator[](size_t index) const { - RTC_DCHECK_LT(index, size_); - return data()[index]; - } - - T* begin() { return data(); } - T* end() { return data() + size(); } - const T* begin() const { return data(); } - const T* end() const { return data() + size(); } - const T* cbegin() const { return data(); } - const T* cend() const { return data() + size(); } - - // The SetData functions replace the contents of the buffer. They accept the - // same input types as the constructors. - template ::value>::type* = nullptr> - void SetData(const U* data, size_t size) { - RTC_DCHECK(IsConsistent()); - size_ = 0; - AppendData(data, size); - } - - template ::value>::type* = nullptr> - void SetData(const U (&array)[N]) { - SetData(array, N); - } - - template ::value>::type* = nullptr> - void SetData(const W& w) { - SetData(w.data(), w.size()); - } - - // Replace the data in the buffer with at most |max_elements| of data, using - // the function |setter|, which should have the following signature: - // size_t setter(ArrayView view) - // |setter| is given an appropriately typed ArrayView of the area in which to - // write the data (i.e. starting at the beginning of the buffer) and should - // return the number of elements actually written. This number must be <= - // |max_elements|. - template ::value>::type* = nullptr> - size_t SetData(size_t max_elements, F&& setter) { - RTC_DCHECK(IsConsistent()); - size_ = 0; - return AppendData(max_elements, std::forward(setter)); - } - - // The AppendData functions add data to the end of the buffer. They accept - // the same input types as the constructors. - template ::value>::type* = nullptr> - void AppendData(const U* data, size_t size) { - RTC_DCHECK(IsConsistent()); - const size_t new_size = size_ + size; - EnsureCapacityWithHeadroom(new_size, true); - static_assert(sizeof(T) == sizeof(U), ""); - std::memcpy(data_.get() + size_, data, size * sizeof(U)); - size_ = new_size; - RTC_DCHECK(IsConsistent()); - } - - template ::value>::type* = nullptr> - void AppendData(const U (&array)[N]) { - AppendData(array, N); - } - - template ::value>::type* = nullptr> - void AppendData(const W& w) { - AppendData(w.data(), w.size()); - } - - template ::value>::type* = nullptr> - void AppendData(const U& item) { - AppendData(&item, 1); - } - - // Append at most |max_elements| to the end of the buffer, using the function - // |setter|, which should have the following signature: - // size_t setter(ArrayView view) - // |setter| is given an appropriately typed ArrayView of the area in which to - // write the data (i.e. starting at the former end of the buffer) and should - // return the number of elements actually written. This number must be <= - // |max_elements|. - template ::value>::type* = nullptr> - size_t AppendData(size_t max_elements, F&& setter) { - RTC_DCHECK(IsConsistent()); - const size_t old_size = size_; - SetSize(old_size + max_elements); - U* base_ptr = data() + old_size; - size_t written_elements = setter(rtc::ArrayView(base_ptr, max_elements)); - - RTC_CHECK_LE(written_elements, max_elements); - size_ = old_size + written_elements; - RTC_DCHECK(IsConsistent()); - return written_elements; - } - - // Sets the size of the buffer. If the new size is smaller than the old, the - // buffer contents will be kept but truncated; if the new size is greater, - // the existing contents will be kept and the new space will be - // uninitialized. - void SetSize(size_t size) { - EnsureCapacityWithHeadroom(size, true); - size_ = size; - } - - // Ensure that the buffer size can be increased to at least capacity without - // further reallocation. (Of course, this operation might need to reallocate - // the buffer.) - void EnsureCapacity(size_t capacity) { - // Don't allocate extra headroom, since the user is asking for a specific - // capacity. - EnsureCapacityWithHeadroom(capacity, false); - } - - // Resets the buffer to zero size without altering capacity. Works even if the - // buffer has been moved from. - void Clear() { - size_ = 0; - RTC_DCHECK(IsConsistent()); - } - - // Swaps two buffers. Also works for buffers that have been moved from. - friend void swap(BufferT& a, BufferT& b) { - using std::swap; - swap(a.size_, b.size_); - swap(a.capacity_, b.capacity_); - swap(a.data_, b.data_); - } - - private: - void EnsureCapacityWithHeadroom(size_t capacity, bool extra_headroom) { - RTC_DCHECK(IsConsistent()); - if (capacity <= capacity_) - return; - - // If the caller asks for extra headroom, ensure that the new capacity is - // >= 1.5 times the old capacity. Any constant > 1 is sufficient to prevent - // quadratic behavior; as to why we pick 1.5 in particular, see - // https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md and - // http://www.gahcep.com/cpp-internals-stl-vector-part-1/. - const size_t new_capacity = - extra_headroom ? std::max(capacity, capacity_ + capacity_ / 2) - : capacity; - - std::unique_ptr new_data(new T[new_capacity]); - std::memcpy(new_data.get(), data_.get(), size_ * sizeof(T)); - data_ = std::move(new_data); - capacity_ = new_capacity; - RTC_DCHECK(IsConsistent()); - } - - // Precondition for all methods except Clear and the destructor. - // Postcondition for all methods except move construction and move - // assignment, which leave the moved-from object in a possibly inconsistent - // state. - bool IsConsistent() const { - return (data_ || capacity_ == 0) && capacity_ >= size_; - } - - // Called when *this has been moved from. Conceptually it's a no-op, but we - // can mutate the state slightly to help subsequent sanity checks catch bugs. - void OnMovedFrom() { -#if RTC_DCHECK_IS_ON - // Make *this consistent and empty. Shouldn't be necessary, but better safe - // than sorry. - size_ = 0; - capacity_ = 0; -#else - // Ensure that *this is always inconsistent, to provoke bugs. - size_ = 1; - capacity_ = 0; -#endif - } - - size_t size_; - size_t capacity_; - std::unique_ptr data_; -}; - -// By far the most common sort of buffer. -using Buffer = BufferT; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_BUFFER_H_ diff --git a/webrtc/rtc_base/bufferqueue.h b/webrtc/rtc_base/bufferqueue.h deleted file mode 100644 index 7db2c8cb5b..0000000000 --- a/webrtc/rtc_base/bufferqueue.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_BUFFERQUEUE_H_ -#define WEBRTC_RTC_BASE_BUFFERQUEUE_H_ - -#include -#include - -#include "webrtc/base/buffer.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/criticalsection.h" - -namespace rtc { - -class BufferQueue { - public: - // Creates a buffer queue with a given capacity and default buffer size. - BufferQueue(size_t capacity, size_t default_size); - virtual ~BufferQueue(); - - // Return number of queued buffers. - size_t size() const; - - // Clear the BufferQueue by moving all Buffers from |queue_| to |free_list_|. - void Clear(); - - // ReadFront will only read one buffer at a time and will truncate buffers - // that don't fit in the passed memory. - // Returns true unless no data could be returned. - bool ReadFront(void* data, size_t bytes, size_t* bytes_read); - - // WriteBack always writes either the complete memory or nothing. - // Returns true unless no data could be written. - bool WriteBack(const void* data, size_t bytes, size_t* bytes_written); - - protected: - // These methods are called when the state of the queue changes. - virtual void NotifyReadableForTest() {} - virtual void NotifyWritableForTest() {} - - private: - size_t capacity_; - size_t default_size_; - CriticalSection crit_; - std::deque queue_ GUARDED_BY(crit_); - std::vector free_list_ GUARDED_BY(crit_); - - RTC_DISALLOW_COPY_AND_ASSIGN(BufferQueue); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_BUFFERQUEUE_H_ diff --git a/webrtc/rtc_base/bytebuffer.h b/webrtc/rtc_base/bytebuffer.h deleted file mode 100644 index b631ae1d4e..0000000000 --- a/webrtc/rtc_base/bytebuffer.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_BYTEBUFFER_H_ -#define WEBRTC_RTC_BASE_BYTEBUFFER_H_ - -#include - -#include "webrtc/base/basictypes.h" -#include "webrtc/base/buffer.h" -#include "webrtc/base/constructormagic.h" - -namespace rtc { - -class ByteBuffer { - public: - enum ByteOrder { - ORDER_NETWORK = 0, // Default, use network byte order (big endian). - ORDER_HOST, // Use the native order of the host. - }; - - explicit ByteBuffer(ByteOrder byte_order) : byte_order_(byte_order) {} - - ByteOrder Order() const { return byte_order_; } - - private: - ByteOrder byte_order_; - - RTC_DISALLOW_COPY_AND_ASSIGN(ByteBuffer); -}; - -class ByteBufferWriter : public ByteBuffer { - public: - // |byte_order| defines order of bytes in the buffer. - ByteBufferWriter(); - explicit ByteBufferWriter(ByteOrder byte_order); - ByteBufferWriter(const char* bytes, size_t len); - ByteBufferWriter(const char* bytes, size_t len, ByteOrder byte_order); - - ~ByteBufferWriter(); - - const char* Data() const { return bytes_; } - size_t Length() const { return end_; } - size_t Capacity() const { return size_; } - - // Write value to the buffer. Resizes the buffer when it is - // neccessary. - void WriteUInt8(uint8_t val); - void WriteUInt16(uint16_t val); - void WriteUInt24(uint32_t val); - void WriteUInt32(uint32_t val); - void WriteUInt64(uint64_t val); - void WriteUVarint(uint64_t val); - void WriteString(const std::string& val); - void WriteBytes(const char* val, size_t len); - - // Reserves the given number of bytes and returns a char* that can be written - // into. Useful for functions that require a char* buffer and not a - // ByteBufferWriter. - char* ReserveWriteBuffer(size_t len); - - // Resize the buffer to the specified |size|. - void Resize(size_t size); - - // Clears the contents of the buffer. After this, Length() will be 0. - void Clear(); - - private: - void Construct(const char* bytes, size_t size); - - char* bytes_; - size_t size_; - size_t end_; - - // There are sensible ways to define these, but they aren't needed in our code - // base. - RTC_DISALLOW_COPY_AND_ASSIGN(ByteBufferWriter); -}; - -// The ByteBufferReader references the passed data, i.e. the pointer must be -// valid during the lifetime of the reader. -class ByteBufferReader : public ByteBuffer { - public: - ByteBufferReader(const char* bytes, size_t len); - ByteBufferReader(const char* bytes, size_t len, ByteOrder byte_order); - - // Initializes buffer from a zero-terminated string. - explicit ByteBufferReader(const char* bytes); - - explicit ByteBufferReader(const Buffer& buf); - - explicit ByteBufferReader(const ByteBufferWriter& buf); - - // Returns start of unprocessed data. - const char* Data() const { return bytes_ + start_; } - // Returns number of unprocessed bytes. - size_t Length() const { return end_ - start_; } - - // Read a next value from the buffer. Return false if there isn't - // enough data left for the specified type. - bool ReadUInt8(uint8_t* val); - bool ReadUInt16(uint16_t* val); - bool ReadUInt24(uint32_t* val); - bool ReadUInt32(uint32_t* val); - bool ReadUInt64(uint64_t* val); - bool ReadUVarint(uint64_t* val); - bool ReadBytes(char* val, size_t len); - - // Appends next |len| bytes from the buffer to |val|. Returns false - // if there is less than |len| bytes left. - bool ReadString(std::string* val, size_t len); - - // Moves current position |size| bytes forward. Returns false if - // there is less than |size| bytes left in the buffer. Consume doesn't - // permanently remove data, so remembered read positions are still valid - // after this call. - bool Consume(size_t size); - - private: - void Construct(const char* bytes, size_t size); - - const char* bytes_; - size_t size_; - size_t start_; - size_t end_; - - RTC_DISALLOW_COPY_AND_ASSIGN(ByteBufferReader); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_BYTEBUFFER_H_ diff --git a/webrtc/rtc_base/byteorder.h b/webrtc/rtc_base/byteorder.h deleted file mode 100644 index d188f3126a..0000000000 --- a/webrtc/rtc_base/byteorder.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_BYTEORDER_H_ -#define WEBRTC_RTC_BASE_BYTEORDER_H_ - -#if defined(WEBRTC_POSIX) && !defined(__native_client__) -#include -#endif - -#include "webrtc/base/basictypes.h" - -#if defined(WEBRTC_MAC) -#include - -#define htobe16(v) OSSwapHostToBigInt16(v) -#define htobe32(v) OSSwapHostToBigInt32(v) -#define htobe64(v) OSSwapHostToBigInt64(v) -#define be16toh(v) OSSwapBigToHostInt16(v) -#define be32toh(v) OSSwapBigToHostInt32(v) -#define be64toh(v) OSSwapBigToHostInt64(v) - -#define htole16(v) OSSwapHostToLittleInt16(v) -#define htole32(v) OSSwapHostToLittleInt32(v) -#define htole64(v) OSSwapHostToLittleInt64(v) -#define le16toh(v) OSSwapLittleToHostInt16(v) -#define le32toh(v) OSSwapLittleToHostInt32(v) -#define le64toh(v) OSSwapLittleToHostInt64(v) -#elif defined(WEBRTC_WIN) || defined(__native_client__) - -#if defined(WEBRTC_WIN) -#include -#include -#else -#include -#endif - -#define htobe16(v) htons(v) -#define htobe32(v) htonl(v) -#define be16toh(v) ntohs(v) -#define be32toh(v) ntohl(v) -#if defined(WEBRTC_WIN) -#define htobe64(v) htonll(v) -#define be64toh(v) ntohll(v) -#endif - -#if defined(RTC_ARCH_CPU_LITTLE_ENDIAN) -#define htole16(v) (v) -#define htole32(v) (v) -#define htole64(v) (v) -#define le16toh(v) (v) -#define le32toh(v) (v) -#define le64toh(v) (v) -#if defined(__native_client__) -#define htobe64(v) __builtin_bswap64(v) -#define be64toh(v) __builtin_bswap64(v) -#endif -#elif defined(RTC_ARCH_CPU_BIG_ENDIAN) -#define htole16(v) __builtin_bswap16(v) -#define htole32(v) __builtin_bswap32(v) -#define htole64(v) __builtin_bswap64(v) -#define le16toh(v) __builtin_bswap16(v) -#define le32toh(v) __builtin_bswap32(v) -#define le64toh(v) __builtin_bswap64(v) -#if defined(__native_client__) -#define htobe64(v) (v) -#define be64toh(v) (v) -#endif -#else -#error RTC_ARCH_CPU_BIG_ENDIAN or RTC_ARCH_CPU_LITTLE_ENDIAN must be defined. -#endif // defined(RTC_ARCH_CPU_LITTLE_ENDIAN) -#elif defined(WEBRTC_POSIX) -#include -#endif - -namespace rtc { - -// Reading and writing of little and big-endian numbers from memory - -inline void Set8(void* memory, size_t offset, uint8_t v) { - static_cast(memory)[offset] = v; -} - -inline uint8_t Get8(const void* memory, size_t offset) { - return static_cast(memory)[offset]; -} - -inline void SetBE16(void* memory, uint16_t v) { - *static_cast(memory) = htobe16(v); -} - -inline void SetBE32(void* memory, uint32_t v) { - *static_cast(memory) = htobe32(v); -} - -inline void SetBE64(void* memory, uint64_t v) { - *static_cast(memory) = htobe64(v); -} - -inline uint16_t GetBE16(const void* memory) { - return be16toh(*static_cast(memory)); -} - -inline uint32_t GetBE32(const void* memory) { - return be32toh(*static_cast(memory)); -} - -inline uint64_t GetBE64(const void* memory) { - return be64toh(*static_cast(memory)); -} - -inline void SetLE16(void* memory, uint16_t v) { - *static_cast(memory) = htole16(v); -} - -inline void SetLE32(void* memory, uint32_t v) { - *static_cast(memory) = htole32(v); -} - -inline void SetLE64(void* memory, uint64_t v) { - *static_cast(memory) = htole64(v); -} - -inline uint16_t GetLE16(const void* memory) { - return le16toh(*static_cast(memory)); -} - -inline uint32_t GetLE32(const void* memory) { - return le32toh(*static_cast(memory)); -} - -inline uint64_t GetLE64(const void* memory) { - return le64toh(*static_cast(memory)); -} - -// Check if the current host is big endian. -inline bool IsHostBigEndian() { -#if defined(RTC_ARCH_CPU_BIG_ENDIAN) - return true; -#else - return false; -#endif -} - -inline uint16_t HostToNetwork16(uint16_t n) { - return htobe16(n); -} - -inline uint32_t HostToNetwork32(uint32_t n) { - return htobe32(n); -} - -inline uint64_t HostToNetwork64(uint64_t n) { - return htobe64(n); -} - -inline uint16_t NetworkToHost16(uint16_t n) { - return be16toh(n); -} - -inline uint32_t NetworkToHost32(uint32_t n) { - return be32toh(n); -} - -inline uint64_t NetworkToHost64(uint64_t n) { - return be64toh(n); -} - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_BYTEORDER_H_ diff --git a/webrtc/rtc_base/callback.h b/webrtc/rtc_base/callback.h deleted file mode 100644 index 4435a18d18..0000000000 --- a/webrtc/rtc_base/callback.h +++ /dev/null @@ -1,260 +0,0 @@ -// This file was GENERATED by command: -// pump.py callback.h.pump -// DO NOT EDIT BY HAND!!! - -/* - * Copyright 2012 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// To generate callback.h from callback.h.pump, execute: -// /home/build/google3/third_party/gtest/scripts/pump.py callback.h.pump - -// Callbacks are callable object containers. They can hold a function pointer -// or a function object and behave like a value type. Internally, data is -// reference-counted, making copies and pass-by-value inexpensive. -// -// Callbacks are typed using template arguments. The format is: -// CallbackN -// where N is the number of arguments supplied to the callable object. -// Callbacks are invoked using operator(), just like a function or a function -// object. Default-constructed callbacks are "empty," and executing an empty -// callback does nothing. A callback can be made empty by assigning it from -// a default-constructed callback. -// -// Callbacks are similar in purpose to std::function (which isn't available on -// all platforms we support) and a lightweight alternative to sigslots. Since -// they effectively hide the type of the object they call, they're useful in -// breaking dependencies between objects that need to interact with one another. -// Notably, they can hold the results of Bind(), std::bind*, etc, without -// needing -// to know the resulting object type of those calls. -// -// Sigslots, on the other hand, provide a fuller feature set, such as multiple -// subscriptions to a signal, optional thread-safety, and lifetime tracking of -// slots. When these features are needed, choose sigslots. -// -// Example: -// int sqr(int x) { return x * x; } -// struct AddK { -// int k; -// int operator()(int x) const { return x + k; } -// } add_k = {5}; -// -// Callback1 my_callback; -// cout << my_callback.empty() << endl; // true -// -// my_callback = Callback1(&sqr); -// cout << my_callback.empty() << endl; // false -// cout << my_callback(3) << endl; // 9 -// -// my_callback = Callback1(add_k); -// cout << my_callback(10) << endl; // 15 -// -// my_callback = Callback1(); -// cout << my_callback.empty() << endl; // true - -#ifndef WEBRTC_RTC_BASE_CALLBACK_H_ -#define WEBRTC_RTC_BASE_CALLBACK_H_ - -#include "webrtc/base/refcount.h" -#include "webrtc/base/scoped_ref_ptr.h" - -namespace rtc { - -template -class Callback0 { - public: - // Default copy operations are appropriate for this class. - Callback0() {} - template Callback0(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()() { - if (empty()) - return R(); - return helper_->Run(); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run() = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run() { - return functor_(); - } - T functor_; - }; - scoped_refptr helper_; -}; - -template -class Callback1 { - public: - // Default copy operations are appropriate for this class. - Callback1() {} - template Callback1(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()(P1 p1) { - if (empty()) - return R(); - return helper_->Run(p1); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run(P1 p1) = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run(P1 p1) { - return functor_(p1); - } - T functor_; - }; - scoped_refptr helper_; -}; - -template -class Callback2 { - public: - // Default copy operations are appropriate for this class. - Callback2() {} - template Callback2(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()(P1 p1, P2 p2) { - if (empty()) - return R(); - return helper_->Run(p1, p2); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run(P1 p1, P2 p2) = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run(P1 p1, P2 p2) { - return functor_(p1, p2); - } - T functor_; - }; - scoped_refptr helper_; -}; - -template -class Callback3 { - public: - // Default copy operations are appropriate for this class. - Callback3() {} - template Callback3(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()(P1 p1, P2 p2, P3 p3) { - if (empty()) - return R(); - return helper_->Run(p1, p2, p3); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run(P1 p1, P2 p2, P3 p3) = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run(P1 p1, P2 p2, P3 p3) { - return functor_(p1, p2, p3); - } - T functor_; - }; - scoped_refptr helper_; -}; - -template -class Callback4 { - public: - // Default copy operations are appropriate for this class. - Callback4() {} - template Callback4(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()(P1 p1, P2 p2, P3 p3, P4 p4) { - if (empty()) - return R(); - return helper_->Run(p1, p2, p3, p4); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4) = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4) { - return functor_(p1, p2, p3, p4); - } - T functor_; - }; - scoped_refptr helper_; -}; - -template -class Callback5 { - public: - // Default copy operations are appropriate for this class. - Callback5() {} - template Callback5(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { - if (empty()) - return R(); - return helper_->Run(p1, p2, p3, p4, p5); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { - return functor_(p1, p2, p3, p4, p5); - } - T functor_; - }; - scoped_refptr helper_; -}; -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_CALLBACK_H_ diff --git a/webrtc/rtc_base/checks.h b/webrtc/rtc_base/checks.h deleted file mode 100644 index d2fb115e88..0000000000 --- a/webrtc/rtc_base/checks.h +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright 2006 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_CHECKS_H_ -#define WEBRTC_RTC_BASE_CHECKS_H_ - -#include "webrtc/typedefs.h" - -// If you for some reson need to know if DCHECKs are on, test the value of -// RTC_DCHECK_IS_ON. (Test its value, not if it's defined; it'll always be -// defined, to either a true or a false value.) -#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) -#define RTC_DCHECK_IS_ON 1 -#else -#define RTC_DCHECK_IS_ON 0 -#endif - -#ifdef __cplusplus -extern "C" { -#endif -NO_RETURN void rtc_FatalMessage(const char* file, int line, const char* msg); -#ifdef __cplusplus -} // extern "C" -#endif - -#ifdef __cplusplus -// C++ version. - -#include -#include - -#include "webrtc/base/safe_compare.h" - -// The macros here print a message to stderr and abort under various -// conditions. All will accept additional stream messages. For example: -// RTC_DCHECK_EQ(foo, bar) << "I'm printed when foo != bar."; -// -// - RTC_CHECK(x) is an assertion that x is always true, and that if it isn't, -// it's better to terminate the process than to continue. During development, -// the reason that it's better to terminate might simply be that the error -// handling code isn't in place yet; in production, the reason might be that -// the author of the code truly believes that x will always be true, but that -// she recognizes that if she is wrong, abrupt and unpleasant process -// termination is still better than carrying on with the assumption violated. -// -// RTC_CHECK always evaluates its argument, so it's OK for x to have side -// effects. -// -// - RTC_DCHECK(x) is the same as RTC_CHECK(x)---an assertion that x is always -// true---except that x will only be evaluated in debug builds; in production -// builds, x is simply assumed to be true. This is useful if evaluating x is -// expensive and the expected cost of failing to detect the violated -// assumption is acceptable. You should not handle cases where a production -// build fails to spot a violated condition, even those that would result in -// crashes. If the code needs to cope with the error, make it cope, but don't -// call RTC_DCHECK; if the condition really can't occur, but you'd sleep -// better at night knowing that the process will suicide instead of carrying -// on in case you were wrong, use RTC_CHECK instead of RTC_DCHECK. -// -// RTC_DCHECK only evaluates its argument in debug builds, so if x has visible -// side effects, you need to write e.g. -// bool w = x; RTC_DCHECK(w); -// -// - RTC_CHECK_EQ, _NE, _GT, ..., and RTC_DCHECK_EQ, _NE, _GT, ... are -// specialized variants of RTC_CHECK and RTC_DCHECK that print prettier -// messages if the condition doesn't hold. Prefer them to raw RTC_CHECK and -// RTC_DCHECK. -// -// - FATAL() aborts unconditionally. -// -// TODO(ajm): Ideally, checks.h would be combined with logging.h, but -// consolidation with system_wrappers/logging.h should happen first. - -namespace rtc { - -// Helper macro which avoids evaluating the arguments to a stream if -// the condition doesn't hold. -#define RTC_LAZY_STREAM(stream, condition) \ - !(condition) ? static_cast(0) : rtc::FatalMessageVoidify() & (stream) - -// The actual stream used isn't important. We reference |ignored| in the code -// but don't evaluate it; this is to avoid "unused variable" warnings (we do so -// in a particularly convoluted way with an extra ?: because that appears to be -// the simplest construct that keeps Visual Studio from complaining about -// condition being unused). -#define RTC_EAT_STREAM_PARAMETERS(ignored) \ - (true ? true : ((void)(ignored), true)) \ - ? static_cast(0) \ - : rtc::FatalMessageVoidify() & rtc::FatalMessage("", 0).stream() - -// Call RTC_EAT_STREAM_PARAMETERS with an argument that fails to compile if -// values of the same types as |a| and |b| can't be compared with the given -// operation, and that would evaluate |a| and |b| if evaluated. -#define RTC_EAT_STREAM_PARAMETERS_OP(op, a, b) \ - RTC_EAT_STREAM_PARAMETERS(((void)rtc::Safe##op(a, b))) - -// RTC_CHECK dies with a fatal error if condition is not true. It is *not* -// controlled by NDEBUG or anything else, so the check will be executed -// regardless of compilation mode. -// -// We make sure RTC_CHECK et al. always evaluates their arguments, as -// doing RTC_CHECK(FunctionWithSideEffect()) is a common idiom. -#define RTC_CHECK(condition) \ - RTC_LAZY_STREAM(rtc::FatalMessage(__FILE__, __LINE__).stream(), \ - !(condition)) \ - << "Check failed: " #condition << std::endl << "# " - -// Helper macro for binary operators. -// Don't use this macro directly in your code, use RTC_CHECK_EQ et al below. -// -// TODO(akalin): Rewrite this so that constructs like if (...) -// RTC_CHECK_EQ(...) else { ... } work properly. -#define RTC_CHECK_OP(name, op, val1, val2) \ - if (std::string* _result = \ - rtc::Check##name##Impl((val1), (val2), #val1 " " #op " " #val2)) \ - rtc::FatalMessage(__FILE__, __LINE__, _result).stream() - -// Build the error message string. This is separate from the "Impl" -// function template because it is not performance critical and so can -// be out of line, while the "Impl" code should be inline. Caller -// takes ownership of the returned string. -template -std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { - std::ostringstream ss; - ss << names << " (" << v1 << " vs. " << v2 << ")"; - std::string* msg = new std::string(ss.str()); - return msg; -} - -// MSVC doesn't like complex extern templates and DLLs. -#if !defined(COMPILER_MSVC) -// Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated -// in logging.cc. -extern template std::string* MakeCheckOpString( - const int&, const int&, const char* names); -extern template -std::string* MakeCheckOpString( - const unsigned long&, const unsigned long&, const char* names); -extern template -std::string* MakeCheckOpString( - const unsigned long&, const unsigned int&, const char* names); -extern template -std::string* MakeCheckOpString( - const unsigned int&, const unsigned long&, const char* names); -extern template -std::string* MakeCheckOpString( - const std::string&, const std::string&, const char* name); -#endif - -// Helper functions for RTC_CHECK_OP macro. -// The (int, int) specialization works around the issue that the compiler -// will not instantiate the template version of the function on values of -// unnamed enum type - see comment below. -#define DEFINE_RTC_CHECK_OP_IMPL(name) \ - template \ - inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ - const char* names) { \ - if (rtc::Safe##name(v1, v2)) \ - return nullptr; \ - else \ - return rtc::MakeCheckOpString(v1, v2, names); \ - } \ - inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \ - if (rtc::Safe##name(v1, v2)) \ - return nullptr; \ - else \ - return rtc::MakeCheckOpString(v1, v2, names); \ - } -DEFINE_RTC_CHECK_OP_IMPL(Eq) -DEFINE_RTC_CHECK_OP_IMPL(Ne) -DEFINE_RTC_CHECK_OP_IMPL(Le) -DEFINE_RTC_CHECK_OP_IMPL(Lt) -DEFINE_RTC_CHECK_OP_IMPL(Ge) -DEFINE_RTC_CHECK_OP_IMPL(Gt) -#undef DEFINE_RTC_CHECK_OP_IMPL - -#define RTC_CHECK_EQ(val1, val2) RTC_CHECK_OP(Eq, ==, val1, val2) -#define RTC_CHECK_NE(val1, val2) RTC_CHECK_OP(Ne, !=, val1, val2) -#define RTC_CHECK_LE(val1, val2) RTC_CHECK_OP(Le, <=, val1, val2) -#define RTC_CHECK_LT(val1, val2) RTC_CHECK_OP(Lt, <, val1, val2) -#define RTC_CHECK_GE(val1, val2) RTC_CHECK_OP(Ge, >=, val1, val2) -#define RTC_CHECK_GT(val1, val2) RTC_CHECK_OP(Gt, >, val1, val2) - -// The RTC_DCHECK macro is equivalent to RTC_CHECK except that it only generates -// code in debug builds. It does reference the condition parameter in all cases, -// though, so callers won't risk getting warnings about unused variables. -#if RTC_DCHECK_IS_ON -#define RTC_DCHECK(condition) RTC_CHECK(condition) -#define RTC_DCHECK_EQ(v1, v2) RTC_CHECK_EQ(v1, v2) -#define RTC_DCHECK_NE(v1, v2) RTC_CHECK_NE(v1, v2) -#define RTC_DCHECK_LE(v1, v2) RTC_CHECK_LE(v1, v2) -#define RTC_DCHECK_LT(v1, v2) RTC_CHECK_LT(v1, v2) -#define RTC_DCHECK_GE(v1, v2) RTC_CHECK_GE(v1, v2) -#define RTC_DCHECK_GT(v1, v2) RTC_CHECK_GT(v1, v2) -#else -#define RTC_DCHECK(condition) RTC_EAT_STREAM_PARAMETERS(condition) -#define RTC_DCHECK_EQ(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Eq, v1, v2) -#define RTC_DCHECK_NE(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Ne, v1, v2) -#define RTC_DCHECK_LE(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Le, v1, v2) -#define RTC_DCHECK_LT(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Lt, v1, v2) -#define RTC_DCHECK_GE(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Ge, v1, v2) -#define RTC_DCHECK_GT(v1, v2) RTC_EAT_STREAM_PARAMETERS_OP(Gt, v1, v2) -#endif - -// This is identical to LogMessageVoidify but in name. -class FatalMessageVoidify { - public: - FatalMessageVoidify() { } - // This has to be an operator with a precedence lower than << but - // higher than ?: - void operator&(std::ostream&) { } -}; - -#define RTC_UNREACHABLE_CODE_HIT false -#define RTC_NOTREACHED() RTC_DCHECK(RTC_UNREACHABLE_CODE_HIT) - -#define FATAL() rtc::FatalMessage(__FILE__, __LINE__).stream() -// TODO(ajm): Consider adding RTC_NOTIMPLEMENTED macro when -// base/logging.h and system_wrappers/logging.h are consolidated such that we -// can match the Chromium behavior. - -// Like a stripped-down LogMessage from logging.h, except that it aborts. -class FatalMessage { - public: - FatalMessage(const char* file, int line); - // Used for RTC_CHECK_EQ(), etc. Takes ownership of the given string. - FatalMessage(const char* file, int line, std::string* result); - NO_RETURN ~FatalMessage(); - - std::ostream& stream() { return stream_; } - - private: - void Init(const char* file, int line); - - std::ostringstream stream_; -}; - -// Performs the integer division a/b and returns the result. CHECKs that the -// remainder is zero. -template -inline T CheckedDivExact(T a, T b) { - RTC_CHECK_EQ(a % b, 0) << a << " is not evenly divisible by " << b; - return a / b; -} - -} // namespace rtc - -#else // __cplusplus not defined -// C version. Lacks many features compared to the C++ version, but usage -// guidelines are the same. - -#define RTC_CHECK(condition) \ - do { \ - if (!(condition)) { \ - rtc_FatalMessage(__FILE__, __LINE__, "CHECK failed: " #condition); \ - } \ - } while (0) - -#define RTC_CHECK_EQ(a, b) RTC_CHECK((a) == (b)) -#define RTC_CHECK_NE(a, b) RTC_CHECK((a) != (b)) -#define RTC_CHECK_LE(a, b) RTC_CHECK((a) <= (b)) -#define RTC_CHECK_LT(a, b) RTC_CHECK((a) < (b)) -#define RTC_CHECK_GE(a, b) RTC_CHECK((a) >= (b)) -#define RTC_CHECK_GT(a, b) RTC_CHECK((a) > (b)) - -#define RTC_DCHECK(condition) \ - do { \ - if (RTC_DCHECK_IS_ON && !(condition)) { \ - rtc_FatalMessage(__FILE__, __LINE__, "DCHECK failed: " #condition); \ - } \ - } while (0) - -#define RTC_DCHECK_EQ(a, b) RTC_DCHECK((a) == (b)) -#define RTC_DCHECK_NE(a, b) RTC_DCHECK((a) != (b)) -#define RTC_DCHECK_LE(a, b) RTC_DCHECK((a) <= (b)) -#define RTC_DCHECK_LT(a, b) RTC_DCHECK((a) < (b)) -#define RTC_DCHECK_GE(a, b) RTC_DCHECK((a) >= (b)) -#define RTC_DCHECK_GT(a, b) RTC_DCHECK((a) > (b)) - -#endif // __cplusplus - -#endif // WEBRTC_RTC_BASE_CHECKS_H_ diff --git a/webrtc/rtc_base/compile_assert_c.h b/webrtc/rtc_base/compile_assert_c.h deleted file mode 100644 index 591eda1379..0000000000 --- a/webrtc/rtc_base/compile_assert_c.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_COMPILE_ASSERT_C_H_ -#define WEBRTC_RTC_BASE_COMPILE_ASSERT_C_H_ - -// Use this macro to verify at compile time that certain restrictions are met. -// The argument is the boolean expression to evaluate. -// Example: -// RTC_COMPILE_ASSERT(sizeof(foo) < 128); -// Note: In C++, use static_assert instead! -#define RTC_COMPILE_ASSERT(expression) switch (0) {case 0: case expression:;} - -#endif // WEBRTC_RTC_BASE_COMPILE_ASSERT_C_H_ diff --git a/webrtc/rtc_base/constructormagic.h b/webrtc/rtc_base/constructormagic.h deleted file mode 100644 index 14de7e8cf5..0000000000 --- a/webrtc/rtc_base/constructormagic.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_CONSTRUCTORMAGIC_H_ -#define WEBRTC_RTC_BASE_CONSTRUCTORMAGIC_H_ - -// Put this in the declarations for a class to be unassignable. -#define RTC_DISALLOW_ASSIGN(TypeName) \ - void operator=(const TypeName&) = delete - -// A macro to disallow the copy constructor and operator= functions. This should -// be used in the declarations for a class. -#define RTC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&) = delete; \ - RTC_DISALLOW_ASSIGN(TypeName) - -// A macro to disallow all the implicit constructors, namely the default -// constructor, copy constructor and operator= functions. -// -// This should be used in the declarations for a class that wants to prevent -// anyone from instantiating it. This is especially useful for classes -// containing only static methods. -#define RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ - TypeName() = delete; \ - RTC_DISALLOW_COPY_AND_ASSIGN(TypeName) - -#endif // WEBRTC_RTC_BASE_CONSTRUCTORMAGIC_H_ diff --git a/webrtc/rtc_base/copyonwritebuffer.h b/webrtc/rtc_base/copyonwritebuffer.h deleted file mode 100644 index d0cdafb34c..0000000000 --- a/webrtc/rtc_base/copyonwritebuffer.h +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_COPYONWRITEBUFFER_H_ -#define WEBRTC_RTC_BASE_COPYONWRITEBUFFER_H_ - -#include -#include - -#include "webrtc/base/buffer.h" -#include "webrtc/base/checks.h" -#include "webrtc/base/refcount.h" -#include "webrtc/base/scoped_ref_ptr.h" - -namespace rtc { - -class CopyOnWriteBuffer { - public: - // An empty buffer. - CopyOnWriteBuffer(); - // Copy size and contents of an existing buffer. - CopyOnWriteBuffer(const CopyOnWriteBuffer& buf); - // Move contents from an existing buffer. - CopyOnWriteBuffer(CopyOnWriteBuffer&& buf); - - // Construct a buffer with the specified number of uninitialized bytes. - explicit CopyOnWriteBuffer(size_t size); - CopyOnWriteBuffer(size_t size, size_t capacity); - - // Construct a buffer and copy the specified number of bytes into it. The - // source array may be (const) uint8_t*, int8_t*, or char*. - template ::value>::type* = nullptr> - CopyOnWriteBuffer(const T* data, size_t size) - : CopyOnWriteBuffer(data, size, size) {} - template ::value>::type* = nullptr> - CopyOnWriteBuffer(const T* data, size_t size, size_t capacity) - : CopyOnWriteBuffer(size, capacity) { - if (buffer_) { - std::memcpy(buffer_->data(), data, size); - } - } - - // Construct a buffer from the contents of an array. - template ::value>::type* = nullptr> - CopyOnWriteBuffer(const T (&array)[N]) // NOLINT: runtime/explicit - : CopyOnWriteBuffer(array, N) {} - - ~CopyOnWriteBuffer(); - - // Get a pointer to the data. Just .data() will give you a (const) uint8_t*, - // but you may also use .data() and .data(). - template ::value>::type* = nullptr> - const T* data() const { - return cdata(); - } - - // Get writable pointer to the data. This will create a copy of the underlying - // data if it is shared with other buffers. - template ::value>::type* = nullptr> - T* data() { - RTC_DCHECK(IsConsistent()); - if (!buffer_) { - return nullptr; - } - CloneDataIfReferenced(buffer_->capacity()); - return buffer_->data(); - } - - // Get const pointer to the data. This will not create a copy of the - // underlying data if it is shared with other buffers. - template ::value>::type* = nullptr> - const T* cdata() const { - RTC_DCHECK(IsConsistent()); - if (!buffer_) { - return nullptr; - } - return buffer_->data(); - } - - size_t size() const { - RTC_DCHECK(IsConsistent()); - return buffer_ ? buffer_->size() : 0; - } - - size_t capacity() const { - RTC_DCHECK(IsConsistent()); - return buffer_ ? buffer_->capacity() : 0; - } - - CopyOnWriteBuffer& operator=(const CopyOnWriteBuffer& buf) { - RTC_DCHECK(IsConsistent()); - RTC_DCHECK(buf.IsConsistent()); - if (&buf != this) { - buffer_ = buf.buffer_; - } - return *this; - } - - CopyOnWriteBuffer& operator=(CopyOnWriteBuffer&& buf) { - RTC_DCHECK(IsConsistent()); - RTC_DCHECK(buf.IsConsistent()); - buffer_ = std::move(buf.buffer_); - return *this; - } - - bool operator==(const CopyOnWriteBuffer& buf) const; - - bool operator!=(const CopyOnWriteBuffer& buf) const { - return !(*this == buf); - } - - uint8_t& operator[](size_t index) { - RTC_DCHECK_LT(index, size()); - return data()[index]; - } - - uint8_t operator[](size_t index) const { - RTC_DCHECK_LT(index, size()); - return cdata()[index]; - } - - // Replace the contents of the buffer. Accepts the same types as the - // constructors. - template ::value>::type* = nullptr> - void SetData(const T* data, size_t size) { - RTC_DCHECK(IsConsistent()); - if (!buffer_) { - buffer_ = size > 0 ? new RefCountedObject(data, size) : nullptr; - } else if (!buffer_->HasOneRef()) { - buffer_ = new RefCountedObject(data, size, buffer_->capacity()); - } else { - buffer_->SetData(data, size); - } - RTC_DCHECK(IsConsistent()); - } - - template ::value>::type* = nullptr> - void SetData(const T (&array)[N]) { - SetData(array, N); - } - - void SetData(const CopyOnWriteBuffer& buf) { - RTC_DCHECK(IsConsistent()); - RTC_DCHECK(buf.IsConsistent()); - if (&buf != this) { - buffer_ = buf.buffer_; - } - } - - // Append data to the buffer. Accepts the same types as the constructors. - template ::value>::type* = nullptr> - void AppendData(const T* data, size_t size) { - RTC_DCHECK(IsConsistent()); - if (!buffer_) { - buffer_ = new RefCountedObject(data, size); - RTC_DCHECK(IsConsistent()); - return; - } - - CloneDataIfReferenced(std::max(buffer_->capacity(), - buffer_->size() + size)); - buffer_->AppendData(data, size); - RTC_DCHECK(IsConsistent()); - } - - template ::value>::type* = nullptr> - void AppendData(const T (&array)[N]) { - AppendData(array, N); - } - - void AppendData(const CopyOnWriteBuffer& buf) { - AppendData(buf.data(), buf.size()); - } - - // Sets the size of the buffer. If the new size is smaller than the old, the - // buffer contents will be kept but truncated; if the new size is greater, - // the existing contents will be kept and the new space will be - // uninitialized. - void SetSize(size_t size); - - // Ensure that the buffer size can be increased to at least capacity without - // further reallocation. (Of course, this operation might need to reallocate - // the buffer.) - void EnsureCapacity(size_t capacity); - - // Resets the buffer to zero size without altering capacity. Works even if the - // buffer has been moved from. - void Clear(); - - // Swaps two buffers. - friend void swap(CopyOnWriteBuffer& a, CopyOnWriteBuffer& b) { - std::swap(a.buffer_, b.buffer_); - } - - private: - // Create a copy of the underlying data if it is referenced from other Buffer - // objects. - void CloneDataIfReferenced(size_t new_capacity); - - // Pre- and postcondition of all methods. - bool IsConsistent() const { - return (!buffer_ || buffer_->capacity() > 0); - } - - // buffer_ is either null, or points to an rtc::Buffer with capacity > 0. - scoped_refptr> buffer_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_COPYONWRITEBUFFER_H_ diff --git a/webrtc/rtc_base/cpu_time.h b/webrtc/rtc_base/cpu_time.h deleted file mode 100644 index 2d431dc467..0000000000 --- a/webrtc/rtc_base/cpu_time.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_CPU_TIME_H_ -#define WEBRTC_RTC_BASE_CPU_TIME_H_ - -#include - -namespace rtc { - -// Returns total CPU time of a current process in nanoseconds. -// Time base is unknown, therefore use only to calculate deltas. -int64_t GetProcessCpuTimeNanos(); - -// Returns total CPU time of a current thread in nanoseconds. -// Time base is unknown, therefore use only to calculate deltas. -int64_t GetThreadCpuTimeNanos(); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_CPU_TIME_H_ diff --git a/webrtc/rtc_base/crc32.h b/webrtc/rtc_base/crc32.h deleted file mode 100644 index a7228df31c..0000000000 --- a/webrtc/rtc_base/crc32.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2012 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_CRC32_H_ -#define WEBRTC_RTC_BASE_CRC32_H_ - -#include - -#include "webrtc/base/basictypes.h" - -namespace rtc { - -// Updates a CRC32 checksum with |len| bytes from |buf|. |initial| holds the -// checksum result from the previous update; for the first call, it should be 0. -uint32_t UpdateCrc32(uint32_t initial, const void* buf, size_t len); - -// Computes a CRC32 checksum using |len| bytes from |buf|. -inline uint32_t ComputeCrc32(const void* buf, size_t len) { - return UpdateCrc32(0, buf, len); -} -inline uint32_t ComputeCrc32(const std::string& str) { - return ComputeCrc32(str.c_str(), str.size()); -} - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_CRC32_H_ diff --git a/webrtc/rtc_base/criticalsection.h b/webrtc/rtc_base/criticalsection.h deleted file mode 100644 index 20a23ce6e3..0000000000 --- a/webrtc/rtc_base/criticalsection.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_CRITICALSECTION_H_ -#define WEBRTC_RTC_BASE_CRITICALSECTION_H_ - -#include "webrtc/base/atomicops.h" -#include "webrtc/base/checks.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/platform_thread_types.h" -#include "webrtc/base/thread_annotations.h" -#include "webrtc/typedefs.h" - -#if defined(WEBRTC_WIN) -// Include winsock2.h before including to maintain consistency with -// win32.h. We can't include win32.h directly here since it pulls in -// headers such as basictypes.h which causes problems in Chromium where webrtc -// exists as two separate projects, webrtc and libjingle. -#include -#include -#include // must come after windows headers. -#endif // defined(WEBRTC_WIN) - -#if defined(WEBRTC_POSIX) -#include -#endif - -// See notes in the 'Performance' unit test for the effects of this flag. -#define USE_NATIVE_MUTEX_ON_MAC 0 - -#if defined(WEBRTC_MAC) && !USE_NATIVE_MUTEX_ON_MAC -#include -#endif - -#define CS_DEBUG_CHECKS RTC_DCHECK_IS_ON - -#if CS_DEBUG_CHECKS -#define CS_DEBUG_CODE(x) x -#else // !CS_DEBUG_CHECKS -#define CS_DEBUG_CODE(x) -#endif // !CS_DEBUG_CHECKS - -namespace rtc { - -// Locking methods (Enter, TryEnter, Leave)are const to permit protecting -// members inside a const context without requiring mutable CriticalSections -// everywhere. -class LOCKABLE CriticalSection { - public: - CriticalSection(); - ~CriticalSection(); - - void Enter() const EXCLUSIVE_LOCK_FUNCTION(); - bool TryEnter() const EXCLUSIVE_TRYLOCK_FUNCTION(true); - void Leave() const UNLOCK_FUNCTION(); - - private: - // Use only for RTC_DCHECKing. - bool CurrentThreadIsOwner() const; - -#if defined(WEBRTC_WIN) - mutable CRITICAL_SECTION crit_; -#elif defined(WEBRTC_POSIX) -# if defined(WEBRTC_MAC) && !USE_NATIVE_MUTEX_ON_MAC - // Number of times the lock has been locked + number of threads waiting. - // TODO(tommi): We could use this number and subtract the recursion count - // to find places where we have multiple threads contending on the same lock. - mutable volatile int lock_queue_; - // |recursion_| represents the recursion count + 1 for the thread that owns - // the lock. Only modified by the thread that owns the lock. - mutable int recursion_; - // Used to signal a single waiting thread when the lock becomes available. - mutable dispatch_semaphore_t semaphore_; - // The thread that currently holds the lock. Required to handle recursion. - mutable PlatformThreadRef owning_thread_; -# else - mutable pthread_mutex_t mutex_; -# endif - mutable PlatformThreadRef thread_; // Only used by RTC_DCHECKs. - mutable int recursion_count_; // Only used by RTC_DCHECKs. -#else // !defined(WEBRTC_WIN) && !defined(WEBRTC_POSIX) -# error Unsupported platform. -#endif -}; - -// CritScope, for serializing execution through a scope. -class SCOPED_LOCKABLE CritScope { - public: - explicit CritScope(const CriticalSection* cs) EXCLUSIVE_LOCK_FUNCTION(cs); - ~CritScope() UNLOCK_FUNCTION(); - private: - const CriticalSection* const cs_; - RTC_DISALLOW_COPY_AND_ASSIGN(CritScope); -}; - -// Tries to lock a critical section on construction via -// CriticalSection::TryEnter, and unlocks on destruction if the -// lock was taken. Never blocks. -// -// IMPORTANT: Unlike CritScope, the lock may not be owned by this thread in -// subsequent code. Users *must* check locked() to determine if the -// lock was taken. If you're not calling locked(), you're doing it wrong! -class TryCritScope { - public: - explicit TryCritScope(const CriticalSection* cs); - ~TryCritScope(); -#if defined(WEBRTC_WIN) - _Check_return_ bool locked() const; -#elif defined(WEBRTC_POSIX) - bool locked() const __attribute__ ((__warn_unused_result__)); -#else // !defined(WEBRTC_WIN) && !defined(WEBRTC_POSIX) -# error Unsupported platform. -#endif - private: - const CriticalSection* const cs_; - const bool locked_; - mutable bool lock_was_called_; // Only used by RTC_DCHECKs. - RTC_DISALLOW_COPY_AND_ASSIGN(TryCritScope); -}; - -// A POD lock used to protect global variables. Do NOT use for other purposes. -// No custom constructor or private data member should be added. -class LOCKABLE GlobalLockPod { - public: - void Lock() EXCLUSIVE_LOCK_FUNCTION(); - - void Unlock() UNLOCK_FUNCTION(); - - volatile int lock_acquired; -}; - -class GlobalLock : public GlobalLockPod { - public: - GlobalLock(); -}; - -// GlobalLockScope, for serializing execution through a scope. -class SCOPED_LOCKABLE GlobalLockScope { - public: - explicit GlobalLockScope(GlobalLockPod* lock) EXCLUSIVE_LOCK_FUNCTION(lock); - ~GlobalLockScope() UNLOCK_FUNCTION(); - private: - GlobalLockPod* const lock_; - RTC_DISALLOW_COPY_AND_ASSIGN(GlobalLockScope); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_CRITICALSECTION_H_ diff --git a/webrtc/rtc_base/cryptstring.h b/webrtc/rtc_base/cryptstring.h deleted file mode 100644 index b7b6694cf6..0000000000 --- a/webrtc/rtc_base/cryptstring.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_CRYPTSTRING_H_ -#define WEBRTC_RTC_BASE_CRYPTSTRING_H_ - -#include - -#include -#include -#include - -namespace rtc { - -class CryptStringImpl { -public: - virtual ~CryptStringImpl() {} - virtual size_t GetLength() const = 0; - virtual void CopyTo(char * dest, bool nullterminate) const = 0; - virtual std::string UrlEncode() const = 0; - virtual CryptStringImpl * Copy() const = 0; - virtual void CopyRawTo(std::vector * dest) const = 0; -}; - -class EmptyCryptStringImpl : public CryptStringImpl { -public: - ~EmptyCryptStringImpl() override {} - size_t GetLength() const override; - void CopyTo(char* dest, bool nullterminate) const override; - std::string UrlEncode() const override; - CryptStringImpl* Copy() const override; - void CopyRawTo(std::vector* dest) const override; -}; - -class CryptString { - public: - CryptString(); - size_t GetLength() const { return impl_->GetLength(); } - void CopyTo(char * dest, bool nullterminate) const { impl_->CopyTo(dest, nullterminate); } - CryptString(const CryptString& other); - explicit CryptString(const CryptStringImpl& impl); - ~CryptString(); - CryptString & operator=(const CryptString & other) { - if (this != &other) { - impl_.reset(other.impl_->Copy()); - } - return *this; - } - void Clear() { impl_.reset(new EmptyCryptStringImpl()); } - std::string UrlEncode() const { return impl_->UrlEncode(); } - void CopyRawTo(std::vector * dest) const { - return impl_->CopyRawTo(dest); - } - - private: - std::unique_ptr impl_; -}; - - -// Used for constructing strings where a password is involved and we -// need to ensure that we zero memory afterwards -class FormatCryptString { -public: - FormatCryptString() { - storage_ = new char[32]; - capacity_ = 32; - length_ = 0; - storage_[0] = 0; - } - - void Append(const std::string & text) { - Append(text.data(), text.length()); - } - - void Append(const char * data, size_t length) { - EnsureStorage(length_ + length + 1); - memcpy(storage_ + length_, data, length); - length_ += length; - storage_[length_] = '\0'; - } - - void Append(const CryptString * password) { - size_t len = password->GetLength(); - EnsureStorage(length_ + len + 1); - password->CopyTo(storage_ + length_, true); - length_ += len; - } - - size_t GetLength() { - return length_; - } - - const char * GetData() { - return storage_; - } - - - // Ensures storage of at least n bytes - void EnsureStorage(size_t n) { - if (capacity_ >= n) { - return; - } - - size_t old_capacity = capacity_; - char * old_storage = storage_; - - for (;;) { - capacity_ *= 2; - if (capacity_ >= n) - break; - } - - storage_ = new char[capacity_]; - - if (old_capacity) { - memcpy(storage_, old_storage, length_); - - // zero memory in a way that an optimizer won't optimize it out - old_storage[0] = 0; - for (size_t i = 1; i < old_capacity; i++) { - old_storage[i] = old_storage[i - 1]; - } - delete[] old_storage; - } - } - - ~FormatCryptString() { - if (capacity_) { - storage_[0] = 0; - for (size_t i = 1; i < capacity_; i++) { - storage_[i] = storage_[i - 1]; - } - } - delete[] storage_; - } -private: - char * storage_; - size_t capacity_; - size_t length_; -}; - -class InsecureCryptStringImpl : public CryptStringImpl { - public: - std::string& password() { return password_; } - const std::string& password() const { return password_; } - - ~InsecureCryptStringImpl() override = default; - size_t GetLength() const override; - void CopyTo(char* dest, bool nullterminate) const override; - std::string UrlEncode() const override; - CryptStringImpl* Copy() const override; - void CopyRawTo(std::vector* dest) const override; - - private: - std::string password_; -}; - -} - -#endif // WEBRTC_RTC_BASE_CRYPTSTRING_H_ diff --git a/webrtc/rtc_base/deprecation.h b/webrtc/rtc_base/deprecation.h deleted file mode 100644 index e02629a1a9..0000000000 --- a/webrtc/rtc_base/deprecation.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_DEPRECATION_H_ -#define WEBRTC_RTC_BASE_DEPRECATION_H_ - -// Annotate the declarations of deprecated functions with this to cause a -// compiler warning when they're used. Like so: -// -// RTC_DEPRECATED std::pony PonyPlz(const std::pony_spec& ps); -// -// NOTE 1: The annotation goes on the declaration in the .h file, not the -// definition in the .cc file! -// -// NOTE 2: In order to keep unit testing the deprecated function without -// getting warnings, do something like this: -// -// std::pony DEPRECATED_PonyPlz(const std::pony_spec& ps); -// RTC_DEPRECATED inline std::pony PonyPlz(const std::pony_spec& ps) { -// return DEPRECATED_PonyPlz(ps); -// } -// -// In other words, rename the existing function, and provide an inline wrapper -// using the original name that calls it. That way, callers who are willing to -// call it using the DEPRECATED_-prefixed name don't get the warning. -// -// TODO(kwiberg): Remove this when we can use [[deprecated]] from C++14. -#if defined(_MSC_VER) -// Note: Deprecation warnings seem to fail to trigger on Windows -// (https://bugs.chromium.org/p/webrtc/issues/detail?id=5368). -#define RTC_DEPRECATED __declspec(deprecated) -#elif defined(__GNUC__) -#define RTC_DEPRECATED __attribute__ ((__deprecated__)) -#else -#define RTC_DEPRECATED -#endif - -#endif // WEBRTC_RTC_BASE_DEPRECATION_H_ diff --git a/webrtc/rtc_base/dscp.h b/webrtc/rtc_base/dscp.h deleted file mode 100644 index e65ed77257..0000000000 --- a/webrtc/rtc_base/dscp.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2013 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_DSCP_H_ -#define WEBRTC_RTC_BASE_DSCP_H_ - -namespace rtc { -// Differentiated Services Code Point. -// See http://tools.ietf.org/html/rfc2474 for details. -enum DiffServCodePoint { - DSCP_NO_CHANGE = -1, - DSCP_DEFAULT = 0, // Same as DSCP_CS0 - DSCP_CS0 = 0, // The default - DSCP_CS1 = 8, // Bulk/background traffic - DSCP_AF11 = 10, - DSCP_AF12 = 12, - DSCP_AF13 = 14, - DSCP_CS2 = 16, - DSCP_AF21 = 18, - DSCP_AF22 = 20, - DSCP_AF23 = 22, - DSCP_CS3 = 24, - DSCP_AF31 = 26, - DSCP_AF32 = 28, - DSCP_AF33 = 30, - DSCP_CS4 = 32, - DSCP_AF41 = 34, // Video - DSCP_AF42 = 36, // Video - DSCP_AF43 = 38, // Video - DSCP_CS5 = 40, // Video - DSCP_EF = 46, // Voice - DSCP_CS6 = 48, // Voice - DSCP_CS7 = 56, // Control messages -}; - -} // namespace rtc - - #endif // WEBRTC_RTC_BASE_DSCP_H_ diff --git a/webrtc/rtc_base/event.h b/webrtc/rtc_base/event.h deleted file mode 100644 index ca43d4df57..0000000000 --- a/webrtc/rtc_base/event.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_EVENT_H_ -#define WEBRTC_RTC_BASE_EVENT_H_ - -#include "webrtc/base/constructormagic.h" -#if defined(WEBRTC_WIN) -#include "webrtc/base/win32.h" // NOLINT: consider this a system header. -#elif defined(WEBRTC_POSIX) -#include -#else -#error "Must define either WEBRTC_WIN or WEBRTC_POSIX." -#endif - -namespace rtc { - -class Event { - public: - static const int kForever = -1; - - Event(bool manual_reset, bool initially_signaled); - ~Event(); - - void Set(); - void Reset(); - - // Wait for the event to become signaled, for the specified number of - // |milliseconds|. To wait indefinetly, pass kForever. - bool Wait(int milliseconds); - - private: -#if defined(WEBRTC_WIN) - HANDLE event_handle_; -#elif defined(WEBRTC_POSIX) - pthread_mutex_t event_mutex_; - pthread_cond_t event_cond_; - const bool is_manual_reset_; - bool event_status_; -#endif - - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Event); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_EVENT_H_ diff --git a/webrtc/rtc_base/event_tracer.h b/webrtc/rtc_base/event_tracer.h deleted file mode 100644 index e0136abb7b..0000000000 --- a/webrtc/rtc_base/event_tracer.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This file defines the interface for event tracing in WebRTC. -// -// Event log handlers are set through SetupEventTracer(). User of this API will -// provide two function pointers to handle event tracing calls. -// -// * GetCategoryEnabledPtr -// Event tracing system calls this function to determine if a particular -// event category is enabled. -// -// * AddTraceEventPtr -// Adds a tracing event. It is the user's responsibility to log the data -// provided. -// -// Parameters for the above two functions are described in trace_event.h. - -#ifndef WEBRTC_RTC_BASE_EVENT_TRACER_H_ -#define WEBRTC_RTC_BASE_EVENT_TRACER_H_ - -#include - -namespace webrtc { - -typedef const unsigned char* (*GetCategoryEnabledPtr)(const char* name); -typedef void (*AddTraceEventPtr)(char phase, - const unsigned char* category_enabled, - const char* name, - unsigned long long id, - int num_args, - const char** arg_names, - const unsigned char* arg_types, - const unsigned long long* arg_values, - unsigned char flags); - -// User of WebRTC can call this method to setup event tracing. -// -// This method must be called before any WebRTC methods. Functions -// provided should be thread-safe. -void SetupEventTracer( - GetCategoryEnabledPtr get_category_enabled_ptr, - AddTraceEventPtr add_trace_event_ptr); - -// This class defines interface for the event tracing system to call -// internally. Do not call these methods directly. -class EventTracer { - public: - static const unsigned char* GetCategoryEnabled( - const char* name); - - static void AddTraceEvent( - char phase, - const unsigned char* category_enabled, - const char* name, - unsigned long long id, - int num_args, - const char** arg_names, - const unsigned char* arg_types, - const unsigned long long* arg_values, - unsigned char flags); -}; - -} // namespace webrtc - -namespace rtc { -namespace tracing { -// Set up internal event tracer. -void SetupInternalTracer(); -bool StartInternalCapture(const char* filename); -void StartInternalCaptureToFile(FILE* file); -void StopInternalCapture(); -// Make sure we run this, this will tear down the internal tracing. -void ShutdownInternalTracer(); -} // namespace tracing -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_EVENT_TRACER_H_ diff --git a/webrtc/rtc_base/fakeclock.h b/webrtc/rtc_base/fakeclock.h deleted file mode 100644 index 659ae10d7b..0000000000 --- a/webrtc/rtc_base/fakeclock.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_FAKECLOCK_H_ -#define WEBRTC_RTC_BASE_FAKECLOCK_H_ - -#include "webrtc/base/criticalsection.h" -#include "webrtc/base/timedelta.h" -#include "webrtc/base/timeutils.h" - -namespace rtc { - -// Fake clock for use with unit tests, which does not tick on its own. -// Starts at time 0. -// -// TODO(deadbeef): Unify with webrtc::SimulatedClock. -class FakeClock : public ClockInterface { - public: - ~FakeClock() override {} - - // ClockInterface implementation. - int64_t TimeNanos() const override; - - // Methods that can be used by the test to control the time. - - // Should only be used to set a time in the future. - void SetTimeNanos(int64_t nanos); - void SetTimeMicros(int64_t micros) { - SetTimeNanos(kNumNanosecsPerMicrosec * micros); - } - - void AdvanceTime(TimeDelta delta); - void AdvanceTimeMicros(int64_t micros) { - AdvanceTime(rtc::TimeDelta::FromMicroseconds(micros)); - } - private: - CriticalSection lock_; - int64_t time_ GUARDED_BY(lock_) = 0; -}; - -// Helper class that sets itself as the global clock in its constructor and -// unsets it in its destructor. -class ScopedFakeClock : public FakeClock { - public: - ScopedFakeClock(); - ~ScopedFakeClock() override; - - private: - ClockInterface* prev_clock_; -}; - -// Helper class to "undo" the fake clock temporarily. -class ScopedRealClock { - public: - ScopedRealClock(); - ~ScopedRealClock(); - - private: - ClockInterface* prev_clock_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_FAKECLOCK_H_ diff --git a/webrtc/rtc_base/fakenetwork.h b/webrtc/rtc_base/fakenetwork.h deleted file mode 100644 index ef3b5da1e1..0000000000 --- a/webrtc/rtc_base/fakenetwork.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2009 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_FAKENETWORK_H_ -#define WEBRTC_RTC_BASE_FAKENETWORK_H_ - -#include -#include -#include -#include - -#include "webrtc/base/network.h" -#include "webrtc/base/messagehandler.h" -#include "webrtc/base/socketaddress.h" -#include "webrtc/base/stringencode.h" -#include "webrtc/base/thread.h" - -namespace rtc { - -const int kFakeIPv4NetworkPrefixLength = 24; -const int kFakeIPv6NetworkPrefixLength = 64; - -// Fake network manager that allows us to manually specify the IPs to use. -class FakeNetworkManager : public NetworkManagerBase, - public MessageHandler { - public: - FakeNetworkManager() {} - - typedef std::vector> IfaceList; - - void AddInterface(const SocketAddress& iface) { - // Ensure a unique name for the interface if its name is not given. - AddInterface(iface, "test" + rtc::ToString(next_index_++)); - } - - void AddInterface(const SocketAddress& iface, const std::string& if_name) { - AddInterface(iface, if_name, ADAPTER_TYPE_UNKNOWN); - } - - void AddInterface(const SocketAddress& iface, - const std::string& if_name, - AdapterType type) { - SocketAddress address(if_name, 0); - address.SetResolvedIP(iface.ipaddr()); - ifaces_.push_back(std::make_pair(address, type)); - DoUpdateNetworks(); - } - - void RemoveInterface(const SocketAddress& iface) { - for (IfaceList::iterator it = ifaces_.begin(); - it != ifaces_.end(); ++it) { - if (it->first.EqualIPs(iface)) { - ifaces_.erase(it); - break; - } - } - DoUpdateNetworks(); - } - - virtual void StartUpdating() { - ++start_count_; - if (start_count_ == 1) { - sent_first_update_ = false; - rtc::Thread::Current()->Post(RTC_FROM_HERE, this); - } else { - if (sent_first_update_) { - SignalNetworksChanged(); - } - } - } - - virtual void StopUpdating() { --start_count_; } - - // MessageHandler interface. - virtual void OnMessage(Message* msg) { - DoUpdateNetworks(); - } - - using NetworkManagerBase::set_enumeration_permission; - using NetworkManagerBase::set_default_local_addresses; - - private: - void DoUpdateNetworks() { - if (start_count_ == 0) - return; - std::vector networks; - for (IfaceList::iterator it = ifaces_.begin(); - it != ifaces_.end(); ++it) { - int prefix_length = 0; - if (it->first.ipaddr().family() == AF_INET) { - prefix_length = kFakeIPv4NetworkPrefixLength; - } else if (it->first.ipaddr().family() == AF_INET6) { - prefix_length = kFakeIPv6NetworkPrefixLength; - } - IPAddress prefix = TruncateIP(it->first.ipaddr(), prefix_length); - std::unique_ptr net(new Network(it->first.hostname(), - it->first.hostname(), prefix, - prefix_length, it->second)); - net->set_default_local_address_provider(this); - net->AddIP(it->first.ipaddr()); - networks.push_back(net.release()); - } - bool changed; - MergeNetworkList(networks, &changed); - if (changed || !sent_first_update_) { - SignalNetworksChanged(); - sent_first_update_ = true; - } - } - - IfaceList ifaces_; - int next_index_ = 0; - int start_count_ = 0; - bool sent_first_update_ = false; - - IPAddress default_local_ipv4_address_; - IPAddress default_local_ipv6_address_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_FAKENETWORK_H_ diff --git a/webrtc/rtc_base/fakesslidentity.h b/webrtc/rtc_base/fakesslidentity.h deleted file mode 100644 index cc23b318bb..0000000000 --- a/webrtc/rtc_base/fakesslidentity.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright 2012 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_FAKESSLIDENTITY_H_ -#define WEBRTC_RTC_BASE_FAKESSLIDENTITY_H_ - -#include -#include -#include - -#include "webrtc/base/checks.h" -#include "webrtc/base/messagedigest.h" -#include "webrtc/base/sslidentity.h" - -namespace rtc { - -class FakeSSLCertificate : public rtc::SSLCertificate { - public: - // SHA-1 is the default digest algorithm because it is available in all build - // configurations used for unit testing. - explicit FakeSSLCertificate(const std::string& data) - : data_(data), digest_algorithm_(DIGEST_SHA_1), expiration_time_(-1) {} - explicit FakeSSLCertificate(const std::vector& certs) - : data_(certs.front()), - digest_algorithm_(DIGEST_SHA_1), - expiration_time_(-1) { - std::vector::const_iterator it; - // Skip certs[0]. - for (it = certs.begin() + 1; it != certs.end(); ++it) { - certs_.push_back(FakeSSLCertificate(*it)); - } - } - FakeSSLCertificate* GetReference() const override { - return new FakeSSLCertificate(*this); - } - std::string ToPEMString() const override { - return data_; - } - void ToDER(Buffer* der_buffer) const override { - std::string der_string; - RTC_CHECK(SSLIdentity::PemToDer(kPemTypeCertificate, data_, &der_string)); - der_buffer->SetData(der_string.c_str(), der_string.size()); - } - int64_t CertificateExpirationTime() const override { - return expiration_time_; - } - void SetCertificateExpirationTime(int64_t expiration_time) { - expiration_time_ = expiration_time; - } - void set_digest_algorithm(const std::string& algorithm) { - digest_algorithm_ = algorithm; - } - bool GetSignatureDigestAlgorithm(std::string* algorithm) const override { - *algorithm = digest_algorithm_; - return true; - } - bool ComputeDigest(const std::string& algorithm, - unsigned char* digest, - size_t size, - size_t* length) const override { - *length = rtc::ComputeDigest(algorithm, data_.c_str(), data_.size(), - digest, size); - return (*length != 0); - } - std::unique_ptr GetChain() const override { - if (certs_.empty()) - return nullptr; - std::vector new_certs(certs_.size()); - std::transform(certs_.begin(), certs_.end(), new_certs.begin(), DupCert); - std::unique_ptr chain(new SSLCertChain(new_certs)); - std::for_each(new_certs.begin(), new_certs.end(), DeleteCert); - return chain; - } - - private: - static FakeSSLCertificate* DupCert(FakeSSLCertificate cert) { - return cert.GetReference(); - } - static void DeleteCert(SSLCertificate* cert) { delete cert; } - std::string data_; - std::vector certs_; - std::string digest_algorithm_; - // Expiration time in seconds relative to epoch, 1970-01-01T00:00:00Z (UTC). - int64_t expiration_time_; -}; - -class FakeSSLIdentity : public rtc::SSLIdentity { - public: - explicit FakeSSLIdentity(const std::string& data) : cert_(data) {} - explicit FakeSSLIdentity(const FakeSSLCertificate& cert) : cert_(cert) {} - virtual FakeSSLIdentity* GetReference() const { - return new FakeSSLIdentity(*this); - } - virtual const FakeSSLCertificate& certificate() const { return cert_; } - virtual std::string PrivateKeyToPEMString() const { - RTC_NOTREACHED(); // Not implemented. - return ""; - } - virtual std::string PublicKeyToPEMString() const { - RTC_NOTREACHED(); // Not implemented. - return ""; - } - virtual bool operator==(const SSLIdentity& other) const { - RTC_NOTREACHED(); // Not implemented. - return false; - } - private: - FakeSSLCertificate cert_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_FAKESSLIDENTITY_H_ diff --git a/webrtc/rtc_base/file.h b/webrtc/rtc_base/file.h deleted file mode 100644 index 7c82006d86..0000000000 --- a/webrtc/rtc_base/file.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_FILE_H_ -#define WEBRTC_RTC_BASE_FILE_H_ - -#include - -#include - -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/pathutils.h" -#include "webrtc/base/platform_file.h" - -namespace rtc { - -// This class wraps the platform specific APIs for simple file interactions. -// -// The various read and write methods are best effort, i.e. if an underlying -// call does not manage to read/write all the data more calls will be performed, -// until an error is detected or all data is read/written. -class File { - public: - // Wraps the given PlatformFile. This class is then responsible for closing - // the file, which will be done in the destructor if Close is never called. - explicit File(PlatformFile); - // The default constructor produces a closed file. - File(); - ~File(); - - File(File&& other); - File& operator=(File&& other); - - // Open and Create give files with both reading and writing enabled. - static File Open(const std::string& path); - static File Open(Pathname&& path); - static File Open(const Pathname& path); - // If the file already exists it will be overwritten. - static File Create(const std::string& path); - static File Create(Pathname&& path); - static File Create(const Pathname& path); - - // Remove a file in the file system. - static bool Remove(const std::string& path); - static bool Remove(Pathname&& path); - static bool Remove(const Pathname& path); - - size_t Write(const uint8_t* data, size_t length); - size_t Read(uint8_t* buffer, size_t length); - - // The current position in the file after a call to these methods is platform - // dependent (MSVC gives position offset+length, most other - // compilers/platforms do not alter the position), i.e. do not depend on it, - // do a Seek before any subsequent Read/Write. - size_t WriteAt(const uint8_t* data, size_t length, size_t offset); - size_t ReadAt(uint8_t* buffer, size_t length, size_t offset); - - // Attempt to position the file at the given offset from the start. - // Returns true if successful, false otherwise. - bool Seek(size_t offset); - - // Attempt to close the file. Returns true if successful, false otherwise, - // most notably when the file is already closed. - bool Close(); - - bool IsOpen(); - - private: - PlatformFile file_; - RTC_DISALLOW_COPY_AND_ASSIGN(File); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_FILE_H_ diff --git a/webrtc/rtc_base/filerotatingstream.h b/webrtc/rtc_base/filerotatingstream.h deleted file mode 100644 index 9a4820a27c..0000000000 --- a/webrtc/rtc_base/filerotatingstream.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_FILEROTATINGSTREAM_H_ -#define WEBRTC_RTC_BASE_FILEROTATINGSTREAM_H_ - -#include -#include -#include - -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/stream.h" - -namespace rtc { - -// FileRotatingStream writes to a file in the directory specified in the -// constructor. It rotates the files once the current file is full. The -// individual file size and the number of files used is configurable in the -// constructor. Open() must be called before using this stream. -class FileRotatingStream : public StreamInterface { - public: - // Use this constructor for reading a directory previously written to with - // this stream. - FileRotatingStream(const std::string& dir_path, - const std::string& file_prefix); - - // Use this constructor for writing to a directory. Files in the directory - // matching the prefix will be deleted on open. - FileRotatingStream(const std::string& dir_path, - const std::string& file_prefix, - size_t max_file_size, - size_t num_files); - - ~FileRotatingStream() override; - - // StreamInterface methods. - StreamState GetState() const override; - StreamResult Read(void* buffer, - size_t buffer_len, - size_t* read, - int* error) override; - StreamResult Write(const void* data, - size_t data_len, - size_t* written, - int* error) override; - bool Flush() override; - // Returns the total file size currently used on disk. - bool GetSize(size_t* size) const override; - void Close() override; - - // Opens the appropriate file(s). Call this before using the stream. - bool Open(); - - // Disabling buffering causes writes to block until disk is updated. This is - // enabled by default for performance. - bool DisableBuffering(); - - // Returns the path used for the i-th newest file, where the 0th file is the - // newest file. The file may or may not exist, this is just used for - // formatting. Index must be less than GetNumFiles(). - std::string GetFilePath(size_t index) const; - - // Returns the number of files that will used by this stream. - size_t GetNumFiles() const { return file_names_.size(); } - - protected: - size_t GetMaxFileSize() const { return max_file_size_; } - - void SetMaxFileSize(size_t size) { max_file_size_ = size; } - - size_t GetRotationIndex() const { return rotation_index_; } - - void SetRotationIndex(size_t index) { rotation_index_ = index; } - - virtual void OnRotation() {} - - private: - enum Mode { kRead, kWrite }; - - FileRotatingStream(const std::string& dir_path, - const std::string& file_prefix, - size_t max_file_size, - size_t num_files, - Mode mode); - - bool OpenCurrentFile(); - void CloseCurrentFile(); - - // Rotates the files by creating a new current file, renaming the - // existing files, and deleting the oldest one. e.g. - // file_0 -> file_1 - // file_1 -> file_2 - // file_2 -> delete - // create new file_0 - void RotateFiles(); - - // Returns a list of file names in the directory beginning with the prefix. - std::vector GetFilesWithPrefix() const; - // Private version of GetFilePath. - std::string GetFilePath(size_t index, size_t num_files) const; - - const std::string dir_path_; - const std::string file_prefix_; - const Mode mode_; - - // FileStream is used to write to the current file. - std::unique_ptr file_stream_; - // Convenience storage for file names so we don't generate them over and over. - std::vector file_names_; - size_t max_file_size_; - size_t current_file_index_; - // The rotation index indicates the index of the file that will be - // deleted first on rotation. Indices lower than this index will be rotated. - size_t rotation_index_; - // Number of bytes written to current file. We need this because with - // buffering the file size read from disk might not be accurate. - size_t current_bytes_written_; - bool disable_buffering_; - - RTC_DISALLOW_COPY_AND_ASSIGN(FileRotatingStream); -}; - -// CallSessionFileRotatingStream is meant to be used in situations where we will -// have limited disk space. Its purpose is to read and write logs up to a -// maximum size. Once the maximum size is exceeded, logs from the middle are -// deleted whereas logs from the beginning and end are preserved. The reason for -// this is because we anticipate that in WebRTC the beginning and end of the -// logs are most useful for call diagnostics. -// -// This implementation simply writes to a single file until -// |max_total_log_size| / 2 bytes are written to it, and subsequently writes to -// a set of rotating files. We do this by inheriting FileRotatingStream and -// setting the appropriate internal variables so that we don't delete the last -// (earliest) file on rotate, and that that file's size is bigger. -// -// Open() must be called before using this stream. -class CallSessionFileRotatingStream : public FileRotatingStream { - public: - // Use this constructor for reading a directory previously written to with - // this stream. - explicit CallSessionFileRotatingStream(const std::string& dir_path); - // Use this constructor for writing to a directory. Files in the directory - // matching what's used by the stream will be deleted. |max_total_log_size| - // must be at least 4. - CallSessionFileRotatingStream(const std::string& dir_path, - size_t max_total_log_size); - ~CallSessionFileRotatingStream() override {} - - protected: - void OnRotation() override; - - private: - static size_t GetRotatingLogSize(size_t max_total_log_size); - static size_t GetNumRotatingLogFiles(size_t max_total_log_size); - static const char* kLogPrefix; - static const size_t kRotatingLogFileDefaultSize; - - const size_t max_total_log_size_; - size_t num_rotations_; - - RTC_DISALLOW_COPY_AND_ASSIGN(CallSessionFileRotatingStream); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_FILEROTATINGSTREAM_H_ diff --git a/webrtc/rtc_base/fileutils.h b/webrtc/rtc_base/fileutils.h deleted file mode 100644 index 17e810379c..0000000000 --- a/webrtc/rtc_base/fileutils.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_FILEUTILS_H_ -#define WEBRTC_RTC_BASE_FILEUTILS_H_ - -#include - -#if !defined(WEBRTC_WIN) -#include -#include -#include -#include -#include -#endif - -#include "webrtc/base/checks.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/platform_file.h" - -namespace rtc { - -class FileStream; -class Pathname; - -////////////////////////// -// Directory Iterator // -////////////////////////// - -// A DirectoryIterator is created with a given directory. It originally points -// to the first file in the directory, and can be advanecd with Next(). This -// allows you to get information about each file. - -class DirectoryIterator { - friend class Filesystem; - public: - // Constructor - DirectoryIterator(); - // Destructor - virtual ~DirectoryIterator(); - - // Starts traversing a directory - // dir is the directory to traverse - // returns true if the directory exists and is valid - // The iterator will point to the first entry in the directory - virtual bool Iterate(const Pathname &path); - - // Advances to the next file - // returns true if there were more files in the directory. - virtual bool Next(); - - // returns true if the file currently pointed to is a directory - virtual bool IsDirectory() const; - - // returns the name of the file currently pointed to - virtual std::string Name() const; - - private: - std::string directory_; -#if defined(WEBRTC_WIN) - WIN32_FIND_DATA data_; - HANDLE handle_; -#else - DIR *dir_; - struct dirent *dirent_; - struct stat stat_; -#endif -}; - -class FilesystemInterface { - public: - virtual ~FilesystemInterface() {} - - // This will attempt to delete the path located at filename. - // It DCHECKs and returns false if the path points to a folder or a - // non-existent file. - virtual bool DeleteFile(const Pathname &filename) = 0; - - // Creates a directory. This will call itself recursively to create /foo/bar - // even if /foo does not exist. Returns true if the function succeeds. - virtual bool CreateFolder(const Pathname &pathname) = 0; - - // This moves a file from old_path to new_path, where "old_path" is a - // plain file. This DCHECKs and returns false if old_path points to a - // directory, and returns true if the function succeeds. - virtual bool MoveFile(const Pathname &old_path, const Pathname &new_path) = 0; - - // Returns true if pathname refers to a directory - virtual bool IsFolder(const Pathname& pathname) = 0; - - // Returns true if pathname refers to a file - virtual bool IsFile(const Pathname& pathname) = 0; - - // Returns true if pathname refers to no filesystem object, every parent - // directory either exists, or is also absent. - virtual bool IsAbsent(const Pathname& pathname) = 0; - - // A folder appropriate for storing temporary files (Contents are - // automatically deleted when the program exits) - virtual bool GetTemporaryFolder(Pathname &path, bool create, - const std::string *append) = 0; - - virtual std::string TempFilename(const Pathname &dir, - const std::string &prefix) = 0; - - // Determines the size of the file indicated by path. - virtual bool GetFileSize(const Pathname& path, size_t* size) = 0; -}; - -class Filesystem { - public: - static FilesystemInterface *default_filesystem() { - RTC_DCHECK(default_filesystem_); - return default_filesystem_; - } - - static void set_default_filesystem(FilesystemInterface *filesystem) { - default_filesystem_ = filesystem; - } - - static FilesystemInterface *swap_default_filesystem( - FilesystemInterface *filesystem) { - FilesystemInterface *cur = default_filesystem_; - default_filesystem_ = filesystem; - return cur; - } - - static bool CreateFolder(const Pathname &pathname) { - return EnsureDefaultFilesystem()->CreateFolder(pathname); - } - - static bool DeleteFile(const Pathname &filename) { - return EnsureDefaultFilesystem()->DeleteFile(filename); - } - - static bool MoveFile(const Pathname &old_path, const Pathname &new_path) { - return EnsureDefaultFilesystem()->MoveFile(old_path, new_path); - } - - static bool IsFolder(const Pathname& pathname) { - return EnsureDefaultFilesystem()->IsFolder(pathname); - } - - static bool IsFile(const Pathname &pathname) { - return EnsureDefaultFilesystem()->IsFile(pathname); - } - - static bool IsAbsent(const Pathname &pathname) { - return EnsureDefaultFilesystem()->IsAbsent(pathname); - } - - static bool GetTemporaryFolder(Pathname &path, bool create, - const std::string *append) { - return EnsureDefaultFilesystem()->GetTemporaryFolder(path, create, append); - } - - static std::string TempFilename(const Pathname &dir, - const std::string &prefix) { - return EnsureDefaultFilesystem()->TempFilename(dir, prefix); - } - - static bool GetFileSize(const Pathname& path, size_t* size) { - return EnsureDefaultFilesystem()->GetFileSize(path, size); - } - - private: - static FilesystemInterface* default_filesystem_; - - static FilesystemInterface *EnsureDefaultFilesystem(); - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_FILEUTILS_H_ diff --git a/webrtc/rtc_base/firewallsocketserver.h b/webrtc/rtc_base/firewallsocketserver.h deleted file mode 100644 index 5c3abdcf18..0000000000 --- a/webrtc/rtc_base/firewallsocketserver.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_FIREWALLSOCKETSERVER_H_ -#define WEBRTC_RTC_BASE_FIREWALLSOCKETSERVER_H_ - -#include -#include "webrtc/base/socketserver.h" -#include "webrtc/base/criticalsection.h" - -namespace rtc { - -class FirewallManager; - -// This SocketServer shim simulates a rule-based firewall server. - -enum FirewallProtocol { FP_UDP, FP_TCP, FP_ANY }; -enum FirewallDirection { FD_IN, FD_OUT, FD_ANY }; - -class FirewallSocketServer : public SocketServer { - public: - FirewallSocketServer(SocketServer* server, - FirewallManager* manager = nullptr, - bool should_delete_server = false); - ~FirewallSocketServer() override; - - SocketServer* socketserver() const { return server_; } - void set_socketserver(SocketServer* server) { - if (server_ && should_delete_server_) { - delete server_; - server_ = nullptr; - should_delete_server_ = false; - } - server_ = server; - } - - // Settings to control whether CreateSocket or Socket::Listen succeed. - void set_udp_sockets_enabled(bool enabled) { udp_sockets_enabled_ = enabled; } - void set_tcp_sockets_enabled(bool enabled) { tcp_sockets_enabled_ = enabled; } - bool tcp_listen_enabled() const { return tcp_listen_enabled_; } - void set_tcp_listen_enabled(bool enabled) { tcp_listen_enabled_ = enabled; } - - // Rules govern the behavior of Connect/Accept/Send/Recv attempts. - void AddRule(bool allow, FirewallProtocol p = FP_ANY, - FirewallDirection d = FD_ANY, - const SocketAddress& addr = SocketAddress()); - void AddRule(bool allow, FirewallProtocol p, - const SocketAddress& src, const SocketAddress& dst); - void ClearRules(); - - bool Check(FirewallProtocol p, - const SocketAddress& src, const SocketAddress& dst); - - // Set the IP addresses for which Bind will fail. By default this list is - // empty. This can be used to simulate a real OS that refuses to bind to - // addresses under various circumstances. - // - // No matter how many addresses are added (including INADDR_ANY), the server - // will still allow creating outgoing TCP connections, since they don't - // require explicitly binding a socket. - void SetUnbindableIps(const std::vector& unbindable_ips); - bool IsBindableIp(const rtc::IPAddress& ip); - - Socket* CreateSocket(int type) override; - Socket* CreateSocket(int family, int type) override; - - AsyncSocket* CreateAsyncSocket(int type) override; - AsyncSocket* CreateAsyncSocket(int family, int type) override; - - void SetMessageQueue(MessageQueue* queue) override; - bool Wait(int cms, bool process_io) override; - void WakeUp() override; - - Socket * WrapSocket(Socket * sock, int type); - AsyncSocket * WrapSocket(AsyncSocket * sock, int type); - - private: - SocketServer * server_; - FirewallManager * manager_; - CriticalSection crit_; - struct Rule { - bool allow; - FirewallProtocol p; - FirewallDirection d; - SocketAddress src; - SocketAddress dst; - }; - std::vector rules_; - std::vector unbindable_ips_; - bool should_delete_server_; - bool udp_sockets_enabled_; - bool tcp_sockets_enabled_; - bool tcp_listen_enabled_; -}; - -// FirewallManager allows you to manage firewalls in multiple threads together - -class FirewallManager { - public: - FirewallManager(); - ~FirewallManager(); - - void AddServer(FirewallSocketServer * server); - void RemoveServer(FirewallSocketServer * server); - - void AddRule(bool allow, FirewallProtocol p = FP_ANY, - FirewallDirection d = FD_ANY, - const SocketAddress& addr = SocketAddress()); - void ClearRules(); - - private: - CriticalSection crit_; - std::vector servers_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_FIREWALLSOCKETSERVER_H_ diff --git a/webrtc/rtc_base/flags.h b/webrtc/rtc_base/flags.h deleted file mode 100644 index 3d4527ced8..0000000000 --- a/webrtc/rtc_base/flags.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright 2006 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -// Originally comes from shared/commandlineflags/flags.h - -// Flags are defined and declared using DEFINE_xxx and DECLARE_xxx macros, -// where xxx is the flag type. Flags are referred to via FLAG_yyy, -// where yyy is the flag name. For intialization and iteration of flags, -// see the FlagList class. For full programmatic access to any -// flag, see the Flag class. -// -// The implementation only relies and basic C++ functionality -// and needs no special library or STL support. - -#ifndef WEBRTC_RTC_BASE_FLAGS_H_ -#define WEBRTC_RTC_BASE_FLAGS_H_ - -#include "webrtc/base/checks.h" -#include "webrtc/base/constructormagic.h" - -namespace rtc { - -// Internal use only. -union FlagValue { - // Note: Because in C++ non-bool values are silently converted into - // bool values ('bool b = "false";' results in b == true!), we pass - // and int argument to New_BOOL as this appears to be safer - sigh. - // In particular, it prevents the (not uncommon!) bug where a bool - // flag is defined via: DEFINE_bool(flag, "false", "some comment");. - static FlagValue New_BOOL(int b) { - FlagValue v; - v.b = (b != 0); - return v; - } - - static FlagValue New_INT(int i) { - FlagValue v; - v.i = i; - return v; - } - - static FlagValue New_FLOAT(float f) { - FlagValue v; - v.f = f; - return v; - } - - static FlagValue New_STRING(const char* s) { - FlagValue v; - v.s = s; - return v; - } - - bool b; - int i; - double f; - const char* s; -}; - - -// Each flag can be accessed programmatically via a Flag object. -class Flag { - public: - enum Type { BOOL, INT, FLOAT, STRING }; - - // Internal use only. - Flag(const char* file, const char* name, const char* comment, - Type type, void* variable, FlagValue default_); - - // General flag information - const char* file() const { return file_; } - const char* name() const { return name_; } - const char* comment() const { return comment_; } - - // Flag type - Type type() const { return type_; } - - // Flag variables - bool* bool_variable() const { - RTC_DCHECK_EQ(BOOL, type_); - return &variable_->b; - } - - int* int_variable() const { - RTC_DCHECK_EQ(INT, type_); - return &variable_->i; - } - - double* float_variable() const { - RTC_DCHECK_EQ(FLOAT, type_); - return &variable_->f; - } - - const char** string_variable() const { - RTC_DCHECK_EQ(STRING, type_); - return &variable_->s; - } - - // Default values - bool bool_default() const { - RTC_DCHECK_EQ(BOOL, type_); - return default_.b; - } - - int int_default() const { - RTC_DCHECK_EQ(INT, type_); - return default_.i; - } - - double float_default() const { - RTC_DCHECK_EQ(FLOAT, type_); - return default_.f; - } - - const char* string_default() const { - RTC_DCHECK_EQ(STRING, type_); - return default_.s; - } - - // Resets a flag to its default value - void SetToDefault(); - - // Iteration support - Flag* next() const { return next_; } - - // Prints flag information. The current flag value is only printed - // if print_current_value is set. - void Print(bool print_current_value); - - private: - const char* file_; - const char* name_; - const char* comment_; - - Type type_; - FlagValue* variable_; - FlagValue default_; - - Flag* next_; - - friend class FlagList; // accesses next_ -}; - - -// Internal use only. -#define DEFINE_FLAG(type, c_type, name, default, comment) \ - /* define and initialize the flag */ \ - c_type FLAG_##name = (default); \ - /* register the flag */ \ - static rtc::Flag Flag_##name(__FILE__, #name, (comment), \ - rtc::Flag::type, &FLAG_##name, \ - rtc::FlagValue::New_##type(default)) - - -// Internal use only. -#define DECLARE_FLAG(c_type, name) \ - /* declare the external flag */ \ - extern c_type FLAG_##name - - -// Use the following macros to define a new flag: -#define DEFINE_bool(name, default, comment) \ - DEFINE_FLAG(BOOL, bool, name, default, comment) -#define DEFINE_int(name, default, comment) \ - DEFINE_FLAG(INT, int, name, default, comment) -#define DEFINE_float(name, default, comment) \ - DEFINE_FLAG(FLOAT, double, name, default, comment) -#define DEFINE_string(name, default, comment) \ - DEFINE_FLAG(STRING, const char*, name, default, comment) - - -// Use the following macros to declare a flag defined elsewhere: -#define DECLARE_bool(name) DECLARE_FLAG(bool, name) -#define DECLARE_int(name) DECLARE_FLAG(int, name) -#define DECLARE_float(name) DECLARE_FLAG(double, name) -#define DECLARE_string(name) DECLARE_FLAG(const char*, name) - - -// The global list of all flags. -class FlagList { - public: - FlagList(); - - // The null-terminated list of all flags. Traverse with Flag::next(). - static Flag* list() { return list_; } - - // If file != nullptr, prints information for all flags defined in file; - // otherwise prints information for all flags in all files. The current flag - // value is only printed if print_current_value is set. - static void Print(const char* file, bool print_current_value); - - // Lookup a flag by name. Returns the matching flag or null. - static Flag* Lookup(const char* name); - - // Helper function to parse flags: Takes an argument arg and splits it into - // a flag name and flag value (or null if they are missing). is_bool is set - // if the arg started with "-no" or "--no". The buffer may be used to NUL- - // terminate the name, it must be large enough to hold any possible name. - static void SplitArgument(const char* arg, - char* buffer, int buffer_size, - const char** name, const char** value, - bool* is_bool); - - // Set the flag values by parsing the command line. If remove_flags - // is set, the flags and associated values are removed from (argc, - // argv). Returns 0 if no error occurred. Otherwise, returns the - // argv index > 0 for the argument where an error occurred. In that - // case, (argc, argv) will remain unchanged indepdendent of the - // remove_flags value, and no assumptions about flag settings should - // be made. - // - // The following syntax for flags is accepted (both '-' and '--' are ok): - // - // --flag (bool flags only) - // --noflag (bool flags only) - // --flag=value (non-bool flags only, no spaces around '=') - // --flag value (non-bool flags only) - static int SetFlagsFromCommandLine(int* argc, - const char** argv, - bool remove_flags); - static inline int SetFlagsFromCommandLine(int* argc, - char** argv, - bool remove_flags) { - return SetFlagsFromCommandLine(argc, const_cast(argv), - remove_flags); - } - - // Registers a new flag. Called during program initialization. Not - // thread-safe. - static void Register(Flag* flag); - - private: - static Flag* list_; -}; - -#if defined(WEBRTC_WIN) -// A helper class to translate Windows command line arguments into UTF8, -// which then allows us to just pass them to the flags system. -// This encapsulates all the work of getting the command line and translating -// it to an array of 8-bit strings; all you have to do is create one of these, -// and then call argc() and argv(). -class WindowsCommandLineArguments { - public: - WindowsCommandLineArguments(); - ~WindowsCommandLineArguments(); - - int argc() { return argc_; } - char **argv() { return argv_; } - private: - int argc_; - char **argv_; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(WindowsCommandLineArguments); -}; -#endif // WEBRTC_WIN - -} // namespace rtc - -#endif // SHARED_COMMANDLINEFLAGS_FLAGS_H_ diff --git a/webrtc/rtc_base/format_macros.h b/webrtc/rtc_base/format_macros.h deleted file mode 100644 index 3c28127226..0000000000 --- a/webrtc/rtc_base/format_macros.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_FORMAT_MACROS_H_ -#define WEBRTC_RTC_BASE_FORMAT_MACROS_H_ - -// This file defines the format macros for some integer types and is derived -// from Chromium's base/format_macros.h. - -// To print a 64-bit value in a portable way: -// int64_t value; -// printf("xyz:%" PRId64, value); -// The "d" in the macro corresponds to %d; you can also use PRIu64 etc. -// -// To print a size_t value in a portable way: -// size_t size; -// printf("xyz: %" PRIuS, size); -// The "u" in the macro corresponds to %u, and S is for "size". - -#include "webrtc/typedefs.h" - -#if defined(WEBRTC_POSIX) - -#if (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && !defined(PRId64) -#error "inttypes.h has already been included before this header file, but " -#error "without __STDC_FORMAT_MACROS defined." -#endif - -#if !defined(__STDC_FORMAT_MACROS) -#define __STDC_FORMAT_MACROS -#endif - -#include - -#if !defined(PRIuS) -#define PRIuS "zu" -#endif - -// The size of NSInteger and NSUInteger varies between 32-bit and 64-bit -// architectures and Apple does not provides standard format macros and -// recommends casting. This has many drawbacks, so instead define macros -// for formatting those types. -#if defined(WEBRTC_MAC) -#if defined(WEBRTC_ARCH_64_BITS) -#if !defined(PRIdNS) -#define PRIdNS "ld" -#endif -#if !defined(PRIuNS) -#define PRIuNS "lu" -#endif -#if !defined(PRIxNS) -#define PRIxNS "lx" -#endif -#else // defined(WEBRTC_ARCH_64_BITS) -#if !defined(PRIdNS) -#define PRIdNS "d" -#endif -#if !defined(PRIuNS) -#define PRIuNS "u" -#endif -#if !defined(PRIxNS) -#define PRIxNS "x" -#endif -#endif -#endif // defined(WEBRTC_MAC) - -#else // WEBRTC_WIN - -#include - -#if !defined(PRId64) -#define PRId64 "I64d" -#endif - -#if !defined(PRIu64) -#define PRIu64 "I64u" -#endif - -#if !defined(PRIx64) -#define PRIx64 "I64x" -#endif - -#if !defined(PRIuS) -#define PRIuS "Iu" -#endif - -#endif - -#endif // WEBRTC_RTC_BASE_FORMAT_MACROS_H_ diff --git a/webrtc/rtc_base/function_view.h b/webrtc/rtc_base/function_view.h deleted file mode 100644 index 56964a6473..0000000000 --- a/webrtc/rtc_base/function_view.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_FUNCTION_VIEW_H_ -#define WEBRTC_RTC_BASE_FUNCTION_VIEW_H_ - -#include -#include - -#include "webrtc/base/checks.h" - -// Just like std::function, FunctionView will wrap any callable and hide its -// actual type, exposing only its signature. But unlike std::function, -// FunctionView doesn't own its callable---it just points to it. Thus, it's a -// good choice mainly as a function argument when the callable argument will -// not be called again once the function has returned. -// -// Its constructors are implicit, so that callers won't have to convert lambdas -// and other callables to FunctionView explicitly. This is -// safe because FunctionView is only a reference to the real callable. -// -// Example use: -// -// void SomeFunction(rtc::FunctionView index_transform); -// ... -// SomeFunction([](int i) { return 2 * i + 1; }); -// -// Note: FunctionView is tiny (essentially just two pointers) and trivially -// copyable, so it's probably cheaper to pass it by value than by const -// reference. - -namespace rtc { - -template -class FunctionView; // Undefined. - -template -class FunctionView final { - public: - // Constructor for lambdas and other callables; it accepts every type of - // argument except those noted in its enable_if call. - template < - typename F, - typename std::enable_if< - // Not for function pointers; we have another constructor for that - // below. - !std::is_function::type>::type>::value && - - // Not for nullptr; we have another constructor for that below. - !std::is_same::type>::value && - - // Not for FunctionView objects; we have another constructor for that - // (the implicitly declared copy constructor). - !std::is_same::type>::type>::value>::type* = nullptr> - FunctionView(F&& f) - : call_(CallVoidPtr::type>) { - f_.void_ptr = &f; - } - - // Constructor that accepts function pointers. If the argument is null, the - // result is an empty FunctionView. - template < - typename F, - typename std::enable_if::type>::type>::value>::type* = - nullptr> - FunctionView(F&& f) - : call_(f ? CallFunPtr::type> : nullptr) { - f_.fun_ptr = reinterpret_cast(f); - } - - // Constructor that accepts nullptr. It creates an empty FunctionView. - template ::type>::value>::type* = nullptr> - FunctionView(F&& f) : call_(nullptr) {} - - // Default constructor. Creates an empty FunctionView. - FunctionView() : call_(nullptr) {} - - RetT operator()(ArgT... args) const { - RTC_DCHECK(call_); - return call_(f_, std::forward(args)...); - } - - // Returns true if we have a function, false if we don't (i.e., we're null). - explicit operator bool() const { return !!call_; } - - private: - union VoidUnion { - void* void_ptr; - void (*fun_ptr)(); - }; - - template - static RetT CallVoidPtr(VoidUnion vu, ArgT... args) { - return (*static_cast(vu.void_ptr))(std::forward(args)...); - } - template - static RetT CallFunPtr(VoidUnion vu, ArgT... args) { - return (reinterpret_cast::type>(vu.fun_ptr))( - std::forward(args)...); - } - - // A pointer to the callable thing, with type information erased. It's a - // union because we have to use separate types depending on if the callable - // thing is a function pointer or something else. - VoidUnion f_; - - // Pointer to a dispatch function that knows the type of the callable thing - // that's stored in f_, and how to call it. A FunctionView object is empty - // (null) iff call_ is null. - RetT (*call_)(VoidUnion, ArgT...); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_FUNCTION_VIEW_H_ diff --git a/webrtc/rtc_base/gtest_prod_util.h b/webrtc/rtc_base/gtest_prod_util.h deleted file mode 100644 index 4837604945..0000000000 --- a/webrtc/rtc_base/gtest_prod_util.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_GTEST_PROD_UTIL_H_ -#define WEBRTC_RTC_BASE_GTEST_PROD_UTIL_H_ - -// Define our own version of FRIEND_TEST here rather than including -// gtest_prod.h to avoid depending on any part of GTest in production code. -#define FRIEND_TEST_WEBRTC(test_case_name, test_name)\ -friend class test_case_name##_##test_name##_Test - -// This file is a plain copy of Chromium's base/gtest_prod_util.h. -// -// This is a wrapper for gtest's FRIEND_TEST macro that friends -// test with all possible prefixes. This is very helpful when changing the test -// prefix, because the friend declarations don't need to be updated. -// -// Example usage: -// -// class MyClass { -// private: -// void MyMethod(); -// FRIEND_TEST_ALL_PREFIXES(MyClassTest, MyMethod); -// }; -#define FRIEND_TEST_ALL_PREFIXES(test_case_name, test_name) \ - FRIEND_TEST_WEBRTC(test_case_name, test_name); \ - FRIEND_TEST_WEBRTC(test_case_name, DISABLED_##test_name); \ - FRIEND_TEST_WEBRTC(test_case_name, FLAKY_##test_name); \ - FRIEND_TEST_WEBRTC(test_case_name, FAILS_##test_name) - -#endif // WEBRTC_RTC_BASE_GTEST_PROD_UTIL_H_ diff --git a/webrtc/rtc_base/gunit.h b/webrtc/rtc_base/gunit.h deleted file mode 100644 index b9b5a69349..0000000000 --- a/webrtc/rtc_base/gunit.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_GUNIT_H_ -#define WEBRTC_RTC_BASE_GUNIT_H_ - -#include "webrtc/base/fakeclock.h" -#include "webrtc/base/logging.h" -#include "webrtc/base/thread.h" -#if defined(GTEST_RELATIVE_PATH) -#include "webrtc/test/gtest.h" -#else -#include "testing/base/public/gunit.h" -#endif - -// Wait until "ex" is true, or "timeout" expires. -#define WAIT(ex, timeout) \ - for (int64_t start = rtc::SystemTimeMillis(); \ - !(ex) && rtc::SystemTimeMillis() < start + (timeout);) { \ - rtc::Thread::Current()->ProcessMessages(0); \ - rtc::Thread::Current()->SleepMs(1); \ - } - -// This returns the result of the test in res, so that we don't re-evaluate -// the expression in the XXXX_WAIT macros below, since that causes problems -// when the expression is only true the first time you check it. -#define WAIT_(ex, timeout, res) \ - do { \ - int64_t start = rtc::SystemTimeMillis(); \ - res = (ex); \ - while (!res && rtc::SystemTimeMillis() < start + (timeout)) { \ - rtc::Thread::Current()->ProcessMessages(0); \ - rtc::Thread::Current()->SleepMs(1); \ - res = (ex); \ - } \ - } while (0) - -// The typical EXPECT_XXXX and ASSERT_XXXXs, but done until true or a timeout. -#define EXPECT_TRUE_WAIT(ex, timeout) \ - do { \ - bool res; \ - WAIT_(ex, timeout, res); \ - if (!res) EXPECT_TRUE(ex); \ - } while (0) - -#define EXPECT_EQ_WAIT(v1, v2, timeout) \ - do { \ - bool res; \ - WAIT_(v1 == v2, timeout, res); \ - if (!res) EXPECT_EQ(v1, v2); \ - } while (0) - -#define ASSERT_TRUE_WAIT(ex, timeout) \ - do { \ - bool res; \ - WAIT_(ex, timeout, res); \ - if (!res) ASSERT_TRUE(ex); \ - } while (0) - -#define ASSERT_EQ_WAIT(v1, v2, timeout) \ - do { \ - bool res; \ - WAIT_(v1 == v2, timeout, res); \ - if (!res) ASSERT_EQ(v1, v2); \ - } while (0) - -// Version with a "soft" timeout and a margin. This logs if the timeout is -// exceeded, but it only fails if the expression still isn't true after the -// margin time passes. -#define EXPECT_TRUE_WAIT_MARGIN(ex, timeout, margin) \ - do { \ - bool res; \ - WAIT_(ex, timeout, res); \ - if (res) { \ - break; \ - } \ - LOG(LS_WARNING) << "Expression " << #ex << " still not true after " \ - << (timeout) << "ms; waiting an additional " << margin \ - << "ms"; \ - WAIT_(ex, margin, res); \ - if (!res) { \ - EXPECT_TRUE(ex); \ - } \ - } while (0) - -// Wait until "ex" is true, or "timeout" expires, using fake clock where -// messages are processed every millisecond. -// TODO(pthatcher): Allow tests to control how many milliseconds to advance. -#define SIMULATED_WAIT(ex, timeout, clock) \ - for (int64_t start = rtc::TimeMillis(); \ - !(ex) && rtc::TimeMillis() < start + (timeout);) { \ - (clock).AdvanceTime(rtc::TimeDelta::FromMilliseconds(1)); \ - } - -// This returns the result of the test in res, so that we don't re-evaluate -// the expression in the XXXX_WAIT macros below, since that causes problems -// when the expression is only true the first time you check it. -#define SIMULATED_WAIT_(ex, timeout, res, clock) \ - do { \ - int64_t start = rtc::TimeMillis(); \ - res = (ex); \ - while (!res && rtc::TimeMillis() < start + (timeout)) { \ - (clock).AdvanceTime(rtc::TimeDelta::FromMilliseconds(1)); \ - res = (ex); \ - } \ - } while (0) - -// The typical EXPECT_XXXX, but done until true or a timeout with a fake clock. -#define EXPECT_TRUE_SIMULATED_WAIT(ex, timeout, clock) \ - do { \ - bool res; \ - SIMULATED_WAIT_(ex, timeout, res, clock); \ - if (!res) { \ - EXPECT_TRUE(ex); \ - } \ - } while (0) - -#define EXPECT_EQ_SIMULATED_WAIT(v1, v2, timeout, clock) \ - do { \ - bool res; \ - SIMULATED_WAIT_(v1 == v2, timeout, res, clock); \ - if (!res) { \ - EXPECT_EQ(v1, v2); \ - } \ - } while (0) - -#define ASSERT_TRUE_SIMULATED_WAIT(ex, timeout, clock) \ - do { \ - bool res; \ - SIMULATED_WAIT_(ex, timeout, res, clock); \ - if (!res) \ - ASSERT_TRUE(ex); \ - } while (0) - -#define ASSERT_EQ_SIMULATED_WAIT(v1, v2, timeout, clock) \ - do { \ - bool res; \ - SIMULATED_WAIT_(v1 == v2, timeout, res, clock); \ - if (!res) \ - ASSERT_EQ(v1, v2); \ - } while (0) - -#endif // WEBRTC_RTC_BASE_GUNIT_H_ diff --git a/webrtc/rtc_base/gunit_prod.h b/webrtc/rtc_base/gunit_prod.h deleted file mode 100644 index 789f11bfce..0000000000 --- a/webrtc/rtc_base/gunit_prod.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2012 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_GUNIT_PROD_H_ -#define WEBRTC_RTC_BASE_GUNIT_PROD_H_ - -#if defined(WEBRTC_ANDROID) -// Android doesn't use gtest at all, so anything that relies on gtest should -// check this define first. -#define NO_GTEST -#elif defined (GTEST_RELATIVE_PATH) -#include "gtest/gtest_prod.h" -#else -#include "testing/base/gunit_prod.h" -#endif - -#endif // WEBRTC_RTC_BASE_GUNIT_PROD_H_ diff --git a/webrtc/rtc_base/helpers.h b/webrtc/rtc_base/helpers.h deleted file mode 100644 index 0a4298affe..0000000000 --- a/webrtc/rtc_base/helpers.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_HELPERS_H_ -#define WEBRTC_RTC_BASE_HELPERS_H_ - -#include -#include "webrtc/base/basictypes.h" - -namespace rtc { - -// For testing, we can return predictable data. -void SetRandomTestMode(bool test); - -// Initializes the RNG, and seeds it with the specified entropy. -bool InitRandom(int seed); -bool InitRandom(const char* seed, size_t len); - -// Generates a (cryptographically) random string of the given length. -// We generate base64 values so that they will be printable. -std::string CreateRandomString(size_t length); - -// Generates a (cryptographically) random string of the given length. -// We generate base64 values so that they will be printable. -// Return false if the random number generator failed. -bool CreateRandomString(size_t length, std::string* str); - -// Generates a (cryptographically) random string of the given length, -// with characters from the given table. Return false if the random -// number generator failed. -// For ease of implementation, the function requires that the table -// size evenly divide 256; otherwise, it returns false. -bool CreateRandomString(size_t length, const std::string& table, - std::string* str); - -// Generates (cryptographically) random data of the given length. -// Return false if the random number generator failed. -bool CreateRandomData(size_t length, std::string* data); - -// Generates a (cryptographically) random UUID version 4 string. -std::string CreateRandomUuid(); - -// Generates a random id. -uint32_t CreateRandomId(); - -// Generates a 64 bit random id. -uint64_t CreateRandomId64(); - -// Generates a random id > 0. -uint32_t CreateRandomNonZeroId(); - -// Generates a random double between 0.0 (inclusive) and 1.0 (exclusive). -double CreateRandomDouble(); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_HELPERS_H_ diff --git a/webrtc/rtc_base/httpbase.h b/webrtc/rtc_base/httpbase.h deleted file mode 100644 index d5730ba927..0000000000 --- a/webrtc/rtc_base/httpbase.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef WEBRTC_RTC_BASE_HTTPBASE_H_ -#define WEBRTC_RTC_BASE_HTTPBASE_H_ - -#include "webrtc/base/httpcommon.h" - -namespace rtc { - -class StreamInterface; - -/////////////////////////////////////////////////////////////////////////////// -// HttpParser - Parses an HTTP stream provided via Process and end_of_input, and -// generates events for: -// Structural Elements: Leader, Headers, Document Data -// Events: End of Headers, End of Document, Errors -/////////////////////////////////////////////////////////////////////////////// - -class HttpParser { -public: - enum ProcessResult { PR_CONTINUE, PR_BLOCK, PR_COMPLETE }; - HttpParser(); - virtual ~HttpParser(); - - void reset(); - ProcessResult Process(const char* buffer, size_t len, size_t* processed, - HttpError* error); - bool is_valid_end_of_input() const; - void complete(HttpError err); - - size_t GetDataRemaining() const { return data_size_; } - -protected: - ProcessResult ProcessLine(const char* line, size_t len, HttpError* error); - - // HttpParser Interface - virtual ProcessResult ProcessLeader(const char* line, size_t len, - HttpError* error) = 0; - virtual ProcessResult ProcessHeader(const char* name, size_t nlen, - const char* value, size_t vlen, - HttpError* error) = 0; - virtual ProcessResult ProcessHeaderComplete(bool chunked, size_t& data_size, - HttpError* error) = 0; - virtual ProcessResult ProcessData(const char* data, size_t len, size_t& read, - HttpError* error) = 0; - virtual void OnComplete(HttpError err) = 0; - -private: - enum State { - ST_LEADER, ST_HEADERS, - ST_CHUNKSIZE, ST_CHUNKTERM, ST_TRAILERS, - ST_DATA, ST_COMPLETE - } state_; - bool chunked_; - size_t data_size_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// IHttpNotify -/////////////////////////////////////////////////////////////////////////////// - -enum HttpMode { HM_NONE, HM_CONNECT, HM_RECV, HM_SEND }; - -class IHttpNotify { -public: - virtual ~IHttpNotify() {} - virtual HttpError onHttpHeaderComplete(bool chunked, size_t& data_size) = 0; - virtual void onHttpComplete(HttpMode mode, HttpError err) = 0; - virtual void onHttpClosed(HttpError err) = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// -// HttpBase - Provides a state machine for implementing HTTP-based components. -// Attach HttpBase to a StreamInterface which represents a bidirectional HTTP -// stream, and then call send() or recv() to initiate sending or receiving one -// side of an HTTP transaction. By default, HttpBase operates as an I/O pump, -// moving data from the HTTP stream to the HttpData object and vice versa. -// However, it can also operate in stream mode, in which case the user of the -// stream interface drives I/O via calls to Read(). -/////////////////////////////////////////////////////////////////////////////// - -class HttpBase -: private HttpParser, - public sigslot::has_slots<> -{ -public: - HttpBase(); - ~HttpBase() override; - - void notify(IHttpNotify* notify) { notify_ = notify; } - bool attach(StreamInterface* stream); - StreamInterface* stream() { return http_stream_; } - StreamInterface* detach(); - bool isConnected() const; - - void send(HttpData* data); - void recv(HttpData* data); - void abort(HttpError err); - - HttpMode mode() const { return mode_; } - - void set_ignore_data(bool ignore) { ignore_data_ = ignore; } - bool ignore_data() const { return ignore_data_; } - - // Obtaining this stream puts HttpBase into stream mode until the stream - // is closed. HttpBase can only expose one open stream interface at a time. - // Further calls will return null. - StreamInterface* GetDocumentStream(); - -protected: - // Do cleanup when the http stream closes (error may be 0 for a clean - // shutdown), and return the error code to signal. - HttpError HandleStreamClose(int error); - - // DoReceiveLoop acts as a data pump, pulling data from the http stream, - // pushing it through the HttpParser, and then populating the HttpData object - // based on the callbacks from the parser. One of the most interesting - // callbacks is ProcessData, which provides the actual http document body. - // This data is then written to the HttpData::document. As a result, data - // flows from the network to the document, with some incidental protocol - // parsing in between. - // Ideally, we would pass in the document* to DoReceiveLoop, to more easily - // support GetDocumentStream(). However, since the HttpParser is callback - // driven, we are forced to store the pointer somewhere until the callback - // is triggered. - // Returns true if the received document has finished, and - // HttpParser::complete should be called. - bool DoReceiveLoop(HttpError* err); - - void read_and_process_data(); - void flush_data(); - bool queue_headers(); - void do_complete(HttpError err = HE_NONE); - - void OnHttpStreamEvent(StreamInterface* stream, int events, int error); - void OnDocumentEvent(StreamInterface* stream, int events, int error); - - // HttpParser Interface - ProcessResult ProcessLeader(const char* line, - size_t len, - HttpError* error) override; - ProcessResult ProcessHeader(const char* name, - size_t nlen, - const char* value, - size_t vlen, - HttpError* error) override; - ProcessResult ProcessHeaderComplete(bool chunked, - size_t& data_size, - HttpError* error) override; - ProcessResult ProcessData(const char* data, - size_t len, - size_t& read, - HttpError* error) override; - void OnComplete(HttpError err) override; - -private: - class DocumentStream; - friend class DocumentStream; - - enum { kBufferSize = 32 * 1024 }; - - HttpMode mode_; - HttpData* data_; - IHttpNotify* notify_; - StreamInterface* http_stream_; - DocumentStream* doc_stream_; - char buffer_[kBufferSize]; - size_t len_; - - bool ignore_data_, chunk_data_; - HttpData::const_iterator header_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_HTTPBASE_H_ diff --git a/webrtc/rtc_base/httpcommon-inl.h b/webrtc/rtc_base/httpcommon-inl.h deleted file mode 100644 index c324831463..0000000000 --- a/webrtc/rtc_base/httpcommon-inl.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_HTTPCOMMON_INL_H_ -#define WEBRTC_RTC_BASE_HTTPCOMMON_INL_H_ - -#include "webrtc/base/arraysize.h" -#include "webrtc/base/checks.h" -#include "webrtc/base/httpcommon.h" - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// -// Url -/////////////////////////////////////////////////////////////////////////////// - -template -void Url::do_set_url(const CTYPE* val, size_t len) { - if (ascnicmp(val, "http://", 7) == 0) { - val += 7; len -= 7; - secure_ = false; - } else if (ascnicmp(val, "https://", 8) == 0) { - val += 8; len -= 8; - secure_ = true; - } else { - clear(); - return; - } - const CTYPE* path = strchrn(val, len, static_cast('/')); - if (!path) { - path = val + len; - } - size_t address_length = (path - val); - do_set_address(val, address_length); - do_set_full_path(path, len - address_length); -} - -template -void Url::do_set_address(const CTYPE* val, size_t len) { - if (const CTYPE* at = strchrn(val, len, static_cast('@'))) { - // Everything before the @ is a user:password combo, so skip it. - len -= at - val + 1; - val = at + 1; - } - if (const CTYPE* colon = strchrn(val, len, static_cast(':'))) { - host_.assign(val, colon - val); - // Note: In every case, we're guaranteed that colon is followed by a null, - // or non-numeric character. - port_ = static_cast(::strtoul(colon + 1, nullptr, 10)); - // TODO: Consider checking for invalid data following port number. - } else { - host_.assign(val, len); - port_ = HttpDefaultPort(secure_); - } -} - -template -void Url::do_set_full_path(const CTYPE* val, size_t len) { - const CTYPE* query = strchrn(val, len, static_cast('?')); - if (!query) { - query = val + len; - } - size_t path_length = (query - val); - if (0 == path_length) { - // TODO: consider failing in this case. - path_.assign(1, static_cast('/')); - } else { - RTC_DCHECK(val[0] == static_cast('/')); - path_.assign(val, path_length); - } - query_.assign(query, len - path_length); -} - -template -void Url::do_get_url(string* val) const { - CTYPE protocol[9]; - asccpyn(protocol, arraysize(protocol), secure_ ? "https://" : "http://"); - val->append(protocol); - do_get_address(val); - do_get_full_path(val); -} - -template -void Url::do_get_address(string* val) const { - val->append(host_); - if (port_ != HttpDefaultPort(secure_)) { - CTYPE format[5], port[32]; - asccpyn(format, arraysize(format), ":%hu"); - sprintfn(port, arraysize(port), format, port_); - val->append(port); - } -} - -template -void Url::do_get_full_path(string* val) const { - val->append(path_); - val->append(query_); -} - -template -bool Url::get_attribute(const string& name, string* value) const { - if (query_.empty()) - return false; - - std::string::size_type pos = query_.find(name, 1); - if (std::string::npos == pos) - return false; - - pos += name.length() + 1; - if ((pos > query_.length()) || (static_cast('=') != query_[pos-1])) - return false; - - std::string::size_type end = query_.find(static_cast('&'), pos); - if (std::string::npos == end) { - end = query_.length(); - } - value->assign(query_.substr(pos, end - pos)); - return true; -} - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_HTTPCOMMON_INL_H_ diff --git a/webrtc/rtc_base/httpcommon.h b/webrtc/rtc_base/httpcommon.h deleted file mode 100644 index 12d18d5cff..0000000000 --- a/webrtc/rtc_base/httpcommon.h +++ /dev/null @@ -1,458 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_HTTPCOMMON_H_ -#define WEBRTC_RTC_BASE_HTTPCOMMON_H_ - -#include -#include -#include -#include -#include "webrtc/base/basictypes.h" -#include "webrtc/base/checks.h" -#include "webrtc/base/stringutils.h" -#include "webrtc/base/stream.h" - -namespace rtc { - -class CryptString; -class SocketAddress; - -////////////////////////////////////////////////////////////////////// -// Constants -////////////////////////////////////////////////////////////////////// - -enum HttpCode { - HC_OK = 200, - HC_NON_AUTHORITATIVE = 203, - HC_NO_CONTENT = 204, - HC_PARTIAL_CONTENT = 206, - - HC_MULTIPLE_CHOICES = 300, - HC_MOVED_PERMANENTLY = 301, - HC_FOUND = 302, - HC_SEE_OTHER = 303, - HC_NOT_MODIFIED = 304, - HC_MOVED_TEMPORARILY = 307, - - HC_BAD_REQUEST = 400, - HC_UNAUTHORIZED = 401, - HC_FORBIDDEN = 403, - HC_NOT_FOUND = 404, - HC_PROXY_AUTHENTICATION_REQUIRED = 407, - HC_GONE = 410, - - HC_INTERNAL_SERVER_ERROR = 500, - HC_NOT_IMPLEMENTED = 501, - HC_SERVICE_UNAVAILABLE = 503, -}; - -enum HttpVersion { - HVER_1_0, HVER_1_1, HVER_UNKNOWN, - HVER_LAST = HVER_UNKNOWN -}; - -enum HttpVerb { - HV_GET, HV_POST, HV_PUT, HV_DELETE, HV_CONNECT, HV_HEAD, - HV_LAST = HV_HEAD -}; - -enum HttpError { - HE_NONE, - HE_PROTOCOL, // Received non-valid HTTP data - HE_DISCONNECTED, // Connection closed unexpectedly - HE_OVERFLOW, // Received too much data for internal buffers - HE_CONNECT_FAILED, // The socket failed to connect. - HE_SOCKET_ERROR, // An error occurred on a connected socket - HE_SHUTDOWN, // Http object is being destroyed - HE_OPERATION_CANCELLED, // Connection aborted locally - HE_AUTH, // Proxy Authentication Required - HE_CERTIFICATE_EXPIRED, // During SSL negotiation - HE_STREAM, // Problem reading or writing to the document - HE_CACHE, // Problem reading from cache - HE_DEFAULT -}; - -enum HttpHeader { - HH_AGE, - HH_CACHE_CONTROL, - HH_CONNECTION, - HH_CONTENT_DISPOSITION, - HH_CONTENT_LENGTH, - HH_CONTENT_RANGE, - HH_CONTENT_TYPE, - HH_COOKIE, - HH_DATE, - HH_ETAG, - HH_EXPIRES, - HH_HOST, - HH_IF_MODIFIED_SINCE, - HH_IF_NONE_MATCH, - HH_KEEP_ALIVE, - HH_LAST_MODIFIED, - HH_LOCATION, - HH_PROXY_AUTHENTICATE, - HH_PROXY_AUTHORIZATION, - HH_PROXY_CONNECTION, - HH_RANGE, - HH_SET_COOKIE, - HH_TE, - HH_TRAILERS, - HH_TRANSFER_ENCODING, - HH_UPGRADE, - HH_USER_AGENT, - HH_WWW_AUTHENTICATE, - HH_LAST = HH_WWW_AUTHENTICATE -}; - -const uint16_t HTTP_DEFAULT_PORT = 80; -const uint16_t HTTP_SECURE_PORT = 443; - -////////////////////////////////////////////////////////////////////// -// Utility Functions -////////////////////////////////////////////////////////////////////// - -inline HttpError mkerr(HttpError err, HttpError def_err = HE_DEFAULT) { - return (err != HE_NONE) ? err : def_err; -} - -const char* ToString(HttpVersion version); -bool FromString(HttpVersion& version, const std::string& str); - -const char* ToString(HttpVerb verb); -bool FromString(HttpVerb& verb, const std::string& str); - -const char* ToString(HttpHeader header); -bool FromString(HttpHeader& header, const std::string& str); - -inline bool HttpCodeIsInformational(uint32_t code) { - return ((code / 100) == 1); -} -inline bool HttpCodeIsSuccessful(uint32_t code) { - return ((code / 100) == 2); -} -inline bool HttpCodeIsRedirection(uint32_t code) { - return ((code / 100) == 3); -} -inline bool HttpCodeIsClientError(uint32_t code) { - return ((code / 100) == 4); -} -inline bool HttpCodeIsServerError(uint32_t code) { - return ((code / 100) == 5); -} - -bool HttpCodeHasBody(uint32_t code); -bool HttpCodeIsCacheable(uint32_t code); -bool HttpHeaderIsEndToEnd(HttpHeader header); -bool HttpHeaderIsCollapsible(HttpHeader header); - -struct HttpData; -bool HttpShouldKeepAlive(const HttpData& data); - -typedef std::pair HttpAttribute; -typedef std::vector HttpAttributeList; -void HttpComposeAttributes(const HttpAttributeList& attributes, char separator, - std::string* composed); -void HttpParseAttributes(const char * data, size_t len, - HttpAttributeList& attributes); -bool HttpHasAttribute(const HttpAttributeList& attributes, - const std::string& name, - std::string* value); -bool HttpHasNthAttribute(HttpAttributeList& attributes, - size_t index, - std::string* name, - std::string* value); - -// Convert RFC1123 date (DoW, DD Mon YYYY HH:MM:SS TZ) to unix timestamp -bool HttpDateToSeconds(const std::string& date, time_t* seconds); - -inline uint16_t HttpDefaultPort(bool secure) { - return secure ? HTTP_SECURE_PORT : HTTP_DEFAULT_PORT; -} - -// Returns the http server notation for a given address -std::string HttpAddress(const SocketAddress& address, bool secure); - -// functional for insensitive std::string compare -struct iless { - bool operator()(const std::string& lhs, const std::string& rhs) const { - return (::_stricmp(lhs.c_str(), rhs.c_str()) < 0); - } -}; - -// put quotes around a string and escape any quotes inside it -std::string quote(const std::string& str); - -////////////////////////////////////////////////////////////////////// -// Url -////////////////////////////////////////////////////////////////////// - -template -class Url { -public: - typedef typename Traits::string string; - - // TODO: Implement Encode/Decode - static int Encode(const CTYPE* source, CTYPE* destination, size_t len); - static int Encode(const string& source, string& destination); - static int Decode(const CTYPE* source, CTYPE* destination, size_t len); - static int Decode(const string& source, string& destination); - - Url(const string& url) { do_set_url(url.c_str(), url.size()); } - Url(const string& path, const string& host, uint16_t port = HTTP_DEFAULT_PORT) - : host_(host), port_(port), secure_(HTTP_SECURE_PORT == port) { - set_full_path(path); - } - - bool valid() const { return !host_.empty(); } - void clear() { - host_.clear(); - port_ = HTTP_DEFAULT_PORT; - secure_ = false; - path_.assign(1, static_cast('/')); - query_.clear(); - } - - void set_url(const string& val) { - do_set_url(val.c_str(), val.size()); - } - string url() const { - string val; do_get_url(&val); return val; - } - - void set_address(const string& val) { - do_set_address(val.c_str(), val.size()); - } - string address() const { - string val; do_get_address(&val); return val; - } - - void set_full_path(const string& val) { - do_set_full_path(val.c_str(), val.size()); - } - string full_path() const { - string val; do_get_full_path(&val); return val; - } - - void set_host(const string& val) { host_ = val; } - const string& host() const { return host_; } - - void set_port(uint16_t val) { port_ = val; } - uint16_t port() const { return port_; } - - void set_secure(bool val) { secure_ = val; } - bool secure() const { return secure_; } - - void set_path(const string& val) { - if (val.empty()) { - path_.assign(1, static_cast('/')); - } else { - RTC_DCHECK(val[0] == static_cast('/')); - path_ = val; - } - } - const string& path() const { return path_; } - - void set_query(const string& val) { - RTC_DCHECK(val.empty() || (val[0] == static_cast('?'))); - query_ = val; - } - const string& query() const { return query_; } - - bool get_attribute(const string& name, string* value) const; - -private: - void do_set_url(const CTYPE* val, size_t len); - void do_set_address(const CTYPE* val, size_t len); - void do_set_full_path(const CTYPE* val, size_t len); - - void do_get_url(string* val) const; - void do_get_address(string* val) const; - void do_get_full_path(string* val) const; - - string host_, path_, query_; - uint16_t port_; - bool secure_; -}; - -////////////////////////////////////////////////////////////////////// -// HttpData -////////////////////////////////////////////////////////////////////// - -struct HttpData { - typedef std::multimap HeaderMap; - typedef HeaderMap::const_iterator const_iterator; - typedef HeaderMap::iterator iterator; - - HttpVersion version; - std::unique_ptr document; - - HttpData(); - - enum HeaderCombine { HC_YES, HC_NO, HC_AUTO, HC_REPLACE, HC_NEW }; - void changeHeader(const std::string& name, const std::string& value, - HeaderCombine combine); - inline void addHeader(const std::string& name, const std::string& value, - bool append = true) { - changeHeader(name, value, append ? HC_AUTO : HC_NO); - } - inline void setHeader(const std::string& name, const std::string& value, - bool overwrite = true) { - changeHeader(name, value, overwrite ? HC_REPLACE : HC_NEW); - } - // Returns count of erased headers - size_t clearHeader(const std::string& name); - // Returns iterator to next header - iterator clearHeader(iterator header); - - // keep in mind, this may not do what you want in the face of multiple headers - bool hasHeader(const std::string& name, std::string* value) const; - - inline const_iterator begin() const { - return headers_.begin(); - } - inline const_iterator end() const { - return headers_.end(); - } - inline iterator begin() { - return headers_.begin(); - } - inline iterator end() { - return headers_.end(); - } - inline const_iterator begin(const std::string& name) const { - return headers_.lower_bound(name); - } - inline const_iterator end(const std::string& name) const { - return headers_.upper_bound(name); - } - inline iterator begin(const std::string& name) { - return headers_.lower_bound(name); - } - inline iterator end(const std::string& name) { - return headers_.upper_bound(name); - } - - // Convenience methods using HttpHeader - inline void changeHeader(HttpHeader header, const std::string& value, - HeaderCombine combine) { - changeHeader(ToString(header), value, combine); - } - inline void addHeader(HttpHeader header, const std::string& value, - bool append = true) { - addHeader(ToString(header), value, append); - } - inline void setHeader(HttpHeader header, const std::string& value, - bool overwrite = true) { - setHeader(ToString(header), value, overwrite); - } - inline void clearHeader(HttpHeader header) { - clearHeader(ToString(header)); - } - inline bool hasHeader(HttpHeader header, std::string* value) const { - return hasHeader(ToString(header), value); - } - inline const_iterator begin(HttpHeader header) const { - return headers_.lower_bound(ToString(header)); - } - inline const_iterator end(HttpHeader header) const { - return headers_.upper_bound(ToString(header)); - } - inline iterator begin(HttpHeader header) { - return headers_.lower_bound(ToString(header)); - } - inline iterator end(HttpHeader header) { - return headers_.upper_bound(ToString(header)); - } - - void setContent(const std::string& content_type, StreamInterface* document); - void setDocumentAndLength(StreamInterface* document); - - virtual size_t formatLeader(char* buffer, size_t size) const = 0; - virtual HttpError parseLeader(const char* line, size_t len) = 0; - -protected: - virtual ~HttpData(); - void clear(bool release_document); - void copy(const HttpData& src); - -private: - HeaderMap headers_; -}; - -struct HttpRequestData : public HttpData { - HttpVerb verb; - std::string path; - - HttpRequestData() : verb(HV_GET) { } - - void clear(bool release_document); - void copy(const HttpRequestData& src); - - size_t formatLeader(char* buffer, size_t size) const override; - HttpError parseLeader(const char* line, size_t len) override; - - bool getAbsoluteUri(std::string* uri) const; - bool getRelativeUri(std::string* host, std::string* path) const; -}; - -struct HttpResponseData : public HttpData { - uint32_t scode; - std::string message; - - HttpResponseData() : scode(HC_INTERNAL_SERVER_ERROR) { } - void clear(bool release_document); - void copy(const HttpResponseData& src); - - // Convenience methods - void set_success(uint32_t scode = HC_OK); - void set_success(const std::string& content_type, - StreamInterface* document, - uint32_t scode = HC_OK); - void set_redirect(const std::string& location, - uint32_t scode = HC_MOVED_TEMPORARILY); - void set_error(uint32_t scode); - - size_t formatLeader(char* buffer, size_t size) const override; - HttpError parseLeader(const char* line, size_t len) override; -}; - -struct HttpTransaction { - HttpRequestData request; - HttpResponseData response; -}; - -////////////////////////////////////////////////////////////////////// -// Http Authentication -////////////////////////////////////////////////////////////////////// - -struct HttpAuthContext { - std::string auth_method; - HttpAuthContext(const std::string& auth) : auth_method(auth) { } - virtual ~HttpAuthContext() { } -}; - -enum HttpAuthResult { HAR_RESPONSE, HAR_IGNORE, HAR_CREDENTIALS, HAR_ERROR }; - -// 'context' is used by this function to record information between calls. -// Start by passing a null pointer, then pass the same pointer each additional -// call. When the authentication attempt is finished, delete the context. -HttpAuthResult HttpAuthenticate( - const char * challenge, size_t len, - const SocketAddress& server, - const std::string& method, const std::string& uri, - const std::string& username, const CryptString& password, - HttpAuthContext *& context, std::string& response, std::string& auth_method); - -////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_HTTPCOMMON_H_ diff --git a/webrtc/rtc_base/httpserver.h b/webrtc/rtc_base/httpserver.h deleted file mode 100644 index a4acc4b49b..0000000000 --- a/webrtc/rtc_base/httpserver.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_HTTPSERVER_H_ -#define WEBRTC_RTC_BASE_HTTPSERVER_H_ - -#include -#include - -#include "webrtc/base/httpbase.h" - -namespace rtc { - -class AsyncSocket; -class HttpServer; -class SocketAddress; - -////////////////////////////////////////////////////////////////////// -// HttpServer -////////////////////////////////////////////////////////////////////// - -const int HTTP_INVALID_CONNECTION_ID = 0; - -struct HttpServerTransaction : public HttpTransaction { -public: - HttpServerTransaction(int id) : connection_id_(id) { } - int connection_id() const { return connection_id_; } - -private: - int connection_id_; -}; - -class HttpServer { -public: - HttpServer(); - virtual ~HttpServer(); - - int HandleConnection(StreamInterface* stream); - // Due to sigslot issues, we can't destroy some streams at an arbitrary time. - sigslot::signal3 SignalConnectionClosed; - - // This signal occurs when the HTTP request headers have been received, but - // before the request body is written to the request document. By default, - // the request document is a MemoryStream. By handling this signal, the - // document can be overridden, in which case the third signal argument should - // be set to true. In the case where the request body should be ignored, - // the document can be set to null. Note that the transaction object is still - // owened by the HttpServer at this point. - sigslot::signal3 - SignalHttpRequestHeader; - - // An HTTP request has been made, and is available in the transaction object. - // Populate the transaction's response, and then return the object via the - // Respond method. Note that during this time, ownership of the transaction - // object is transferred, so it may be passed between threads, although - // respond must be called on the server's active thread. - sigslot::signal2 SignalHttpRequest; - void Respond(HttpServerTransaction* transaction); - - // If you want to know when a request completes, listen to this event. - sigslot::signal3 - SignalHttpRequestComplete; - - // Stop processing the connection indicated by connection_id. - // Unless force is true, the server will complete sending a response that is - // in progress. - void Close(int connection_id, bool force); - void CloseAll(bool force); - - // After calling CloseAll, this event is signalled to indicate that all - // outstanding connections have closed. - sigslot::signal1 SignalCloseAllComplete; - -private: - class Connection : private IHttpNotify { - public: - Connection(int connection_id, HttpServer* server); - ~Connection() override; - - void BeginProcess(StreamInterface* stream); - StreamInterface* EndProcess(); - - void Respond(HttpServerTransaction* transaction); - void InitiateClose(bool force); - - // IHttpNotify Interface - HttpError onHttpHeaderComplete(bool chunked, size_t& data_size) override; - void onHttpComplete(HttpMode mode, HttpError err) override; - void onHttpClosed(HttpError err) override; - - int connection_id_; - HttpServer* server_; - HttpBase base_; - HttpServerTransaction* current_; - bool signalling_, close_; - }; - - Connection* Find(int connection_id); - void Remove(int connection_id); - - friend class Connection; - typedef std::map ConnectionMap; - - ConnectionMap connections_; - int next_connection_id_; - bool closing_; -}; - -////////////////////////////////////////////////////////////////////// - -class HttpListenServer : public HttpServer, public sigslot::has_slots<> { -public: - HttpListenServer(); - ~HttpListenServer() override; - - int Listen(const SocketAddress& address); - bool GetAddress(SocketAddress* address) const; - void StopListening(); - -private: - void OnReadEvent(AsyncSocket* socket); - void OnConnectionClosed(HttpServer* server, int connection_id, - StreamInterface* stream); - - std::unique_ptr listener_; -}; - -////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_HTTPSERVER_H_ diff --git a/webrtc/rtc_base/ifaddrs-android.h b/webrtc/rtc_base/ifaddrs-android.h deleted file mode 100644 index 2c171f0a85..0000000000 --- a/webrtc/rtc_base/ifaddrs-android.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2013 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_IFADDRS_ANDROID_H_ -#define WEBRTC_RTC_BASE_IFADDRS_ANDROID_H_ - -#include -#include - - -// Implementation of getifaddrs for Android. -// Fills out a list of ifaddr structs (see below) which contain information -// about every network interface available on the host. -// See 'man getifaddrs' on Linux or OS X (nb: it is not a POSIX function). -struct ifaddrs { - struct ifaddrs* ifa_next; - char* ifa_name; - unsigned int ifa_flags; - struct sockaddr* ifa_addr; - struct sockaddr* ifa_netmask; - // Real ifaddrs has broadcast, point to point and data members. - // We don't need them (yet?). -}; - -namespace rtc { - -int getifaddrs(struct ifaddrs** result); -void freeifaddrs(struct ifaddrs* addrs); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_IFADDRS_ANDROID_H_ diff --git a/webrtc/rtc_base/ifaddrs_converter.h b/webrtc/rtc_base/ifaddrs_converter.h deleted file mode 100644 index 0cda8d491e..0000000000 --- a/webrtc/rtc_base/ifaddrs_converter.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_IFADDRS_CONVERTER_H_ -#define WEBRTC_RTC_BASE_IFADDRS_CONVERTER_H_ - -#if defined(WEBRTC_ANDROID) -#include "webrtc/base/ifaddrs-android.h" -#else -#include -#endif // WEBRTC_ANDROID - -#include "webrtc/base/ipaddress.h" - -namespace rtc { - -// This class converts native interface addresses to our internal IPAddress -// class. Subclasses should override ConvertNativeToIPAttributes to implement -// the different ways of retrieving IPv6 attributes for various POSIX platforms. -class IfAddrsConverter { - public: - IfAddrsConverter(); - virtual ~IfAddrsConverter(); - virtual bool ConvertIfAddrsToIPAddress(const struct ifaddrs* interface, - InterfaceAddress* ipaddress, - IPAddress* mask); - - protected: - virtual bool ConvertNativeAttributesToIPAttributes( - const struct ifaddrs* interface, - int* ip_attributes); -}; - -IfAddrsConverter* CreateIfAddrsConverter(); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_IFADDRS_CONVERTER_H_ diff --git a/webrtc/rtc_base/ignore_wundef.h b/webrtc/rtc_base/ignore_wundef.h deleted file mode 100644 index 77da2b9dd0..0000000000 --- a/webrtc/rtc_base/ignore_wundef.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_IGNORE_WUNDEF_H_ -#define WEBRTC_RTC_BASE_IGNORE_WUNDEF_H_ - -// If a header file uses #if on possibly undefined macros (and it's for some -// reason not possible to just fix the header file), include it like this: -// -// RTC_PUSH_IGNORING_WUNDEF() -// #include "misbehaving_header.h" -// RTC_POP_IGNORING_WUNDEF() -// -// This will cause the compiler to not emit -Wundef warnings for that file. - -#ifdef __clang__ -#define RTC_PUSH_IGNORING_WUNDEF() \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wundef\"") -#define RTC_POP_IGNORING_WUNDEF() _Pragma("clang diagnostic pop") -#else -#define RTC_PUSH_IGNORING_WUNDEF() -#define RTC_POP_IGNORING_WUNDEF() -#endif // __clang__ - -#endif // WEBRTC_RTC_BASE_IGNORE_WUNDEF_H_ diff --git a/webrtc/rtc_base/ipaddress.h b/webrtc/rtc_base/ipaddress.h deleted file mode 100644 index e8a9f29d15..0000000000 --- a/webrtc/rtc_base/ipaddress.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2011 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_IPADDRESS_H_ -#define WEBRTC_RTC_BASE_IPADDRESS_H_ - -#if defined(WEBRTC_POSIX) -#include -#include -#include -#include -#endif -#if defined(WEBRTC_WIN) -#include -#include -#endif -#include -#include -#include - -#include "webrtc/base/basictypes.h" -#include "webrtc/base/byteorder.h" -#if defined(WEBRTC_WIN) -#include "webrtc/base/win32.h" -#endif - -namespace rtc { - -enum IPv6AddressFlag { - IPV6_ADDRESS_FLAG_NONE = 0x00, - - // Temporary address is dynamic by nature and will not carry MAC - // address. - IPV6_ADDRESS_FLAG_TEMPORARY = 1 << 0, - - // Temporary address could become deprecated once the preferred - // lifetime is reached. It is still valid but just shouldn't be used - // to create new connection. - IPV6_ADDRESS_FLAG_DEPRECATED = 1 << 1, -}; - -// Version-agnostic IP address class, wraps a union of in_addr and in6_addr. -class IPAddress { - public: - IPAddress() : family_(AF_UNSPEC) { - ::memset(&u_, 0, sizeof(u_)); - } - - explicit IPAddress(const in_addr& ip4) : family_(AF_INET) { - memset(&u_, 0, sizeof(u_)); - u_.ip4 = ip4; - } - - explicit IPAddress(const in6_addr& ip6) : family_(AF_INET6) { - u_.ip6 = ip6; - } - - explicit IPAddress(uint32_t ip_in_host_byte_order) : family_(AF_INET) { - memset(&u_, 0, sizeof(u_)); - u_.ip4.s_addr = HostToNetwork32(ip_in_host_byte_order); - } - - IPAddress(const IPAddress& other) : family_(other.family_) { - ::memcpy(&u_, &other.u_, sizeof(u_)); - } - - virtual ~IPAddress() {} - - const IPAddress & operator=(const IPAddress& other) { - family_ = other.family_; - ::memcpy(&u_, &other.u_, sizeof(u_)); - return *this; - } - - bool operator==(const IPAddress& other) const; - bool operator!=(const IPAddress& other) const; - bool operator <(const IPAddress& other) const; - bool operator >(const IPAddress& other) const; - friend std::ostream& operator<<(std::ostream& os, const IPAddress& addr); - - int family() const { return family_; } - in_addr ipv4_address() const; - in6_addr ipv6_address() const; - - // Returns the number of bytes needed to store the raw address. - size_t Size() const; - - // Wraps inet_ntop. - std::string ToString() const; - - // Same as ToString but anonymizes it by hiding the last part. - std::string ToSensitiveString() const; - - // Returns an unmapped address from a possibly-mapped address. - // Returns the same address if this isn't a mapped address. - IPAddress Normalized() const; - - // Returns this address as an IPv6 address. - // Maps v4 addresses (as ::ffff:a.b.c.d), returns v6 addresses unchanged. - IPAddress AsIPv6Address() const; - - // For socketaddress' benefit. Returns the IP in host byte order. - uint32_t v4AddressAsHostOrderInteger() const; - - // Whether this is an unspecified IP address. - bool IsNil() const; - - private: - int family_; - union { - in_addr ip4; - in6_addr ip6; - } u_; -}; - -// IP class which could represent IPv6 address flags which is only -// meaningful in IPv6 case. -class InterfaceAddress : public IPAddress { - public: - InterfaceAddress() : ipv6_flags_(IPV6_ADDRESS_FLAG_NONE) {} - - InterfaceAddress(IPAddress ip) - : IPAddress(ip), ipv6_flags_(IPV6_ADDRESS_FLAG_NONE) {} - - InterfaceAddress(IPAddress addr, int ipv6_flags) - : IPAddress(addr), ipv6_flags_(ipv6_flags) {} - - InterfaceAddress(const in6_addr& ip6, int ipv6_flags) - : IPAddress(ip6), ipv6_flags_(ipv6_flags) {} - - const InterfaceAddress & operator=(const InterfaceAddress& other); - - bool operator==(const InterfaceAddress& other) const; - bool operator!=(const InterfaceAddress& other) const; - - int ipv6_flags() const { return ipv6_flags_; } - friend std::ostream& operator<<(std::ostream& os, - const InterfaceAddress& addr); - - private: - int ipv6_flags_; -}; - -bool IPFromAddrInfo(struct addrinfo* info, IPAddress* out); -bool IPFromString(const std::string& str, IPAddress* out); -bool IPFromString(const std::string& str, int flags, - InterfaceAddress* out); -bool IPIsAny(const IPAddress& ip); -bool IPIsLoopback(const IPAddress& ip); -bool IPIsPrivate(const IPAddress& ip); -bool IPIsUnspec(const IPAddress& ip); -size_t HashIP(const IPAddress& ip); - -// These are only really applicable for IPv6 addresses. -bool IPIs6Bone(const IPAddress& ip); -bool IPIs6To4(const IPAddress& ip); -bool IPIsLinkLocal(const IPAddress& ip); -bool IPIsMacBased(const IPAddress& ip); -bool IPIsSiteLocal(const IPAddress& ip); -bool IPIsTeredo(const IPAddress& ip); -bool IPIsULA(const IPAddress& ip); -bool IPIsV4Compatibility(const IPAddress& ip); -bool IPIsV4Mapped(const IPAddress& ip); - -// Returns the precedence value for this IP as given in RFC3484. -int IPAddressPrecedence(const IPAddress& ip); - -// Returns 'ip' truncated to be 'length' bits long. -IPAddress TruncateIP(const IPAddress& ip, int length); - -IPAddress GetLoopbackIP(int family); -IPAddress GetAnyIP(int family); - -// Returns the number of contiguously set bits, counting from the MSB in network -// byte order, in this IPAddress. Bits after the first 0 encountered are not -// counted. -int CountIPMaskBits(IPAddress mask); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_IPADDRESS_H_ diff --git a/webrtc/rtc_base/json.h b/webrtc/rtc_base/json.h deleted file mode 100644 index 7e1050e070..0000000000 --- a/webrtc/rtc_base/json.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_JSON_H_ -#define WEBRTC_RTC_BASE_JSON_H_ - -#include -#include - -#if !defined(WEBRTC_EXTERNAL_JSON) -#include "json/json.h" -#else -#include "third_party/jsoncpp/json.h" -#endif - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// -// JSON Helpers -/////////////////////////////////////////////////////////////////////////////// - -// Robust conversion operators, better than the ones in JsonCpp. -bool GetIntFromJson(const Json::Value& in, int* out); -bool GetUIntFromJson(const Json::Value& in, unsigned int* out); -bool GetStringFromJson(const Json::Value& in, std::string* out); -bool GetBoolFromJson(const Json::Value& in, bool* out); -bool GetDoubleFromJson(const Json::Value& in, double* out); - -// Pull values out of a JSON array. -bool GetValueFromJsonArray(const Json::Value& in, size_t n, - Json::Value* out); -bool GetIntFromJsonArray(const Json::Value& in, size_t n, - int* out); -bool GetUIntFromJsonArray(const Json::Value& in, size_t n, - unsigned int* out); -bool GetStringFromJsonArray(const Json::Value& in, size_t n, - std::string* out); -bool GetBoolFromJsonArray(const Json::Value& in, size_t n, - bool* out); -bool GetDoubleFromJsonArray(const Json::Value& in, size_t n, - double* out); - -// Convert json arrays to std::vector -bool JsonArrayToValueVector(const Json::Value& in, - std::vector* out); -bool JsonArrayToIntVector(const Json::Value& in, - std::vector* out); -bool JsonArrayToUIntVector(const Json::Value& in, - std::vector* out); -bool JsonArrayToStringVector(const Json::Value& in, - std::vector* out); -bool JsonArrayToBoolVector(const Json::Value& in, - std::vector* out); -bool JsonArrayToDoubleVector(const Json::Value& in, - std::vector* out); - -// Convert std::vector to json array -Json::Value ValueVectorToJsonArray(const std::vector& in); -Json::Value IntVectorToJsonArray(const std::vector& in); -Json::Value UIntVectorToJsonArray(const std::vector& in); -Json::Value StringVectorToJsonArray(const std::vector& in); -Json::Value BoolVectorToJsonArray(const std::vector& in); -Json::Value DoubleVectorToJsonArray(const std::vector& in); - -// Pull values out of a JSON object. -bool GetValueFromJsonObject(const Json::Value& in, const std::string& k, - Json::Value* out); -bool GetIntFromJsonObject(const Json::Value& in, const std::string& k, - int* out); -bool GetUIntFromJsonObject(const Json::Value& in, const std::string& k, - unsigned int* out); -bool GetStringFromJsonObject(const Json::Value& in, const std::string& k, - std::string* out); -bool GetBoolFromJsonObject(const Json::Value& in, const std::string& k, - bool* out); -bool GetDoubleFromJsonObject(const Json::Value& in, const std::string& k, - double* out); - -// Writes out a Json value as a string. -std::string JsonValueToString(const Json::Value& json); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_JSON_H_ diff --git a/webrtc/rtc_base/keep_ref_until_done.h b/webrtc/rtc_base/keep_ref_until_done.h deleted file mode 100644 index e590e4c1ea..0000000000 --- a/webrtc/rtc_base/keep_ref_until_done.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_KEEP_REF_UNTIL_DONE_H_ -#define WEBRTC_RTC_BASE_KEEP_REF_UNTIL_DONE_H_ - -#include "webrtc/base/bind.h" -#include "webrtc/base/callback.h" -#include "webrtc/base/refcount.h" -#include "webrtc/base/scoped_ref_ptr.h" - -namespace rtc { - -namespace impl { -template -static inline void DoNothing(const scoped_refptr& object) {} -} // namespace impl - -// KeepRefUntilDone keeps a reference to |object| until the returned -// callback goes out of scope. If the returned callback is copied, the -// reference will be released when the last callback goes out of scope. -template -static inline Callback0 KeepRefUntilDone(ObjectT* object) { - return rtc::Bind(&impl::DoNothing, scoped_refptr(object)); -} - -template -static inline Callback0 KeepRefUntilDone( - const scoped_refptr& object) { - return rtc::Bind(&impl::DoNothing, object); -} - -} // namespace rtc - - -#endif // WEBRTC_RTC_BASE_KEEP_REF_UNTIL_DONE_H_ diff --git a/webrtc/rtc_base/location.h b/webrtc/rtc_base/location.h deleted file mode 100644 index 6a4c9798c8..0000000000 --- a/webrtc/rtc_base/location.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_LOCATION_H_ -#define WEBRTC_RTC_BASE_LOCATION_H_ - -#include - -#include "webrtc/base/stringize_macros.h" - -namespace rtc { - -// Location provides basic info where of an object was constructed, or was -// significantly brought to life. -// This is a stripped down version of: -// https://code.google.com/p/chromium/codesearch#chromium/src/base/location.h -class Location { - public: - // Constructor should be called with a long-lived char*, such as __FILE__. - // It assumes the provided value will persist as a global constant, and it - // will not make a copy of it. - // - // TODO(deadbeef): Tracing is currently limited to 2 arguments, which is - // why the file name and line number are combined into one argument. - // - // Once TracingV2 is available, separate the file name and line number. - Location(const char* function_name, const char* file_and_line); - Location(); - Location(const Location& other); - Location& operator=(const Location& other); - - const char* function_name() const { return function_name_; } - const char* file_and_line() const { return file_and_line_; } - - std::string ToString() const; - - private: - const char* function_name_; - const char* file_and_line_; -}; - -// Define a macro to record the current source location. -#define RTC_FROM_HERE RTC_FROM_HERE_WITH_FUNCTION(__FUNCTION__) - -#define RTC_FROM_HERE_WITH_FUNCTION(function_name) \ - ::rtc::Location(function_name, __FILE__ ":" STRINGIZE(__LINE__)) - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_LOCATION_H_ diff --git a/webrtc/rtc_base/logging.h b/webrtc/rtc_base/logging.h deleted file mode 100644 index 455aac0bf0..0000000000 --- a/webrtc/rtc_base/logging.h +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// LOG(...) an ostream target that can be used to send formatted -// output to a variety of logging targets, such as debugger console, stderr, -// or any LogSink. -// The severity level passed as the first argument to the LOGging -// functions is used as a filter, to limit the verbosity of the logging. -// Static members of LogMessage documented below are used to control the -// verbosity and target of the output. -// There are several variations on the LOG macro which facilitate logging -// of common error conditions, detailed below. - -// LOG(sev) logs the given stream at severity "sev", which must be a -// compile-time constant of the LoggingSeverity type, without the namespace -// prefix. -// LOG_V(sev) Like LOG(), but sev is a run-time variable of the LoggingSeverity -// type (basically, it just doesn't prepend the namespace). -// LOG_F(sev) Like LOG(), but includes the name of the current function. -// LOG_T(sev) Like LOG(), but includes the this pointer. -// LOG_T_F(sev) Like LOG_F(), but includes the this pointer. -// LOG_GLE(M)(sev [, mod]) attempt to add a string description of the -// HRESULT returned by GetLastError. The "M" variant allows searching of a -// DLL's string table for the error description. -// LOG_ERRNO(sev) attempts to add a string description of an errno-derived -// error. errno and associated facilities exist on both Windows and POSIX, -// but on Windows they only apply to the C/C++ runtime. -// LOG_ERR(sev) is an alias for the platform's normal error system, i.e. _GLE on -// Windows and _ERRNO on POSIX. -// (The above three also all have _EX versions that let you specify the error -// code, rather than using the last one.) -// LOG_E(sev, ctx, err, ...) logs a detailed error interpreted using the -// specified context. -// LOG_CHECK_LEVEL(sev) (and LOG_CHECK_LEVEL_V(sev)) can be used as a test -// before performing expensive or sensitive operations whose sole purpose is -// to output logging data at the desired level. -// Lastly, PLOG(sev, err) is an alias for LOG_ERR_EX. - -#ifndef WEBRTC_RTC_BASE_LOGGING_H_ -#define WEBRTC_RTC_BASE_LOGGING_H_ - -#include - -#include -#include -#include -#include - -#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) -#include -#endif - -#include "webrtc/base/basictypes.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/thread_annotations.h" - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// -// ConstantLabel can be used to easily generate string names from constant -// values. This can be useful for logging descriptive names of error messages. -// Usage: -// const ConstantLabel LIBRARY_ERRORS[] = { -// KLABEL(SOME_ERROR), -// KLABEL(SOME_OTHER_ERROR), -// ... -// LASTLABEL -// } -// -// int err = LibraryFunc(); -// LOG(LS_ERROR) << "LibraryFunc returned: " -// << ErrorName(err, LIBRARY_ERRORS); - -struct ConstantLabel { int value; const char * label; }; -#define KLABEL(x) { x, #x } -#define TLABEL(x, y) { x, y } -#define LASTLABEL { 0, 0 } - -const char* FindLabel(int value, const ConstantLabel entries[]); -std::string ErrorName(int err, const ConstantLabel* err_table); - -#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) -// Returns a UTF8 description from an OS X Status error. -std::string DescriptionFromOSStatus(OSStatus err); -#endif - -////////////////////////////////////////////////////////////////////// - -// Note that the non-standard LoggingSeverity aliases exist because they are -// still in broad use. The meanings of the levels are: -// LS_SENSITIVE: Information which should only be logged with the consent -// of the user, due to privacy concerns. -// LS_VERBOSE: This level is for data which we do not want to appear in the -// normal debug log, but should appear in diagnostic logs. -// LS_INFO: Chatty level used in debugging for all sorts of things, the default -// in debug builds. -// LS_WARNING: Something that may warrant investigation. -// LS_ERROR: Something that should not have occurred. -// LS_NONE: Don't log. -enum LoggingSeverity { - LS_SENSITIVE, - LS_VERBOSE, - LS_INFO, - LS_WARNING, - LS_ERROR, - LS_NONE, - INFO = LS_INFO, - WARNING = LS_WARNING, - LERROR = LS_ERROR -}; - -// LogErrorContext assists in interpreting the meaning of an error value. -enum LogErrorContext { - ERRCTX_NONE, - ERRCTX_ERRNO, // System-local errno - ERRCTX_HRESULT, // Windows HRESULT - ERRCTX_OSSTATUS, // MacOS OSStatus - - // Abbreviations for LOG_E macro - ERRCTX_EN = ERRCTX_ERRNO, // LOG_E(sev, EN, x) - ERRCTX_HR = ERRCTX_HRESULT, // LOG_E(sev, HR, x) - ERRCTX_OS = ERRCTX_OSSTATUS, // LOG_E(sev, OS, x) -}; - -// Virtual sink interface that can receive log messages. -class LogSink { - public: - LogSink() {} - virtual ~LogSink() {} - virtual void OnLogMessage(const std::string& message) = 0; -}; - -class LogMessage { - public: - LogMessage(const char* file, - int line, - LoggingSeverity sev, - LogErrorContext err_ctx = ERRCTX_NONE, - int err = 0, - const char* module = nullptr); - - LogMessage(const char* file, - int line, - LoggingSeverity sev, - const std::string& tag); - - ~LogMessage(); - - static inline bool Loggable(LoggingSeverity sev) { return (sev >= min_sev_); } - std::ostream& stream() { return print_stream_; } - - // Returns the time at which this function was called for the first time. - // The time will be used as the logging start time. - // If this is not called externally, the LogMessage ctor also calls it, in - // which case the logging start time will be the time of the first LogMessage - // instance is created. - static int64_t LogStartTime(); - - // Returns the wall clock equivalent of |LogStartTime|, in seconds from the - // epoch. - static uint32_t WallClockStartTime(); - - // LogThreads: Display the thread identifier of the current thread - static void LogThreads(bool on = true); - - // LogTimestamps: Display the elapsed time of the program - static void LogTimestamps(bool on = true); - - // These are the available logging channels - // Debug: Debug console on Windows, otherwise stderr - static void LogToDebug(LoggingSeverity min_sev); - static LoggingSeverity GetLogToDebug() { return dbg_sev_; } - - // Sets whether logs will be directed to stderr in debug mode. - static void SetLogToStderr(bool log_to_stderr); - - // Stream: Any non-blocking stream interface. LogMessage takes ownership of - // the stream. Multiple streams may be specified by using AddLogToStream. - // LogToStream is retained for backwards compatibility; when invoked, it - // will discard any previously set streams and install the specified stream. - // GetLogToStream gets the severity for the specified stream, of if none - // is specified, the minimum stream severity. - // RemoveLogToStream removes the specified stream, without destroying it. - static int GetLogToStream(LogSink* stream = nullptr); - static void AddLogToStream(LogSink* stream, LoggingSeverity min_sev); - static void RemoveLogToStream(LogSink* stream); - - // Testing against MinLogSeverity allows code to avoid potentially expensive - // logging operations by pre-checking the logging level. - static int GetMinLogSeverity() { return min_sev_; } - - // Parses the provided parameter stream to configure the options above. - // Useful for configuring logging from the command line. - static void ConfigureLogging(const char* params); - - private: - typedef std::pair StreamAndSeverity; - typedef std::list StreamList; - - // Updates min_sev_ appropriately when debug sinks change. - static void UpdateMinLogSeverity(); - - // These write out the actual log messages. - static void OutputToDebug(const std::string& msg, - LoggingSeverity severity, - const std::string& tag); - - // The ostream that buffers the formatted message before output - std::ostringstream print_stream_; - - // The severity level of this message - LoggingSeverity severity_; - - // The Android debug output tag. - std::string tag_; - - // String data generated in the constructor, that should be appended to - // the message before output. - std::string extra_; - - // dbg_sev_ is the thresholds for those output targets - // min_sev_ is the minimum (most verbose) of those levels, and is used - // as a short-circuit in the logging macros to identify messages that won't - // be logged. - // ctx_sev_ is the minimum level at which file context is displayed - static LoggingSeverity min_sev_, dbg_sev_, ctx_sev_; - - // The output streams and their associated severities - static StreamList streams_; - - // Flags for formatting options - static bool thread_, timestamp_; - - // Determines if logs will be directed to stderr in debug mode. - static bool log_to_stderr_; - - RTC_DISALLOW_COPY_AND_ASSIGN(LogMessage); -}; - -////////////////////////////////////////////////////////////////////// -// Logging Helpers -////////////////////////////////////////////////////////////////////// - -class LogMultilineState { - public: - size_t unprintable_count_[2]; - LogMultilineState() { - unprintable_count_[0] = unprintable_count_[1] = 0; - } -}; - -// When possible, pass optional state variable to track various data across -// multiple calls to LogMultiline. Otherwise, pass null. -void LogMultiline(LoggingSeverity level, const char* label, bool input, - const void* data, size_t len, bool hex_mode, - LogMultilineState* state); - -#ifndef LOG - -// The following non-obvious technique for implementation of a -// conditional log stream was stolen from google3/base/logging.h. - -// This class is used to explicitly ignore values in the conditional -// logging macros. This avoids compiler warnings like "value computed -// is not used" and "statement has no effect". - -class LogMessageVoidify { - public: - LogMessageVoidify() { } - // This has to be an operator with a precedence lower than << but - // higher than ?: - void operator&(std::ostream&) { } -}; - -#define LOG_SEVERITY_PRECONDITION(sev) \ - !(rtc::LogMessage::Loggable(sev)) \ - ? (void) 0 \ - : rtc::LogMessageVoidify() & - -#define LOG(sev) \ - LOG_SEVERITY_PRECONDITION(rtc::sev) \ - rtc::LogMessage(__FILE__, __LINE__, rtc::sev).stream() - -// The _V version is for when a variable is passed in. It doesn't do the -// namespace concatination. -#define LOG_V(sev) \ - LOG_SEVERITY_PRECONDITION(sev) \ - rtc::LogMessage(__FILE__, __LINE__, sev).stream() - -// The _F version prefixes the message with the current function name. -#if (defined(__GNUC__) && !defined(NDEBUG)) || defined(WANT_PRETTY_LOG_F) -#define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": " -#define LOG_T_F(sev) LOG(sev) << this << ": " << __PRETTY_FUNCTION__ << ": " -#else -#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " -#define LOG_T_F(sev) LOG(sev) << this << ": " << __FUNCTION__ << ": " -#endif - -#define LOG_CHECK_LEVEL(sev) \ - rtc::LogCheckLevel(rtc::sev) -#define LOG_CHECK_LEVEL_V(sev) \ - rtc::LogCheckLevel(sev) - -inline bool LogCheckLevel(LoggingSeverity sev) { - return (LogMessage::GetMinLogSeverity() <= sev); -} - -#define LOG_E(sev, ctx, err, ...) \ - LOG_SEVERITY_PRECONDITION(rtc::sev) \ - rtc::LogMessage(__FILE__, __LINE__, rtc::sev, \ - rtc::ERRCTX_ ## ctx, err , ##__VA_ARGS__) \ - .stream() - -#define LOG_T(sev) LOG(sev) << this << ": " - -#define LOG_ERRNO_EX(sev, err) \ - LOG_E(sev, ERRNO, err) -#define LOG_ERRNO(sev) \ - LOG_ERRNO_EX(sev, errno) - -#if defined(WEBRTC_WIN) -#define LOG_GLE_EX(sev, err) \ - LOG_E(sev, HRESULT, err) -#define LOG_GLE(sev) \ - LOG_GLE_EX(sev, GetLastError()) -#define LOG_GLEM(sev, mod) \ - LOG_E(sev, HRESULT, GetLastError(), mod) -#define LOG_ERR_EX(sev, err) \ - LOG_GLE_EX(sev, err) -#define LOG_ERR(sev) \ - LOG_GLE(sev) -#define LAST_SYSTEM_ERROR \ - (::GetLastError()) -#elif defined(__native_client__) && __native_client__ -#define LOG_ERR_EX(sev, err) \ - LOG(sev) -#define LOG_ERR(sev) \ - LOG(sev) -#define LAST_SYSTEM_ERROR \ - (0) -#elif defined(WEBRTC_POSIX) -#define LOG_ERR_EX(sev, err) \ - LOG_ERRNO_EX(sev, err) -#define LOG_ERR(sev) \ - LOG_ERRNO(sev) -#define LAST_SYSTEM_ERROR \ - (errno) -#endif // WEBRTC_WIN - -#define LOG_TAG(sev, tag) \ - LOG_SEVERITY_PRECONDITION(sev) \ - rtc::LogMessage(nullptr, 0, sev, tag).stream() - -#define PLOG(sev, err) \ - LOG_ERR_EX(sev, err) - -// TODO(?): Add an "assert" wrapper that logs in the same manner. - -#endif // LOG - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_LOGGING_H_ diff --git a/webrtc/rtc_base/logsinks.h b/webrtc/rtc_base/logsinks.h deleted file mode 100644 index bfc3703bc7..0000000000 --- a/webrtc/rtc_base/logsinks.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_LOGSINKS_H_ -#define WEBRTC_RTC_BASE_LOGSINKS_H_ - -#include -#include - -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/filerotatingstream.h" -#include "webrtc/base/logging.h" - -namespace rtc { - -// Log sink that uses a FileRotatingStream to write to disk. -// Init() must be called before adding this sink. -class FileRotatingLogSink : public LogSink { - public: - // |num_log_files| must be greater than 1 and |max_log_size| must be greater - // than 0. - FileRotatingLogSink(const std::string& log_dir_path, - const std::string& log_prefix, - size_t max_log_size, - size_t num_log_files); - ~FileRotatingLogSink() override; - - // Writes the message to the current file. It will spill over to the next - // file if needed. - void OnLogMessage(const std::string& message) override; - - // Deletes any existing files in the directory and creates a new log file. - virtual bool Init(); - - // Disables buffering on the underlying stream. - bool DisableBuffering(); - - protected: - explicit FileRotatingLogSink(FileRotatingStream* stream); - - private: - std::unique_ptr stream_; - - RTC_DISALLOW_COPY_AND_ASSIGN(FileRotatingLogSink); -}; - -// Log sink that uses a CallSessionFileRotatingStream to write to disk. -// Init() must be called before adding this sink. -class CallSessionFileRotatingLogSink : public FileRotatingLogSink { - public: - CallSessionFileRotatingLogSink(const std::string& log_dir_path, - size_t max_total_log_size); - ~CallSessionFileRotatingLogSink() override; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(CallSessionFileRotatingLogSink); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_LOGSINKS_H_ diff --git a/webrtc/rtc_base/macutils.h b/webrtc/rtc_base/macutils.h deleted file mode 100644 index 5b4021b8fd..0000000000 --- a/webrtc/rtc_base/macutils.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2007 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_MACUTILS_H_ -#define WEBRTC_RTC_BASE_MACUTILS_H_ - -#include -#include - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// - -// Note that some of these functions work for both iOS and Mac OS X. The ones -// that are specific to Mac are #ifdef'ed as such. - -bool ToUtf8(const CFStringRef str16, std::string* str8); -bool ToUtf16(const std::string& str8, CFStringRef* str16); - -#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) -void DecodeFourChar(UInt32 fc, std::string* out); - -enum MacOSVersionName { - kMacOSUnknown, // ??? - kMacOSOlder, // 10.2- - kMacOSPanther, // 10.3 - kMacOSTiger, // 10.4 - kMacOSLeopard, // 10.5 - kMacOSSnowLeopard, // 10.6 - kMacOSLion, // 10.7 - kMacOSMountainLion, // 10.8 - kMacOSMavericks, // 10.9 - kMacOSNewer, // 10.10+ -}; - -MacOSVersionName GetOSVersionName(); -#endif - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_MACUTILS_H_ diff --git a/webrtc/rtc_base/mathutils.h b/webrtc/rtc_base/mathutils.h deleted file mode 100644 index 3882c32803..0000000000 --- a/webrtc/rtc_base/mathutils.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2005 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_MATHUTILS_H_ -#define WEBRTC_RTC_BASE_MATHUTILS_H_ - -#include -#include - -#include "webrtc/base/checks.h" - -#ifndef M_PI -#define M_PI 3.14159265359f -#endif - -// Given two numbers |x| and |y| such that x >= y, computes the difference -// x - y without causing undefined behavior due to signed overflow. -template -typename std::make_unsigned::type unsigned_difference(T x, T y) { - static_assert( - std::is_signed::value, - "Function unsigned_difference is only meaningful for signed types."); - RTC_DCHECK_GE(x, y); - typedef typename std::make_unsigned::type unsigned_type; - // int -> unsigned conversion repeatedly adds UINT_MAX + 1 until the number - // can be represented as an unsigned. Since we know that the actual - // difference x - y can be represented as an unsigned, it is sufficient to - // compute the difference modulo UINT_MAX + 1, i.e using unsigned arithmetic. - return static_cast(x) - static_cast(y); -} - -#endif // WEBRTC_RTC_BASE_MATHUTILS_H_ diff --git a/webrtc/rtc_base/md5.h b/webrtc/rtc_base/md5.h deleted file mode 100644 index 9326d53eaa..0000000000 --- a/webrtc/rtc_base/md5.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This is the header file for the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * To compute the message digest of a chunk of bytes, declare an - * MD5Context structure, pass it to MD5Init, call MD5Update as - * needed on buffers full of bytes, and then call MD5Final, which - * will fill a supplied 16-byte array with the digest. - * - */ - -// Changes(fbarchard): Ported to C++ and Google style guide. -// Made context first parameter in MD5Final for consistency with Sha1. -// Changes(hellner): added rtc namespace -// Changes(pbos): Reverted types back to uint32(8)_t with _t suffix. - -#ifndef WEBRTC_RTC_BASE_MD5_H_ -#define WEBRTC_RTC_BASE_MD5_H_ - -#include -#include - -namespace rtc { - -struct MD5Context { - uint32_t buf[4]; - uint32_t bits[2]; - uint32_t in[16]; -}; - -void MD5Init(MD5Context* context); -void MD5Update(MD5Context* context, const uint8_t* data, size_t len); -void MD5Final(MD5Context* context, uint8_t digest[16]); -void MD5Transform(uint32_t buf[4], const uint32_t in[16]); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_MD5_H_ diff --git a/webrtc/rtc_base/md5digest.h b/webrtc/rtc_base/md5digest.h deleted file mode 100644 index be5b7d02dd..0000000000 --- a/webrtc/rtc_base/md5digest.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2012 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_MD5DIGEST_H_ -#define WEBRTC_RTC_BASE_MD5DIGEST_H_ - -#include "webrtc/base/md5.h" -#include "webrtc/base/messagedigest.h" - -namespace rtc { - -// A simple wrapper for our MD5 implementation. -class Md5Digest : public MessageDigest { - public: - enum { kSize = 16 }; - Md5Digest() { - MD5Init(&ctx_); - } - size_t Size() const override; - void Update(const void* buf, size_t len) override; - size_t Finish(void* buf, size_t len) override; - - private: - MD5Context ctx_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_MD5DIGEST_H_ diff --git a/webrtc/rtc_base/memory_usage.h b/webrtc/rtc_base/memory_usage.h deleted file mode 100644 index 4cb8231697..0000000000 --- a/webrtc/rtc_base/memory_usage.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef WEBRTC_RTC_BASE_MEMORY_USAGE_H_ -#define WEBRTC_RTC_BASE_MEMORY_USAGE_H_ - -#include - -namespace rtc { - -// Returns current memory used by the process in bytes (working set size on -// Windows and resident set size on other platforms). -// Returns -1 on failure. -int64_t GetProcessResidentSizeBytes(); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_MEMORY_USAGE_H_ diff --git a/webrtc/rtc_base/messagedigest.h b/webrtc/rtc_base/messagedigest.h deleted file mode 100644 index 12e4287a14..0000000000 --- a/webrtc/rtc_base/messagedigest.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_MESSAGEDIGEST_H_ -#define WEBRTC_RTC_BASE_MESSAGEDIGEST_H_ - -#include - -namespace rtc { - -// Definitions for the digest algorithms. -extern const char DIGEST_MD5[]; -extern const char DIGEST_SHA_1[]; -extern const char DIGEST_SHA_224[]; -extern const char DIGEST_SHA_256[]; -extern const char DIGEST_SHA_384[]; -extern const char DIGEST_SHA_512[]; - -// A general class for computing hashes. -class MessageDigest { - public: - enum { kMaxSize = 64 }; // Maximum known size (SHA-512) - virtual ~MessageDigest() {} - // Returns the digest output size (e.g. 16 bytes for MD5). - virtual size_t Size() const = 0; - // Updates the digest with |len| bytes from |buf|. - virtual void Update(const void* buf, size_t len) = 0; - // Outputs the digest value to |buf| with length |len|. - // Returns the number of bytes written, i.e., Size(). - virtual size_t Finish(void* buf, size_t len) = 0; -}; - -// A factory class for creating digest objects. -class MessageDigestFactory { - public: - static MessageDigest* Create(const std::string& alg); -}; - -// A whitelist of approved digest algorithms from RFC 4572 (FIPS 180). -bool IsFips180DigestAlgorithm(const std::string& alg); - -// Functions to create hashes. - -// Computes the hash of |in_len| bytes of |input|, using the |digest| hash -// implementation, and outputs the hash to the buffer |output|, which is -// |out_len| bytes long. Returns the number of bytes written to |output| if -// successful, or 0 if |out_len| was too small. -size_t ComputeDigest(MessageDigest* digest, const void* input, size_t in_len, - void* output, size_t out_len); -// Like the previous function, but creates a digest implementation based on -// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns 0 if there is no -// digest with the given name. -size_t ComputeDigest(const std::string& alg, const void* input, size_t in_len, - void* output, size_t out_len); -// Computes the hash of |input| using the |digest| hash implementation, and -// returns it as a hex-encoded string. -std::string ComputeDigest(MessageDigest* digest, const std::string& input); -// Like the previous function, but creates a digest implementation based on -// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns empty string if -// there is no digest with the given name. -std::string ComputeDigest(const std::string& alg, const std::string& input); -// Like the previous function, but returns an explicit result code. -bool ComputeDigest(const std::string& alg, const std::string& input, - std::string* output); - -// Shorthand way to compute a hex-encoded hash using MD5. -inline std::string MD5(const std::string& input) { - return ComputeDigest(DIGEST_MD5, input); -} - -// Functions to compute RFC 2104 HMACs. - -// Computes the HMAC of |in_len| bytes of |input|, using the |digest| hash -// implementation and |key_len| bytes of |key| to key the HMAC, and outputs -// the HMAC to the buffer |output|, which is |out_len| bytes long. Returns the -// number of bytes written to |output| if successful, or 0 if |out_len| was too -// small. -size_t ComputeHmac(MessageDigest* digest, const void* key, size_t key_len, - const void* input, size_t in_len, - void* output, size_t out_len); -// Like the previous function, but creates a digest implementation based on -// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns 0 if there is no -// digest with the given name. -size_t ComputeHmac(const std::string& alg, const void* key, size_t key_len, - const void* input, size_t in_len, - void* output, size_t out_len); -// Computes the HMAC of |input| using the |digest| hash implementation and |key| -// to key the HMAC, and returns it as a hex-encoded string. -std::string ComputeHmac(MessageDigest* digest, const std::string& key, - const std::string& input); -// Like the previous function, but creates a digest implementation based on -// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns empty string if -// there is no digest with the given name. -std::string ComputeHmac(const std::string& alg, const std::string& key, - const std::string& input); -// Like the previous function, but returns an explicit result code. -bool ComputeHmac(const std::string& alg, const std::string& key, - const std::string& input, std::string* output); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_MESSAGEDIGEST_H_ diff --git a/webrtc/rtc_base/messagehandler.h b/webrtc/rtc_base/messagehandler.h deleted file mode 100644 index 8cb445766c..0000000000 --- a/webrtc/rtc_base/messagehandler.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_MESSAGEHANDLER_H_ -#define WEBRTC_RTC_BASE_MESSAGEHANDLER_H_ - -#include -#include - -#include "webrtc/base/constructormagic.h" - -namespace rtc { - -struct Message; - -// Messages get dispatched to a MessageHandler - -class MessageHandler { - public: - virtual ~MessageHandler(); - virtual void OnMessage(Message* msg) = 0; - - protected: - MessageHandler() {} - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(MessageHandler); -}; - -// Helper class to facilitate executing a functor on a thread. -template -class FunctorMessageHandler : public MessageHandler { - public: - explicit FunctorMessageHandler(const FunctorT& functor) - : functor_(functor) {} - virtual void OnMessage(Message* msg) { - result_ = functor_(); - } - const ReturnT& result() const { return result_; } - - // Returns moved result. Should not call result() or MoveResult() again - // after this. - ReturnT MoveResult() { return std::move(result_); } - - private: - FunctorT functor_; - ReturnT result_; -}; - -// Specialization for ReturnT of void. -template -class FunctorMessageHandler : public MessageHandler { - public: - explicit FunctorMessageHandler(const FunctorT& functor) - : functor_(functor) {} - virtual void OnMessage(Message* msg) { - functor_(); - } - void result() const {} - void MoveResult() {} - - private: - FunctorT functor_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_MESSAGEHANDLER_H_ diff --git a/webrtc/rtc_base/messagequeue.h b/webrtc/rtc_base/messagequeue.h deleted file mode 100644 index 4e534fa2fa..0000000000 --- a/webrtc/rtc_base/messagequeue.h +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_MESSAGEQUEUE_H_ -#define WEBRTC_RTC_BASE_MESSAGEQUEUE_H_ - -#include - -#include -#include -#include -#include -#include -#include - -#include "webrtc/base/basictypes.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/criticalsection.h" -#include "webrtc/base/location.h" -#include "webrtc/base/messagehandler.h" -#include "webrtc/base/scoped_ref_ptr.h" -#include "webrtc/base/sigslot.h" -#include "webrtc/base/socketserver.h" -#include "webrtc/base/timeutils.h" -#include "webrtc/base/thread_annotations.h" - -namespace rtc { - -struct Message; -class MessageQueue; - -// MessageQueueManager does cleanup of of message queues - -class MessageQueueManager { - public: - static void Add(MessageQueue *message_queue); - static void Remove(MessageQueue *message_queue); - static void Clear(MessageHandler *handler); - - // For testing purposes, we expose whether or not the MessageQueueManager - // instance has been initialized. It has no other use relative to the rest of - // the functions of this class, which auto-initialize the underlying - // MessageQueueManager instance when necessary. - static bool IsInitialized(); - - // Mainly for testing purposes, for use with a simulated clock. - // Ensures that all message queues have processed delayed messages - // up until the current point in time. - static void ProcessAllMessageQueues(); - - private: - static MessageQueueManager* Instance(); - - MessageQueueManager(); - ~MessageQueueManager(); - - void AddInternal(MessageQueue *message_queue); - void RemoveInternal(MessageQueue *message_queue); - void ClearInternal(MessageHandler *handler); - void ProcessAllMessageQueuesInternal(); - - static MessageQueueManager* instance_; - // This list contains all live MessageQueues. - std::vector message_queues_ GUARDED_BY(crit_); - - // Acquire this with DebugNonReentrantCritScope. - CriticalSection crit_; - bool locked_ GUARDED_BY(crit_); -}; - -// Derive from this for specialized data -// App manages lifetime, except when messages are purged - -class MessageData { - public: - MessageData() {} - virtual ~MessageData() {} -}; - -template -class TypedMessageData : public MessageData { - public: - explicit TypedMessageData(const T& data) : data_(data) { } - const T& data() const { return data_; } - T& data() { return data_; } - private: - T data_; -}; - -// Like TypedMessageData, but for pointers that require a delete. -template -class ScopedMessageData : public MessageData { - public: - explicit ScopedMessageData(std::unique_ptr data) - : data_(std::move(data)) {} - // Deprecated. - // TODO(deadbeef): Remove this once downstream applications stop using it. - explicit ScopedMessageData(T* data) : data_(data) {} - // Deprecated. - // TODO(deadbeef): Returning a reference to a unique ptr? Why. Get rid of - // this once downstream applications stop using it, then rename inner_data to - // just data. - const std::unique_ptr& data() const { return data_; } - std::unique_ptr& data() { return data_; } - - const T& inner_data() const { return *data_; } - T& inner_data() { return *data_; } - - private: - std::unique_ptr data_; -}; - -// Like ScopedMessageData, but for reference counted pointers. -template -class ScopedRefMessageData : public MessageData { - public: - explicit ScopedRefMessageData(T* data) : data_(data) { } - const scoped_refptr& data() const { return data_; } - scoped_refptr& data() { return data_; } - private: - scoped_refptr data_; -}; - -template -inline MessageData* WrapMessageData(const T& data) { - return new TypedMessageData(data); -} - -template -inline const T& UseMessageData(MessageData* data) { - return static_cast< TypedMessageData* >(data)->data(); -} - -template -class DisposeData : public MessageData { - public: - explicit DisposeData(T* data) : data_(data) { } - virtual ~DisposeData() { delete data_; } - private: - T* data_; -}; - -const uint32_t MQID_ANY = static_cast(-1); -const uint32_t MQID_DISPOSE = static_cast(-2); - -// No destructor - -struct Message { - Message() - : phandler(nullptr), message_id(0), pdata(nullptr), ts_sensitive(0) {} - inline bool Match(MessageHandler* handler, uint32_t id) const { - return (handler == nullptr || handler == phandler) && - (id == MQID_ANY || id == message_id); - } - Location posted_from; - MessageHandler *phandler; - uint32_t message_id; - MessageData *pdata; - int64_t ts_sensitive; -}; - -typedef std::list MessageList; - -// DelayedMessage goes into a priority queue, sorted by trigger time. Messages -// with the same trigger time are processed in num_ (FIFO) order. - -class DelayedMessage { - public: - DelayedMessage(int64_t delay, - int64_t trigger, - uint32_t num, - const Message& msg) - : cmsDelay_(delay), msTrigger_(trigger), num_(num), msg_(msg) {} - - bool operator< (const DelayedMessage& dmsg) const { - return (dmsg.msTrigger_ < msTrigger_) - || ((dmsg.msTrigger_ == msTrigger_) && (dmsg.num_ < num_)); - } - - int64_t cmsDelay_; // for debugging - int64_t msTrigger_; - uint32_t num_; - Message msg_; -}; - -class MessageQueue { - public: - static const int kForever = -1; - - // Create a new MessageQueue and optionally assign it to the passed - // SocketServer. Subclasses that override Clear should pass false for - // init_queue and call DoInit() from their constructor to prevent races - // with the MessageQueueManager using the object while the vtable is still - // being created. - MessageQueue(SocketServer* ss, bool init_queue); - MessageQueue(std::unique_ptr ss, bool init_queue); - - // NOTE: SUBCLASSES OF MessageQueue THAT OVERRIDE Clear MUST CALL - // DoDestroy() IN THEIR DESTRUCTORS! This is required to avoid a data race - // between the destructor modifying the vtable, and the MessageQueueManager - // calling Clear on the object from a different thread. - virtual ~MessageQueue(); - - SocketServer* socketserver(); - - // Note: The behavior of MessageQueue has changed. When a MQ is stopped, - // futher Posts and Sends will fail. However, any pending Sends and *ready* - // Posts (as opposed to unexpired delayed Posts) will be delivered before - // Get (or Peek) returns false. By guaranteeing delivery of those messages, - // we eliminate the race condition when an MessageHandler and MessageQueue - // may be destroyed independently of each other. - virtual void Quit(); - virtual bool IsQuitting(); - virtual void Restart(); - // Not all message queues actually process messages (such as SignalThread). - // In those cases, it's important to know, before posting, that it won't be - // Processed. Normally, this would be true until IsQuitting() is true. - virtual bool IsProcessingMessages(); - - // Get() will process I/O until: - // 1) A message is available (returns true) - // 2) cmsWait seconds have elapsed (returns false) - // 3) Stop() is called (returns false) - virtual bool Get(Message *pmsg, int cmsWait = kForever, - bool process_io = true); - virtual bool Peek(Message *pmsg, int cmsWait = 0); - virtual void Post(const Location& posted_from, - MessageHandler* phandler, - uint32_t id = 0, - MessageData* pdata = nullptr, - bool time_sensitive = false); - virtual void PostDelayed(const Location& posted_from, - int cmsDelay, - MessageHandler* phandler, - uint32_t id = 0, - MessageData* pdata = nullptr); - virtual void PostAt(const Location& posted_from, - int64_t tstamp, - MessageHandler* phandler, - uint32_t id = 0, - MessageData* pdata = nullptr); - // TODO(honghaiz): Remove this when all the dependencies are removed. - virtual void PostAt(const Location& posted_from, - uint32_t tstamp, - MessageHandler* phandler, - uint32_t id = 0, - MessageData* pdata = nullptr); - virtual void Clear(MessageHandler* phandler, - uint32_t id = MQID_ANY, - MessageList* removed = nullptr); - virtual void Dispatch(Message *pmsg); - virtual void ReceiveSends(); - - // Amount of time until the next message can be retrieved - virtual int GetDelay(); - - bool empty() const { return size() == 0u; } - size_t size() const { - CritScope cs(&crit_); // msgq_.size() is not thread safe. - return msgq_.size() + dmsgq_.size() + (fPeekKeep_ ? 1u : 0u); - } - - // Internally posts a message which causes the doomed object to be deleted - template void Dispose(T* doomed) { - if (doomed) { - Post(RTC_FROM_HERE, nullptr, MQID_DISPOSE, new DisposeData(doomed)); - } - } - - // When this signal is sent out, any references to this queue should - // no longer be used. - sigslot::signal0<> SignalQueueDestroyed; - - protected: - class PriorityQueue : public std::priority_queue { - public: - container_type& container() { return c; } - void reheap() { make_heap(c.begin(), c.end(), comp); } - }; - - void DoDelayPost(const Location& posted_from, - int64_t cmsDelay, - int64_t tstamp, - MessageHandler* phandler, - uint32_t id, - MessageData* pdata); - - // Perform initialization, subclasses must call this from their constructor - // if false was passed as init_queue to the MessageQueue constructor. - void DoInit(); - - // Perform cleanup, subclasses that override Clear must call this from the - // destructor. - void DoDestroy(); - - void WakeUpSocketServer(); - - bool fPeekKeep_; - Message msgPeek_; - MessageList msgq_ GUARDED_BY(crit_); - PriorityQueue dmsgq_ GUARDED_BY(crit_); - uint32_t dmsgq_next_num_ GUARDED_BY(crit_); - CriticalSection crit_; - bool fInitialized_; - bool fDestroyed_; - - private: - volatile int stop_; - - // The SocketServer might not be owned by MessageQueue. - SocketServer* const ss_; - // Used if SocketServer ownership lies with |this|. - std::unique_ptr own_ss_; - - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MessageQueue); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_MESSAGEQUEUE_H_ diff --git a/webrtc/rtc_base/mod_ops.h b/webrtc/rtc_base/mod_ops.h deleted file mode 100644 index d51f127c7c..0000000000 --- a/webrtc/rtc_base/mod_ops.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_MOD_OPS_H_ -#define WEBRTC_RTC_BASE_MOD_OPS_H_ - -#include -#include - -#include "webrtc/base/checks.h" - -namespace webrtc { - -template // NOLINT -inline unsigned long Add(unsigned long a, unsigned long b) { // NOLINT - RTC_DCHECK_LT(a, M); - unsigned long t = M - b % M; // NOLINT - unsigned long res = a - t; // NOLINT - if (t > a) - return res + M; - return res; -} - -template // NOLINT -inline unsigned long Subtract(unsigned long a, unsigned long b) { // NOLINT - RTC_DCHECK_LT(a, M); - unsigned long sub = b % M; // NOLINT - if (a < sub) - return M - (sub - a); - return a - sub; -} - -// Calculates the forward difference between two wrapping numbers. -// -// Example: -// uint8_t x = 253; -// uint8_t y = 2; -// -// ForwardDiff(x, y) == 5 -// -// 252 253 254 255 0 1 2 3 -// ################################################# -// | | x | | | | | y | | -// ################################################# -// |----->----->----->----->-----> -// -// ForwardDiff(y, x) == 251 -// -// 252 253 254 255 0 1 2 3 -// ################################################# -// | | x | | | | | y | | -// ################################################# -// -->-----> |----->--- -// -template -inline T ForwardDiff(T a, T b) { - static_assert(std::is_unsigned::value, - "Type must be an unsigned integer."); - RTC_DCHECK_LT(a, M); - RTC_DCHECK_LT(b, M); - return a <= b ? b - a : M - (a - b); -} - -template -inline T ForwardDiff(T a, T b) { - static_assert(std::is_unsigned::value, - "Type must be an unsigned integer."); - return b - a; -} - -// Calculates the reverse difference between two wrapping numbers. -// -// Example: -// uint8_t x = 253; -// uint8_t y = 2; -// -// ReverseDiff(y, x) == 5 -// -// 252 253 254 255 0 1 2 3 -// ################################################# -// | | x | | | | | y | | -// ################################################# -// <-----<-----<-----<-----<-----| -// -// ReverseDiff(x, y) == 251 -// -// 252 253 254 255 0 1 2 3 -// ################################################# -// | | x | | | | | y | | -// ################################################# -// ---<-----| |<-----<-- -// -template -inline T ReverseDiff(T a, T b) { - static_assert(std::is_unsigned::value, - "Type must be an unsigned integer."); - RTC_DCHECK_LT(a, M); - RTC_DCHECK_LT(b, M); - return b <= a ? a - b : M - (b - a); -} - -template -inline T ReverseDiff(T a, T b) { - static_assert(std::is_unsigned::value, - "Type must be an unsigned integer."); - return a - b; -} - -// Calculates the minimum distance between to wrapping numbers. -// -// The minimum distance is defined as min(ForwardDiff(a, b), ReverseDiff(a, b)) -template -inline T MinDiff(T a, T b) { - static_assert(std::is_unsigned::value, - "Type must be an unsigned integer."); - return std::min(ForwardDiff(a, b), ReverseDiff(a, b)); -} - -template -inline T MinDiff(T a, T b) { - static_assert(std::is_unsigned::value, - "Type must be an unsigned integer."); - return std::min(ForwardDiff(a, b), ReverseDiff(a, b)); -} - -} // namespace webrtc - -#endif // WEBRTC_RTC_BASE_MOD_OPS_H_ diff --git a/webrtc/rtc_base/natserver.h b/webrtc/rtc_base/natserver.h deleted file mode 100644 index 136cc04818..0000000000 --- a/webrtc/rtc_base/natserver.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_NATSERVER_H_ -#define WEBRTC_RTC_BASE_NATSERVER_H_ - -#include -#include - -#include "webrtc/base/asyncudpsocket.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/socketaddresspair.h" -#include "webrtc/base/thread.h" -#include "webrtc/base/socketfactory.h" -#include "webrtc/base/nattypes.h" -#include "webrtc/base/proxyserver.h" - -namespace rtc { - -// Change how routes (socketaddress pairs) are compared based on the type of -// NAT. The NAT server maintains a hashtable of the routes that it knows -// about. So these affect which routes are treated the same. -struct RouteCmp { - explicit RouteCmp(NAT* nat); - size_t operator()(const SocketAddressPair& r) const; - bool operator()( - const SocketAddressPair& r1, const SocketAddressPair& r2) const; - - bool symmetric; -}; - -// Changes how addresses are compared based on the filtering rules of the NAT. -struct AddrCmp { - explicit AddrCmp(NAT* nat); - size_t operator()(const SocketAddress& r) const; - bool operator()(const SocketAddress& r1, const SocketAddress& r2) const; - - bool use_ip; - bool use_port; -}; - -// Implements the NAT device. It listens for packets on the internal network, -// translates them, and sends them out over the external network. -// -// TCP connections initiated from the internal side of the NAT server are -// also supported, by making a connection to the NAT server's TCP address and -// then sending the remote address in quasi-STUN format. The connection status -// will be indicated back to the client as a 1 byte status code, where '0' -// indicates success. - -const int NAT_SERVER_UDP_PORT = 4237; -const int NAT_SERVER_TCP_PORT = 4238; - -class NATServer : public sigslot::has_slots<> { - public: - NATServer( - NATType type, SocketFactory* internal, - const SocketAddress& internal_udp_addr, - const SocketAddress& internal_tcp_addr, - SocketFactory* external, const SocketAddress& external_ip); - ~NATServer() override; - - SocketAddress internal_udp_address() const { - return udp_server_socket_->GetLocalAddress(); - } - - SocketAddress internal_tcp_address() const { - return tcp_proxy_server_->GetServerAddress(); - } - - // Packets received on one of the networks. - void OnInternalUDPPacket(AsyncPacketSocket* socket, const char* buf, - size_t size, const SocketAddress& addr, - const PacketTime& packet_time); - void OnExternalUDPPacket(AsyncPacketSocket* socket, const char* buf, - size_t size, const SocketAddress& remote_addr, - const PacketTime& packet_time); - - private: - typedef std::set AddressSet; - - /* Records a translation and the associated external socket. */ - struct TransEntry { - TransEntry(const SocketAddressPair& r, AsyncUDPSocket* s, NAT* nat); - ~TransEntry(); - - void WhitelistInsert(const SocketAddress& addr); - bool WhitelistContains(const SocketAddress& ext_addr); - - SocketAddressPair route; - AsyncUDPSocket* socket; - AddressSet* whitelist; - CriticalSection crit_; - }; - - typedef std::map InternalMap; - typedef std::map ExternalMap; - - /* Creates a new entry that translates the given route. */ - void Translate(const SocketAddressPair& route); - - /* Determines whether the NAT would filter out a packet from this address. */ - bool ShouldFilterOut(TransEntry* entry, const SocketAddress& ext_addr); - - NAT* nat_; - SocketFactory* external_; - SocketAddress external_ip_; - AsyncUDPSocket* udp_server_socket_; - ProxyServer* tcp_proxy_server_; - InternalMap* int_map_; - ExternalMap* ext_map_; - RTC_DISALLOW_COPY_AND_ASSIGN(NATServer); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_NATSERVER_H_ diff --git a/webrtc/rtc_base/natsocketfactory.h b/webrtc/rtc_base/natsocketfactory.h deleted file mode 100644 index c2f72a8483..0000000000 --- a/webrtc/rtc_base/natsocketfactory.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_NATSOCKETFACTORY_H_ -#define WEBRTC_RTC_BASE_NATSOCKETFACTORY_H_ - -#include -#include -#include -#include - -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/natserver.h" -#include "webrtc/base/socketaddress.h" -#include "webrtc/base/socketserver.h" - -namespace rtc { - -const size_t kNATEncodedIPv4AddressSize = 8U; -const size_t kNATEncodedIPv6AddressSize = 20U; - -// Used by the NAT socket implementation. -class NATInternalSocketFactory { - public: - virtual ~NATInternalSocketFactory() {} - virtual AsyncSocket* CreateInternalSocket(int family, int type, - const SocketAddress& local_addr, SocketAddress* nat_addr) = 0; -}; - -// Creates sockets that will send all traffic through a NAT, using an existing -// NATServer instance running at nat_addr. The actual data is sent using sockets -// from a socket factory, given to the constructor. -class NATSocketFactory : public SocketFactory, public NATInternalSocketFactory { - public: - NATSocketFactory(SocketFactory* factory, const SocketAddress& nat_udp_addr, - const SocketAddress& nat_tcp_addr); - - // SocketFactory implementation - Socket* CreateSocket(int type) override; - Socket* CreateSocket(int family, int type) override; - AsyncSocket* CreateAsyncSocket(int type) override; - AsyncSocket* CreateAsyncSocket(int family, int type) override; - - // NATInternalSocketFactory implementation - AsyncSocket* CreateInternalSocket(int family, - int type, - const SocketAddress& local_addr, - SocketAddress* nat_addr) override; - - private: - SocketFactory* factory_; - SocketAddress nat_udp_addr_; - SocketAddress nat_tcp_addr_; - RTC_DISALLOW_COPY_AND_ASSIGN(NATSocketFactory); -}; - -// Creates sockets that will send traffic through a NAT depending on what -// address they bind to. This can be used to simulate a client on a NAT sending -// to a client that is not behind a NAT. -// Note that the internal addresses of clients must be unique. This is because -// there is only one socketserver per thread, and the Bind() address is used to -// figure out which NAT (if any) the socket should talk to. -// -// Example with 3 NATs (2 cascaded), and 3 clients. -// ss->AddTranslator("1.2.3.4", "192.168.0.1", NAT_ADDR_RESTRICTED); -// ss->AddTranslator("99.99.99.99", "10.0.0.1", NAT_SYMMETRIC)-> -// AddTranslator("10.0.0.2", "192.168.1.1", NAT_OPEN_CONE); -// ss->GetTranslator("1.2.3.4")->AddClient("1.2.3.4", "192.168.0.2"); -// ss->GetTranslator("99.99.99.99")->AddClient("10.0.0.3"); -// ss->GetTranslator("99.99.99.99")->GetTranslator("10.0.0.2")-> -// AddClient("192.168.1.2"); -class NATSocketServer : public SocketServer, public NATInternalSocketFactory { - public: - class Translator; - // holds a list of NATs - class TranslatorMap : private std::map { - public: - ~TranslatorMap(); - Translator* Get(const SocketAddress& ext_ip); - Translator* Add(const SocketAddress& ext_ip, Translator*); - void Remove(const SocketAddress& ext_ip); - Translator* FindClient(const SocketAddress& int_ip); - }; - - // a specific NAT - class Translator { - public: - Translator(NATSocketServer* server, NATType type, - const SocketAddress& int_addr, SocketFactory* ext_factory, - const SocketAddress& ext_addr); - ~Translator(); - - SocketFactory* internal_factory() { return internal_factory_.get(); } - SocketAddress internal_udp_address() const { - return nat_server_->internal_udp_address(); - } - SocketAddress internal_tcp_address() const { - return SocketAddress(); // nat_server_->internal_tcp_address(); - } - - Translator* GetTranslator(const SocketAddress& ext_ip); - Translator* AddTranslator(const SocketAddress& ext_ip, - const SocketAddress& int_ip, NATType type); - void RemoveTranslator(const SocketAddress& ext_ip); - - bool AddClient(const SocketAddress& int_ip); - void RemoveClient(const SocketAddress& int_ip); - - // Looks for the specified client in this or a child NAT. - Translator* FindClient(const SocketAddress& int_ip); - - private: - NATSocketServer* server_; - std::unique_ptr internal_factory_; - std::unique_ptr nat_server_; - TranslatorMap nats_; - std::set clients_; - }; - - explicit NATSocketServer(SocketServer* ss); - - SocketServer* socketserver() { return server_; } - MessageQueue* queue() { return msg_queue_; } - - Translator* GetTranslator(const SocketAddress& ext_ip); - Translator* AddTranslator(const SocketAddress& ext_ip, - const SocketAddress& int_ip, NATType type); - void RemoveTranslator(const SocketAddress& ext_ip); - - // SocketServer implementation - Socket* CreateSocket(int type) override; - Socket* CreateSocket(int family, int type) override; - - AsyncSocket* CreateAsyncSocket(int type) override; - AsyncSocket* CreateAsyncSocket(int family, int type) override; - - void SetMessageQueue(MessageQueue* queue) override; - bool Wait(int cms, bool process_io) override; - void WakeUp() override; - - // NATInternalSocketFactory implementation - AsyncSocket* CreateInternalSocket(int family, - int type, - const SocketAddress& local_addr, - SocketAddress* nat_addr) override; - - private: - SocketServer* server_; - MessageQueue* msg_queue_; - TranslatorMap nats_; - RTC_DISALLOW_COPY_AND_ASSIGN(NATSocketServer); -}; - -// Free-standing NAT helper functions. -size_t PackAddressForNAT(char* buf, size_t buf_size, - const SocketAddress& remote_addr); -size_t UnpackAddressFromNAT(const char* buf, size_t buf_size, - SocketAddress* remote_addr); -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_NATSOCKETFACTORY_H_ diff --git a/webrtc/rtc_base/nattypes.h b/webrtc/rtc_base/nattypes.h deleted file mode 100644 index cc846c039e..0000000000 --- a/webrtc/rtc_base/nattypes.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_NATTYPES_H_ -#define WEBRTC_RTC_BASE_NATTYPES_H_ - -namespace rtc { - -/* Identifies each type of NAT that can be simulated. */ -enum NATType { - NAT_OPEN_CONE, - NAT_ADDR_RESTRICTED, - NAT_PORT_RESTRICTED, - NAT_SYMMETRIC -}; - -// Implements the rules for each specific type of NAT. -class NAT { -public: - virtual ~NAT() { } - - // Determines whether this NAT uses both source and destination address when - // checking whether a mapping already exists. - virtual bool IsSymmetric() = 0; - - // Determines whether this NAT drops packets received from a different IP - // the one last sent to. - virtual bool FiltersIP() = 0; - - // Determines whether this NAT drops packets received from a different port - // the one last sent to. - virtual bool FiltersPort() = 0; - - // Returns an implementation of the given type of NAT. - static NAT* Create(NATType type); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_NATTYPES_H_ diff --git a/webrtc/rtc_base/nethelpers.h b/webrtc/rtc_base/nethelpers.h deleted file mode 100644 index 2d34f2df1f..0000000000 --- a/webrtc/rtc_base/nethelpers.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2008 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_NETHELPERS_H_ -#define WEBRTC_RTC_BASE_NETHELPERS_H_ - -#if defined(WEBRTC_POSIX) -#include -#include -#elif WEBRTC_WIN -#include // NOLINT -#endif - -#include - -#include "webrtc/base/asyncresolverinterface.h" -#include "webrtc/base/signalthread.h" -#include "webrtc/base/sigslot.h" -#include "webrtc/base/socketaddress.h" - -namespace rtc { - -class AsyncResolverTest; - -// AsyncResolver will perform async DNS resolution, signaling the result on -// the SignalDone from AsyncResolverInterface when the operation completes. -class AsyncResolver : public SignalThread, public AsyncResolverInterface { - public: - AsyncResolver(); - ~AsyncResolver() override; - - void Start(const SocketAddress& addr) override; - bool GetResolvedAddress(int family, SocketAddress* addr) const override; - int GetError() const override; - void Destroy(bool wait) override; - - const std::vector& addresses() const { return addresses_; } - void set_error(int error) { error_ = error; } - - protected: - void DoWork() override; - void OnWorkDone() override; - - private: - SocketAddress addr_; - std::vector addresses_; - int error_; -}; - -// rtc namespaced wrappers for inet_ntop and inet_pton so we can avoid -// the windows-native versions of these. -const char* inet_ntop(int af, const void *src, char* dst, socklen_t size); -int inet_pton(int af, const char* src, void *dst); - -bool HasIPv4Enabled(); -bool HasIPv6Enabled(); -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_NETHELPERS_H_ diff --git a/webrtc/rtc_base/network.h b/webrtc/rtc_base/network.h deleted file mode 100644 index 17574f6001..0000000000 --- a/webrtc/rtc_base/network.h +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_NETWORK_H_ -#define WEBRTC_RTC_BASE_NETWORK_H_ - -#include - -#include -#include -#include -#include -#include - -#include "webrtc/base/ipaddress.h" -#include "webrtc/base/networkmonitor.h" -#include "webrtc/base/messagehandler.h" -#include "webrtc/base/sigslot.h" - -#if defined(WEBRTC_POSIX) -struct ifaddrs; -#endif // defined(WEBRTC_POSIX) - -namespace rtc { - -extern const char kPublicIPv4Host[]; -extern const char kPublicIPv6Host[]; - -class IfAddrsConverter; -class Network; -class NetworkMonitorInterface; -class Thread; - -static const uint16_t kNetworkCostMax = 999; -static const uint16_t kNetworkCostHigh = 900; -static const uint16_t kNetworkCostUnknown = 50; -static const uint16_t kNetworkCostLow = 10; -static const uint16_t kNetworkCostMin = 0; - -// By default, ignore loopback interfaces on the host. -const int kDefaultNetworkIgnoreMask = ADAPTER_TYPE_LOOPBACK; - -// Makes a string key for this network. Used in the network manager's maps. -// Network objects are keyed on interface name, network prefix and the -// length of that prefix. -std::string MakeNetworkKey(const std::string& name, const IPAddress& prefix, - int prefix_length); - -class DefaultLocalAddressProvider { - public: - virtual ~DefaultLocalAddressProvider() = default; - // The default local address is the local address used in multi-homed endpoint - // when the any address (0.0.0.0 or ::) is used as the local address. It's - // important to check the return value as a IP family may not be enabled. - virtual bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const = 0; -}; - -// Generic network manager interface. It provides list of local -// networks. -// -// Every method of NetworkManager (including the destructor) must be called on -// the same thread, except for the constructor which may be called on any -// thread. -// -// This allows constructing a NetworkManager subclass on one thread and -// passing it into an object that uses it on a different thread. -class NetworkManager : public DefaultLocalAddressProvider { - public: - typedef std::vector NetworkList; - - // This enum indicates whether adapter enumeration is allowed. - enum EnumerationPermission { - ENUMERATION_ALLOWED, // Adapter enumeration is allowed. Getting 0 network - // from GetNetworks means that there is no network - // available. - ENUMERATION_BLOCKED, // Adapter enumeration is disabled. - // GetAnyAddressNetworks() should be used instead. - }; - - NetworkManager(); - ~NetworkManager() override; - - // Called when network list is updated. - sigslot::signal0<> SignalNetworksChanged; - - // Indicates a failure when getting list of network interfaces. - sigslot::signal0<> SignalError; - - // This should be called on the NetworkManager's thread before the - // NetworkManager is used. Subclasses may override this if necessary. - virtual void Initialize() {} - - // Start/Stop monitoring of network interfaces - // list. SignalNetworksChanged or SignalError is emitted immediately - // after StartUpdating() is called. After that SignalNetworksChanged - // is emitted whenever list of networks changes. - virtual void StartUpdating() = 0; - virtual void StopUpdating() = 0; - - // Returns the current list of networks available on this machine. - // StartUpdating() must be called before this method is called. - // It makes sure that repeated calls return the same object for a - // given network, so that quality is tracked appropriately. Does not - // include ignored networks. - virtual void GetNetworks(NetworkList* networks) const = 0; - - // return the current permission state of GetNetworks() - virtual EnumerationPermission enumeration_permission() const; - - // "AnyAddressNetwork" is a network which only contains single "any address" - // IP address. (i.e. INADDR_ANY for IPv4 or in6addr_any for IPv6). This is - // useful as binding to such interfaces allow default routing behavior like - // http traffic. - // - // This method appends the "any address" networks to the list, such that this - // can optionally be called after GetNetworks. - // - // TODO(guoweis): remove this body when chromium implements this. - virtual void GetAnyAddressNetworks(NetworkList* networks) {} - - // Dumps the current list of networks in the network manager. - virtual void DumpNetworks() {} - bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const override; - - struct Stats { - int ipv4_network_count; - int ipv6_network_count; - Stats() { - ipv4_network_count = 0; - ipv6_network_count = 0; - } - }; -}; - -// Base class for NetworkManager implementations. -class NetworkManagerBase : public NetworkManager { - public: - NetworkManagerBase(); - ~NetworkManagerBase() override; - - void GetNetworks(NetworkList* networks) const override; - void GetAnyAddressNetworks(NetworkList* networks) override; - // Defaults to true. - bool ipv6_enabled() const { return ipv6_enabled_; } - void set_ipv6_enabled(bool enabled) { ipv6_enabled_ = enabled; } - - void set_max_ipv6_networks(int networks) { max_ipv6_networks_ = networks; } - int max_ipv6_networks() { return max_ipv6_networks_; } - - EnumerationPermission enumeration_permission() const override; - - bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const override; - - protected: - typedef std::map NetworkMap; - // Updates |networks_| with the networks listed in |list|. If - // |network_map_| already has a Network object for a network listed - // in the |list| then it is reused. Accept ownership of the Network - // objects in the |list|. |changed| will be set to true if there is - // any change in the network list. - void MergeNetworkList(const NetworkList& list, bool* changed); - - // |stats| will be populated even if |*changed| is false. - void MergeNetworkList(const NetworkList& list, - bool* changed, - NetworkManager::Stats* stats); - - void set_enumeration_permission(EnumerationPermission state) { - enumeration_permission_ = state; - } - - void set_default_local_addresses(const IPAddress& ipv4, - const IPAddress& ipv6); - - private: - friend class NetworkTest; - - Network* GetNetworkFromAddress(const rtc::IPAddress& ip) const; - - EnumerationPermission enumeration_permission_; - - NetworkList networks_; - int max_ipv6_networks_; - - NetworkMap networks_map_; - bool ipv6_enabled_; - - std::unique_ptr ipv4_any_address_network_; - std::unique_ptr ipv6_any_address_network_; - - IPAddress default_local_ipv4_address_; - IPAddress default_local_ipv6_address_; - // We use 16 bits to save the bandwidth consumption when sending the network - // id over the Internet. It is OK that the 16-bit integer overflows to get a - // network id 0 because we only compare the network ids in the old and the new - // best connections in the transport channel. - uint16_t next_available_network_id_ = 1; -}; - -// Basic implementation of the NetworkManager interface that gets list -// of networks using OS APIs. -class BasicNetworkManager : public NetworkManagerBase, - public MessageHandler, - public sigslot::has_slots<> { - public: - BasicNetworkManager(); - ~BasicNetworkManager() override; - - void StartUpdating() override; - void StopUpdating() override; - - void DumpNetworks() override; - - // MessageHandler interface. - void OnMessage(Message* msg) override; - bool started() { return start_count_ > 0; } - - // Sets the network ignore list, which is empty by default. Any network on the - // ignore list will be filtered from network enumeration results. - void set_network_ignore_list(const std::vector& list) { - network_ignore_list_ = list; - } - -#if defined(WEBRTC_LINUX) - // Sets the flag for ignoring non-default routes. - void set_ignore_non_default_routes(bool value) { - ignore_non_default_routes_ = true; - } -#endif - - protected: -#if defined(WEBRTC_POSIX) - // Separated from CreateNetworks for tests. - void ConvertIfAddrs(ifaddrs* interfaces, - IfAddrsConverter* converter, - bool include_ignored, - NetworkList* networks) const; -#endif // defined(WEBRTC_POSIX) - - // Creates a network object for each network available on the machine. - bool CreateNetworks(bool include_ignored, NetworkList* networks) const; - - // Determines if a network should be ignored. This should only be determined - // based on the network's property instead of any individual IP. - bool IsIgnoredNetwork(const Network& network) const; - - // This function connects a UDP socket to a public address and returns the - // local address associated it. Since it binds to the "any" address - // internally, it returns the default local address on a multi-homed endpoint. - IPAddress QueryDefaultLocalAddress(int family) const; - - private: - friend class NetworkTest; - - // Creates a network monitor and listens for network updates. - void StartNetworkMonitor(); - // Stops and removes the network monitor. - void StopNetworkMonitor(); - // Called when it receives updates from the network monitor. - void OnNetworksChanged(); - - // Updates the networks and reschedules the next update. - void UpdateNetworksContinually(); - // Only updates the networks; does not reschedule the next update. - void UpdateNetworksOnce(); - - AdapterType GetAdapterTypeFromName(const char* network_name) const; - - Thread* thread_; - bool sent_first_update_; - int start_count_; - std::vector network_ignore_list_; - bool ignore_non_default_routes_; - std::unique_ptr network_monitor_; -}; - -// Represents a Unix-type network interface, with a name and single address. -class Network { - public: - Network(const std::string& name, - const std::string& description, - const IPAddress& prefix, - int prefix_length); - - Network(const std::string& name, - const std::string& description, - const IPAddress& prefix, - int prefix_length, - AdapterType type); - ~Network(); - - sigslot::signal1 SignalTypeChanged; - - const DefaultLocalAddressProvider* default_local_address_provider() { - return default_local_address_provider_; - } - void set_default_local_address_provider( - const DefaultLocalAddressProvider* provider) { - default_local_address_provider_ = provider; - } - - // Returns the name of the interface this network is associated wtih. - const std::string& name() const { return name_; } - - // Returns the OS-assigned name for this network. This is useful for - // debugging but should not be sent over the wire (for privacy reasons). - const std::string& description() const { return description_; } - - // Returns the prefix for this network. - const IPAddress& prefix() const { return prefix_; } - // Returns the length, in bits, of this network's prefix. - int prefix_length() const { return prefix_length_; } - - // |key_| has unique value per network interface. Used in sorting network - // interfaces. Key is derived from interface name and it's prefix. - std::string key() const { return key_; } - - // Returns the Network's current idea of the 'best' IP it has. - // Or return an unset IP if this network has no active addresses. - // Here is the rule on how we mark the IPv6 address as ignorable for WebRTC. - // 1) return all global temporary dynamic and non-deprecrated ones. - // 2) if #1 not available, return global ones. - // 3) if #2 not available, use ULA ipv6 as last resort. (ULA stands - // for unique local address, which is not route-able in open - // internet but might be useful for a close WebRTC deployment. - - // TODO(guoweis): rule #3 actually won't happen at current - // implementation. The reason being that ULA address starting with - // 0xfc 0r 0xfd will be grouped into its own Network. The result of - // that is WebRTC will have one extra Network to generate candidates - // but the lack of rule #3 shouldn't prevent turning on IPv6 since - // ULA should only be tried in a close deployment anyway. - - // Note that when not specifying any flag, it's treated as case global - // IPv6 address - IPAddress GetBestIP() const; - - // Keep the original function here for now. - // TODO(guoweis): Remove this when all callers are migrated to GetBestIP(). - IPAddress ip() const { return GetBestIP(); } - - // Adds an active IP address to this network. Does not check for duplicates. - void AddIP(const InterfaceAddress& ip) { ips_.push_back(ip); } - - // Sets the network's IP address list. Returns true if new IP addresses were - // detected. Passing true to already_changed skips this check. - bool SetIPs(const std::vector& ips, bool already_changed); - // Get the list of IP Addresses associated with this network. - const std::vector& GetIPs() const { return ips_;} - // Clear the network's list of addresses. - void ClearIPs() { ips_.clear(); } - - // Returns the scope-id of the network's address. - // Should only be relevant for link-local IPv6 addresses. - int scope_id() const { return scope_id_; } - void set_scope_id(int id) { scope_id_ = id; } - - // Indicates whether this network should be ignored, perhaps because - // the IP is 0, or the interface is one we know is invalid. - bool ignored() const { return ignored_; } - void set_ignored(bool ignored) { ignored_ = ignored; } - - AdapterType type() const { return type_; } - void set_type(AdapterType type) { - if (type_ == type) { - return; - } - type_ = type; - SignalTypeChanged(this); - } - - uint16_t GetCost() const { - switch (type_) { - case rtc::ADAPTER_TYPE_ETHERNET: - case rtc::ADAPTER_TYPE_LOOPBACK: - return kNetworkCostMin; - case rtc::ADAPTER_TYPE_WIFI: - case rtc::ADAPTER_TYPE_VPN: - return kNetworkCostLow; - case rtc::ADAPTER_TYPE_CELLULAR: - return kNetworkCostHigh; - default: - return kNetworkCostUnknown; - } - } - // A unique id assigned by the network manager, which may be signaled - // to the remote side in the candidate. - uint16_t id() const { return id_; } - void set_id(uint16_t id) { id_ = id; } - - int preference() const { return preference_; } - void set_preference(int preference) { preference_ = preference; } - - // When we enumerate networks and find a previously-seen network is missing, - // we do not remove it (because it may be used elsewhere). Instead, we mark - // it inactive, so that we can detect network changes properly. - bool active() const { return active_; } - void set_active(bool active) { - if (active_ != active) { - active_ = active; - } - } - - // Debugging description of this network - std::string ToString() const; - - private: - const DefaultLocalAddressProvider* default_local_address_provider_ = nullptr; - std::string name_; - std::string description_; - IPAddress prefix_; - int prefix_length_; - std::string key_; - std::vector ips_; - int scope_id_; - bool ignored_; - AdapterType type_; - int preference_; - bool active_ = true; - uint16_t id_ = 0; - - friend class NetworkManager; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_NETWORK_H_ diff --git a/webrtc/rtc_base/networkmonitor.h b/webrtc/rtc_base/networkmonitor.h deleted file mode 100644 index db976bfaa6..0000000000 --- a/webrtc/rtc_base/networkmonitor.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_NETWORKMONITOR_H_ -#define WEBRTC_RTC_BASE_NETWORKMONITOR_H_ - -#include "webrtc/base/logging.h" -#include "webrtc/base/sigslot.h" -#include "webrtc/base/thread.h" - -namespace rtc { - -class IPAddress; - -enum class NetworkBindingResult { - SUCCESS = 0, // No error - FAILURE = -1, // Generic error - NOT_IMPLEMENTED = -2, - ADDRESS_NOT_FOUND = -3, - NETWORK_CHANGED = -4 -}; - -enum AdapterType { - // This enum resembles the one in Chromium net::ConnectionType. - ADAPTER_TYPE_UNKNOWN = 0, - ADAPTER_TYPE_ETHERNET = 1 << 0, - ADAPTER_TYPE_WIFI = 1 << 1, - ADAPTER_TYPE_CELLULAR = 1 << 2, - ADAPTER_TYPE_VPN = 1 << 3, - ADAPTER_TYPE_LOOPBACK = 1 << 4 -}; - -class NetworkBinderInterface { - public: - // Binds a socket to the network that is attached to |address| so that all - // packets on the socket |socket_fd| will be sent via that network. - // This is needed because some operating systems (like Android) require a - // special bind call to put packets on a non-default network interface. - virtual NetworkBindingResult BindSocketToNetwork( - int socket_fd, - const IPAddress& address) = 0; - virtual ~NetworkBinderInterface() {} -}; - -/* - * Receives network-change events via |OnNetworksChanged| and signals the - * networks changed event. - * - * Threading consideration: - * It is expected that all upstream operations (from native to Java) are - * performed from the worker thread. This includes creating, starting and - * stopping the monitor. This avoids the potential race condition when creating - * the singleton Java NetworkMonitor class. Downstream operations can be from - * any thread, but this class will forward all the downstream operations onto - * the worker thread. - * - * Memory consideration: - * NetworkMonitor is owned by the caller (NetworkManager). The global network - * monitor factory is owned by the factory itself but needs to be released from - * the factory creator. - */ -// Generic network monitor interface. It starts and stops monitoring network -// changes, and fires the SignalNetworksChanged event when networks change. -class NetworkMonitorInterface { - public: - NetworkMonitorInterface(); - virtual ~NetworkMonitorInterface(); - - sigslot::signal0<> SignalNetworksChanged; - - virtual void Start() = 0; - virtual void Stop() = 0; - - // Implementations should call this method on the base when networks change, - // and the base will fire SignalNetworksChanged on the right thread. - virtual void OnNetworksChanged() = 0; - - virtual AdapterType GetAdapterType(const std::string& interface_name) = 0; -}; - -class NetworkMonitorBase : public NetworkMonitorInterface, - public MessageHandler, - public sigslot::has_slots<> { - public: - NetworkMonitorBase(); - ~NetworkMonitorBase() override; - - void OnNetworksChanged() override; - - void OnMessage(Message* msg) override; - - protected: - Thread* worker_thread() { return worker_thread_; } - - private: - Thread* worker_thread_; -}; - -/* - * NetworkMonitorFactory creates NetworkMonitors. - */ -class NetworkMonitorFactory { - public: - // This is not thread-safe; it should be called once (or once per audio/video - // call) during the call initialization. - static void SetFactory(NetworkMonitorFactory* factory); - - static void ReleaseFactory(NetworkMonitorFactory* factory); - static NetworkMonitorFactory* GetFactory(); - - virtual NetworkMonitorInterface* CreateNetworkMonitor() = 0; - - virtual ~NetworkMonitorFactory(); - - protected: - NetworkMonitorFactory(); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_NETWORKMONITOR_H_ diff --git a/webrtc/rtc_base/networkroute.h b/webrtc/rtc_base/networkroute.h deleted file mode 100644 index c43f5fc28c..0000000000 --- a/webrtc/rtc_base/networkroute.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_NETWORKROUTE_H_ -#define WEBRTC_RTC_BASE_NETWORKROUTE_H_ - -// TODO(honghaiz): Make a directory that describes the interfaces and structs -// the media code can rely on and the network code can implement, and both can -// depend on that, but not depend on each other. Then, move this file to that -// directory. -namespace rtc { - -struct NetworkRoute { - bool connected; - uint16_t local_network_id; - uint16_t remote_network_id; - int last_sent_packet_id; // Last packet id sent on the PREVIOUS route. - - NetworkRoute() - : connected(false), - local_network_id(0), - remote_network_id(0), - last_sent_packet_id(-1) {} - - // The route is connected if the local and remote network ids are provided. - NetworkRoute(bool connected, - uint16_t local_net_id, - uint16_t remote_net_id, - int last_packet_id) - : connected(connected), - local_network_id(local_net_id), - remote_network_id(remote_net_id), - last_sent_packet_id(last_packet_id) {} - - // |last_sent_packet_id| does not affect the NetworkRoute comparison. - bool operator==(const NetworkRoute& nr) const { - return connected == nr.connected && - local_network_id == nr.local_network_id && - remote_network_id == nr.remote_network_id; - } - - bool operator!=(const NetworkRoute& nr) const { return !(*this == nr); } -}; -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_NETWORKROUTE_H_ diff --git a/webrtc/rtc_base/nullsocketserver.h b/webrtc/rtc_base/nullsocketserver.h deleted file mode 100644 index f506e4c345..0000000000 --- a/webrtc/rtc_base/nullsocketserver.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2012 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_NULLSOCKETSERVER_H_ -#define WEBRTC_RTC_BASE_NULLSOCKETSERVER_H_ - -#include "webrtc/base/event.h" -#include "webrtc/base/socketserver.h" - -namespace rtc { - -class NullSocketServer : public SocketServer { - public: - NullSocketServer(); - ~NullSocketServer() override; - - bool Wait(int cms, bool process_io) override; - void WakeUp() override; - - Socket* CreateSocket(int type) override; - Socket* CreateSocket(int family, int type) override; - AsyncSocket* CreateAsyncSocket(int type) override; - AsyncSocket* CreateAsyncSocket(int family, int type) override; - - private: - Event event_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_NULLSOCKETSERVER_H_ diff --git a/webrtc/rtc_base/numerics/exp_filter.h b/webrtc/rtc_base/numerics/exp_filter.h deleted file mode 100644 index 24b81518d1..0000000000 --- a/webrtc/rtc_base/numerics/exp_filter.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_NUMERICS_EXP_FILTER_H_ -#define WEBRTC_RTC_BASE_NUMERICS_EXP_FILTER_H_ - -namespace rtc { - -// This class can be used, for example, for smoothing the result of bandwidth -// estimation and packet loss estimation. - -class ExpFilter { - public: - static const float kValueUndefined; - - explicit ExpFilter(float alpha, float max = kValueUndefined) : max_(max) { - Reset(alpha); - } - - // Resets the filter to its initial state, and resets filter factor base to - // the given value |alpha|. - void Reset(float alpha); - - // Applies the filter with a given exponent on the provided sample: - // y(k) = min(alpha_^ exp * y(k-1) + (1 - alpha_^ exp) * sample, max_). - float Apply(float exp, float sample); - - // Returns current filtered value. - float filtered() const { return filtered_; } - - // Changes the filter factor base to the given value |alpha|. - void UpdateBase(float alpha); - - private: - float alpha_; // Filter factor base. - float filtered_; // Current filter output. - const float max_; -}; -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_NUMERICS_EXP_FILTER_H_ diff --git a/webrtc/rtc_base/numerics/percentile_filter.h b/webrtc/rtc_base/numerics/percentile_filter.h deleted file mode 100644 index 66391f0501..0000000000 --- a/webrtc/rtc_base/numerics/percentile_filter.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_NUMERICS_PERCENTILE_FILTER_H_ -#define WEBRTC_RTC_BASE_NUMERICS_PERCENTILE_FILTER_H_ - -#include - -#include -#include - -#include "webrtc/base/checks.h" - -namespace webrtc { - -// Class to efficiently get the percentile value from a group of observations. -// The percentile is the value below which a given percentage of the -// observations fall. -template -class PercentileFilter { - public: - // Construct filter. |percentile| should be between 0 and 1. - explicit PercentileFilter(float percentile); - - // Insert one observation. The complexity of this operation is logarithmic in - // the size of the container. - void Insert(const T& value); - - // Remove one observation or return false if |value| doesn't exist in the - // container. The complexity of this operation is logarithmic in the size of - // the container. - bool Erase(const T& value); - - // Get the percentile value. The complexity of this operation is constant. - T GetPercentileValue() const; - - private: - // Update iterator and index to point at target percentile value. - void UpdatePercentileIterator(); - - const float percentile_; - std::multiset set_; - // Maintain iterator and index of current target percentile value. - typename std::multiset::iterator percentile_it_; - int64_t percentile_index_; -}; - -template -PercentileFilter::PercentileFilter(float percentile) - : percentile_(percentile), - percentile_it_(set_.begin()), - percentile_index_(0) { - RTC_CHECK_GE(percentile, 0.0f); - RTC_CHECK_LE(percentile, 1.0f); -} - -template -void PercentileFilter::Insert(const T& value) { - // Insert element at the upper bound. - set_.insert(value); - if (set_.size() == 1u) { - // First element inserted - initialize percentile iterator and index. - percentile_it_ = set_.begin(); - percentile_index_ = 0; - } else if (value < *percentile_it_) { - // If new element is before us, increment |percentile_index_|. - ++percentile_index_; - } - UpdatePercentileIterator(); -} - -template -bool PercentileFilter::Erase(const T& value) { - typename std::multiset::const_iterator it = set_.lower_bound(value); - // Ignore erase operation if the element is not present in the current set. - if (it == set_.end() || *it != value) - return false; - if (it == percentile_it_) { - // If same iterator, update to the following element. Index is not - // affected. - percentile_it_ = set_.erase(it); - } else { - set_.erase(it); - // If erased element was before us, decrement |percentile_index_|. - if (value <= *percentile_it_) - --percentile_index_; - } - UpdatePercentileIterator(); - return true; -} - -template -void PercentileFilter::UpdatePercentileIterator() { - if (set_.empty()) - return; - const int64_t index = static_cast(percentile_ * (set_.size() - 1)); - std::advance(percentile_it_, index - percentile_index_); - percentile_index_ = index; -} - -template -T PercentileFilter::GetPercentileValue() const { - return set_.empty() ? 0 : *percentile_it_; -} - -} // namespace webrtc - -#endif // WEBRTC_RTC_BASE_NUMERICS_PERCENTILE_FILTER_H_ diff --git a/webrtc/rtc_base/onetimeevent.h b/webrtc/rtc_base/onetimeevent.h deleted file mode 100644 index f22a6dc282..0000000000 --- a/webrtc/rtc_base/onetimeevent.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ONETIMEEVENT_H_ -#define WEBRTC_RTC_BASE_ONETIMEEVENT_H_ - -#include "webrtc/base/criticalsection.h" -#include "webrtc/typedefs.h" - -namespace webrtc { -// Provides a simple way to perform an operation (such as logging) one -// time in a certain scope. -// Example: -// OneTimeEvent firstFrame; -// ... -// if (firstFrame()) { -// LOG(LS_INFO) << "This is the first frame". -// } -class OneTimeEvent { - public: - OneTimeEvent() {} - bool operator()() { - rtc::CritScope cs(&critsect_); - if (happened_) { - return false; - } - happened_ = true; - return true; - } - - private: - bool happened_ = false; - rtc::CriticalSection critsect_; -}; - -// A non-thread-safe, ligher-weight version of the OneTimeEvent class. -class ThreadUnsafeOneTimeEvent { - public: - ThreadUnsafeOneTimeEvent() {} - bool operator()() { - if (happened_) { - return false; - } - happened_ = true; - return true; - } - - private: - bool happened_ = false; -}; - -} // namespace webrtc - -#endif // WEBRTC_RTC_BASE_ONETIMEEVENT_H_ diff --git a/webrtc/rtc_base/openssl.h b/webrtc/rtc_base/openssl.h deleted file mode 100644 index 4c89c94ec6..0000000000 --- a/webrtc/rtc_base/openssl.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2013 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_OPENSSL_H_ -#define WEBRTC_RTC_BASE_OPENSSL_H_ - -#include - -#if (OPENSSL_VERSION_NUMBER < 0x10000000L) -#error OpenSSL is older than 1.0.0, which is the minimum supported version. -#endif - -#endif // WEBRTC_RTC_BASE_OPENSSL_H_ diff --git a/webrtc/rtc_base/openssladapter.h b/webrtc/rtc_base/openssladapter.h deleted file mode 100644 index 7080b8b1fe..0000000000 --- a/webrtc/rtc_base/openssladapter.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_OPENSSLADAPTER_H_ -#define WEBRTC_RTC_BASE_OPENSSLADAPTER_H_ - -#include -#include "webrtc/base/buffer.h" -#include "webrtc/base/messagehandler.h" -#include "webrtc/base/messagequeue.h" -#include "webrtc/base/ssladapter.h" - -typedef struct ssl_st SSL; -typedef struct ssl_ctx_st SSL_CTX; -typedef struct x509_store_ctx_st X509_STORE_CTX; - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// - -class OpenSSLAdapter : public SSLAdapter, public MessageHandler { -public: - static bool InitializeSSL(VerificationCallback callback); - static bool InitializeSSLThread(); - static bool CleanupSSL(); - - OpenSSLAdapter(AsyncSocket* socket); - ~OpenSSLAdapter() override; - - void SetMode(SSLMode mode) override; - int StartSSL(const char* hostname, bool restartable) override; - int Send(const void* pv, size_t cb) override; - int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; - int Recv(void* pv, size_t cb, int64_t* timestamp) override; - int RecvFrom(void* pv, - size_t cb, - SocketAddress* paddr, - int64_t* timestamp) override; - int Close() override; - - // Note that the socket returns ST_CONNECTING while SSL is being negotiated. - ConnState GetState() const override; - -protected: - void OnConnectEvent(AsyncSocket* socket) override; - void OnReadEvent(AsyncSocket* socket) override; - void OnWriteEvent(AsyncSocket* socket) override; - void OnCloseEvent(AsyncSocket* socket, int err) override; - -private: - enum SSLState { - SSL_NONE, SSL_WAIT, SSL_CONNECTING, SSL_CONNECTED, SSL_ERROR - }; - - enum { MSG_TIMEOUT }; - - int BeginSSL(); - int ContinueSSL(); - void Error(const char* context, int err, bool signal = true); - void Cleanup(); - - // Return value and arguments have the same meanings as for Send; |error| is - // an output parameter filled with the result of SSL_get_error. - int DoSslWrite(const void* pv, size_t cb, int* error); - - void OnMessage(Message* msg) override; - - static bool VerifyServerName(SSL* ssl, const char* host, - bool ignore_bad_cert); - bool SSLPostConnectionCheck(SSL* ssl, const char* host); -#if !defined(NDEBUG) - static void SSLInfoCallback(const SSL* s, int where, int ret); -#endif - static int SSLVerifyCallback(int ok, X509_STORE_CTX* store); - static VerificationCallback custom_verify_callback_; - friend class OpenSSLStreamAdapter; // for custom_verify_callback_; - - static bool ConfigureTrustedRootCertificates(SSL_CTX* ctx); - SSL_CTX* SetupSSLContext(); - - SSLState state_; - bool ssl_read_needs_write_; - bool ssl_write_needs_read_; - // If true, socket will retain SSL configuration after Close. - bool restartable_; - - // This buffer is used if SSL_write fails with SSL_ERROR_WANT_WRITE, which - // means we need to keep retrying with *the same exact data* until it - // succeeds. Afterwards it will be cleared. - Buffer pending_data_; - - SSL* ssl_; - SSL_CTX* ssl_ctx_; - std::string ssl_host_name_; - // Do DTLS or not - SSLMode ssl_mode_; - - bool custom_verification_succeeded_; -}; - -///////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - - -#endif // WEBRTC_RTC_BASE_OPENSSLADAPTER_H_ diff --git a/webrtc/rtc_base/openssldigest.h b/webrtc/rtc_base/openssldigest.h deleted file mode 100644 index 05aded42f1..0000000000 --- a/webrtc/rtc_base/openssldigest.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_OPENSSLDIGEST_H_ -#define WEBRTC_RTC_BASE_OPENSSLDIGEST_H_ - -#include - -#include "webrtc/base/messagedigest.h" - -namespace rtc { - -// An implementation of the digest class that uses OpenSSL. -class OpenSSLDigest : public MessageDigest { - public: - // Creates an OpenSSLDigest with |algorithm| as the hash algorithm. - explicit OpenSSLDigest(const std::string& algorithm); - ~OpenSSLDigest() override; - // Returns the digest output size (e.g. 16 bytes for MD5). - size_t Size() const override; - // Updates the digest with |len| bytes from |buf|. - void Update(const void* buf, size_t len) override; - // Outputs the digest value to |buf| with length |len|. - size_t Finish(void* buf, size_t len) override; - - // Helper function to look up a digest's EVP by name. - static bool GetDigestEVP(const std::string &algorithm, - const EVP_MD** md); - // Helper function to look up a digest's name by EVP. - static bool GetDigestName(const EVP_MD* md, - std::string* algorithm); - // Helper function to get the length of a digest. - static bool GetDigestSize(const std::string &algorithm, - size_t* len); - - private: - EVP_MD_CTX ctx_; - const EVP_MD* md_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_OPENSSLDIGEST_H_ diff --git a/webrtc/rtc_base/opensslidentity.h b/webrtc/rtc_base/opensslidentity.h deleted file mode 100644 index 3d6c8106c2..0000000000 --- a/webrtc/rtc_base/opensslidentity.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_OPENSSLIDENTITY_H_ -#define WEBRTC_RTC_BASE_OPENSSLIDENTITY_H_ - -#include -#include - -#include -#include - -#include "webrtc/base/checks.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/sslidentity.h" - -typedef struct ssl_ctx_st SSL_CTX; - -namespace rtc { - -// OpenSSLKeyPair encapsulates an OpenSSL EVP_PKEY* keypair object, -// which is reference counted inside the OpenSSL library. -class OpenSSLKeyPair { - public: - explicit OpenSSLKeyPair(EVP_PKEY* pkey) : pkey_(pkey) { - RTC_DCHECK(pkey_ != nullptr); - } - - static OpenSSLKeyPair* Generate(const KeyParams& key_params); - // Constructs a key pair from the private key PEM string. This must not result - // in missing public key parameters. Returns null on error. - static OpenSSLKeyPair* FromPrivateKeyPEMString( - const std::string& pem_string); - - virtual ~OpenSSLKeyPair(); - - virtual OpenSSLKeyPair* GetReference(); - - EVP_PKEY* pkey() const { return pkey_; } - std::string PrivateKeyToPEMString() const; - std::string PublicKeyToPEMString() const; - bool operator==(const OpenSSLKeyPair& other) const; - bool operator!=(const OpenSSLKeyPair& other) const; - - private: - void AddReference(); - - EVP_PKEY* pkey_; - - RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLKeyPair); -}; - -// OpenSSLCertificate encapsulates an OpenSSL X509* certificate object, -// which is also reference counted inside the OpenSSL library. -class OpenSSLCertificate : public SSLCertificate { - public: - // Caller retains ownership of the X509 object. - explicit OpenSSLCertificate(X509* x509) : x509_(x509) { - AddReference(); - } - - static OpenSSLCertificate* Generate(OpenSSLKeyPair* key_pair, - const SSLIdentityParams& params); - static OpenSSLCertificate* FromPEMString(const std::string& pem_string); - - ~OpenSSLCertificate() override; - - OpenSSLCertificate* GetReference() const override; - - X509* x509() const { return x509_; } - - std::string ToPEMString() const override; - void ToDER(Buffer* der_buffer) const override; - bool operator==(const OpenSSLCertificate& other) const; - bool operator!=(const OpenSSLCertificate& other) const; - - // Compute the digest of the certificate given algorithm - bool ComputeDigest(const std::string& algorithm, - unsigned char* digest, - size_t size, - size_t* length) const override; - - // Compute the digest of a certificate as an X509 * - static bool ComputeDigest(const X509* x509, - const std::string& algorithm, - unsigned char* digest, - size_t size, - size_t* length); - - bool GetSignatureDigestAlgorithm(std::string* algorithm) const override; - std::unique_ptr GetChain() const override; - - int64_t CertificateExpirationTime() const override; - - private: - void AddReference() const; - - X509* x509_; - - RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLCertificate); -}; - -// Holds a keypair and certificate together, and a method to generate -// them consistently. -class OpenSSLIdentity : public SSLIdentity { - public: - static OpenSSLIdentity* GenerateWithExpiration(const std::string& common_name, - const KeyParams& key_params, - time_t certificate_lifetime); - static OpenSSLIdentity* GenerateForTest(const SSLIdentityParams& params); - static SSLIdentity* FromPEMStrings(const std::string& private_key, - const std::string& certificate); - ~OpenSSLIdentity() override; - - const OpenSSLCertificate& certificate() const override; - OpenSSLIdentity* GetReference() const override; - - // Configure an SSL context object to use our key and certificate. - bool ConfigureIdentity(SSL_CTX* ctx); - - std::string PrivateKeyToPEMString() const override; - std::string PublicKeyToPEMString() const override; - bool operator==(const OpenSSLIdentity& other) const; - bool operator!=(const OpenSSLIdentity& other) const; - - private: - OpenSSLIdentity(OpenSSLKeyPair* key_pair, OpenSSLCertificate* certificate); - - static OpenSSLIdentity* GenerateInternal(const SSLIdentityParams& params); - - std::unique_ptr key_pair_; - std::unique_ptr certificate_; - - RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLIdentity); -}; - - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_OPENSSLIDENTITY_H_ diff --git a/webrtc/rtc_base/opensslstreamadapter.h b/webrtc/rtc_base/opensslstreamadapter.h deleted file mode 100644 index 67c8046358..0000000000 --- a/webrtc/rtc_base/opensslstreamadapter.h +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_OPENSSLSTREAMADAPTER_H_ -#define WEBRTC_RTC_BASE_OPENSSLSTREAMADAPTER_H_ - -#include -#include -#include - -#include "webrtc/base/buffer.h" -#include "webrtc/base/sslstreamadapter.h" -#include "webrtc/base/opensslidentity.h" - -typedef struct ssl_st SSL; -typedef struct ssl_ctx_st SSL_CTX; -typedef struct ssl_cipher_st SSL_CIPHER; -typedef struct x509_store_ctx_st X509_STORE_CTX; - -namespace rtc { - -// This class was written with OpenSSLAdapter (a socket adapter) as a -// starting point. It has similar structure and functionality, but uses a -// "peer-to-peer" mode, verifying the peer's certificate using a digest -// sent over a secure signaling channel. -// -// Static methods to initialize and deinit the SSL library are in -// OpenSSLAdapter. These should probably be moved out to a neutral class. -// -// In a few cases I have factored out some OpenSSLAdapter code into static -// methods so it can be reused from this class. Eventually that code should -// probably be moved to a common support class. Unfortunately there remain a -// few duplicated sections of code. I have not done more restructuring because -// I did not want to affect existing code that uses OpenSSLAdapter. -// -// This class does not support the SSL connection restart feature present in -// OpenSSLAdapter. I am not entirely sure how the feature is useful and I am -// not convinced that it works properly. -// -// This implementation is careful to disallow data exchange after an SSL error, -// and it has an explicit SSL_CLOSED state. It should not be possible to send -// any data in clear after one of the StartSSL methods has been called. - -// Look in sslstreamadapter.h for documentation of the methods. - -class OpenSSLIdentity; - -/////////////////////////////////////////////////////////////////////////////// - -class OpenSSLStreamAdapter : public SSLStreamAdapter { - public: - explicit OpenSSLStreamAdapter(StreamInterface* stream); - ~OpenSSLStreamAdapter() override; - - void SetIdentity(SSLIdentity* identity) override; - - // Default argument is for compatibility - void SetServerRole(SSLRole role = SSL_SERVER) override; - bool SetPeerCertificateDigest( - const std::string& digest_alg, - const unsigned char* digest_val, - size_t digest_len, - SSLPeerCertificateDigestError* error = nullptr) override; - - std::unique_ptr GetPeerCertificate() const override; - - // Goes from state SSL_NONE to either SSL_CONNECTING or SSL_WAIT, depending - // on whether the underlying stream is already open or not. - int StartSSL() override; - void SetMode(SSLMode mode) override; - void SetMaxProtocolVersion(SSLProtocolVersion version) override; - void SetInitialRetransmissionTimeout(int timeout_ms) override; - - StreamResult Read(void* data, - size_t data_len, - size_t* read, - int* error) override; - StreamResult Write(const void* data, - size_t data_len, - size_t* written, - int* error) override; - void Close() override; - StreamState GetState() const override; - - // TODO(guoweis): Move this away from a static class method. - static std::string SslCipherSuiteToName(int crypto_suite); - - bool GetSslCipherSuite(int* cipher) override; - - int GetSslVersion() const override; - - // Key Extractor interface - bool ExportKeyingMaterial(const std::string& label, - const uint8_t* context, - size_t context_len, - bool use_context, - uint8_t* result, - size_t result_len) override; - - // DTLS-SRTP interface - bool SetDtlsSrtpCryptoSuites(const std::vector& crypto_suites) override; - bool GetDtlsSrtpCryptoSuite(int* crypto_suite) override; - - bool IsTlsConnected() override; - - // Capabilities interfaces. - static bool IsBoringSsl(); - - static bool IsAcceptableCipher(int cipher, KeyType key_type); - static bool IsAcceptableCipher(const std::string& cipher, KeyType key_type); - - // Use our timeutils.h source of timing in BoringSSL, allowing us to test - // using a fake clock. - static void enable_time_callback_for_testing(); - - protected: - void OnEvent(StreamInterface* stream, int events, int err) override; - - private: - enum SSLState { - // Before calling one of the StartSSL methods, data flows - // in clear text. - SSL_NONE, - SSL_WAIT, // waiting for the stream to open to start SSL negotiation - SSL_CONNECTING, // SSL negotiation in progress - SSL_CONNECTED, // SSL stream successfully established - SSL_ERROR, // some SSL error occurred, stream is closed - SSL_CLOSED // Clean close - }; - - enum { MSG_TIMEOUT = MSG_MAX+1}; - - // The following three methods return 0 on success and a negative - // error code on failure. The error code may be from OpenSSL or -1 - // on some other error cases, so it can't really be interpreted - // unfortunately. - - // Prepare SSL library, state is SSL_CONNECTING. - int BeginSSL(); - // Perform SSL negotiation steps. - int ContinueSSL(); - - // Error handler helper. signal is given as true for errors in - // asynchronous contexts (when an error method was not returned - // through some other method), and in that case an SE_CLOSE event is - // raised on the stream with the specified error. - // A 0 error means a graceful close, otherwise there is not really enough - // context to interpret the error code. - // |alert| indicates an alert description (one of the SSL_AD constants) to - // send to the remote endpoint when closing the association. If 0, a normal - // shutdown will be performed. - void Error(const char* context, int err, uint8_t alert, bool signal); - void Cleanup(uint8_t alert); - - // Override MessageHandler - void OnMessage(Message* msg) override; - - // Flush the input buffers by reading left bytes (for DTLS) - void FlushInput(unsigned int left); - - // SSL library configuration - SSL_CTX* SetupSSLContext(); - // Verify the peer certificate matches the signaled digest. - bool VerifyPeerCertificate(); - // SSL certification verification error handler, called back from - // the openssl library. Returns an int interpreted as a boolean in - // the C style: zero means verification failure, non-zero means - // passed. - static int SSLVerifyCallback(int ok, X509_STORE_CTX* store); - - bool waiting_to_verify_peer_certificate() const { - return client_auth_enabled() && !peer_certificate_verified_; - } - - bool has_peer_certificate_digest() const { - return !peer_certificate_digest_algorithm_.empty() && - !peer_certificate_digest_value_.empty(); - } - - SSLState state_; - SSLRole role_; - int ssl_error_code_; // valid when state_ == SSL_ERROR or SSL_CLOSED - // Whether the SSL negotiation is blocked on needing to read or - // write to the wrapped stream. - bool ssl_read_needs_write_; - bool ssl_write_needs_read_; - - SSL* ssl_; - SSL_CTX* ssl_ctx_; - - // Our key and certificate. - std::unique_ptr identity_; - // The certificate that the peer presented. Initially null, until the - // connection is established. - std::unique_ptr peer_certificate_; - bool peer_certificate_verified_ = false; - // The digest of the certificate that the peer must present. - Buffer peer_certificate_digest_value_; - std::string peer_certificate_digest_algorithm_; - - // The DtlsSrtp ciphers - std::string srtp_ciphers_; - - // Do DTLS or not - SSLMode ssl_mode_; - - // Max. allowed protocol version - SSLProtocolVersion ssl_max_version_; - - // A 50-ms initial timeout ensures rapid setup on fast connections, but may - // be too aggressive for low bandwidth links. - int dtls_handshake_timeout_ms_ = 50; -}; - -///////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_OPENSSLSTREAMADAPTER_H_ diff --git a/webrtc/rtc_base/optional.h b/webrtc/rtc_base/optional.h deleted file mode 100644 index ab3abf9f88..0000000000 --- a/webrtc/rtc_base/optional.h +++ /dev/null @@ -1,409 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_OPTIONAL_H_ -#define WEBRTC_RTC_BASE_OPTIONAL_H_ - -#include -#include -#include - -#ifdef UNIT_TEST -#include -#include -#endif // UNIT_TEST - -#include "webrtc/base/array_view.h" -#include "webrtc/base/checks.h" -#include "webrtc/base/sanitizer.h" - -namespace rtc { - -namespace optional_internal { - -#if RTC_HAS_ASAN - -// This is a non-inlined function. The optimizer can't see inside it. It -// prevents the compiler from generating optimized code that reads value_ even -// if it is unset. Although safe, this causes memory sanitizers to complain. -void* FunctionThatDoesNothingImpl(void*); - -template -inline T* FunctionThatDoesNothing(T* x) { - return reinterpret_cast( - FunctionThatDoesNothingImpl(reinterpret_cast(x))); -} - -#else - -template -inline T* FunctionThatDoesNothing(T* x) { return x; } - -#endif - -} // namespace optional_internal - -// Simple std::optional-wannabe. It either contains a T or not. -// -// A moved-from Optional may only be destroyed, and assigned to if T allows -// being assigned to after having been moved from. Specifically, you may not -// assume that it just doesn't contain a value anymore. -// -// Examples of good places to use Optional: -// -// - As a class or struct member, when the member doesn't always have a value: -// struct Prisoner { -// std::string name; -// Optional cell_number; // Empty if not currently incarcerated. -// }; -// -// - As a return value for functions that may fail to return a value on all -// allowed inputs. For example, a function that searches an array might -// return an Optional (the index where it found the element, or -// nothing if it didn't find it); and a function that parses numbers might -// return Optional (the parsed number, or nothing if parsing failed). -// -// Examples of bad places to use Optional: -// -// - As a return value for functions that may fail because of disallowed -// inputs. For example, a string length function should not return -// Optional so that it can return nothing in case the caller passed -// it a null pointer; the function should probably use RTC_[D]CHECK instead, -// and return plain size_t. -// -// - As a return value for functions that may fail to return a value on all -// allowed inputs, but need to tell the caller what went wrong. Returning -// Optional when parsing a single number as in the example above -// might make sense, but any larger parse job is probably going to need to -// tell the caller what the problem was, not just that there was one. -// -// - As a non-mutable function argument. When you want to pass a value of a -// type T that can fail to be there, const T* is almost always both fastest -// and cleanest. (If you're *sure* that the the caller will always already -// have an Optional, const Optional& is slightly faster than const T*, -// but this is a micro-optimization. In general, stick to const T*.) -// -// TODO(kwiberg): Get rid of this class when the standard library has -// std::optional (and we're allowed to use it). -template -class Optional final { - public: - // Construct an empty Optional. - Optional() : has_value_(false), empty_('\0') { - PoisonValue(); - } - - // Construct an Optional that contains a value. - explicit Optional(const T& value) : has_value_(true) { - new (&value_) T(value); - } - explicit Optional(T&& value) : has_value_(true) { - new (&value_) T(std::move(value)); - } - - // Copy constructor: copies the value from m if it has one. - Optional(const Optional& m) : has_value_(m.has_value_) { - if (has_value_) - new (&value_) T(m.value_); - else - PoisonValue(); - } - - // Move constructor: if m has a value, moves the value from m, leaving m - // still in a state where it has a value, but a moved-from one (the - // properties of which depends on T; the only general guarantee is that we - // can destroy m). - Optional(Optional&& m) : has_value_(m.has_value_) { - if (has_value_) - new (&value_) T(std::move(m.value_)); - else - PoisonValue(); - } - - ~Optional() { - if (has_value_) - value_.~T(); - else - UnpoisonValue(); - } - - // Copy assignment. Uses T's copy assignment if both sides have a value, T's - // copy constructor if only the right-hand side has a value. - Optional& operator=(const Optional& m) { - if (m.has_value_) { - if (has_value_) { - value_ = m.value_; // T's copy assignment. - } else { - UnpoisonValue(); - new (&value_) T(m.value_); // T's copy constructor. - has_value_ = true; - } - } else { - reset(); - } - return *this; - } - - // Move assignment. Uses T's move assignment if both sides have a value, T's - // move constructor if only the right-hand side has a value. The state of m - // after it's been moved from is as for the move constructor. - Optional& operator=(Optional&& m) { - if (m.has_value_) { - if (has_value_) { - value_ = std::move(m.value_); // T's move assignment. - } else { - UnpoisonValue(); - new (&value_) T(std::move(m.value_)); // T's move constructor. - has_value_ = true; - } - } else { - reset(); - } - return *this; - } - - // Swap the values if both m1 and m2 have values; move the value if only one - // of them has one. - friend void swap(Optional& m1, Optional& m2) { - if (m1.has_value_) { - if (m2.has_value_) { - // Both have values: swap. - using std::swap; - swap(m1.value_, m2.value_); - } else { - // Only m1 has a value: move it to m2. - m2.UnpoisonValue(); - new (&m2.value_) T(std::move(m1.value_)); - m1.value_.~T(); // Destroy the moved-from value. - m1.has_value_ = false; - m2.has_value_ = true; - m1.PoisonValue(); - } - } else if (m2.has_value_) { - // Only m2 has a value: move it to m1. - m1.UnpoisonValue(); - new (&m1.value_) T(std::move(m2.value_)); - m2.value_.~T(); // Destroy the moved-from value. - m1.has_value_ = true; - m2.has_value_ = false; - m2.PoisonValue(); - } - } - - // Destroy any contained value. Has no effect if we have no value. - void reset() { - if (!has_value_) - return; - value_.~T(); - has_value_ = false; - PoisonValue(); - } - - template - void emplace(Args&&... args) { - if (has_value_) - value_.~T(); - else - UnpoisonValue(); - new (&value_) T(std::forward(args)...); - has_value_ = true; - } - - // Conversion to bool to test if we have a value. - explicit operator bool() const { return has_value_; } - bool has_value() const { return has_value_; } - - // Dereferencing. Only allowed if we have a value. - const T* operator->() const { - RTC_DCHECK(has_value_); - return &value_; - } - T* operator->() { - RTC_DCHECK(has_value_); - return &value_; - } - const T& operator*() const { - RTC_DCHECK(has_value_); - return value_; - } - T& operator*() { - RTC_DCHECK(has_value_); - return value_; - } - const T& value() const { - RTC_DCHECK(has_value_); - return value_; - } - T& value() { - RTC_DCHECK(has_value_); - return value_; - } - - // Dereference with a default value in case we don't have a value. - const T& value_or(const T& default_val) const { - // The no-op call prevents the compiler from generating optimized code that - // reads value_ even if !has_value_, but only if FunctionThatDoesNothing is - // not completely inlined; see its declaration.). - return has_value_ ? *optional_internal::FunctionThatDoesNothing(&value_) - : default_val; - } - - // Dereference and move value. - T MoveValue() { - RTC_DCHECK(has_value_); - return std::move(value_); - } - - // Equality tests. Two Optionals are equal if they contain equivalent values, - // or if they're both empty. - friend bool operator==(const Optional& m1, const Optional& m2) { - return m1.has_value_ && m2.has_value_ ? m1.value_ == m2.value_ - : m1.has_value_ == m2.has_value_; - } - friend bool operator==(const Optional& opt, const T& value) { - return opt.has_value_ && opt.value_ == value; - } - friend bool operator==(const T& value, const Optional& opt) { - return opt.has_value_ && value == opt.value_; - } - - friend bool operator!=(const Optional& m1, const Optional& m2) { - return m1.has_value_ && m2.has_value_ ? m1.value_ != m2.value_ - : m1.has_value_ != m2.has_value_; - } - friend bool operator!=(const Optional& opt, const T& value) { - return !opt.has_value_ || opt.value_ != value; - } - friend bool operator!=(const T& value, const Optional& opt) { - return !opt.has_value_ || value != opt.value_; - } - - private: - // Tell sanitizers that value_ shouldn't be touched. - void PoisonValue() { - rtc::AsanPoison(rtc::MakeArrayView(&value_, 1)); - rtc::MsanMarkUninitialized(rtc::MakeArrayView(&value_, 1)); - } - - // Tell sanitizers that value_ is OK to touch again. - void UnpoisonValue() { - rtc::AsanUnpoison(rtc::MakeArrayView(&value_, 1)); - } - - bool has_value_; // True iff value_ contains a live value. - union { - // empty_ exists only to make it possible to initialize the union, even when - // it doesn't contain any data. If the union goes uninitialized, it may - // trigger compiler warnings. - char empty_; - // By placing value_ in a union, we get to manage its construction and - // destruction manually: the Optional constructors won't automatically - // construct it, and the Optional destructor won't automatically destroy - // it. Basically, this just allocates a properly sized and aligned block of - // memory in which we can manually put a T with placement new. - T value_; - }; -}; - -#ifdef UNIT_TEST -namespace optional_internal { - -// Checks if there's a valid PrintTo(const T&, std::ostream*) call for T. -template -struct HasPrintTo { - private: - struct No {}; - - template - static auto Test(const T2& obj) - -> decltype(PrintTo(obj, std::declval())); - - template - static No Test(...); - - public: - static constexpr bool value = - !std::is_same(std::declval())), No>::value; -}; - -// Checks if there's a valid operator<<(std::ostream&, const T&) call for T. -template -struct HasOstreamOperator { - private: - struct No {}; - - template - static auto Test(const T2& obj) - -> decltype(std::declval() << obj); - - template - static No Test(...); - - public: - static constexpr bool value = - !std::is_same(std::declval())), No>::value; -}; - -// Prefer using PrintTo to print the object. -template -typename std::enable_if::value, void>::type OptionalPrintToHelper( - const T& value, - std::ostream* os) { - PrintTo(value, os); -} - -// Fall back to operator<<(std::ostream&, ...) if it exists. -template -typename std::enable_if::value && !HasPrintTo::value, - void>::type -OptionalPrintToHelper(const T& value, std::ostream* os) { - *os << value; -} - -inline void OptionalPrintObjectBytes(const unsigned char* bytes, - size_t size, - std::ostream* os) { - *os << "(bytes[i]); - } - *os << "]>"; -} - -// As a final back-up, just print the contents of the objcets byte-wise. -template -typename std::enable_if::value && !HasPrintTo::value, - void>::type -OptionalPrintToHelper(const T& value, std::ostream* os) { - OptionalPrintObjectBytes(reinterpret_cast(&value), - sizeof(value), os); -} - -} // namespace optional_internal - -// PrintTo is used by gtest to print out the results of tests. We want to ensure -// the object contained in an Optional can be printed out if it's set, while -// avoiding touching the object's storage if it is undefined. -template -void PrintTo(const rtc::Optional& opt, std::ostream* os) { - if (opt) { - optional_internal::OptionalPrintToHelper(*opt, os); - } else { - *os << ""; - } -} - -#endif // UNIT_TEST - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_OPTIONAL_H_ diff --git a/webrtc/rtc_base/optionsfile.h b/webrtc/rtc_base/optionsfile.h deleted file mode 100644 index 778ffaf9e8..0000000000 --- a/webrtc/rtc_base/optionsfile.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2008 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_OPTIONSFILE_H_ -#define WEBRTC_RTC_BASE_OPTIONSFILE_H_ - -#include -#include - -namespace rtc { - -// Implements storage of simple options in a text file on disk. This is -// cross-platform, but it is intended mostly for Linux where there is no -// first-class options storage system. -class OptionsFile { - public: - OptionsFile(const std::string &path); - ~OptionsFile(); - - // Loads the file from disk, overwriting the in-memory values. - bool Load(); - // Saves the contents in memory, overwriting the on-disk values. - bool Save(); - - bool GetStringValue(const std::string& option, std::string* out_val) const; - bool GetIntValue(const std::string& option, int* out_val) const; - bool SetStringValue(const std::string& option, const std::string& val); - bool SetIntValue(const std::string& option, int val); - bool RemoveValue(const std::string& option); - - private: - typedef std::map OptionsMap; - - static bool IsLegalName(const std::string &name); - static bool IsLegalValue(const std::string &value); - - std::string path_; - OptionsMap options_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_OPTIONSFILE_H_ diff --git a/webrtc/rtc_base/pathutils.h b/webrtc/rtc_base/pathutils.h deleted file mode 100644 index 20305ca27a..0000000000 --- a/webrtc/rtc_base/pathutils.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_PATHUTILS_H_ -#define WEBRTC_RTC_BASE_PATHUTILS_H_ - -#include - -#include "webrtc/base/checks.h" - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// -// Pathname - parsing of pathnames into components, and vice versa. -// -// To establish consistent terminology, a filename never contains a folder -// component. A folder never contains a filename. A pathname may include -// a folder and/or filename component. Here are some examples: -// -// pathname() /home/john/example.txt -// folder() /home/john/ -// filename() example.txt -// parent_folder() /home/ -// folder_name() john/ -// basename() example -// extension() .txt -// -// Basename may begin, end, and/or include periods, but no folder delimiters. -// If extension exists, it consists of a period followed by zero or more -// non-period/non-delimiter characters, and basename is non-empty. -/////////////////////////////////////////////////////////////////////////////// - -class Pathname { -public: - // Folder delimiters are slash and backslash - static bool IsFolderDelimiter(char ch); - static char DefaultFolderDelimiter(); - - Pathname(); - Pathname(const Pathname&); - Pathname(Pathname&&); - Pathname(const std::string& pathname); - Pathname(const std::string& folder, const std::string& filename); - - Pathname& operator=(const Pathname&); - Pathname& operator=(Pathname&&); - - // Normalize changes all folder delimiters to folder_delimiter() - void Normalize(); - - // Reset to the empty pathname - void clear(); - - // Returns true if the pathname is empty. Note: this->pathname().empty() - // is always false. - bool empty() const; - - // Returns the folder and filename components. If the pathname is empty, - // returns a string representing the current directory (as a relative path, - // i.e., "."). - std::string pathname() const; - void SetPathname(const std::string& pathname); - void SetPathname(const std::string& folder, const std::string& filename); - - std::string folder() const; - std::string parent_folder() const; - // SetFolder and AppendFolder will append a folder delimiter, if needed. - void SetFolder(const std::string& folder); - void AppendFolder(const std::string& folder); - - bool SetBasename(const std::string& basename); - - // SetExtension will prefix a period, if needed. - bool SetExtension(const std::string& extension); - - std::string filename() const; - bool SetFilename(const std::string& filename); - -private: - std::string folder_, basename_, extension_; - char folder_delimiter_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_PATHUTILS_H_ diff --git a/webrtc/rtc_base/physicalsocketserver.h b/webrtc/rtc_base/physicalsocketserver.h deleted file mode 100644 index 55433bde56..0000000000 --- a/webrtc/rtc_base/physicalsocketserver.h +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_PHYSICALSOCKETSERVER_H_ -#define WEBRTC_RTC_BASE_PHYSICALSOCKETSERVER_H_ - -#if defined(WEBRTC_POSIX) && defined(WEBRTC_LINUX) -#include -#define WEBRTC_USE_EPOLL 1 -#endif - -#include -#include -#include - -#include "webrtc/base/nethelpers.h" -#include "webrtc/base/socketserver.h" -#include "webrtc/base/criticalsection.h" - -#if defined(WEBRTC_POSIX) -typedef int SOCKET; -#endif // WEBRTC_POSIX - -namespace rtc { - -// Event constants for the Dispatcher class. -enum DispatcherEvent { - DE_READ = 0x0001, - DE_WRITE = 0x0002, - DE_CONNECT = 0x0004, - DE_CLOSE = 0x0008, - DE_ACCEPT = 0x0010, -}; - -class Signaler; -#if defined(WEBRTC_POSIX) -class PosixSignalDispatcher; -#endif - -class Dispatcher { - public: - virtual ~Dispatcher() {} - virtual uint32_t GetRequestedEvents() = 0; - virtual void OnPreEvent(uint32_t ff) = 0; - virtual void OnEvent(uint32_t ff, int err) = 0; -#if defined(WEBRTC_WIN) - virtual WSAEVENT GetWSAEvent() = 0; - virtual SOCKET GetSocket() = 0; - virtual bool CheckSignalClose() = 0; -#elif defined(WEBRTC_POSIX) - virtual int GetDescriptor() = 0; - virtual bool IsDescriptorClosed() = 0; -#endif -}; - -// A socket server that provides the real sockets of the underlying OS. -class PhysicalSocketServer : public SocketServer { - public: - PhysicalSocketServer(); - ~PhysicalSocketServer() override; - - // SocketFactory: - Socket* CreateSocket(int type) override; - Socket* CreateSocket(int family, int type) override; - - AsyncSocket* CreateAsyncSocket(int type) override; - AsyncSocket* CreateAsyncSocket(int family, int type) override; - - // Internal Factory for Accept (virtual so it can be overwritten in tests). - virtual AsyncSocket* WrapSocket(SOCKET s); - - // SocketServer: - bool Wait(int cms, bool process_io) override; - void WakeUp() override; - - void Add(Dispatcher* dispatcher); - void Remove(Dispatcher* dispatcher); - void Update(Dispatcher* dispatcher); - -#if defined(WEBRTC_POSIX) - // Sets the function to be executed in response to the specified POSIX signal. - // The function is executed from inside Wait() using the "self-pipe trick"-- - // regardless of which thread receives the signal--and hence can safely - // manipulate user-level data structures. - // "handler" may be SIG_IGN, SIG_DFL, or a user-specified function, just like - // with signal(2). - // Only one PhysicalSocketServer should have user-level signal handlers. - // Dispatching signals on multiple PhysicalSocketServers is not reliable. - // The signal mask is not modified. It is the caller's responsibily to - // maintain it as desired. - virtual bool SetPosixSignalHandler(int signum, void (*handler)(int)); - - protected: - Dispatcher* signal_dispatcher(); -#endif - - private: - typedef std::set DispatcherSet; - - void AddRemovePendingDispatchers(); - -#if defined(WEBRTC_POSIX) - bool WaitSelect(int cms, bool process_io); - static bool InstallSignal(int signum, void (*handler)(int)); - - std::unique_ptr signal_dispatcher_; -#endif // WEBRTC_POSIX -#if defined(WEBRTC_USE_EPOLL) - void AddEpoll(Dispatcher* dispatcher); - void RemoveEpoll(Dispatcher* dispatcher); - void UpdateEpoll(Dispatcher* dispatcher); - bool WaitEpoll(int cms); - bool WaitPoll(int cms, Dispatcher* dispatcher); - - int epoll_fd_ = INVALID_SOCKET; - std::vector epoll_events_; -#endif // WEBRTC_USE_EPOLL - DispatcherSet dispatchers_; - DispatcherSet pending_add_dispatchers_; - DispatcherSet pending_remove_dispatchers_; - bool processing_dispatchers_ = false; - Signaler* signal_wakeup_; - CriticalSection crit_; - bool fWait_; -#if defined(WEBRTC_WIN) - WSAEVENT socket_ev_; -#endif -}; - -class PhysicalSocket : public AsyncSocket, public sigslot::has_slots<> { - public: - PhysicalSocket(PhysicalSocketServer* ss, SOCKET s = INVALID_SOCKET); - ~PhysicalSocket() override; - - // Creates the underlying OS socket (same as the "socket" function). - virtual bool Create(int family, int type); - - SocketAddress GetLocalAddress() const override; - SocketAddress GetRemoteAddress() const override; - - int Bind(const SocketAddress& bind_addr) override; - int Connect(const SocketAddress& addr) override; - - int GetError() const override; - void SetError(int error) override; - - ConnState GetState() const override; - - int GetOption(Option opt, int* value) override; - int SetOption(Option opt, int value) override; - - int Send(const void* pv, size_t cb) override; - int SendTo(const void* buffer, - size_t length, - const SocketAddress& addr) override; - - int Recv(void* buffer, size_t length, int64_t* timestamp) override; - int RecvFrom(void* buffer, - size_t length, - SocketAddress* out_addr, - int64_t* timestamp) override; - - int Listen(int backlog) override; - AsyncSocket* Accept(SocketAddress* out_addr) override; - - int Close() override; - - SocketServer* socketserver() { return ss_; } - - protected: - int DoConnect(const SocketAddress& connect_addr); - - // Make virtual so ::accept can be overwritten in tests. - virtual SOCKET DoAccept(SOCKET socket, sockaddr* addr, socklen_t* addrlen); - - // Make virtual so ::send can be overwritten in tests. - virtual int DoSend(SOCKET socket, const char* buf, int len, int flags); - - // Make virtual so ::sendto can be overwritten in tests. - virtual int DoSendTo(SOCKET socket, const char* buf, int len, int flags, - const struct sockaddr* dest_addr, socklen_t addrlen); - - void OnResolveResult(AsyncResolverInterface* resolver); - - void UpdateLastError(); - void MaybeRemapSendError(); - - uint8_t enabled_events() const { return enabled_events_; } - virtual void SetEnabledEvents(uint8_t events); - virtual void EnableEvents(uint8_t events); - virtual void DisableEvents(uint8_t events); - - static int TranslateOption(Option opt, int* slevel, int* sopt); - - PhysicalSocketServer* ss_; - SOCKET s_; - bool udp_; - CriticalSection crit_; - int error_ GUARDED_BY(crit_); - ConnState state_; - AsyncResolver* resolver_; - -#if !defined(NDEBUG) - std::string dbg_addr_; -#endif - - private: - uint8_t enabled_events_ = 0; -}; - -class SocketDispatcher : public Dispatcher, public PhysicalSocket { - public: - explicit SocketDispatcher(PhysicalSocketServer *ss); - SocketDispatcher(SOCKET s, PhysicalSocketServer *ss); - ~SocketDispatcher() override; - - bool Initialize(); - - virtual bool Create(int type); - bool Create(int family, int type) override; - -#if defined(WEBRTC_WIN) - WSAEVENT GetWSAEvent() override; - SOCKET GetSocket() override; - bool CheckSignalClose() override; -#elif defined(WEBRTC_POSIX) - int GetDescriptor() override; - bool IsDescriptorClosed() override; -#endif - - uint32_t GetRequestedEvents() override; - void OnPreEvent(uint32_t ff) override; - void OnEvent(uint32_t ff, int err) override; - - int Close() override; - -#if defined(WEBRTC_USE_EPOLL) - protected: - void StartBatchedEventUpdates(); - void FinishBatchedEventUpdates(); - - void SetEnabledEvents(uint8_t events) override; - void EnableEvents(uint8_t events) override; - void DisableEvents(uint8_t events) override; -#endif - - private: -#if defined(WEBRTC_WIN) - static int next_id_; - int id_; - bool signal_close_; - int signal_err_; -#endif // WEBRTC_WIN -#if defined(WEBRTC_USE_EPOLL) - void MaybeUpdateDispatcher(uint8_t old_events); - - int saved_enabled_events_ = -1; -#endif -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_PHYSICALSOCKETSERVER_H_ diff --git a/webrtc/rtc_base/platform_file.h b/webrtc/rtc_base/platform_file.h deleted file mode 100644 index ccb7bfc452..0000000000 --- a/webrtc/rtc_base/platform_file.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2014 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_PLATFORM_FILE_H_ -#define WEBRTC_RTC_BASE_PLATFORM_FILE_H_ - -#include -#include - -#if defined(WEBRTC_WIN) -#include "webrtc/base/win32.h" -#endif - -namespace rtc { - -#if defined(WEBRTC_WIN) -typedef HANDLE PlatformFile; -#elif defined(WEBRTC_POSIX) -typedef int PlatformFile; -#else -#error Unsupported platform -#endif - -extern const PlatformFile kInvalidPlatformFileValue; - -// Associates a standard FILE stream with an existing PlatformFile. -// Note that after this function has returned a valid FILE stream, -// the PlatformFile should no longer be used. -FILE* FdopenPlatformFileForWriting(PlatformFile file); - -// Closes a PlatformFile. -// Don't use ClosePlatformFile to close a file opened with FdopenPlatformFile. -// Use fclose instead. -bool ClosePlatformFile(PlatformFile file); - -// Removes a file in the filesystem. -bool RemoveFile(const std::string& path); - -// Opens a file for reading and writing. You might want to use base/file.h -// instead. -PlatformFile OpenPlatformFile(const std::string& path); - -// Creates a new file for reading and writing. If the file already exists it -// will be overwritten. You might want to use base/file.h instead. -PlatformFile CreatePlatformFile(const std::string& path); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_PLATFORM_FILE_H_ diff --git a/webrtc/rtc_base/platform_thread.h b/webrtc/rtc_base/platform_thread.h deleted file mode 100644 index 84f2b67f77..0000000000 --- a/webrtc/rtc_base/platform_thread.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_PLATFORM_THREAD_H_ -#define WEBRTC_RTC_BASE_PLATFORM_THREAD_H_ - -#include - -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/event.h" -#include "webrtc/base/platform_thread_types.h" -#include "webrtc/base/thread_checker.h" - -namespace rtc { - -PlatformThreadId CurrentThreadId(); -PlatformThreadRef CurrentThreadRef(); - -// Compares two thread identifiers for equality. -bool IsThreadRefEqual(const PlatformThreadRef& a, const PlatformThreadRef& b); - -// Sets the current thread name. -void SetCurrentThreadName(const char* name); - -// Callback function that the spawned thread will enter once spawned. -// A return value of false is interpreted as that the function has no -// more work to do and that the thread can be released. -typedef bool (*ThreadRunFunctionDeprecated)(void*); -typedef void (*ThreadRunFunction)(void*); - -enum ThreadPriority { -#ifdef WEBRTC_WIN - kLowPriority = THREAD_PRIORITY_BELOW_NORMAL, - kNormalPriority = THREAD_PRIORITY_NORMAL, - kHighPriority = THREAD_PRIORITY_ABOVE_NORMAL, - kHighestPriority = THREAD_PRIORITY_HIGHEST, - kRealtimePriority = THREAD_PRIORITY_TIME_CRITICAL -#else - kLowPriority = 1, - kNormalPriority = 2, - kHighPriority = 3, - kHighestPriority = 4, - kRealtimePriority = 5 -#endif -}; - -// Represents a simple worker thread. The implementation must be assumed -// to be single threaded, meaning that all methods of the class, must be -// called from the same thread, including instantiation. -class PlatformThread { - public: - PlatformThread(ThreadRunFunctionDeprecated func, - void* obj, - const char* thread_name); - PlatformThread(ThreadRunFunction func, - void* obj, - const char* thread_name, - ThreadPriority priority = kNormalPriority); - virtual ~PlatformThread(); - - const std::string& name() const { return name_; } - - // Spawns a thread and tries to set thread priority according to the priority - // from when CreateThread was called. - void Start(); - - bool IsRunning() const; - - // Returns an identifier for the worker thread that can be used to do - // thread checks. - PlatformThreadRef GetThreadRef() const; - - // Stops (joins) the spawned thread. - void Stop(); - - // Set the priority of the thread. Must be called when thread is running. - // TODO(tommi): Make private and only allow public support via ctor. - bool SetPriority(ThreadPriority priority); - - protected: -#if defined(WEBRTC_WIN) - // Exposed to derived classes to allow for special cases specific to Windows. - bool QueueAPC(PAPCFUNC apc_function, ULONG_PTR data); -#endif - - private: - void Run(); - - ThreadRunFunctionDeprecated const run_function_deprecated_ = nullptr; - ThreadRunFunction const run_function_ = nullptr; - const ThreadPriority priority_ = kNormalPriority; - void* const obj_; - // TODO(pbos): Make sure call sites use string literals and update to a const - // char* instead of a std::string. - const std::string name_; - rtc::ThreadChecker thread_checker_; - rtc::ThreadChecker spawned_thread_checker_; -#if defined(WEBRTC_WIN) - static DWORD WINAPI StartThread(void* param); - - bool stop_ = false; - HANDLE thread_ = nullptr; - DWORD thread_id_ = 0; -#else - static void* StartThread(void* param); - - // An atomic flag that we use to stop the thread. Only modified on the - // controlling thread and checked on the worker thread. - volatile int stop_flag_ = 0; - pthread_t thread_ = 0; -#endif // defined(WEBRTC_WIN) - RTC_DISALLOW_COPY_AND_ASSIGN(PlatformThread); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_PLATFORM_THREAD_H_ diff --git a/webrtc/rtc_base/platform_thread_types.h b/webrtc/rtc_base/platform_thread_types.h deleted file mode 100644 index 705d6ca1eb..0000000000 --- a/webrtc/rtc_base/platform_thread_types.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_PLATFORM_THREAD_TYPES_H_ -#define WEBRTC_RTC_BASE_PLATFORM_THREAD_TYPES_H_ - -#if defined(WEBRTC_WIN) -#include -#include -#elif defined(WEBRTC_POSIX) -#include -#include -#endif - -namespace rtc { -#if defined(WEBRTC_WIN) -typedef DWORD PlatformThreadId; -typedef DWORD PlatformThreadRef; -#elif defined(WEBRTC_POSIX) -typedef pid_t PlatformThreadId; -typedef pthread_t PlatformThreadRef; -#endif -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_PLATFORM_THREAD_TYPES_H_ diff --git a/webrtc/rtc_base/protobuf_utils.h b/webrtc/rtc_base/protobuf_utils.h deleted file mode 100644 index c8c98b0367..0000000000 --- a/webrtc/rtc_base/protobuf_utils.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#ifndef WEBRTC_RTC_BASE_PROTOBUF_UTILS_H_ -#define WEBRTC_RTC_BASE_PROTOBUF_UTILS_H_ - -namespace webrtc { - -using ProtoString = std::string; - -} // namespace webrtc - -#if WEBRTC_ENABLE_PROTOBUF - -#include "third_party/protobuf/src/google/protobuf/message_lite.h" -#include "third_party/protobuf/src/google/protobuf/repeated_field.h" - -namespace webrtc { - -using google::protobuf::MessageLite; -using google::protobuf::RepeatedPtrField; - -} // namespace webrtc - -#endif // WEBRTC_ENABLE_PROTOBUF - -#endif // WEBRTC_RTC_BASE_PROTOBUF_UTILS_H_ diff --git a/webrtc/rtc_base/proxyinfo.h b/webrtc/rtc_base/proxyinfo.h deleted file mode 100644 index 89bb1b7870..0000000000 --- a/webrtc/rtc_base/proxyinfo.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_PROXYINFO_H_ -#define WEBRTC_RTC_BASE_PROXYINFO_H_ - -#include -#include "webrtc/base/socketaddress.h" -#include "webrtc/base/cryptstring.h" - -namespace rtc { - -enum ProxyType { - PROXY_NONE, - PROXY_HTTPS, - PROXY_SOCKS5, - PROXY_UNKNOWN -}; -const char * ProxyToString(ProxyType proxy); - -struct ProxyInfo { - ProxyType type; - SocketAddress address; - std::string autoconfig_url; - bool autodetect; - std::string bypass_list; - std::string username; - CryptString password; - - ProxyInfo(); - ~ProxyInfo(); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_PROXYINFO_H_ diff --git a/webrtc/rtc_base/proxyserver.h b/webrtc/rtc_base/proxyserver.h deleted file mode 100644 index 2fba0fbd34..0000000000 --- a/webrtc/rtc_base/proxyserver.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_PROXYSERVER_H_ -#define WEBRTC_RTC_BASE_PROXYSERVER_H_ - -#include -#include -#include "webrtc/base/asyncsocket.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/socketadapters.h" -#include "webrtc/base/socketaddress.h" -#include "webrtc/base/stream.h" - -namespace rtc { - -class SocketFactory; - -// ProxyServer is a base class that allows for easy construction of proxy -// servers. With its helper class ProxyBinding, it contains all the necessary -// logic for receiving and bridging connections. The specific client-server -// proxy protocol is implemented by an instance of the AsyncProxyServerSocket -// class; children of ProxyServer implement WrapSocket appropriately to return -// the correct protocol handler. - -class ProxyBinding : public sigslot::has_slots<> { - public: - ProxyBinding(AsyncProxyServerSocket* in_socket, AsyncSocket* out_socket); - ~ProxyBinding() override; - sigslot::signal1 SignalDestroyed; - - private: - void OnConnectRequest(AsyncProxyServerSocket* socket, - const SocketAddress& addr); - void OnInternalRead(AsyncSocket* socket); - void OnInternalWrite(AsyncSocket* socket); - void OnInternalClose(AsyncSocket* socket, int err); - void OnExternalConnect(AsyncSocket* socket); - void OnExternalRead(AsyncSocket* socket); - void OnExternalWrite(AsyncSocket* socket); - void OnExternalClose(AsyncSocket* socket, int err); - - static void Read(AsyncSocket* socket, FifoBuffer* buffer); - static void Write(AsyncSocket* socket, FifoBuffer* buffer); - void Destroy(); - - static const int kBufferSize = 4096; - std::unique_ptr int_socket_; - std::unique_ptr ext_socket_; - bool connected_; - FifoBuffer out_buffer_; - FifoBuffer in_buffer_; - RTC_DISALLOW_COPY_AND_ASSIGN(ProxyBinding); -}; - -class ProxyServer : public sigslot::has_slots<> { - public: - ProxyServer(SocketFactory* int_factory, const SocketAddress& int_addr, - SocketFactory* ext_factory, const SocketAddress& ext_ip); - ~ProxyServer() override; - - // Returns the address to which the proxy server is bound - SocketAddress GetServerAddress(); - - protected: - void OnAcceptEvent(AsyncSocket* socket); - virtual AsyncProxyServerSocket* WrapSocket(AsyncSocket* socket) = 0; - void OnBindingDestroyed(ProxyBinding* binding); - - private: - typedef std::list BindingList; - SocketFactory* ext_factory_; - SocketAddress ext_ip_; - std::unique_ptr server_socket_; - BindingList bindings_; - RTC_DISALLOW_COPY_AND_ASSIGN(ProxyServer); -}; - -// SocksProxyServer is a simple extension of ProxyServer to implement SOCKS. -class SocksProxyServer : public ProxyServer { - public: - SocksProxyServer(SocketFactory* int_factory, const SocketAddress& int_addr, - SocketFactory* ext_factory, const SocketAddress& ext_ip) - : ProxyServer(int_factory, int_addr, ext_factory, ext_ip) { - } - protected: - AsyncProxyServerSocket* WrapSocket(AsyncSocket* socket) override; - RTC_DISALLOW_COPY_AND_ASSIGN(SocksProxyServer); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_PROXYSERVER_H_ diff --git a/webrtc/rtc_base/ptr_util.h b/webrtc/rtc_base/ptr_util.h deleted file mode 100644 index 9276133597..0000000000 --- a/webrtc/rtc_base/ptr_util.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2017 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This implementation is borrowed from chromium. - -#ifndef WEBRTC_RTC_BASE_PTR_UTIL_H_ -#define WEBRTC_RTC_BASE_PTR_UTIL_H_ - -#include -#include - -namespace rtc { - -// Helper to transfer ownership of a raw pointer to a std::unique_ptr. -// Note that std::unique_ptr has very different semantics from -// std::unique_ptr: do not use this helper for array allocations. -template -std::unique_ptr WrapUnique(T* ptr) { - return std::unique_ptr(ptr); -} - -namespace internal { - -template -struct MakeUniqueResult { - using Scalar = std::unique_ptr; -}; - -template -struct MakeUniqueResult { - using Array = std::unique_ptr; -}; - -template -struct MakeUniqueResult { - using Invalid = void; -}; - -} // namespace internal - -// Helper to construct an object wrapped in a std::unique_ptr. This is an -// implementation of C++14's std::make_unique that can be used in Chrome. -// -// MakeUnique(args) should be preferred over WrapUnique(new T(args)): bare -// calls to `new` should be treated with scrutiny. -// -// Usage: -// // ptr is a std::unique_ptr -// auto ptr = MakeUnique("hello world!"); -// -// // arr is a std::unique_ptr -// auto arr = MakeUnique(5); - -// Overload for non-array types. Arguments are forwarded to T's constructor. -template -typename internal::MakeUniqueResult::Scalar MakeUnique(Args&&... args) { - return std::unique_ptr(new T(std::forward(args)...)); -} - -// Overload for array types of unknown bound, e.g. T[]. The array is allocated -// with `new T[n]()` and value-initialized: note that this is distinct from -// `new T[n]`, which default-initializes. -template -typename internal::MakeUniqueResult::Array MakeUnique(size_t size) { - return std::unique_ptr(new typename std::remove_extent::type[size]()); -} - -// Overload to reject array types of known bound, e.g. T[n]. -template -typename internal::MakeUniqueResult::Invalid MakeUnique(Args&&... args) = - delete; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_PTR_UTIL_H_ diff --git a/webrtc/rtc_base/race_checker.h b/webrtc/rtc_base/race_checker.h deleted file mode 100644 index a7c893c812..0000000000 --- a/webrtc/rtc_base/race_checker.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_RACE_CHECKER_H_ -#define WEBRTC_RTC_BASE_RACE_CHECKER_H_ - -#include "webrtc/base/checks.h" -#include "webrtc/base/platform_thread.h" -#include "webrtc/base/thread_annotations.h" - -namespace rtc { - -namespace internal { -class RaceCheckerScope; -} // namespace internal - -// Best-effort race-checking implementation. This primitive uses no -// synchronization at all to be as-fast-as-possible in the non-racy case. -class LOCKABLE RaceChecker { - public: - friend class internal::RaceCheckerScope; - RaceChecker(); - - private: - bool Acquire() const EXCLUSIVE_LOCK_FUNCTION(); - void Release() const UNLOCK_FUNCTION(); - - // Volatile to prevent code being optimized away in Acquire()/Release(). - mutable volatile int access_count_ = 0; - mutable volatile PlatformThreadRef accessing_thread_; -}; - -namespace internal { -class SCOPED_LOCKABLE RaceCheckerScope { - public: - explicit RaceCheckerScope(const RaceChecker* race_checker) - EXCLUSIVE_LOCK_FUNCTION(race_checker); - - bool RaceDetected() const; - ~RaceCheckerScope() UNLOCK_FUNCTION(); - - private: - const RaceChecker* const race_checker_; - const bool race_check_ok_; -}; - -class SCOPED_LOCKABLE RaceCheckerScopeDoNothing { - public: - explicit RaceCheckerScopeDoNothing(const RaceChecker* race_checker) - EXCLUSIVE_LOCK_FUNCTION(race_checker) {} - - ~RaceCheckerScopeDoNothing() UNLOCK_FUNCTION() {} -}; - -} // namespace internal -} // namespace rtc - -#define RTC_CHECK_RUNS_SERIALIZED(x) \ - rtc::internal::RaceCheckerScope race_checker(x); \ - RTC_CHECK(!race_checker.RaceDetected()) - -#if RTC_DCHECK_IS_ON -#define RTC_DCHECK_RUNS_SERIALIZED(x) \ - rtc::internal::RaceCheckerScope race_checker(x); \ - RTC_DCHECK(!race_checker.RaceDetected()) -#else -#define RTC_DCHECK_RUNS_SERIALIZED(x) \ - rtc::internal::RaceCheckerScopeDoNothing race_checker(x) -#endif - -#endif // WEBRTC_RTC_BASE_RACE_CHECKER_H_ diff --git a/webrtc/rtc_base/random.h b/webrtc/rtc_base/random.h deleted file mode 100644 index d8d157cf0d..0000000000 --- a/webrtc/rtc_base/random.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_RANDOM_H_ -#define WEBRTC_RTC_BASE_RANDOM_H_ - -#include - -#include "webrtc/typedefs.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/checks.h" - -namespace webrtc { - -class Random { - public: - // TODO(tommi): Change this so that the seed can be initialized internally, - // e.g. by offering two ways of constructing or offer a static method that - // returns a seed that's suitable for initialization. - // The problem now is that callers are calling clock_->TimeInMicroseconds() - // which calls TickTime::Now().Ticks(), which can return a very low value on - // Mac and can result in a seed of 0 after conversion to microseconds. - // Besides the quality of the random seed being poor, this also requires - // the client to take on extra dependencies to generate a seed. - // If we go for a static seed generator in Random, we can use something from - // webrtc/base and make sure that it works the same way across platforms. - // See also discussion here: https://codereview.webrtc.org/1623543002/ - explicit Random(uint64_t seed); - - // Return pseudo-random integer of the specified type. - // We need to limit the size to 32 bits to keep the output close to uniform. - template - T Rand() { - static_assert(std::numeric_limits::is_integer && - std::numeric_limits::radix == 2 && - std::numeric_limits::digits <= 32, - "Rand is only supported for built-in integer types that are " - "32 bits or smaller."); - return static_cast(NextOutput()); - } - - // Uniformly distributed pseudo-random number in the interval [0, t]. - uint32_t Rand(uint32_t t); - - // Uniformly distributed pseudo-random number in the interval [low, high]. - uint32_t Rand(uint32_t low, uint32_t high); - - // Uniformly distributed pseudo-random number in the interval [low, high]. - int32_t Rand(int32_t low, int32_t high); - - // Normal Distribution. - double Gaussian(double mean, double standard_deviation); - - // Exponential Distribution. - double Exponential(double lambda); - - private: - // Outputs a nonzero 64-bit random number. - uint64_t NextOutput() { - state_ ^= state_ >> 12; - state_ ^= state_ << 25; - state_ ^= state_ >> 27; - RTC_DCHECK(state_ != 0x0ULL); - return state_ * 2685821657736338717ull; - } - - uint64_t state_; - - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Random); -}; - -// Return pseudo-random number in the interval [0.0, 1.0). -template <> -float Random::Rand(); - -// Return pseudo-random number in the interval [0.0, 1.0). -template <> -double Random::Rand(); - -// Return pseudo-random boolean value. -template <> -bool Random::Rand(); - -} // namespace webrtc - -#endif // WEBRTC_RTC_BASE_RANDOM_H_ diff --git a/webrtc/rtc_base/rate_limiter.h b/webrtc/rtc_base/rate_limiter.h deleted file mode 100644 index e13aad0f4b..0000000000 --- a/webrtc/rtc_base/rate_limiter.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_RATE_LIMITER_H_ -#define WEBRTC_RTC_BASE_RATE_LIMITER_H_ - -#include - -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/criticalsection.h" -#include "webrtc/base/rate_statistics.h" - -namespace webrtc { - -class Clock; - -// Class used to limit a bitrate, making sure the average does not exceed a -// maximum as measured over a sliding window. This class is thread safe; all -// methods will acquire (the same) lock befeore executing. -class RateLimiter { - public: - RateLimiter(const Clock* clock, int64_t max_window_ms); - ~RateLimiter(); - - // Try to use rate to send bytes. Returns true on success and if so updates - // current rate. - bool TryUseRate(size_t packet_size_bytes); - - // Set the maximum bitrate, in bps, that this limiter allows to send. - void SetMaxRate(uint32_t max_rate_bps); - - // Set the window size over which to measure the current bitrate. - // For example, irt retransmissions, this is typically the RTT. - // Returns true on success and false if window_size_ms is out of range. - bool SetWindowSize(int64_t window_size_ms); - - private: - const Clock* const clock_; - rtc::CriticalSection lock_; - RateStatistics current_rate_ GUARDED_BY(lock_); - int64_t window_size_ms_ GUARDED_BY(lock_); - uint32_t max_rate_bps_ GUARDED_BY(lock_); - - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RateLimiter); -}; - -} // namespace webrtc - -#endif // WEBRTC_RTC_BASE_RATE_LIMITER_H_ diff --git a/webrtc/rtc_base/rate_statistics.h b/webrtc/rtc_base/rate_statistics.h deleted file mode 100644 index 0a3077bb8a..0000000000 --- a/webrtc/rtc_base/rate_statistics.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_RATE_STATISTICS_H_ -#define WEBRTC_RTC_BASE_RATE_STATISTICS_H_ - -#include - -#include "webrtc/base/optional.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -class RateStatistics { - public: - static constexpr float kBpsScale = 8000.0f; - - // max_window_size_ms = Maximum window size in ms for the rate estimation. - // Initial window size is set to this, but may be changed - // to something lower by calling SetWindowSize(). - // scale = coefficient to convert counts/ms to desired unit - // ex: kBpsScale (8000) for bits/s if count represents bytes. - RateStatistics(int64_t max_window_size_ms, float scale); - ~RateStatistics(); - - // Reset instance to original state. - void Reset(); - - // Update rate with a new data point, moving averaging window as needed. - void Update(size_t count, int64_t now_ms); - - // Note that despite this being a const method, it still updates the internal - // state (moves averaging window), but it doesn't make any alterations that - // are observable from the other methods, as long as supplied timestamps are - // from a monotonic clock. Ie, it doesn't matter if this call moves the - // window, since any subsequent call to Update or Rate would still have moved - // the window as much or more. - rtc::Optional Rate(int64_t now_ms) const; - - // Update the size of the averaging window. The maximum allowed value for - // window_size_ms is max_window_size_ms as supplied in the constructor. - bool SetWindowSize(int64_t window_size_ms, int64_t now_ms); - - private: - void EraseOld(int64_t now_ms); - bool IsInitialized() const; - - // Counters are kept in buckets (circular buffer), with one bucket - // per millisecond. - struct Bucket { - size_t sum; // Sum of all samples in this bucket. - size_t samples; // Number of samples in this bucket. - }; - std::unique_ptr buckets_; - - // Total count recorded in buckets. - size_t accumulated_count_; - - // The total number of samples in the buckets. - size_t num_samples_; - - // Oldest time recorded in buckets. - int64_t oldest_time_; - - // Bucket index of oldest counter recorded in buckets. - uint32_t oldest_index_; - - // To convert counts/ms to desired units - const float scale_; - - // The window sizes, in ms, over which the rate is calculated. - const int64_t max_window_size_ms_; - int64_t current_window_size_ms_; -}; -} // namespace webrtc - -#endif // WEBRTC_RTC_BASE_RATE_STATISTICS_H_ diff --git a/webrtc/rtc_base/ratelimiter.h b/webrtc/rtc_base/ratelimiter.h deleted file mode 100644 index 24ed1add83..0000000000 --- a/webrtc/rtc_base/ratelimiter.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2012 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_RATELIMITER_H_ -#define WEBRTC_RTC_BASE_RATELIMITER_H_ - -#include - -namespace rtc { - -// Limits the rate of use to a certain maximum quantity per period of -// time. Use, for example, for simple bandwidth throttling. -// -// It's implemented like a diet plan: You have so many calories per -// day. If you hit the limit, you can't eat any more until the next -// day. -class RateLimiter { - public: - // For example, 100kb per second. - RateLimiter(size_t max, double period) - : max_per_period_(max), - period_length_(period), - used_in_period_(0), - period_start_(0.0), - period_end_(period) { - } - virtual ~RateLimiter() {} - - // Returns true if if the desired quantity is available in the - // current period (< (max - used)). Once the given time passes the - // end of the period, used is set to zero and more use is available. - bool CanUse(size_t desired, double time); - // Increment the quantity used this period. If past the end of a - // period, a new period is started. - void Use(size_t used, double time); - - size_t used_in_period() const { - return used_in_period_; - } - - size_t max_per_period() const { - return max_per_period_; - } - - private: - size_t max_per_period_; - double period_length_; - size_t used_in_period_; - double period_start_; - double period_end_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_RATELIMITER_H_ diff --git a/webrtc/rtc_base/ratetracker.h b/webrtc/rtc_base/ratetracker.h deleted file mode 100644 index 7cdf4a5dfb..0000000000 --- a/webrtc/rtc_base/ratetracker.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_RATETRACKER_H_ -#define WEBRTC_RTC_BASE_RATETRACKER_H_ - -#include -#include "webrtc/base/basictypes.h" - -namespace rtc { - -// Computes units per second over a given interval by tracking the units over -// each bucket of a given size and calculating the instantaneous rate assuming -// that over each bucket the rate was constant. -class RateTracker { - public: - RateTracker(int64_t bucket_milliseconds, size_t bucket_count); - virtual ~RateTracker(); - - // Computes the average rate over the most recent interval_milliseconds, - // or if the first sample was added within this period, computes the rate - // since the first sample was added. - double ComputeRateForInterval(int64_t interval_milliseconds) const; - - // Computes the average rate over the rate tracker's recording interval - // of bucket_milliseconds * bucket_count. - double ComputeRate() const { - return ComputeRateForInterval(bucket_milliseconds_ * - static_cast(bucket_count_)); - } - - // Computes the average rate since the first sample was added to the - // rate tracker. - double ComputeTotalRate() const; - - // The total number of samples added. - size_t TotalSampleCount() const; - - // Reads the current time in order to determine the appropriate bucket for - // these samples, and increments the count for that bucket by sample_count. - void AddSamples(size_t sample_count); - - protected: - // overrideable for tests - virtual int64_t Time() const; - - private: - void EnsureInitialized(); - size_t NextBucketIndex(size_t bucket_index) const; - - const int64_t bucket_milliseconds_; - const size_t bucket_count_; - size_t* sample_buckets_; - size_t total_sample_count_; - size_t current_bucket_; - int64_t bucket_start_time_milliseconds_; - int64_t initialization_time_milliseconds_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_RATETRACKER_H_ diff --git a/webrtc/rtc_base/refcount.h b/webrtc/rtc_base/refcount.h deleted file mode 100644 index d67e2871c6..0000000000 --- a/webrtc/rtc_base/refcount.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef WEBRTC_RTC_BASE_REFCOUNT_H_ -#define WEBRTC_RTC_BASE_REFCOUNT_H_ - -#include "webrtc/base/refcountedobject.h" - -namespace rtc { - -// Reference count interface. -class RefCountInterface { - public: - virtual int AddRef() const = 0; - virtual int Release() const = 0; - - protected: - virtual ~RefCountInterface() {} -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_REFCOUNT_H_ diff --git a/webrtc/rtc_base/refcountedobject.h b/webrtc/rtc_base/refcountedobject.h deleted file mode 100644 index 5c9e7f1dfd..0000000000 --- a/webrtc/rtc_base/refcountedobject.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef WEBRTC_RTC_BASE_REFCOUNTEDOBJECT_H_ -#define WEBRTC_RTC_BASE_REFCOUNTEDOBJECT_H_ - -#include - -#include "webrtc/base/atomicops.h" - -namespace rtc { - -template -class RefCountedObject : public T { - public: - RefCountedObject() {} - - template - explicit RefCountedObject(P0&& p0) : T(std::forward(p0)) {} - - template - RefCountedObject(P0&& p0, P1&& p1, Args&&... args) - : T(std::forward(p0), - std::forward(p1), - std::forward(args)...) {} - - virtual int AddRef() const { return AtomicOps::Increment(&ref_count_); } - - virtual int Release() const { - int count = AtomicOps::Decrement(&ref_count_); - if (!count) { - delete this; - } - return count; - } - - // Return whether the reference count is one. If the reference count is used - // in the conventional way, a reference count of 1 implies that the current - // thread owns the reference and no other thread shares it. This call - // performs the test for a reference count of one, and performs the memory - // barrier needed for the owning thread to act on the object, knowing that it - // has exclusive access to the object. - virtual bool HasOneRef() const { - return AtomicOps::AcquireLoad(&ref_count_) == 1; - } - - protected: - virtual ~RefCountedObject() {} - - mutable volatile int ref_count_ = 0; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_REFCOUNTEDOBJECT_H_ diff --git a/webrtc/rtc_base/rollingaccumulator.h b/webrtc/rtc_base/rollingaccumulator.h deleted file mode 100644 index 40b2611e1a..0000000000 --- a/webrtc/rtc_base/rollingaccumulator.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2011 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_ROLLINGACCUMULATOR_H_ -#define WEBRTC_RTC_BASE_ROLLINGACCUMULATOR_H_ - -#include -#include - -#include "webrtc/base/checks.h" -#include "webrtc/base/constructormagic.h" - -namespace rtc { - -// RollingAccumulator stores and reports statistics -// over N most recent samples. -// -// T is assumed to be an int, long, double or float. -template -class RollingAccumulator { - public: - explicit RollingAccumulator(size_t max_count) - : samples_(max_count) { - Reset(); - } - ~RollingAccumulator() { - } - - size_t max_count() const { - return samples_.size(); - } - - size_t count() const { - return count_; - } - - void Reset() { - count_ = 0U; - next_index_ = 0U; - sum_ = 0.0; - sum_2_ = 0.0; - max_ = T(); - max_stale_ = false; - min_ = T(); - min_stale_ = false; - } - - void AddSample(T sample) { - if (count_ == max_count()) { - // Remove oldest sample. - T sample_to_remove = samples_[next_index_]; - sum_ -= sample_to_remove; - sum_2_ -= static_cast(sample_to_remove) * sample_to_remove; - if (sample_to_remove >= max_) { - max_stale_ = true; - } - if (sample_to_remove <= min_) { - min_stale_ = true; - } - } else { - // Increase count of samples. - ++count_; - } - // Add new sample. - samples_[next_index_] = sample; - sum_ += sample; - sum_2_ += static_cast(sample) * sample; - if (count_ == 1 || sample >= max_) { - max_ = sample; - max_stale_ = false; - } - if (count_ == 1 || sample <= min_) { - min_ = sample; - min_stale_ = false; - } - // Update next_index_. - next_index_ = (next_index_ + 1) % max_count(); - } - - T ComputeSum() const { - return static_cast(sum_); - } - - double ComputeMean() const { - if (count_ == 0) { - return 0.0; - } - return sum_ / count_; - } - - T ComputeMax() const { - if (max_stale_) { - RTC_DCHECK(count_ > 0) << - "It shouldn't be possible for max_stale_ && count_ == 0"; - max_ = samples_[next_index_]; - for (size_t i = 1u; i < count_; i++) { - max_ = std::max(max_, samples_[(next_index_ + i) % max_count()]); - } - max_stale_ = false; - } - return max_; - } - - T ComputeMin() const { - if (min_stale_) { - RTC_DCHECK(count_ > 0) << - "It shouldn't be possible for min_stale_ && count_ == 0"; - min_ = samples_[next_index_]; - for (size_t i = 1u; i < count_; i++) { - min_ = std::min(min_, samples_[(next_index_ + i) % max_count()]); - } - min_stale_ = false; - } - return min_; - } - - // O(n) time complexity. - // Weights nth sample with weight (learning_rate)^n. Learning_rate should be - // between (0.0, 1.0], otherwise the non-weighted mean is returned. - double ComputeWeightedMean(double learning_rate) const { - if (count_ < 1 || learning_rate <= 0.0 || learning_rate >= 1.0) { - return ComputeMean(); - } - double weighted_mean = 0.0; - double current_weight = 1.0; - double weight_sum = 0.0; - const size_t max_size = max_count(); - for (size_t i = 0; i < count_; ++i) { - current_weight *= learning_rate; - weight_sum += current_weight; - // Add max_size to prevent underflow. - size_t index = (next_index_ + max_size - i - 1) % max_size; - weighted_mean += current_weight * samples_[index]; - } - return weighted_mean / weight_sum; - } - - // Compute estimated variance. Estimation is more accurate - // as the number of samples grows. - double ComputeVariance() const { - if (count_ == 0) { - return 0.0; - } - // Var = E[x^2] - (E[x])^2 - double count_inv = 1.0 / count_; - double mean_2 = sum_2_ * count_inv; - double mean = sum_ * count_inv; - return mean_2 - (mean * mean); - } - - private: - size_t count_; - size_t next_index_; - double sum_; // Sum(x) - double to avoid overflow - double sum_2_; // Sum(x*x) - double to avoid overflow - mutable T max_; - mutable bool max_stale_; - mutable T min_; - mutable bool min_stale_; - std::vector samples_; - - RTC_DISALLOW_COPY_AND_ASSIGN(RollingAccumulator); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_ROLLINGACCUMULATOR_H_ diff --git a/webrtc/rtc_base/rtccertificate.h b/webrtc/rtc_base/rtccertificate.h deleted file mode 100644 index e97ca73b88..0000000000 --- a/webrtc/rtc_base/rtccertificate.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2015 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_RTCCERTIFICATE_H_ -#define WEBRTC_RTC_BASE_RTCCERTIFICATE_H_ - -#include - -#include - -#include "webrtc/base/refcount.h" -#include "webrtc/base/scoped_ref_ptr.h" -#include "webrtc/base/sslidentity.h" - -namespace rtc { - -// This class contains PEM strings of an RTCCertificate's private key and -// certificate and acts as a text representation of RTCCertificate. Certificates -// can be serialized and deserialized to and from this format, which allows for -// cloning and storing of certificates to disk. The PEM format is that of -// |SSLIdentity::PrivateKeyToPEMString| and |SSLCertificate::ToPEMString|, e.g. -// the string representations used by OpenSSL. -class RTCCertificatePEM { - public: - RTCCertificatePEM( - const std::string& private_key, - const std::string& certificate) - : private_key_(private_key), - certificate_(certificate) {} - - const std::string& private_key() const { return private_key_; } - const std::string& certificate() const { return certificate_; } - - private: - std::string private_key_; - std::string certificate_; -}; - -// A thin abstraction layer between "lower level crypto stuff" like -// SSLCertificate and WebRTC usage. Takes ownership of some lower level objects, -// reference counting protects these from premature destruction. -class RTCCertificate : public RefCountInterface { - public: - // Takes ownership of |identity|. - static scoped_refptr Create( - std::unique_ptr identity); - - // Returns the expiration time in ms relative to epoch, 1970-01-01T00:00:00Z. - uint64_t Expires() const; - // Checks if the certificate has expired, where |now| is expressed in ms - // relative to epoch, 1970-01-01T00:00:00Z. - bool HasExpired(uint64_t now) const; - const SSLCertificate& ssl_certificate() const; - - // TODO(hbos): If possible, remove once RTCCertificate and its - // ssl_certificate() is used in all relevant places. Should not pass around - // raw SSLIdentity* for the sake of accessing SSLIdentity::certificate(). - // However, some places might need SSLIdentity* for its public/private key... - SSLIdentity* identity() const { return identity_.get(); } - - // To/from PEM, a text representation of the RTCCertificate. - RTCCertificatePEM ToPEM() const; - // Can return nullptr if the certificate is invalid. - static scoped_refptr FromPEM(const RTCCertificatePEM& pem); - bool operator==(const RTCCertificate& certificate) const; - bool operator!=(const RTCCertificate& certificate) const; - - protected: - explicit RTCCertificate(SSLIdentity* identity); - ~RTCCertificate() override; - - private: - // The SSLIdentity is the owner of the SSLCertificate. To protect our - // ssl_certificate() we take ownership of |identity_|. - std::unique_ptr identity_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_RTCCERTIFICATE_H_ diff --git a/webrtc/rtc_base/rtccertificategenerator.h b/webrtc/rtc_base/rtccertificategenerator.h deleted file mode 100644 index 783ed78ebf..0000000000 --- a/webrtc/rtc_base/rtccertificategenerator.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_RTCCERTIFICATEGENERATOR_H_ -#define WEBRTC_RTC_BASE_RTCCERTIFICATEGENERATOR_H_ - -#include "webrtc/base/optional.h" -#include "webrtc/base/refcount.h" -#include "webrtc/base/rtccertificate.h" -#include "webrtc/base/scoped_ref_ptr.h" -#include "webrtc/base/sslidentity.h" -#include "webrtc/base/thread.h" - -namespace rtc { - -// See |RTCCertificateGeneratorInterface::GenerateCertificateAsync|. -class RTCCertificateGeneratorCallback : public RefCountInterface { - public: - virtual void OnSuccess( - const scoped_refptr& certificate) = 0; - virtual void OnFailure() = 0; - - protected: - ~RTCCertificateGeneratorCallback() override {} -}; - -// Generates |RTCCertificate|s. -// See |RTCCertificateGenerator| for the WebRTC repo's implementation. -class RTCCertificateGeneratorInterface { - public: - virtual ~RTCCertificateGeneratorInterface() {} - - // Generates a certificate asynchronously on the worker thread. - // Must be called on the signaling thread. The |callback| is invoked with the - // result on the signaling thread. |exipres_ms| optionally specifies for how - // long we want the certificate to be valid, but the implementation may choose - // its own restrictions on the expiration time. - virtual void GenerateCertificateAsync( - const KeyParams& key_params, - const Optional& expires_ms, - const scoped_refptr& callback) = 0; -}; - -// Standard implementation of |RTCCertificateGeneratorInterface|. -// The static function |GenerateCertificate| generates a certificate on the -// current thread. The |RTCCertificateGenerator| instance generates certificates -// asynchronously on the worker thread with |GenerateCertificateAsync|. -class RTCCertificateGenerator : public RTCCertificateGeneratorInterface { - public: - // Generates a certificate on the current thread. Returns null on failure. - // If |expires_ms| is specified, the certificate will expire in approximately - // that many milliseconds from now. |expires_ms| is limited to a year, a - // larger value than that is clamped down to a year. If |expires_ms| is not - // specified, a default expiration time is used. - static scoped_refptr GenerateCertificate( - const KeyParams& key_params, - const Optional& expires_ms); - - RTCCertificateGenerator(Thread* signaling_thread, Thread* worker_thread); - ~RTCCertificateGenerator() override {} - - // |RTCCertificateGeneratorInterface| overrides. - // If |expires_ms| is specified, the certificate will expire in approximately - // that many milliseconds from now. |expires_ms| is limited to a year, a - // larger value than that is clamped down to a year. If |expires_ms| is not - // specified, a default expiration time is used. - void GenerateCertificateAsync( - const KeyParams& key_params, - const Optional& expires_ms, - const scoped_refptr& callback) override; - - private: - Thread* const signaling_thread_; - Thread* const worker_thread_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_RTCCERTIFICATEGENERATOR_H_ diff --git a/webrtc/rtc_base/safe_compare.h b/webrtc/rtc_base/safe_compare.h deleted file mode 100644 index 4eb11c24ba..0000000000 --- a/webrtc/rtc_base/safe_compare.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This file defines six constexpr functions: -// -// rtc::SafeEq // == -// rtc::SafeNe // != -// rtc::SafeLt // < -// rtc::SafeLe // <= -// rtc::SafeGt // > -// rtc::SafeGe // >= -// -// They each accept two arguments of arbitrary types, and in almost all cases, -// they simply call the appropriate comparison operator. However, if both -// arguments are integers, they don't compare them using C++'s quirky rules, -// but instead adhere to the true mathematical definitions. It is as if the -// arguments were first converted to infinite-range signed integers, and then -// compared, although of course nothing expensive like that actually takes -// place. In practice, for signed/signed and unsigned/unsigned comparisons and -// some mixed-signed comparisons with a compile-time constant, the overhead is -// zero; in the remaining cases, it is just a few machine instructions (no -// branches). - -#ifndef WEBRTC_RTC_BASE_SAFE_COMPARE_H_ -#define WEBRTC_RTC_BASE_SAFE_COMPARE_H_ - -#include -#include - -#include -#include - -#include "webrtc/base/type_traits.h" - -namespace rtc { - -namespace safe_cmp_impl { - -template -struct LargerIntImpl : std::false_type {}; -template <> -struct LargerIntImpl : std::true_type { - using type = int16_t; -}; -template <> -struct LargerIntImpl : std::true_type { - using type = int32_t; -}; -template <> -struct LargerIntImpl : std::true_type { - using type = int64_t; -}; - -// LargerInt::value is true iff there's a signed type that's larger -// than T1 (and no larger than the larger of T2 and int*, for performance -// reasons); and if there is such a type, LargerInt::type is an alias -// for it. -template -struct LargerInt - : LargerIntImpl {}; - -template -constexpr typename std::make_unsigned::type MakeUnsigned(T a) { - return static_cast::type>(a); -} - -// Overload for when both T1 and T2 have the same signedness. -template ::value == - std::is_signed::value>::type* = nullptr> -constexpr bool Cmp(T1 a, T2 b) { - return Op::Op(a, b); -} - -// Overload for signed - unsigned comparison that can be promoted to a bigger -// signed type. -template ::value && - std::is_unsigned::value && - LargerInt::value>::type* = nullptr> -constexpr bool Cmp(T1 a, T2 b) { - return Op::Op(a, static_cast::type>(b)); -} - -// Overload for unsigned - signed comparison that can be promoted to a bigger -// signed type. -template ::value && - std::is_signed::value && - LargerInt::value>::type* = nullptr> -constexpr bool Cmp(T1 a, T2 b) { - return Op::Op(static_cast::type>(a), b); -} - -// Overload for signed - unsigned comparison that can't be promoted to a bigger -// signed type. -template ::value && - std::is_unsigned::value && - !LargerInt::value>::type* = nullptr> -constexpr bool Cmp(T1 a, T2 b) { - return a < 0 ? Op::Op(-1, 0) : Op::Op(safe_cmp_impl::MakeUnsigned(a), b); -} - -// Overload for unsigned - signed comparison that can't be promoted to a bigger -// signed type. -template ::value && - std::is_signed::value && - !LargerInt::value>::type* = nullptr> -constexpr bool Cmp(T1 a, T2 b) { - return b < 0 ? Op::Op(0, -1) : Op::Op(a, safe_cmp_impl::MakeUnsigned(b)); -} - -#define RTC_SAFECMP_MAKE_OP(name, op) \ - struct name { \ - template \ - static constexpr bool Op(T1 a, T2 b) { \ - return a op b; \ - } \ - }; -RTC_SAFECMP_MAKE_OP(EqOp, ==) -RTC_SAFECMP_MAKE_OP(NeOp, !=) -RTC_SAFECMP_MAKE_OP(LtOp, <) -RTC_SAFECMP_MAKE_OP(LeOp, <=) -RTC_SAFECMP_MAKE_OP(GtOp, >) -RTC_SAFECMP_MAKE_OP(GeOp, >=) -#undef RTC_SAFECMP_MAKE_OP - -} // namespace safe_cmp_impl - -#define RTC_SAFECMP_MAKE_FUN(name) \ - template \ - constexpr \ - typename std::enable_if::value && IsIntlike::value, \ - bool>::type Safe##name(T1 a, T2 b) { \ - /* Unary plus here turns enums into real integral types. */ \ - return safe_cmp_impl::Cmp(+a, +b); \ - } \ - template \ - constexpr \ - typename std::enable_if::value || !IsIntlike::value, \ - bool>::type Safe##name(const T1& a, \ - const T2& b) { \ - return safe_cmp_impl::name##Op::Op(a, b); \ - } -RTC_SAFECMP_MAKE_FUN(Eq) -RTC_SAFECMP_MAKE_FUN(Ne) -RTC_SAFECMP_MAKE_FUN(Lt) -RTC_SAFECMP_MAKE_FUN(Le) -RTC_SAFECMP_MAKE_FUN(Gt) -RTC_SAFECMP_MAKE_FUN(Ge) -#undef RTC_SAFECMP_MAKE_FUN - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SAFE_COMPARE_H_ diff --git a/webrtc/rtc_base/safe_conversions.h b/webrtc/rtc_base/safe_conversions.h deleted file mode 100644 index f8d73e7bc9..0000000000 --- a/webrtc/rtc_base/safe_conversions.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2014 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/numerics/safe_conversions.h. - -#ifndef WEBRTC_RTC_BASE_SAFE_CONVERSIONS_H_ -#define WEBRTC_RTC_BASE_SAFE_CONVERSIONS_H_ - -#include - -#include "webrtc/base/checks.h" -#include "webrtc/base/safe_conversions_impl.h" - -namespace rtc { - -// Convenience function that returns true if the supplied value is in range -// for the destination type. -template -inline bool IsValueInRangeForNumericType(Src value) { - return internal::RangeCheck(value) == internal::TYPE_VALID; -} - -// checked_cast<> and dchecked_cast<> are analogous to static_cast<> for -// numeric types, except that they [D]CHECK that the specified numeric -// conversion will not overflow or underflow. NaN source will always trigger -// the [D]CHECK. -template -inline Dst checked_cast(Src value) { - RTC_CHECK(IsValueInRangeForNumericType(value)); - return static_cast(value); -} -template -inline Dst dchecked_cast(Src value) { - RTC_DCHECK(IsValueInRangeForNumericType(value)); - return static_cast(value); -} - -// saturated_cast<> is analogous to static_cast<> for numeric types, except -// that the specified numeric conversion will saturate rather than overflow or -// underflow. NaN assignment to an integral will trigger a RTC_CHECK condition. -template -inline Dst saturated_cast(Src value) { - // Optimization for floating point values, which already saturate. - if (std::numeric_limits::is_iec559) - return static_cast(value); - - switch (internal::RangeCheck(value)) { - case internal::TYPE_VALID: - return static_cast(value); - - case internal::TYPE_UNDERFLOW: - return std::numeric_limits::min(); - - case internal::TYPE_OVERFLOW: - return std::numeric_limits::max(); - - // Should fail only on attempting to assign NaN to a saturated integer. - case internal::TYPE_INVALID: - FATAL(); - return std::numeric_limits::max(); - } - - FATAL(); - return static_cast(value); -} - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SAFE_CONVERSIONS_H_ diff --git a/webrtc/rtc_base/safe_conversions_impl.h b/webrtc/rtc_base/safe_conversions_impl.h deleted file mode 100644 index ef116cd94c..0000000000 --- a/webrtc/rtc_base/safe_conversions_impl.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2014 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/numerics/safe_conversions_impl.h. - -#ifndef WEBRTC_RTC_BASE_SAFE_CONVERSIONS_IMPL_H_ -#define WEBRTC_RTC_BASE_SAFE_CONVERSIONS_IMPL_H_ - -#include - -namespace rtc { -namespace internal { - -enum DstSign { - DST_UNSIGNED, - DST_SIGNED -}; - -enum SrcSign { - SRC_UNSIGNED, - SRC_SIGNED -}; - -enum DstRange { - OVERLAPS_RANGE, - CONTAINS_RANGE -}; - -// Helper templates to statically determine if our destination type can contain -// all values represented by the source type. - -template ::is_signed ? - DST_SIGNED : DST_UNSIGNED, - SrcSign IsSrcSigned = std::numeric_limits::is_signed ? - SRC_SIGNED : SRC_UNSIGNED> -struct StaticRangeCheck {}; - -template -struct StaticRangeCheck { - typedef std::numeric_limits DstLimits; - typedef std::numeric_limits SrcLimits; - // Compare based on max_exponent, which we must compute for integrals. - static const size_t kDstMaxExponent = DstLimits::is_iec559 ? - DstLimits::max_exponent : - (sizeof(Dst) * 8 - 1); - static const size_t kSrcMaxExponent = SrcLimits::is_iec559 ? - SrcLimits::max_exponent : - (sizeof(Src) * 8 - 1); - static const DstRange value = kDstMaxExponent >= kSrcMaxExponent ? - CONTAINS_RANGE : OVERLAPS_RANGE; -}; - -template -struct StaticRangeCheck { - static const DstRange value = sizeof(Dst) >= sizeof(Src) ? - CONTAINS_RANGE : OVERLAPS_RANGE; -}; - -template -struct StaticRangeCheck { - typedef std::numeric_limits DstLimits; - typedef std::numeric_limits SrcLimits; - // Compare based on max_exponent, which we must compute for integrals. - static const size_t kDstMaxExponent = DstLimits::is_iec559 ? - DstLimits::max_exponent : - (sizeof(Dst) * 8 - 1); - static const size_t kSrcMaxExponent = sizeof(Src) * 8; - static const DstRange value = kDstMaxExponent >= kSrcMaxExponent ? - CONTAINS_RANGE : OVERLAPS_RANGE; -}; - -template -struct StaticRangeCheck { - static const DstRange value = OVERLAPS_RANGE; -}; - - -enum RangeCheckResult { - TYPE_VALID = 0, // Value can be represented by the destination type. - TYPE_UNDERFLOW = 1, // Value would overflow. - TYPE_OVERFLOW = 2, // Value would underflow. - TYPE_INVALID = 3 // Source value is invalid (i.e. NaN). -}; - -// This macro creates a RangeCheckResult from an upper and lower bound -// check by taking advantage of the fact that only NaN can be out of range in -// both directions at once. -#define BASE_NUMERIC_RANGE_CHECK_RESULT(is_in_upper_bound, is_in_lower_bound) \ - RangeCheckResult(((is_in_upper_bound) ? 0 : TYPE_OVERFLOW) | \ - ((is_in_lower_bound) ? 0 : TYPE_UNDERFLOW)) - -template ::is_signed ? - DST_SIGNED : DST_UNSIGNED, - SrcSign IsSrcSigned = std::numeric_limits::is_signed ? - SRC_SIGNED : SRC_UNSIGNED, - DstRange IsSrcRangeContained = StaticRangeCheck::value> -struct RangeCheckImpl {}; - -// The following templates are for ranges that must be verified at runtime. We -// split it into checks based on signedness to avoid confusing casts and -// compiler warnings on signed an unsigned comparisons. - -// Dst range always contains the result: nothing to check. -template -struct RangeCheckImpl { - static RangeCheckResult Check(Src value) { - return TYPE_VALID; - } -}; - -// Signed to signed narrowing. -template -struct RangeCheckImpl { - static RangeCheckResult Check(Src value) { - typedef std::numeric_limits DstLimits; - return DstLimits::is_iec559 ? - BASE_NUMERIC_RANGE_CHECK_RESULT( - value <= static_cast(DstLimits::max()), - value >= static_cast(DstLimits::max() * -1)) : - BASE_NUMERIC_RANGE_CHECK_RESULT( - value <= static_cast(DstLimits::max()), - value >= static_cast(DstLimits::min())); - } -}; - -// Unsigned to unsigned narrowing. -template -struct RangeCheckImpl { - static RangeCheckResult Check(Src value) { - typedef std::numeric_limits DstLimits; - return BASE_NUMERIC_RANGE_CHECK_RESULT( - value <= static_cast(DstLimits::max()), true); - } -}; - -// Unsigned to signed. -template -struct RangeCheckImpl { - static RangeCheckResult Check(Src value) { - typedef std::numeric_limits DstLimits; - return sizeof(Dst) > sizeof(Src) ? TYPE_VALID : - BASE_NUMERIC_RANGE_CHECK_RESULT( - value <= static_cast(DstLimits::max()), true); - } -}; - -// Signed to unsigned. -template -struct RangeCheckImpl { - static RangeCheckResult Check(Src value) { - typedef std::numeric_limits DstLimits; - typedef std::numeric_limits SrcLimits; - // Compare based on max_exponent, which we must compute for integrals. - static const size_t kDstMaxExponent = sizeof(Dst) * 8; - static const size_t kSrcMaxExponent = SrcLimits::is_iec559 ? - SrcLimits::max_exponent : - (sizeof(Src) * 8 - 1); - return (kDstMaxExponent >= kSrcMaxExponent) ? - BASE_NUMERIC_RANGE_CHECK_RESULT(true, value >= static_cast(0)) : - BASE_NUMERIC_RANGE_CHECK_RESULT( - value <= static_cast(DstLimits::max()), - value >= static_cast(0)); - } -}; - -template -inline RangeCheckResult RangeCheck(Src value) { - static_assert(std::numeric_limits::is_specialized, - "argument must be numeric"); - static_assert(std::numeric_limits::is_specialized, - "result must be numeric"); - return RangeCheckImpl::Check(value); -} - -} // namespace internal -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SAFE_CONVERSIONS_IMPL_H_ diff --git a/webrtc/rtc_base/safe_minmax.h b/webrtc/rtc_base/safe_minmax.h deleted file mode 100644 index bb60a3687b..0000000000 --- a/webrtc/rtc_base/safe_minmax.h +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright 2017 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Minimum and maximum -// =================== -// -// rtc::SafeMin(x, y) -// rtc::SafeMax(x, y) -// -// (These are both constexpr.) -// -// Accept two arguments of either any two integral or any two floating-point -// types, and return the smaller and larger value, respectively, with no -// truncation or wrap-around. If only one of the input types is statically -// guaranteed to be able to represent the result, the return type is that type; -// if either one would do, the result type is the smaller type. (One of these -// two cases always applies.) -// -// * The case with one floating-point and one integral type is not allowed, -// because the floating-point type will have greater range, but may not -// have sufficient precision to represent the integer value exactly.) -// -// Clamp (a.k.a. constrain to a given interval) -// ============================================ -// -// rtc::SafeClamp(x, a, b) -// -// Accepts three arguments of any mix of integral types or any mix of -// floating-point types, and returns the value in the closed interval [a, b] -// that is closest to x (that is, if x < a it returns a; if x > b it returns b; -// and if a <= x <= b it returns x). As for SafeMin() and SafeMax(), there is -// no truncation or wrap-around. The result type -// -// 1. is statically guaranteed to be able to represent the result; -// -// 2. is no larger than the largest of the three argument types; and -// -// 3. has the same signedness as the type of the third argument, if this is -// possible without violating the First or Second Law. -// -// There is always at least one type that meets criteria 1 and 2. If more than -// one type meets these criteria equally well, the result type is one of the -// types that is smallest. Note that unlike SafeMin() and SafeMax(), -// SafeClamp() will sometimes pick a return type that isn't the type of any of -// its arguments. -// -// * In this context, a type A is smaller than a type B if it has a smaller -// range; that is, if A::max() - A::min() < B::max() - B::min(). For -// example, int8_t < int16_t == uint16_t < int32_t, and all integral types -// are smaller than all floating-point types.) -// -// * As for SafeMin and SafeMax, mixing integer and floating-point arguments -// is not allowed, because floating-point types have greater range than -// integer types, but do not have sufficient precision to represent the -// values of most integer types exactly. -// -// Requesting a specific return type -// ================================= -// -// All three functions allow callers to explicitly specify the return type as a -// template parameter, overriding the default return type. E.g. -// -// rtc::SafeMin(x, y) // returns an int -// -// If the requested type is statically guaranteed to be able to represent the -// result, then everything's fine, and the return type is as requested. But if -// the requested type is too small, a static_assert is triggered. - -#ifndef WEBRTC_RTC_BASE_SAFE_MINMAX_H_ -#define WEBRTC_RTC_BASE_SAFE_MINMAX_H_ - -#include -#include - -#include "webrtc/base/checks.h" -#include "webrtc/base/safe_compare.h" -#include "webrtc/base/type_traits.h" - -namespace rtc { - -namespace safe_minmax_impl { - -// Make the range of a type available via something other than a constexpr -// function, to work around MSVC limitations. See -// https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expression-sfinae-in-vs-2015-update-1/ -template -struct Limits { - static constexpr T lowest = std::numeric_limits::lowest(); - static constexpr T max = std::numeric_limits::max(); -}; - -template ::value> -struct UnderlyingType; - -template -struct UnderlyingType { - using type = T; -}; - -template -struct UnderlyingType { - using type = typename std::underlying_type::type; -}; - -// Given two types T1 and T2, find types that can hold the smallest (in -// ::min_t) and the largest (in ::max_t) of the two values. -template ::value, - bool int2 = IsIntlike::value> -struct MType { - static_assert(int1 == int2, - "You may not mix integral and floating-point arguments"); -}; - -// Specialization for when neither type is integral (and therefore presumably -// floating-point). -template -struct MType { - using min_t = typename std::common_type::type; - static_assert(std::is_same::value || - std::is_same::value, - ""); - - using max_t = typename std::common_type::type; - static_assert(std::is_same::value || - std::is_same::value, - ""); -}; - -// Specialization for when both types are integral. -template -struct MType { - // The type with the lowest minimum value. In case of a tie, the type with - // the lowest maximum value. In case that too is a tie, the types have the - // same range, and we arbitrarily pick T1. - using min_t = typename std::conditional< - SafeLt(Limits::lowest, Limits::lowest), - T1, - typename std::conditional< - SafeGt(Limits::lowest, Limits::lowest), - T2, - typename std::conditional::max, Limits::max), - T1, - T2>::type>::type>::type; - static_assert(std::is_same::value || - std::is_same::value, - ""); - - // The type with the highest maximum value. In case of a tie, the types have - // the same range (because in C++, integer types with the same maximum also - // have the same minimum). - static_assert(SafeNe(Limits::max, Limits::max) || - SafeEq(Limits::lowest, Limits::lowest), - "integer types with the same max should have the same min"); - using max_t = typename std:: - conditional::max, Limits::max), T1, T2>::type; - static_assert(std::is_same::value || - std::is_same::value, - ""); -}; - -// A dummy type that we pass around at compile time but never actually use. -// Declared but not defined. -struct DefaultType; - -// ::type is A, except we fall back to B if A is DefaultType. We static_assert -// that the chosen type can hold all values that B can hold. -template -struct TypeOr { - using type = typename std:: - conditional::value, B, A>::type; - static_assert(SafeLe(Limits::lowest, Limits::lowest) && - SafeGe(Limits::max, Limits::max), - "The specified type isn't large enough"); - static_assert(IsIntlike::value == IsIntlike::value && - std::is_floating_point::value == - std::is_floating_point::value, - "float<->int conversions not allowed"); -}; - -} // namespace safe_minmax_impl - -template < - typename R = safe_minmax_impl::DefaultType, - typename T1 = safe_minmax_impl::DefaultType, - typename T2 = safe_minmax_impl::DefaultType, - typename R2 = typename safe_minmax_impl::TypeOr< - R, - typename safe_minmax_impl::MType< - typename safe_minmax_impl::UnderlyingType::type, - typename safe_minmax_impl::UnderlyingType::type>::min_t>::type> -constexpr R2 SafeMin(T1 a, T2 b) { - static_assert(IsIntlike::value || std::is_floating_point::value, - "The first argument must be integral or floating-point"); - static_assert(IsIntlike::value || std::is_floating_point::value, - "The second argument must be integral or floating-point"); - return SafeLt(a, b) ? static_cast(a) : static_cast(b); -} - -template < - typename R = safe_minmax_impl::DefaultType, - typename T1 = safe_minmax_impl::DefaultType, - typename T2 = safe_minmax_impl::DefaultType, - typename R2 = typename safe_minmax_impl::TypeOr< - R, - typename safe_minmax_impl::MType< - typename safe_minmax_impl::UnderlyingType::type, - typename safe_minmax_impl::UnderlyingType::type>::max_t>::type> -constexpr R2 SafeMax(T1 a, T2 b) { - static_assert(IsIntlike::value || std::is_floating_point::value, - "The first argument must be integral or floating-point"); - static_assert(IsIntlike::value || std::is_floating_point::value, - "The second argument must be integral or floating-point"); - return SafeGt(a, b) ? static_cast(a) : static_cast(b); -} - -namespace safe_minmax_impl { - -// Given three types T, L, and H, let ::type be a suitable return value for -// SafeClamp(T, L, H). See the docs at the top of this file for details. -template ::value, - bool int2 = IsIntlike::value, - bool int3 = IsIntlike::value> -struct ClampType { - static_assert(int1 == int2 && int1 == int3, - "You may not mix integral and floating-point arguments"); -}; - -// Specialization for when all three types are floating-point. -template -struct ClampType { - using type = typename std::common_type::type; -}; - -// Specialization for when all three types are integral. -template -struct ClampType { - private: - // Range of the return value. The return type must be able to represent this - // full range. - static constexpr auto r_min = - SafeMax(Limits::lowest, SafeMin(Limits::lowest, Limits::lowest)); - static constexpr auto r_max = - SafeMin(Limits::max, SafeMax(Limits::max, Limits::max)); - - // Is the given type an acceptable return type? (That is, can it represent - // all possible return values, and is it no larger than the largest of the - // input types?) - template - struct AcceptableType { - private: - static constexpr bool not_too_large = sizeof(A) <= sizeof(L) || - sizeof(A) <= sizeof(H) || - sizeof(A) <= sizeof(T); - static constexpr bool range_contained = - SafeLe(Limits::lowest, r_min) && SafeLe(r_max, Limits::max); - - public: - static constexpr bool value = not_too_large && range_contained; - }; - - using best_signed_type = typename std::conditional< - AcceptableType::value, - int8_t, - typename std::conditional< - AcceptableType::value, - int16_t, - typename std::conditional::value, - int32_t, - int64_t>::type>::type>::type; - - using best_unsigned_type = typename std::conditional< - AcceptableType::value, - uint8_t, - typename std::conditional< - AcceptableType::value, - uint16_t, - typename std::conditional::value, - uint32_t, - uint64_t>::type>::type>::type; - - public: - // Pick the best type, preferring the same signedness as T but falling back - // to the other one if necessary. - using type = typename std::conditional< - std::is_signed::value, - typename std::conditional::value, - best_signed_type, - best_unsigned_type>::type, - typename std::conditional::value, - best_unsigned_type, - best_signed_type>::type>::type; - static_assert(AcceptableType::value, ""); -}; - -} // namespace safe_minmax_impl - -template < - typename R = safe_minmax_impl::DefaultType, - typename T = safe_minmax_impl::DefaultType, - typename L = safe_minmax_impl::DefaultType, - typename H = safe_minmax_impl::DefaultType, - typename R2 = typename safe_minmax_impl::TypeOr< - R, - typename safe_minmax_impl::ClampType< - typename safe_minmax_impl::UnderlyingType::type, - typename safe_minmax_impl::UnderlyingType::type, - typename safe_minmax_impl::UnderlyingType::type>::type>::type> -R2 SafeClamp(T x, L min, H max) { - static_assert(IsIntlike::value || std::is_floating_point::value, - "The first argument must be integral or floating-point"); - static_assert(IsIntlike::value || std::is_floating_point::value, - "The second argument must be integral or floating-point"); - static_assert(IsIntlike::value || std::is_floating_point::value, - "The third argument must be integral or floating-point"); - RTC_DCHECK_LE(min, max); - return SafeLe(x, min) - ? static_cast(min) - : SafeGe(x, max) ? static_cast(max) : static_cast(x); -} - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SAFE_MINMAX_H_ diff --git a/webrtc/rtc_base/sanitizer.h b/webrtc/rtc_base/sanitizer.h deleted file mode 100644 index 49dc670fd1..0000000000 --- a/webrtc/rtc_base/sanitizer.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SANITIZER_H_ -#define WEBRTC_RTC_BASE_SANITIZER_H_ - -#if defined(__has_feature) -#if __has_feature(address_sanitizer) -#define RTC_HAS_ASAN 1 -#endif -#if __has_feature(memory_sanitizer) -#define RTC_HAS_MSAN 1 -#endif -#endif -#ifndef RTC_HAS_ASAN -#define RTC_HAS_ASAN 0 -#endif -#ifndef RTC_HAS_MSAN -#define RTC_HAS_MSAN 0 -#endif - -#if RTC_HAS_ASAN -#include -#endif -#if RTC_HAS_MSAN -#include -#endif - -#ifdef __has_attribute -#if __has_attribute(no_sanitize) -#define RTC_NO_SANITIZE(what) __attribute__((no_sanitize(what))) -#endif -#endif -#ifndef RTC_NO_SANITIZE -#define RTC_NO_SANITIZE(what) -#endif - -// Ask ASan to mark the memory range [ptr, ptr + element_size * num_elements) -// as being unaddressable, so that reads and writes are not allowed. ASan may -// narrow the range to the nearest alignment boundaries. -static inline void rtc_AsanPoison(const volatile void* ptr, - size_t element_size, - size_t num_elements) { -#if RTC_HAS_ASAN - ASAN_POISON_MEMORY_REGION(ptr, element_size * num_elements); -#endif -} - -// Ask ASan to mark the memory range [ptr, ptr + element_size * num_elements) -// as being addressable, so that reads and writes are allowed. ASan may widen -// the range to the nearest alignment boundaries. -static inline void rtc_AsanUnpoison(const volatile void* ptr, - size_t element_size, - size_t num_elements) { -#if RTC_HAS_ASAN - ASAN_UNPOISON_MEMORY_REGION(ptr, element_size * num_elements); -#endif -} - -// Ask MSan to mark the memory range [ptr, ptr + element_size * num_elements) -// as being uninitialized. -static inline void rtc_MsanMarkUninitialized(const volatile void* ptr, - size_t element_size, - size_t num_elements) { -#if RTC_HAS_MSAN - __msan_poison(ptr, element_size * num_elements); -#endif -} - -// Force an MSan check (if any bits in the memory range [ptr, ptr + -// element_size * num_elements) are uninitialized the call will crash with an -// MSan report). -static inline void rtc_MsanCheckInitialized(const volatile void* ptr, - size_t element_size, - size_t num_elements) { -#if RTC_HAS_MSAN - __msan_check_mem_is_initialized(ptr, element_size * num_elements); -#endif -} - -#ifdef __cplusplus - -namespace rtc { - -template -inline void AsanPoison(const T& mem) { - rtc_AsanPoison(mem.data(), sizeof(mem.data()[0]), mem.size()); -} - -template -inline void AsanUnpoison(const T& mem) { - rtc_AsanUnpoison(mem.data(), sizeof(mem.data()[0]), mem.size()); -} - -template -inline void MsanMarkUninitialized(const T& mem) { - rtc_MsanMarkUninitialized(mem.data(), sizeof(mem.data()[0]), mem.size()); -} - -template -inline void MsanCheckInitialized(const T& mem) { - rtc_MsanCheckInitialized(mem.data(), sizeof(mem.data()[0]), mem.size()); -} - -} // namespace rtc - -#endif // __cplusplus - -#endif // WEBRTC_RTC_BASE_SANITIZER_H_ diff --git a/webrtc/rtc_base/scoped_ref_ptr.h b/webrtc/rtc_base/scoped_ref_ptr.h deleted file mode 100644 index 69086dbc6c..0000000000 --- a/webrtc/rtc_base/scoped_ref_ptr.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2011 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Originally these classes are from Chromium. -// http://src.chromium.org/viewvc/chrome/trunk/src/base/memory/ref_counted.h?view=markup - -// -// A smart pointer class for reference counted objects. Use this class instead -// of calling AddRef and Release manually on a reference counted object to -// avoid common memory leaks caused by forgetting to Release an object -// reference. Sample usage: -// -// class MyFoo : public RefCounted { -// ... -// }; -// -// void some_function() { -// scoped_refptr foo = new MyFoo(); -// foo->Method(param); -// // |foo| is released when this function returns -// } -// -// void some_other_function() { -// scoped_refptr foo = new MyFoo(); -// ... -// foo = nullptr; // explicitly releases |foo| -// ... -// if (foo) -// foo->Method(param); -// } -// -// The above examples show how scoped_refptr acts like a pointer to T. -// Given two scoped_refptr classes, it is also possible to exchange -// references between the two objects, like so: -// -// { -// scoped_refptr a = new MyFoo(); -// scoped_refptr b; -// -// b.swap(a); -// // now, |b| references the MyFoo object, and |a| references null. -// } -// -// To make both |a| and |b| in the above example reference the same MyFoo -// object, simply use the assignment operator: -// -// { -// scoped_refptr a = new MyFoo(); -// scoped_refptr b; -// -// b = a; -// // now, |a| and |b| each own a reference to the same MyFoo object. -// } -// - -#ifndef WEBRTC_RTC_BASE_SCOPED_REF_PTR_H_ -#define WEBRTC_RTC_BASE_SCOPED_REF_PTR_H_ - -#include - -namespace rtc { - -template -class scoped_refptr { - public: - scoped_refptr() : ptr_(nullptr) {} - - scoped_refptr(T* p) : ptr_(p) { - if (ptr_) - ptr_->AddRef(); - } - - scoped_refptr(const scoped_refptr& r) : ptr_(r.ptr_) { - if (ptr_) - ptr_->AddRef(); - } - - template - scoped_refptr(const scoped_refptr& r) : ptr_(r.get()) { - if (ptr_) - ptr_->AddRef(); - } - - // Move constructors. - scoped_refptr(scoped_refptr&& r) : ptr_(r.release()) {} - - template - scoped_refptr(scoped_refptr&& r) : ptr_(r.release()) {} - - ~scoped_refptr() { - if (ptr_) - ptr_->Release(); - } - - T* get() const { return ptr_; } - operator T*() const { return ptr_; } - T* operator->() const { return ptr_; } - - // Release a pointer. - // The return value is the current pointer held by this object. - // If this object holds a null pointer, the return value is null. - // After this operation, this object will hold a null pointer, - // and will not own the object any more. - T* release() { - T* retVal = ptr_; - ptr_ = nullptr; - return retVal; - } - - scoped_refptr& operator=(T* p) { - // AddRef first so that self assignment should work - if (p) - p->AddRef(); - if (ptr_ ) - ptr_ ->Release(); - ptr_ = p; - return *this; - } - - scoped_refptr& operator=(const scoped_refptr& r) { - return *this = r.ptr_; - } - - template - scoped_refptr& operator=(const scoped_refptr& r) { - return *this = r.get(); - } - - scoped_refptr& operator=(scoped_refptr&& r) { - scoped_refptr(std::move(r)).swap(*this); - return *this; - } - - template - scoped_refptr& operator=(scoped_refptr&& r) { - scoped_refptr(std::move(r)).swap(*this); - return *this; - } - - void swap(T** pp) { - T* p = ptr_; - ptr_ = *pp; - *pp = p; - } - - void swap(scoped_refptr& r) { - swap(&r.ptr_); - } - - protected: - T* ptr_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SCOPED_REF_PTR_H_ diff --git a/webrtc/rtc_base/sequenced_task_checker.h b/webrtc/rtc_base/sequenced_task_checker.h deleted file mode 100644 index 5e127c7f41..0000000000 --- a/webrtc/rtc_base/sequenced_task_checker.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SEQUENCED_TASK_CHECKER_H_ -#define WEBRTC_RTC_BASE_SEQUENCED_TASK_CHECKER_H_ - -// Apart from debug builds, we also enable the sequence checker in -// builds with RTC_DCHECK_IS_ON so that trybots and waterfall bots -// with this define will get the same level of checking as debug bots. -#define ENABLE_SEQUENCED_TASK_CHECKER RTC_DCHECK_IS_ON - -#include "webrtc/base/checks.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/thread_annotations.h" -#include "webrtc/base/sequenced_task_checker_impl.h" - -namespace rtc { - -// Do nothing implementation, for use in release mode. -// -// Note: You should almost always use the SequencedTaskChecker class to get the -// right version for your build configuration. -class SequencedTaskCheckerDoNothing { - public: - bool CalledSequentially() const { return true; } - - void Detach() {} -}; - -// SequencedTaskChecker is a helper class used to help verify that some methods -// of a class are called on the same task queue or thread. A -// SequencedTaskChecker is bound to a a task queue if the object is -// created on a task queue, or a thread otherwise. -// -// -// Example: -// class MyClass { -// public: -// void Foo() { -// RTC_DCHECK(sequence_checker_.CalledSequentially()); -// ... (do stuff) ... -// } -// -// private: -// SequencedTaskChecker sequence_checker_; -// } -// -// In Release mode, CalledOnValidThread will always return true. -#if ENABLE_SEQUENCED_TASK_CHECKER -class LOCKABLE SequencedTaskChecker : public SequencedTaskCheckerImpl {}; -#else -class LOCKABLE SequencedTaskChecker : public SequencedTaskCheckerDoNothing {}; -#endif // ENABLE_SEQUENCED_TASK_CHECKER_H_ - -namespace internal { -class SCOPED_LOCKABLE SequencedTaskCheckerScope { - public: - explicit SequencedTaskCheckerScope(const SequencedTaskChecker* checker) - EXCLUSIVE_LOCK_FUNCTION(checker); - ~SequencedTaskCheckerScope() UNLOCK_FUNCTION(); -}; - -} // namespace internal - -#define RTC_DCHECK_CALLED_SEQUENTIALLY(x) \ - rtc::internal::SequencedTaskCheckerScope checker(x) - -#undef ENABLE_SEQUENCED_TASK_CHECKER - -} // namespace rtc -#endif // WEBRTC_RTC_BASE_SEQUENCED_TASK_CHECKER_H_ diff --git a/webrtc/rtc_base/sequenced_task_checker_impl.h b/webrtc/rtc_base/sequenced_task_checker_impl.h deleted file mode 100644 index 8b9ec4c86e..0000000000 --- a/webrtc/rtc_base/sequenced_task_checker_impl.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SEQUENCED_TASK_CHECKER_IMPL_H_ -#define WEBRTC_RTC_BASE_SEQUENCED_TASK_CHECKER_IMPL_H_ - -#include "webrtc/base/thread_checker.h" - -namespace rtc { - -class TaskQueue; -// Real implementation of SequencedTaskChecker, for use in debug mode, or -// for temporary use in release mode. -// -// Note: You should almost always use the SequencedTaskChecker class to get the -// right version for your build configuration. -class SequencedTaskCheckerImpl { - public: - SequencedTaskCheckerImpl(); - ~SequencedTaskCheckerImpl(); - - bool CalledSequentially() const; - - // Changes the task queue or thread that is checked for in IsCurrent. This - // may be useful when an object may be created on one task queue / thread and - // then used exclusively on another thread. - void Detach(); - - private: - typedef const void* QueueId; - CriticalSection lock_; - ThreadChecker thread_checker_; - mutable bool attached_; - mutable QueueId valid_queue_; -}; - -} // namespace rtc -#endif // WEBRTC_RTC_BASE_SEQUENCED_TASK_CHECKER_IMPL_H_ diff --git a/webrtc/rtc_base/sha1.h b/webrtc/rtc_base/sha1.h deleted file mode 100644 index e4db148321..0000000000 --- a/webrtc/rtc_base/sha1.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SHA-1 in C - * By Steve Reid - * 100% Public Domain - * -*/ - -// Ported to C++, Google style, under namespace rtc. - -#ifndef WEBRTC_RTC_BASE_SHA1_H_ -#define WEBRTC_RTC_BASE_SHA1_H_ - -#include -#include - -namespace rtc { - -struct SHA1_CTX { - uint32_t state[5]; - // TODO: Change bit count to uint64_t. - uint32_t count[2]; // Bit count of input. - uint8_t buffer[64]; -}; - -#define SHA1_DIGEST_SIZE 20 - -void SHA1Init(SHA1_CTX* context); -void SHA1Update(SHA1_CTX* context, const uint8_t* data, size_t len); -void SHA1Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SHA1_H_ diff --git a/webrtc/rtc_base/sha1digest.h b/webrtc/rtc_base/sha1digest.h deleted file mode 100644 index bcd5514b88..0000000000 --- a/webrtc/rtc_base/sha1digest.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2012 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SHA1DIGEST_H_ -#define WEBRTC_RTC_BASE_SHA1DIGEST_H_ - -#include "webrtc/base/messagedigest.h" -#include "webrtc/base/sha1.h" - -namespace rtc { - -// A simple wrapper for our SHA-1 implementation. -class Sha1Digest : public MessageDigest { - public: - enum { kSize = SHA1_DIGEST_SIZE }; - Sha1Digest() { - SHA1Init(&ctx_); - } - size_t Size() const override; - void Update(const void* buf, size_t len) override; - size_t Finish(void* buf, size_t len) override; - - private: - SHA1_CTX ctx_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SHA1DIGEST_H_ diff --git a/webrtc/rtc_base/signalthread.h b/webrtc/rtc_base/signalthread.h deleted file mode 100644 index bc8c98ea7d..0000000000 --- a/webrtc/rtc_base/signalthread.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SIGNALTHREAD_H_ -#define WEBRTC_RTC_BASE_SIGNALTHREAD_H_ - -#include - -#include "webrtc/base/checks.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/nullsocketserver.h" -#include "webrtc/base/sigslot.h" -#include "webrtc/base/thread.h" - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// -// SignalThread - Base class for worker threads. The main thread should call -// Start() to begin work, and then follow one of these models: -// Normal: Wait for SignalWorkDone, and then call Release to destroy. -// Cancellation: Call Release(true), to abort the worker thread. -// Fire-and-forget: Call Release(false), which allows the thread to run to -// completion, and then self-destruct without further notification. -// Periodic tasks: Wait for SignalWorkDone, then eventually call Start() -// again to repeat the task. When the instance isn't needed anymore, -// call Release. DoWork, OnWorkStart and OnWorkStop are called again, -// on a new thread. -// The subclass should override DoWork() to perform the background task. By -// periodically calling ContinueWork(), it can check for cancellation. -// OnWorkStart and OnWorkDone can be overridden to do pre- or post-work -// tasks in the context of the main thread. -/////////////////////////////////////////////////////////////////////////////// - -class SignalThread - : public sigslot::has_slots<>, - protected MessageHandler { - public: - explicit SignalThread(bool use_socket_server = true); - - // Context: Main Thread. Call before Start to change the worker's name. - bool SetName(const std::string& name, const void* obj); - - // Context: Main Thread. Call to begin the worker thread. - void Start(); - - // Context: Main Thread. If the worker thread is not running, deletes the - // object immediately. Otherwise, asks the worker thread to abort processing, - // and schedules the object to be deleted once the worker exits. - // SignalWorkDone will not be signalled. If wait is true, does not return - // until the thread is deleted. - void Destroy(bool wait); - - // Context: Main Thread. If the worker thread is complete, deletes the - // object immediately. Otherwise, schedules the object to be deleted once - // the worker thread completes. SignalWorkDone will be signalled. - void Release(); - - // Context: Main Thread. Signalled when work is complete. - sigslot::signal1 SignalWorkDone; - - enum { ST_MSG_WORKER_DONE, ST_MSG_FIRST_AVAILABLE }; - - protected: - ~SignalThread() override; - - Thread* worker() { return &worker_; } - - // Context: Main Thread. Subclass should override to do pre-work setup. - virtual void OnWorkStart() { } - - // Context: Worker Thread. Subclass should override to do work. - virtual void DoWork() = 0; - - // Context: Worker Thread. Subclass should call periodically to - // dispatch messages and determine if the thread should terminate. - bool ContinueWork(); - - // Context: Worker Thread. Subclass should override when extra work is - // needed to abort the worker thread. - virtual void OnWorkStop() { } - - // Context: Main Thread. Subclass should override to do post-work cleanup. - virtual void OnWorkDone() { } - - // Context: Any Thread. If subclass overrides, be sure to call the base - // implementation. Do not use (message_id < ST_MSG_FIRST_AVAILABLE) - void OnMessage(Message* msg) override; - - private: - enum State { - kInit, // Initialized, but not started - kRunning, // Started and doing work - kReleasing, // Same as running, but to be deleted when work is done - kComplete, // Work is done - kStopping, // Work is being interrupted - }; - - class Worker : public Thread { - public: - explicit Worker(SignalThread* parent, bool use_socket_server) - : Thread(use_socket_server - ? SocketServer::CreateDefault() - : std::unique_ptr(new NullSocketServer())), - parent_(parent) {} - ~Worker() override; - void Run() override; - bool IsProcessingMessages() override; - - private: - SignalThread* parent_; - - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Worker); - }; - - class SCOPED_LOCKABLE EnterExit { - public: - explicit EnterExit(SignalThread* t) EXCLUSIVE_LOCK_FUNCTION(t->cs_) - : t_(t) { - t_->cs_.Enter(); - // If refcount_ is zero then the object has already been deleted and we - // will be double-deleting it in ~EnterExit()! (shouldn't happen) - RTC_DCHECK_NE(0, t_->refcount_); - ++t_->refcount_; - } - ~EnterExit() UNLOCK_FUNCTION() { - bool d = (0 == --t_->refcount_); - t_->cs_.Leave(); - if (d) - delete t_; - } - - private: - SignalThread* t_; - - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EnterExit); - }; - - void Run(); - void OnMainThreadDestroyed(); - - Thread* main_; - Worker worker_; - CriticalSection cs_; - State state_; - int refcount_; - - RTC_DISALLOW_COPY_AND_ASSIGN(SignalThread); -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SIGNALTHREAD_H_ diff --git a/webrtc/rtc_base/sigslot.h b/webrtc/rtc_base/sigslot.h deleted file mode 100644 index 2981b52840..0000000000 --- a/webrtc/rtc_base/sigslot.h +++ /dev/null @@ -1,647 +0,0 @@ -// sigslot.h: Signal/Slot classes -// -// Written by Sarah Thompson (sarah@telergy.com) 2002. -// -// License: Public domain. You are free to use this code however you like, with -// the proviso that the author takes on no responsibility or liability for any -// use. -// -// QUICK DOCUMENTATION -// -// (see also the full documentation at http://sigslot.sourceforge.net/) -// -// #define switches -// SIGSLOT_PURE_ISO: -// Define this to force ISO C++ compliance. This also disables all of -// the thread safety support on platforms where it is available. -// -// SIGSLOT_USE_POSIX_THREADS: -// Force use of Posix threads when using a C++ compiler other than gcc -// on a platform that supports Posix threads. (When using gcc, this is -// the default - use SIGSLOT_PURE_ISO to disable this if necessary) -// -// SIGSLOT_DEFAULT_MT_POLICY: -// Where thread support is enabled, this defaults to -// multi_threaded_global. Otherwise, the default is single_threaded. -// #define this yourself to override the default. In pure ISO mode, -// anything other than single_threaded will cause a compiler error. -// -// PLATFORM NOTES -// -// Win32: -// On Win32, the WEBRTC_WIN symbol must be #defined. Most mainstream -// compilers do this by default, but you may need to define it yourself -// if your build environment is less standard. This causes the Win32 -// thread support to be compiled in and used automatically. -// -// Unix/Linux/BSD, etc.: -// If you're using gcc, it is assumed that you have Posix threads -// available, so they are used automatically. You can override this (as -// under Windows) with the SIGSLOT_PURE_ISO switch. If you're using -// something other than gcc but still want to use Posix threads, you -// need to #define SIGSLOT_USE_POSIX_THREADS. -// -// ISO C++: -// If none of the supported platforms are detected, or if -// SIGSLOT_PURE_ISO is defined, all multithreading support is turned -// off, along with any code that might cause a pure ISO C++ environment -// to complain. Before you ask, gcc -ansi -pedantic won't compile this -// library, but gcc -ansi is fine. Pedantic mode seems to throw a lot of -// errors that aren't really there. If you feel like investigating this, -// please contact the author. -// -// -// THREADING MODES -// -// single_threaded: -// Your program is assumed to be single threaded from the point of view -// of signal/slot usage (i.e. all objects using signals and slots are -// created and destroyed from a single thread). Behaviour if objects are -// destroyed concurrently is undefined (i.e. you'll get the occasional -// segmentation fault/memory exception). -// -// multi_threaded_global: -// Your program is assumed to be multi threaded. Objects using signals -// and slots can be safely created and destroyed from any thread, even -// when connections exist. In multi_threaded_global mode, this is -// achieved by a single global mutex (actually a critical section on -// Windows because they are faster). This option uses less OS resources, -// but results in more opportunities for contention, possibly resulting -// in more context switches than are strictly necessary. -// -// multi_threaded_local: -// Behaviour in this mode is essentially the same as -// multi_threaded_global, except that each signal, and each object that -// inherits has_slots, all have their own mutex/critical section. In -// practice, this means that mutex collisions (and hence context -// switches) only happen if they are absolutely essential. However, on -// some platforms, creating a lot of mutexes can slow down the whole OS, -// so use this option with care. -// -// USING THE LIBRARY -// -// See the full documentation at http://sigslot.sourceforge.net/ -// -// Libjingle specific: -// -// This file has been modified such that has_slots and signalx do not have to be -// using the same threading requirements. E.g. it is possible to connect a -// has_slots and signal0 or -// has_slots and signal0. -// If has_slots is single threaded the user must ensure that it is not trying -// to connect or disconnect to signalx concurrently or data race may occur. -// If signalx is single threaded the user must ensure that disconnect, connect -// or signal is not happening concurrently or data race may occur. - -#ifndef WEBRTC_RTC_BASE_SIGSLOT_H_ -#define WEBRTC_RTC_BASE_SIGSLOT_H_ - -#include -#include -#include -#include - -// On our copy of sigslot.h, we set single threading as default. -#define SIGSLOT_DEFAULT_MT_POLICY single_threaded - -#if defined(SIGSLOT_PURE_ISO) || \ - (!defined(WEBRTC_WIN) && !defined(__GNUG__) && \ - !defined(SIGSLOT_USE_POSIX_THREADS)) -#define _SIGSLOT_SINGLE_THREADED -#elif defined(WEBRTC_WIN) -#define _SIGSLOT_HAS_WIN32_THREADS -#if !defined(WIN32_LEAN_AND_MEAN) -#define WIN32_LEAN_AND_MEAN -#endif -#include "webrtc/base/win32.h" -#elif defined(__GNUG__) || defined(SIGSLOT_USE_POSIX_THREADS) -#define _SIGSLOT_HAS_POSIX_THREADS -#include -#else -#define _SIGSLOT_SINGLE_THREADED -#endif - -#ifndef SIGSLOT_DEFAULT_MT_POLICY -#ifdef _SIGSLOT_SINGLE_THREADED -#define SIGSLOT_DEFAULT_MT_POLICY single_threaded -#else -#define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local -#endif -#endif - -// TODO: change this namespace to rtc? -namespace sigslot { - -class single_threaded { - public: - void lock() {} - void unlock() {} -}; - -#ifdef _SIGSLOT_HAS_WIN32_THREADS -// The multi threading policies only get compiled in if they are enabled. -class multi_threaded_global { - public: - multi_threaded_global() { - static bool isinitialised = false; - - if (!isinitialised) { - InitializeCriticalSection(get_critsec()); - isinitialised = true; - } - } - - void lock() { EnterCriticalSection(get_critsec()); } - - void unlock() { LeaveCriticalSection(get_critsec()); } - - private: - CRITICAL_SECTION* get_critsec() { - static CRITICAL_SECTION g_critsec; - return &g_critsec; - } -}; - -class multi_threaded_local { - public: - multi_threaded_local() { InitializeCriticalSection(&m_critsec); } - - multi_threaded_local(const multi_threaded_local&) { - InitializeCriticalSection(&m_critsec); - } - - ~multi_threaded_local() { DeleteCriticalSection(&m_critsec); } - - void lock() { EnterCriticalSection(&m_critsec); } - - void unlock() { LeaveCriticalSection(&m_critsec); } - - private: - CRITICAL_SECTION m_critsec; -}; -#endif // _SIGSLOT_HAS_WIN32_THREADS - -#ifdef _SIGSLOT_HAS_POSIX_THREADS -// The multi threading policies only get compiled in if they are enabled. -class multi_threaded_global { - public: - void lock() { pthread_mutex_lock(get_mutex()); } - void unlock() { pthread_mutex_unlock(get_mutex()); } - - private: - static pthread_mutex_t* get_mutex(); -}; - -class multi_threaded_local { - public: - multi_threaded_local() { pthread_mutex_init(&m_mutex, nullptr); } - multi_threaded_local(const multi_threaded_local&) { - pthread_mutex_init(&m_mutex, nullptr); - } - ~multi_threaded_local() { pthread_mutex_destroy(&m_mutex); } - void lock() { pthread_mutex_lock(&m_mutex); } - void unlock() { pthread_mutex_unlock(&m_mutex); } - - private: - pthread_mutex_t m_mutex; -}; -#endif // _SIGSLOT_HAS_POSIX_THREADS - -template -class lock_block { - public: - mt_policy* m_mutex; - - lock_block(mt_policy* mtx) : m_mutex(mtx) { m_mutex->lock(); } - - ~lock_block() { m_mutex->unlock(); } -}; - -class _signal_base_interface; - -class has_slots_interface { - private: - typedef void (*signal_connect_t)(has_slots_interface* self, - _signal_base_interface* sender); - typedef void (*signal_disconnect_t)(has_slots_interface* self, - _signal_base_interface* sender); - typedef void (*disconnect_all_t)(has_slots_interface* self); - - const signal_connect_t m_signal_connect; - const signal_disconnect_t m_signal_disconnect; - const disconnect_all_t m_disconnect_all; - - protected: - has_slots_interface(signal_connect_t conn, - signal_disconnect_t disc, - disconnect_all_t disc_all) - : m_signal_connect(conn), - m_signal_disconnect(disc), - m_disconnect_all(disc_all) {} - - // Doesn't really need to be virtual, but is for backwards compatibility - // (it was virtual in a previous version of sigslot). - virtual ~has_slots_interface() {} - - public: - void signal_connect(_signal_base_interface* sender) { - m_signal_connect(this, sender); - } - - void signal_disconnect(_signal_base_interface* sender) { - m_signal_disconnect(this, sender); - } - - void disconnect_all() { m_disconnect_all(this); } -}; - -class _signal_base_interface { - private: - typedef void (*slot_disconnect_t)(_signal_base_interface* self, - has_slots_interface* pslot); - typedef void (*slot_duplicate_t)(_signal_base_interface* self, - const has_slots_interface* poldslot, - has_slots_interface* pnewslot); - - const slot_disconnect_t m_slot_disconnect; - const slot_duplicate_t m_slot_duplicate; - - protected: - _signal_base_interface(slot_disconnect_t disc, slot_duplicate_t dupl) - : m_slot_disconnect(disc), m_slot_duplicate(dupl) {} - - ~_signal_base_interface() {} - - public: - void slot_disconnect(has_slots_interface* pslot) { - m_slot_disconnect(this, pslot); - } - - void slot_duplicate(const has_slots_interface* poldslot, - has_slots_interface* pnewslot) { - m_slot_duplicate(this, poldslot, pnewslot); - } -}; - -class _opaque_connection { - private: - typedef void (*emit_t)(const _opaque_connection*); - template - union union_caster { - FromT from; - ToT to; - }; - - emit_t pemit; - has_slots_interface* pdest; - // Pointers to member functions may be up to 16 bytes for virtual classes, - // so make sure we have enough space to store it. - unsigned char pmethod[16]; - - public: - template - _opaque_connection(DestT* pd, void (DestT::*pm)(Args...)) : pdest(pd) { - typedef void (DestT::*pm_t)(Args...); - static_assert(sizeof(pm_t) <= sizeof(pmethod), - "Size of slot function pointer too large."); - - std::memcpy(pmethod, &pm, sizeof(pm_t)); - - typedef void (*em_t)(const _opaque_connection* self, Args...); - union_caster caster2; - caster2.from = &_opaque_connection::emitter; - pemit = caster2.to; - } - - has_slots_interface* getdest() const { return pdest; } - - _opaque_connection duplicate(has_slots_interface* newtarget) const { - _opaque_connection res = *this; - res.pdest = newtarget; - return res; - } - - // Just calls the stored "emitter" function pointer stored at construction - // time. - template - void emit(Args... args) const { - typedef void (*em_t)(const _opaque_connection*, Args...); - union_caster caster; - caster.from = pemit; - (caster.to)(this, args...); - } - - private: - template - static void emitter(const _opaque_connection* self, Args... args) { - typedef void (DestT::*pm_t)(Args...); - pm_t pm; - std::memcpy(&pm, self->pmethod, sizeof(pm_t)); - (static_cast(self->pdest)->*(pm))(args...); - } -}; - -template -class _signal_base : public _signal_base_interface, public mt_policy { - protected: - typedef std::list<_opaque_connection> connections_list; - - _signal_base() - : _signal_base_interface(&_signal_base::do_slot_disconnect, - &_signal_base::do_slot_duplicate), - m_current_iterator(m_connected_slots.end()) {} - - ~_signal_base() { disconnect_all(); } - - private: - _signal_base& operator=(_signal_base const& that); - - public: - _signal_base(const _signal_base& o) - : _signal_base_interface(&_signal_base::do_slot_disconnect, - &_signal_base::do_slot_duplicate), - m_current_iterator(m_connected_slots.end()) { - lock_block lock(this); - for (const auto& connection : o.m_connected_slots) { - connection.getdest()->signal_connect(this); - m_connected_slots.push_back(connection); - } - } - - bool is_empty() { - lock_block lock(this); - return m_connected_slots.empty(); - } - - void disconnect_all() { - lock_block lock(this); - - while (!m_connected_slots.empty()) { - has_slots_interface* pdest = m_connected_slots.front().getdest(); - m_connected_slots.pop_front(); - pdest->signal_disconnect(static_cast<_signal_base_interface*>(this)); - } - // If disconnect_all is called while the signal is firing, advance the - // current slot iterator to the end to avoid an invalidated iterator from - // being dereferenced. - m_current_iterator = m_connected_slots.end(); - } - -#if !defined(NDEBUG) - bool connected(has_slots_interface* pclass) { - lock_block lock(this); - connections_list::const_iterator it = m_connected_slots.begin(); - connections_list::const_iterator itEnd = m_connected_slots.end(); - while (it != itEnd) { - if (it->getdest() == pclass) - return true; - ++it; - } - return false; - } -#endif - - void disconnect(has_slots_interface* pclass) { - lock_block lock(this); - connections_list::iterator it = m_connected_slots.begin(); - connections_list::iterator itEnd = m_connected_slots.end(); - - while (it != itEnd) { - if (it->getdest() == pclass) { - // If we're currently using this iterator because the signal is firing, - // advance it to avoid it being invalidated. - if (m_current_iterator == it) { - m_current_iterator = m_connected_slots.erase(it); - } else { - m_connected_slots.erase(it); - } - pclass->signal_disconnect(static_cast<_signal_base_interface*>(this)); - return; - } - ++it; - } - } - - private: - static void do_slot_disconnect(_signal_base_interface* p, - has_slots_interface* pslot) { - _signal_base* const self = static_cast<_signal_base*>(p); - lock_block lock(self); - connections_list::iterator it = self->m_connected_slots.begin(); - connections_list::iterator itEnd = self->m_connected_slots.end(); - - while (it != itEnd) { - connections_list::iterator itNext = it; - ++itNext; - - if (it->getdest() == pslot) { - // If we're currently using this iterator because the signal is firing, - // advance it to avoid it being invalidated. - if (self->m_current_iterator == it) { - self->m_current_iterator = self->m_connected_slots.erase(it); - } else { - self->m_connected_slots.erase(it); - } - } - - it = itNext; - } - } - - static void do_slot_duplicate(_signal_base_interface* p, - const has_slots_interface* oldtarget, - has_slots_interface* newtarget) { - _signal_base* const self = static_cast<_signal_base*>(p); - lock_block lock(self); - connections_list::iterator it = self->m_connected_slots.begin(); - connections_list::iterator itEnd = self->m_connected_slots.end(); - - while (it != itEnd) { - if (it->getdest() == oldtarget) { - self->m_connected_slots.push_back(it->duplicate(newtarget)); - } - - ++it; - } - } - - protected: - connections_list m_connected_slots; - - // Used to handle a slot being disconnected while a signal is - // firing (iterating m_connected_slots). - connections_list::iterator m_current_iterator; - bool m_erase_current_iterator = false; -}; - -template -class has_slots : public has_slots_interface, public mt_policy { - private: - typedef std::set<_signal_base_interface*> sender_set; - typedef sender_set::const_iterator const_iterator; - - public: - has_slots() - : has_slots_interface(&has_slots::do_signal_connect, - &has_slots::do_signal_disconnect, - &has_slots::do_disconnect_all) {} - - has_slots(has_slots const& o) - : has_slots_interface(&has_slots::do_signal_connect, - &has_slots::do_signal_disconnect, - &has_slots::do_disconnect_all) { - lock_block lock(this); - for (auto* sender : o.m_senders) { - sender->slot_duplicate(&o, this); - m_senders.insert(sender); - } - } - - ~has_slots() { this->disconnect_all(); } - - private: - has_slots& operator=(has_slots const&); - - static void do_signal_connect(has_slots_interface* p, - _signal_base_interface* sender) { - has_slots* const self = static_cast(p); - lock_block lock(self); - self->m_senders.insert(sender); - } - - static void do_signal_disconnect(has_slots_interface* p, - _signal_base_interface* sender) { - has_slots* const self = static_cast(p); - lock_block lock(self); - self->m_senders.erase(sender); - } - - static void do_disconnect_all(has_slots_interface* p) { - has_slots* const self = static_cast(p); - lock_block lock(self); - while (!self->m_senders.empty()) { - std::set<_signal_base_interface*> senders; - senders.swap(self->m_senders); - const_iterator it = senders.begin(); - const_iterator itEnd = senders.end(); - - while (it != itEnd) { - _signal_base_interface* s = *it; - ++it; - s->slot_disconnect(p); - } - } - } - - private: - sender_set m_senders; -}; - -template -class signal_with_thread_policy : public _signal_base { - private: - typedef _signal_base base; - - protected: - typedef typename base::connections_list connections_list; - - public: - signal_with_thread_policy() {} - - template - void connect(desttype* pclass, void (desttype::*pmemfun)(Args...)) { - lock_block lock(this); - this->m_connected_slots.push_back(_opaque_connection(pclass, pmemfun)); - pclass->signal_connect(static_cast<_signal_base_interface*>(this)); - } - - void emit(Args... args) { - lock_block lock(this); - this->m_current_iterator = this->m_connected_slots.begin(); - while (this->m_current_iterator != this->m_connected_slots.end()) { - _opaque_connection const& conn = *this->m_current_iterator; - ++(this->m_current_iterator); - conn.emit(args...); - } - } - - void operator()(Args... args) { emit(args...); } -}; - -// Alias with default thread policy. Needed because both default arguments -// and variadic template arguments must go at the end of the list, so we -// can't have both at once. -template -using signal = signal_with_thread_policy; - -// The previous verion of sigslot didn't use variadic templates, so you would -// need to write "sigslot::signal2", for example. -// Now you can just write "sigslot::signal", but these aliases -// exist for backwards compatibility. -template -using signal0 = signal_with_thread_policy; - -template -using signal1 = signal_with_thread_policy; - -template -using signal2 = signal_with_thread_policy; - -template -using signal3 = signal_with_thread_policy; - -template -using signal4 = signal_with_thread_policy; - -template -using signal5 = signal_with_thread_policy; - -template -using signal6 = signal_with_thread_policy; - -template -using signal7 = - signal_with_thread_policy; - -template -using signal8 = - signal_with_thread_policy; - -} // namespace sigslot - -#endif // WEBRTC_RTC_BASE_SIGSLOT_H_ diff --git a/webrtc/rtc_base/sigslottester.h b/webrtc/rtc_base/sigslottester.h deleted file mode 100755 index 5eeb477a77..0000000000 --- a/webrtc/rtc_base/sigslottester.h +++ /dev/null @@ -1,216 +0,0 @@ -// This file was GENERATED by command: -// pump.py sigslottester.h.pump -// DO NOT EDIT BY HAND!!! - -/* - * Copyright 2014 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SIGSLOTTESTER_H_ -#define WEBRTC_RTC_BASE_SIGSLOTTESTER_H_ - -// To generate sigslottester.h from sigslottester.h.pump, execute: -// /home/build/google3/third_party/gtest/scripts/pump.py sigslottester.h.pump - - -// SigslotTester(s) are utility classes to check if signals owned by an -// object are being invoked at the right time and with the right arguments. -// They are meant to be used in tests. Tests must provide "capture" pointers -// (i.e. address of variables) where the arguments from the signal callback -// can be stored. -// -// Example: -// /* Some signal */ -// sigslot::signal1 foo; -// -// /* We want to monitor foo in some test. Note how signal argument is -// const std::string&, but capture-type is std::string. Capture type -// must be type that can be assigned to. */ -// std::string capture; -// SigslotTester1 slot(&foo, &capture); -// foo.emit("hello"); -// EXPECT_EQ(1, slot.callback_count()); -// EXPECT_EQ("hello", capture); -// /* See unit-tests for more examples */ - -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/sigslot.h" - -namespace rtc { - -// Base version for testing signals that passes no arguments. -class SigslotTester0 : public sigslot::has_slots<> { - public: - explicit SigslotTester0(sigslot::signal0<>* signal) : callback_count_(0) { - signal->connect(this, &SigslotTester0::OnSignalCallback); - } - - int callback_count() const { return callback_count_; } - - private: - void OnSignalCallback() { callback_count_++; } - int callback_count_; - - RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester0); -}; - -// Versions below are for testing signals that pass arguments. For all the -// templates below: -// - A1-A5 is the type of the argument i in the callback. Signals may and often -// do use const-references here for efficiency. -// - C1-C5 is the type of the variable to capture argument i. These should be -// non-const value types suitable for use as lvalues. - -template -class SigslotTester1 : public sigslot::has_slots<> { - public: - SigslotTester1(sigslot::signal1* signal, - C1* capture1) - : callback_count_(0), - capture1_(capture1) { - signal->connect(this, &SigslotTester1::OnSignalCallback); - } - - int callback_count() const { return callback_count_; } - - private: - void OnSignalCallback(A1 arg1) { - callback_count_++; - *capture1_ = arg1; - } - - int callback_count_; - C1* capture1_; - - RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester1); -}; - -template -class SigslotTester2 : public sigslot::has_slots<> { - public: - SigslotTester2(sigslot::signal2* signal, - C1* capture1, C2* capture2) - : callback_count_(0), - capture1_(capture1), capture2_(capture2) { - signal->connect(this, &SigslotTester2::OnSignalCallback); - } - - int callback_count() const { return callback_count_; } - - private: - void OnSignalCallback(A1 arg1, A2 arg2) { - callback_count_++; - *capture1_ = arg1; - *capture2_ = arg2; - } - - int callback_count_; - C1* capture1_; - C2* capture2_; - - RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester2); -}; - -template -class SigslotTester3 : public sigslot::has_slots<> { - public: - SigslotTester3(sigslot::signal3* signal, - C1* capture1, C2* capture2, C3* capture3) - : callback_count_(0), - capture1_(capture1), capture2_(capture2), capture3_(capture3) { - signal->connect(this, &SigslotTester3::OnSignalCallback); - } - - int callback_count() const { return callback_count_; } - - private: - void OnSignalCallback(A1 arg1, A2 arg2, A3 arg3) { - callback_count_++; - *capture1_ = arg1; - *capture2_ = arg2; - *capture3_ = arg3; - } - - int callback_count_; - C1* capture1_; - C2* capture2_; - C3* capture3_; - - RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester3); -}; - -template -class SigslotTester4 : public sigslot::has_slots<> { - public: - SigslotTester4(sigslot::signal4* signal, - C1* capture1, C2* capture2, C3* capture3, C4* capture4) - : callback_count_(0), - capture1_(capture1), capture2_(capture2), capture3_(capture3), - capture4_(capture4) { - signal->connect(this, &SigslotTester4::OnSignalCallback); - } - - int callback_count() const { return callback_count_; } - - private: - void OnSignalCallback(A1 arg1, A2 arg2, A3 arg3, A4 arg4) { - callback_count_++; - *capture1_ = arg1; - *capture2_ = arg2; - *capture3_ = arg3; - *capture4_ = arg4; - } - - int callback_count_; - C1* capture1_; - C2* capture2_; - C3* capture3_; - C4* capture4_; - - RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester4); -}; - -template -class SigslotTester5 : public sigslot::has_slots<> { - public: - SigslotTester5(sigslot::signal5* signal, - C1* capture1, C2* capture2, C3* capture3, C4* capture4, - C5* capture5) - : callback_count_(0), - capture1_(capture1), capture2_(capture2), capture3_(capture3), - capture4_(capture4), capture5_(capture5) { - signal->connect(this, &SigslotTester5::OnSignalCallback); - } - - int callback_count() const { return callback_count_; } - - private: - void OnSignalCallback(A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5) { - callback_count_++; - *capture1_ = arg1; - *capture2_ = arg2; - *capture3_ = arg3; - *capture4_ = arg4; - *capture5_ = arg5; - } - - int callback_count_; - C1* capture1_; - C2* capture2_; - C3* capture3_; - C4* capture4_; - C5* capture5_; - - RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester5); -}; -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SIGSLOTTESTER_H_ diff --git a/webrtc/rtc_base/socket.h b/webrtc/rtc_base/socket.h deleted file mode 100644 index 9aed77e3b2..0000000000 --- a/webrtc/rtc_base/socket.h +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SOCKET_H_ -#define WEBRTC_RTC_BASE_SOCKET_H_ - -#include - -#if defined(WEBRTC_POSIX) -#include -#include -#include -#include -#define SOCKET_EACCES EACCES -#endif - -#if defined(WEBRTC_WIN) -#include "webrtc/base/win32.h" -#endif - -#include "webrtc/base/basictypes.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/socketaddress.h" - -// Rather than converting errors into a private namespace, -// Reuse the POSIX socket api errors. Note this depends on -// Win32 compatibility. - -#if defined(WEBRTC_WIN) -#undef EWOULDBLOCK // Remove errno.h's definition for each macro below. -#define EWOULDBLOCK WSAEWOULDBLOCK -#undef EINPROGRESS -#define EINPROGRESS WSAEINPROGRESS -#undef EALREADY -#define EALREADY WSAEALREADY -#undef ENOTSOCK -#define ENOTSOCK WSAENOTSOCK -#undef EDESTADDRREQ -#define EDESTADDRREQ WSAEDESTADDRREQ -#undef EMSGSIZE -#define EMSGSIZE WSAEMSGSIZE -#undef EPROTOTYPE -#define EPROTOTYPE WSAEPROTOTYPE -#undef ENOPROTOOPT -#define ENOPROTOOPT WSAENOPROTOOPT -#undef EPROTONOSUPPORT -#define EPROTONOSUPPORT WSAEPROTONOSUPPORT -#undef ESOCKTNOSUPPORT -#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -#undef EOPNOTSUPP -#define EOPNOTSUPP WSAEOPNOTSUPP -#undef EPFNOSUPPORT -#define EPFNOSUPPORT WSAEPFNOSUPPORT -#undef EAFNOSUPPORT -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#undef EADDRINUSE -#define EADDRINUSE WSAEADDRINUSE -#undef EADDRNOTAVAIL -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL -#undef ENETDOWN -#define ENETDOWN WSAENETDOWN -#undef ENETUNREACH -#define ENETUNREACH WSAENETUNREACH -#undef ENETRESET -#define ENETRESET WSAENETRESET -#undef ECONNABORTED -#define ECONNABORTED WSAECONNABORTED -#undef ECONNRESET -#define ECONNRESET WSAECONNRESET -#undef ENOBUFS -#define ENOBUFS WSAENOBUFS -#undef EISCONN -#define EISCONN WSAEISCONN -#undef ENOTCONN -#define ENOTCONN WSAENOTCONN -#undef ESHUTDOWN -#define ESHUTDOWN WSAESHUTDOWN -#undef ETOOMANYREFS -#define ETOOMANYREFS WSAETOOMANYREFS -#undef ETIMEDOUT -#define ETIMEDOUT WSAETIMEDOUT -#undef ECONNREFUSED -#define ECONNREFUSED WSAECONNREFUSED -#undef ELOOP -#define ELOOP WSAELOOP -#undef ENAMETOOLONG -#define ENAMETOOLONG WSAENAMETOOLONG -#undef EHOSTDOWN -#define EHOSTDOWN WSAEHOSTDOWN -#undef EHOSTUNREACH -#define EHOSTUNREACH WSAEHOSTUNREACH -#undef ENOTEMPTY -#define ENOTEMPTY WSAENOTEMPTY -#undef EPROCLIM -#define EPROCLIM WSAEPROCLIM -#undef EUSERS -#define EUSERS WSAEUSERS -#undef EDQUOT -#define EDQUOT WSAEDQUOT -#undef ESTALE -#define ESTALE WSAESTALE -#undef EREMOTE -#define EREMOTE WSAEREMOTE -#undef EACCES -#define SOCKET_EACCES WSAEACCES -#endif // WEBRTC_WIN - -#if defined(WEBRTC_POSIX) -#define INVALID_SOCKET (-1) -#define SOCKET_ERROR (-1) -#define closesocket(s) close(s) -#endif // WEBRTC_POSIX - -namespace rtc { - -inline bool IsBlockingError(int e) { - return (e == EWOULDBLOCK) || (e == EAGAIN) || (e == EINPROGRESS); -} - -struct SentPacket { - SentPacket() : packet_id(-1), send_time_ms(-1) {} - SentPacket(int packet_id, int64_t send_time_ms) - : packet_id(packet_id), send_time_ms(send_time_ms) {} - - int packet_id; - int64_t send_time_ms; -}; - -// General interface for the socket implementations of various networks. The -// methods match those of normal UNIX sockets very closely. -class Socket { - public: - virtual ~Socket() {} - - // Returns the address to which the socket is bound. If the socket is not - // bound, then the any-address is returned. - virtual SocketAddress GetLocalAddress() const = 0; - - // Returns the address to which the socket is connected. If the socket is - // not connected, then the any-address is returned. - virtual SocketAddress GetRemoteAddress() const = 0; - - virtual int Bind(const SocketAddress& addr) = 0; - virtual int Connect(const SocketAddress& addr) = 0; - virtual int Send(const void *pv, size_t cb) = 0; - virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr) = 0; - // |timestamp| is in units of microseconds. - virtual int Recv(void* pv, size_t cb, int64_t* timestamp) = 0; - virtual int RecvFrom(void* pv, - size_t cb, - SocketAddress* paddr, - int64_t* timestamp) = 0; - virtual int Listen(int backlog) = 0; - virtual Socket *Accept(SocketAddress *paddr) = 0; - virtual int Close() = 0; - virtual int GetError() const = 0; - virtual void SetError(int error) = 0; - inline bool IsBlocking() const { return IsBlockingError(GetError()); } - - enum ConnState { - CS_CLOSED, - CS_CONNECTING, - CS_CONNECTED - }; - virtual ConnState GetState() const = 0; - - enum Option { - OPT_DONTFRAGMENT, - OPT_RCVBUF, // receive buffer size - OPT_SNDBUF, // send buffer size - OPT_NODELAY, // whether Nagle algorithm is enabled - OPT_IPV6_V6ONLY, // Whether the socket is IPv6 only. - OPT_DSCP, // DSCP code - OPT_RTP_SENDTIME_EXTN_ID, // This is a non-traditional socket option param. - // This is specific to libjingle and will be used - // if SendTime option is needed at socket level. - }; - virtual int GetOption(Option opt, int* value) = 0; - virtual int SetOption(Option opt, int value) = 0; - - protected: - Socket() {} - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(Socket); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SOCKET_H_ diff --git a/webrtc/rtc_base/socket_unittest.h b/webrtc/rtc_base/socket_unittest.h deleted file mode 100644 index a92c7fdc4e..0000000000 --- a/webrtc/rtc_base/socket_unittest.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2009 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SOCKET_UNITTEST_H_ -#define WEBRTC_RTC_BASE_SOCKET_UNITTEST_H_ - -#include "webrtc/base/gunit.h" -#include "webrtc/base/thread.h" - -namespace rtc { - -// Generic socket tests, to be used when testing individual socketservers. -// Derive your specific test class from SocketTest, install your -// socketserver, and call the SocketTest test methods. -class SocketTest : public testing::Test { - protected: - SocketTest() : kIPv4Loopback(INADDR_LOOPBACK), - kIPv6Loopback(in6addr_loopback), - ss_(nullptr) {} - virtual void SetUp() { ss_ = Thread::Current()->socketserver(); } - void TestConnectIPv4(); - void TestConnectIPv6(); - void TestConnectWithDnsLookupIPv4(); - void TestConnectWithDnsLookupIPv6(); - void TestConnectFailIPv4(); - void TestConnectFailIPv6(); - void TestConnectWithDnsLookupFailIPv4(); - void TestConnectWithDnsLookupFailIPv6(); - void TestConnectWithClosedSocketIPv4(); - void TestConnectWithClosedSocketIPv6(); - void TestConnectWhileNotClosedIPv4(); - void TestConnectWhileNotClosedIPv6(); - void TestServerCloseDuringConnectIPv4(); - void TestServerCloseDuringConnectIPv6(); - void TestClientCloseDuringConnectIPv4(); - void TestClientCloseDuringConnectIPv6(); - void TestServerCloseIPv4(); - void TestServerCloseIPv6(); - void TestCloseInClosedCallbackIPv4(); - void TestCloseInClosedCallbackIPv6(); - void TestSocketServerWaitIPv4(); - void TestSocketServerWaitIPv6(); - void TestTcpIPv4(); - void TestTcpIPv6(); - void TestSingleFlowControlCallbackIPv4(); - void TestSingleFlowControlCallbackIPv6(); - void TestUdpIPv4(); - void TestUdpIPv6(); - void TestUdpReadyToSendIPv4(); - void TestUdpReadyToSendIPv6(); - void TestGetSetOptionsIPv4(); - void TestGetSetOptionsIPv6(); - void TestSocketRecvTimestampIPv4(); - void TestSocketRecvTimestampIPv6(); - - static const int kTimeout = 5000; // ms - const IPAddress kIPv4Loopback; - const IPAddress kIPv6Loopback; - - protected: - void TcpInternal(const IPAddress& loopback, size_t data_size, - ptrdiff_t max_send_size); - - private: - void ConnectInternal(const IPAddress& loopback); - void ConnectWithDnsLookupInternal(const IPAddress& loopback, - const std::string& host); - void ConnectFailInternal(const IPAddress& loopback); - - void ConnectWithDnsLookupFailInternal(const IPAddress& loopback); - void ConnectWithClosedSocketInternal(const IPAddress& loopback); - void ConnectWhileNotClosedInternal(const IPAddress& loopback); - void ServerCloseDuringConnectInternal(const IPAddress& loopback); - void ClientCloseDuringConnectInternal(const IPAddress& loopback); - void ServerCloseInternal(const IPAddress& loopback); - void CloseInClosedCallbackInternal(const IPAddress& loopback); - void SocketServerWaitInternal(const IPAddress& loopback); - void SingleFlowControlCallbackInternal(const IPAddress& loopback); - void UdpInternal(const IPAddress& loopback); - void UdpReadyToSend(const IPAddress& loopback); - void GetSetOptionsInternal(const IPAddress& loopback); - void SocketRecvTimestamp(const IPAddress& loopback); - - SocketServer* ss_; -}; - -// For unbound sockets, GetLocalAddress / GetRemoteAddress return AF_UNSPEC -// values on Windows, but an empty address of the same family on Linux/MacOS X. -bool IsUnspecOrEmptyIP(const IPAddress& address); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SOCKET_UNITTEST_H_ diff --git a/webrtc/rtc_base/socketadapters.h b/webrtc/rtc_base/socketadapters.h deleted file mode 100644 index a6c5c4e2dc..0000000000 --- a/webrtc/rtc_base/socketadapters.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SOCKETADAPTERS_H_ -#define WEBRTC_RTC_BASE_SOCKETADAPTERS_H_ - -#include -#include - -#include "webrtc/base/asyncsocket.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/cryptstring.h" -#include "webrtc/base/logging.h" - -namespace rtc { - -struct HttpAuthContext; -class ByteBufferReader; -class ByteBufferWriter; - -/////////////////////////////////////////////////////////////////////////////// - -// Implements a socket adapter that can buffer and process data internally, -// as in the case of connecting to a proxy, where you must speak the proxy -// protocol before commencing normal socket behavior. -class BufferedReadAdapter : public AsyncSocketAdapter { - public: - BufferedReadAdapter(AsyncSocket* socket, size_t buffer_size); - ~BufferedReadAdapter() override; - - int Send(const void* pv, size_t cb) override; - int Recv(void* pv, size_t cb, int64_t* timestamp) override; - - protected: - int DirectSend(const void* pv, size_t cb) { - return AsyncSocketAdapter::Send(pv, cb); - } - - void BufferInput(bool on = true); - virtual void ProcessInput(char* data, size_t* len) = 0; - - void OnReadEvent(AsyncSocket* socket) override; - - private: - char * buffer_; - size_t buffer_size_, data_len_; - bool buffering_; - RTC_DISALLOW_COPY_AND_ASSIGN(BufferedReadAdapter); -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Interface for implementing proxy server sockets. -class AsyncProxyServerSocket : public BufferedReadAdapter { - public: - AsyncProxyServerSocket(AsyncSocket* socket, size_t buffer_size); - ~AsyncProxyServerSocket() override; - sigslot::signal2 SignalConnectRequest; - virtual void SendConnectResult(int err, const SocketAddress& addr) = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Implements a socket adapter that performs the client side of a -// fake SSL handshake. Used for "ssltcp" P2P functionality. -class AsyncSSLSocket : public BufferedReadAdapter { - public: - explicit AsyncSSLSocket(AsyncSocket* socket); - - int Connect(const SocketAddress& addr) override; - - protected: - void OnConnectEvent(AsyncSocket* socket) override; - void ProcessInput(char* data, size_t* len) override; - RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSSLSocket); -}; - -// Implements a socket adapter that performs the server side of a -// fake SSL handshake. Used when implementing a relay server that does "ssltcp". -class AsyncSSLServerSocket : public BufferedReadAdapter { - public: - explicit AsyncSSLServerSocket(AsyncSocket* socket); - - protected: - void ProcessInput(char* data, size_t* len) override; - RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSSLServerSocket); -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Implements a socket adapter that speaks the HTTP/S proxy protocol. -class AsyncHttpsProxySocket : public BufferedReadAdapter { - public: - AsyncHttpsProxySocket(AsyncSocket* socket, const std::string& user_agent, - const SocketAddress& proxy, - const std::string& username, const CryptString& password); - ~AsyncHttpsProxySocket() override; - - // If connect is forced, the adapter will always issue an HTTP CONNECT to the - // target address. Otherwise, it will connect only if the destination port - // is not port 80. - void SetForceConnect(bool force) { force_connect_ = force; } - - int Connect(const SocketAddress& addr) override; - SocketAddress GetRemoteAddress() const override; - int Close() override; - ConnState GetState() const override; - - protected: - void OnConnectEvent(AsyncSocket* socket) override; - void OnCloseEvent(AsyncSocket* socket, int err) override; - void ProcessInput(char* data, size_t* len) override; - - bool ShouldIssueConnect() const; - void SendRequest(); - void ProcessLine(char* data, size_t len); - void EndResponse(); - void Error(int error); - - private: - SocketAddress proxy_, dest_; - std::string agent_, user_, headers_; - CryptString pass_; - bool force_connect_; - size_t content_length_; - int defer_error_; - bool expect_close_; - enum ProxyState { - PS_INIT, PS_LEADER, PS_AUTHENTICATE, PS_SKIP_HEADERS, PS_ERROR_HEADERS, - PS_TUNNEL_HEADERS, PS_SKIP_BODY, PS_TUNNEL, PS_WAIT_CLOSE, PS_ERROR - } state_; - HttpAuthContext * context_; - std::string unknown_mechanisms_; - RTC_DISALLOW_COPY_AND_ASSIGN(AsyncHttpsProxySocket); -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Implements a socket adapter that speaks the SOCKS proxy protocol. -class AsyncSocksProxySocket : public BufferedReadAdapter { - public: - AsyncSocksProxySocket(AsyncSocket* socket, const SocketAddress& proxy, - const std::string& username, const CryptString& password); - ~AsyncSocksProxySocket() override; - - int Connect(const SocketAddress& addr) override; - SocketAddress GetRemoteAddress() const override; - int Close() override; - ConnState GetState() const override; - - protected: - void OnConnectEvent(AsyncSocket* socket) override; - void ProcessInput(char* data, size_t* len) override; - - void SendHello(); - void SendConnect(); - void SendAuth(); - void Error(int error); - - private: - enum State { - SS_INIT, SS_HELLO, SS_AUTH, SS_CONNECT, SS_TUNNEL, SS_ERROR - }; - State state_; - SocketAddress proxy_, dest_; - std::string user_; - CryptString pass_; - RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSocksProxySocket); -}; - -// Implements a proxy server socket for the SOCKS protocol. -class AsyncSocksProxyServerSocket : public AsyncProxyServerSocket { - public: - explicit AsyncSocksProxyServerSocket(AsyncSocket* socket); - - private: - void ProcessInput(char* data, size_t* len) override; - void DirectSend(const ByteBufferWriter& buf); - - void HandleHello(ByteBufferReader* request); - void SendHelloReply(uint8_t method); - void HandleAuth(ByteBufferReader* request); - void SendAuthReply(uint8_t result); - void HandleConnect(ByteBufferReader* request); - void SendConnectResult(int result, const SocketAddress& addr) override; - - void Error(int error); - - static const int kBufferSize = 1024; - enum State { - SS_HELLO, SS_AUTH, SS_CONNECT, SS_CONNECT_PENDING, SS_TUNNEL, SS_ERROR - }; - State state_; - RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSocksProxyServerSocket); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SOCKETADAPTERS_H_ diff --git a/webrtc/rtc_base/socketaddress.h b/webrtc/rtc_base/socketaddress.h deleted file mode 100644 index dd64ae9a88..0000000000 --- a/webrtc/rtc_base/socketaddress.h +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SOCKETADDRESS_H_ -#define WEBRTC_RTC_BASE_SOCKETADDRESS_H_ - -#include -#include -#include -#include "webrtc/base/basictypes.h" -#include "webrtc/base/ipaddress.h" - -#undef SetPort - -struct sockaddr_in; -struct sockaddr_storage; - -namespace rtc { - -// Records an IP address and port. -class SocketAddress { - public: - // Creates a nil address. - SocketAddress(); - - // Creates the address with the given host and port. Host may be a - // literal IP string or a hostname to be resolved later. - // DCHECKs that port is in valid range (0 to 2^16-1). - SocketAddress(const std::string& hostname, int port); - - // Creates the address with the given IP and port. - // IP is given as an integer in host byte order. V4 only, to be deprecated. - // DCHECKs that port is in valid range (0 to 2^16-1). - SocketAddress(uint32_t ip_as_host_order_integer, int port); - - // Creates the address with the given IP and port. - // DCHECKs that port is in valid range (0 to 2^16-1). - SocketAddress(const IPAddress& ip, int port); - - // Creates a copy of the given address. - SocketAddress(const SocketAddress& addr); - - // Resets to the nil address. - void Clear(); - - // Determines if this is a nil address (empty hostname, any IP, null port) - bool IsNil() const; - - // Returns true if ip and port are set. - bool IsComplete() const; - - // Replaces our address with the given one. - SocketAddress& operator=(const SocketAddress& addr); - - // Changes the IP of this address to the given one, and clears the hostname - // IP is given as an integer in host byte order. V4 only, to be deprecated.. - void SetIP(uint32_t ip_as_host_order_integer); - - // Changes the IP of this address to the given one, and clears the hostname. - void SetIP(const IPAddress& ip); - - // Changes the hostname of this address to the given one. - // Does not resolve the address; use Resolve to do so. - void SetIP(const std::string& hostname); - - // Sets the IP address while retaining the hostname. Useful for bypassing - // DNS for a pre-resolved IP. - // IP is given as an integer in host byte order. V4 only, to be deprecated. - void SetResolvedIP(uint32_t ip_as_host_order_integer); - - // Sets the IP address while retaining the hostname. Useful for bypassing - // DNS for a pre-resolved IP. - void SetResolvedIP(const IPAddress& ip); - - // Changes the port of this address to the given one. - // DCHECKs that port is in valid range (0 to 2^16-1). - void SetPort(int port); - - // Returns the hostname. - const std::string& hostname() const { return hostname_; } - - // Returns the IP address as a host byte order integer. - // Returns 0 for non-v4 addresses. - uint32_t ip() const; - - const IPAddress& ipaddr() const; - - int family() const {return ip_.family(); } - - // Returns the port part of this address. - uint16_t port() const; - - // Returns the scope ID associated with this address. Scope IDs are a - // necessary addition to IPv6 link-local addresses, with different network - // interfaces having different scope-ids for their link-local addresses. - // IPv4 address do not have scope_ids and sockaddr_in structures do not have - // a field for them. - int scope_id() const {return scope_id_; } - void SetScopeID(int id) { scope_id_ = id; } - - // Returns the 'host' portion of the address (hostname or IP) in a form - // suitable for use in a URI. If both IP and hostname are present, hostname - // is preferred. IPv6 addresses are enclosed in square brackets ('[' and ']'). - std::string HostAsURIString() const; - - // Same as HostAsURIString but anonymizes IP addresses by hiding the last - // part. - std::string HostAsSensitiveURIString() const; - - // Returns the port as a string. - std::string PortAsString() const; - - // Returns hostname:port or [hostname]:port. - std::string ToString() const; - - // Same as ToString but anonymizes it by hiding the last part. - std::string ToSensitiveString() const; - - // Parses hostname:port and [hostname]:port. - bool FromString(const std::string& str); - - friend std::ostream& operator<<(std::ostream& os, const SocketAddress& addr); - - // Determines whether this represents a missing / any IP address. - // That is, 0.0.0.0 or ::. - // Hostname and/or port may be set. - bool IsAnyIP() const; - - // Determines whether the IP address refers to a loopback address. - // For v4 addresses this means the address is in the range 127.0.0.0/8. - // For v6 addresses this means the address is ::1. - bool IsLoopbackIP() const; - - // Determines whether the IP address is in one of the private ranges: - // For v4: 127.0.0.0/8 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12. - // For v6: FE80::/16 and ::1. - bool IsPrivateIP() const; - - // Determines whether the hostname has been resolved to an IP. - bool IsUnresolvedIP() const; - - // Determines whether this address is identical to the given one. - bool operator ==(const SocketAddress& addr) const; - inline bool operator !=(const SocketAddress& addr) const { - return !this->operator ==(addr); - } - - // Compares based on IP and then port. - bool operator <(const SocketAddress& addr) const; - - // Determines whether this address has the same IP as the one given. - bool EqualIPs(const SocketAddress& addr) const; - - // Determines whether this address has the same port as the one given. - bool EqualPorts(const SocketAddress& addr) const; - - // Hashes this address into a small number. - size_t Hash() const; - - // Write this address to a sockaddr_in. - // If IPv6, will zero out the sockaddr_in and sets family to AF_UNSPEC. - void ToSockAddr(sockaddr_in* saddr) const; - - // Read this address from a sockaddr_in. - bool FromSockAddr(const sockaddr_in& saddr); - - // Read and write the address to/from a sockaddr_storage. - // Dual stack version always sets family to AF_INET6, and maps v4 addresses. - // The other version doesn't map, and outputs an AF_INET address for - // v4 or mapped addresses, and AF_INET6 addresses for others. - // Returns the size of the sockaddr_in or sockaddr_in6 structure that is - // written to the sockaddr_storage, or zero on failure. - size_t ToDualStackSockAddrStorage(sockaddr_storage* saddr) const; - size_t ToSockAddrStorage(sockaddr_storage* saddr) const; - - private: - std::string hostname_; - IPAddress ip_; - uint16_t port_; - int scope_id_; - bool literal_; // Indicates that 'hostname_' contains a literal IP string. -}; - -bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr, - SocketAddress* out); -SocketAddress EmptySocketAddressWithFamily(int family); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SOCKETADDRESS_H_ diff --git a/webrtc/rtc_base/socketaddresspair.h b/webrtc/rtc_base/socketaddresspair.h deleted file mode 100644 index 91137a335f..0000000000 --- a/webrtc/rtc_base/socketaddresspair.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SOCKETADDRESSPAIR_H_ -#define WEBRTC_RTC_BASE_SOCKETADDRESSPAIR_H_ - -#include "webrtc/base/socketaddress.h" - -namespace rtc { - -// Records a pair (source,destination) of socket addresses. The two addresses -// identify a connection between two machines. (For UDP, this "connection" is -// not maintained explicitly in a socket.) -class SocketAddressPair { -public: - SocketAddressPair() {} - SocketAddressPair(const SocketAddress& srs, const SocketAddress& dest); - - const SocketAddress& source() const { return src_; } - const SocketAddress& destination() const { return dest_; } - - bool operator ==(const SocketAddressPair& r) const; - bool operator <(const SocketAddressPair& r) const; - - size_t Hash() const; - -private: - SocketAddress src_; - SocketAddress dest_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SOCKETADDRESSPAIR_H_ diff --git a/webrtc/rtc_base/socketfactory.h b/webrtc/rtc_base/socketfactory.h deleted file mode 100644 index 128026437a..0000000000 --- a/webrtc/rtc_base/socketfactory.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SOCKETFACTORY_H_ -#define WEBRTC_RTC_BASE_SOCKETFACTORY_H_ - -#include "webrtc/base/socket.h" -#include "webrtc/base/asyncsocket.h" - -namespace rtc { - -class SocketFactory { -public: - virtual ~SocketFactory() {} - - // Returns a new socket for blocking communication. The type can be - // SOCK_DGRAM and SOCK_STREAM. - // TODO: C++ inheritance rules mean that all users must have both - // CreateSocket(int) and CreateSocket(int,int). Will remove CreateSocket(int) - // (and CreateAsyncSocket(int) when all callers are changed. - virtual Socket* CreateSocket(int type) = 0; - virtual Socket* CreateSocket(int family, int type) = 0; - // Returns a new socket for nonblocking communication. The type can be - // SOCK_DGRAM and SOCK_STREAM. - virtual AsyncSocket* CreateAsyncSocket(int type) = 0; - virtual AsyncSocket* CreateAsyncSocket(int family, int type) = 0; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SOCKETFACTORY_H_ diff --git a/webrtc/rtc_base/socketserver.h b/webrtc/rtc_base/socketserver.h deleted file mode 100644 index 6d06f2fca7..0000000000 --- a/webrtc/rtc_base/socketserver.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SOCKETSERVER_H_ -#define WEBRTC_RTC_BASE_SOCKETSERVER_H_ - -#include -#include "webrtc/base/socketfactory.h" - -namespace rtc { - -class MessageQueue; -// Needs to be forward declared because there's a circular dependency between -// NetworkMonitor and Thread. -// TODO(deadbeef): Fix this. -class NetworkBinderInterface; - -// Provides the ability to wait for activity on a set of sockets. The Thread -// class provides a nice wrapper on a socket server. -// -// The server is also a socket factory. The sockets it creates will be -// notified of asynchronous I/O from this server's Wait method. -class SocketServer : public SocketFactory { - public: - static const int kForever = -1; - - static std::unique_ptr CreateDefault(); - // When the socket server is installed into a Thread, this function is - // called to allow the socket server to use the thread's message queue for - // any messaging that it might need to perform. - virtual void SetMessageQueue(MessageQueue* queue) {} - - // Sleeps until: - // 1) cms milliseconds have elapsed (unless cms == kForever) - // 2) WakeUp() is called - // While sleeping, I/O is performed if process_io is true. - virtual bool Wait(int cms, bool process_io) = 0; - - // Causes the current wait (if one is in progress) to wake up. - virtual void WakeUp() = 0; - - // A network binder will bind the created sockets to a network. - // It is only used in PhysicalSocketServer. - void set_network_binder(NetworkBinderInterface* binder) { - network_binder_ = binder; - } - NetworkBinderInterface* network_binder() const { return network_binder_; } - - private: - NetworkBinderInterface* network_binder_ = nullptr; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SOCKETSERVER_H_ diff --git a/webrtc/rtc_base/socketstream.h b/webrtc/rtc_base/socketstream.h deleted file mode 100644 index 7991c61ccf..0000000000 --- a/webrtc/rtc_base/socketstream.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2005 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SOCKETSTREAM_H_ -#define WEBRTC_RTC_BASE_SOCKETSTREAM_H_ - -#include "webrtc/base/asyncsocket.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/stream.h" - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// - -class SocketStream : public StreamInterface, public sigslot::has_slots<> { - public: - explicit SocketStream(AsyncSocket* socket); - ~SocketStream() override; - - void Attach(AsyncSocket* socket); - AsyncSocket* Detach(); - - AsyncSocket* GetSocket() { return socket_; } - - StreamState GetState() const override; - - StreamResult Read(void* buffer, - size_t buffer_len, - size_t* read, - int* error) override; - - StreamResult Write(const void* data, - size_t data_len, - size_t* written, - int* error) override; - - void Close() override; - - private: - void OnConnectEvent(AsyncSocket* socket); - void OnReadEvent(AsyncSocket* socket); - void OnWriteEvent(AsyncSocket* socket); - void OnCloseEvent(AsyncSocket* socket, int err); - - AsyncSocket* socket_; - - RTC_DISALLOW_COPY_AND_ASSIGN(SocketStream); -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SOCKETSTREAM_H_ diff --git a/webrtc/rtc_base/ssladapter.h b/webrtc/rtc_base/ssladapter.h deleted file mode 100644 index 7e03c4f8af..0000000000 --- a/webrtc/rtc_base/ssladapter.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SSLADAPTER_H_ -#define WEBRTC_RTC_BASE_SSLADAPTER_H_ - -#include "webrtc/base/asyncsocket.h" -#include "webrtc/base/sslstreamadapter.h" - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// - -class SSLAdapter : public AsyncSocketAdapter { - public: - explicit SSLAdapter(AsyncSocket* socket) - : AsyncSocketAdapter(socket), ignore_bad_cert_(false) { } - - bool ignore_bad_cert() const { return ignore_bad_cert_; } - void set_ignore_bad_cert(bool ignore) { ignore_bad_cert_ = ignore; } - - // Do DTLS or TLS (default is TLS, if unspecified) - virtual void SetMode(SSLMode mode) = 0; - - // StartSSL returns 0 if successful. - // If StartSSL is called while the socket is closed or connecting, the SSL - // negotiation will begin as soon as the socket connects. - virtual int StartSSL(const char* hostname, bool restartable) = 0; - - // Create the default SSL adapter for this platform. On failure, returns null - // and deletes |socket|. Otherwise, the returned SSLAdapter takes ownership - // of |socket|. - static SSLAdapter* Create(AsyncSocket* socket); - - private: - // If true, the server certificate need not match the configured hostname. - bool ignore_bad_cert_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -typedef bool (*VerificationCallback)(void* cert); - -// Call this on the main thread, before using SSL. -// Call CleanupSSLThread when finished with SSL. -bool InitializeSSL(VerificationCallback callback = nullptr); - -// Call to initialize additional threads. -bool InitializeSSLThread(); - -// Call to cleanup additional threads, and also the main thread. -bool CleanupSSL(); - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SSLADAPTER_H_ diff --git a/webrtc/rtc_base/sslfingerprint.h b/webrtc/rtc_base/sslfingerprint.h deleted file mode 100644 index 4effca6afb..0000000000 --- a/webrtc/rtc_base/sslfingerprint.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2012 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SSLFINGERPRINT_H_ -#define WEBRTC_RTC_BASE_SSLFINGERPRINT_H_ - -#include - -#include "webrtc/base/basictypes.h" -#include "webrtc/base/copyonwritebuffer.h" -#include "webrtc/base/rtccertificate.h" -#include "webrtc/base/sslidentity.h" - -namespace rtc { - -class SSLCertificate; - -struct SSLFingerprint { - static SSLFingerprint* Create(const std::string& algorithm, - const rtc::SSLIdentity* identity); - - static SSLFingerprint* Create(const std::string& algorithm, - const rtc::SSLCertificate* cert); - - static SSLFingerprint* CreateFromRfc4572(const std::string& algorithm, - const std::string& fingerprint); - - // Creates a fingerprint from a certificate, using the same digest algorithm - // as the certificate's signature. - static SSLFingerprint* CreateFromCertificate(const RTCCertificate* cert); - - SSLFingerprint(const std::string& algorithm, - const uint8_t* digest_in, - size_t digest_len); - - SSLFingerprint(const SSLFingerprint& from); - - bool operator==(const SSLFingerprint& other) const; - - std::string GetRfc4572Fingerprint() const; - - std::string ToString() const; - - std::string algorithm; - rtc::CopyOnWriteBuffer digest; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SSLFINGERPRINT_H_ diff --git a/webrtc/rtc_base/sslidentity.h b/webrtc/rtc_base/sslidentity.h deleted file mode 100644 index f84f725ca7..0000000000 --- a/webrtc/rtc_base/sslidentity.h +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Handling of certificates and keypairs for SSLStreamAdapter's peer mode. - -#ifndef WEBRTC_RTC_BASE_SSLIDENTITY_H_ -#define WEBRTC_RTC_BASE_SSLIDENTITY_H_ - -#include -#include -#include -#include - -#include "webrtc/base/buffer.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/messagedigest.h" -#include "webrtc/base/timeutils.h" - -namespace rtc { - -// Forward declaration due to circular dependency with SSLCertificate. -class SSLCertChain; - -struct SSLCertificateStats { - SSLCertificateStats(std::string&& fingerprint, - std::string&& fingerprint_algorithm, - std::string&& base64_certificate, - std::unique_ptr&& issuer); - ~SSLCertificateStats(); - std::string fingerprint; - std::string fingerprint_algorithm; - std::string base64_certificate; - std::unique_ptr issuer; -}; - -// Abstract interface overridden by SSL library specific -// implementations. - -// A somewhat opaque type used to encapsulate a certificate. -// Wraps the SSL library's notion of a certificate, with reference counting. -// The SSLCertificate object is pretty much immutable once created. -// (The OpenSSL implementation only does reference counting and -// possibly caching of intermediate results.) -class SSLCertificate { - public: - // Parses and builds a certificate from a PEM encoded string. - // Returns null on failure. - // The length of the string representation of the certificate is - // stored in *pem_length if it is non-null, and only if - // parsing was successful. - // Caller is responsible for freeing the returned object. - static SSLCertificate* FromPEMString(const std::string& pem_string); - virtual ~SSLCertificate() {} - - // Returns a new SSLCertificate object instance wrapping the same - // underlying certificate, including its chain if present. - // Caller is responsible for freeing the returned object. - virtual SSLCertificate* GetReference() const = 0; - - // Provides the cert chain, or null. The chain includes a copy of each - // certificate, excluding the leaf. - virtual std::unique_ptr GetChain() const = 0; - - // Returns a PEM encoded string representation of the certificate. - virtual std::string ToPEMString() const = 0; - - // Provides a DER encoded binary representation of the certificate. - virtual void ToDER(Buffer* der_buffer) const = 0; - - // Gets the name of the digest algorithm that was used to compute this - // certificate's signature. - virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const = 0; - - // Compute the digest of the certificate given algorithm - virtual bool ComputeDigest(const std::string& algorithm, - unsigned char* digest, - size_t size, - size_t* length) const = 0; - - // Returns the time in seconds relative to epoch, 1970-01-01T00:00:00Z (UTC), - // or -1 if an expiration time could not be retrieved. - virtual int64_t CertificateExpirationTime() const = 0; - - // Gets information (fingerprint, etc.) about this certificate and its chain - // (if it has a certificate chain). This is used for certificate stats, see - // https://w3c.github.io/webrtc-stats/#certificatestats-dict*. - std::unique_ptr GetStats() const; - - private: - std::unique_ptr GetStats( - std::unique_ptr issuer) const; -}; - -// SSLCertChain is a simple wrapper for a vector of SSLCertificates. It serves -// primarily to ensure proper memory management (especially deletion) of the -// SSLCertificate pointers. -class SSLCertChain { - public: - // These constructors copy the provided SSLCertificate(s), so the caller - // retains ownership. - explicit SSLCertChain(const std::vector& certs); - explicit SSLCertChain(const SSLCertificate* cert); - ~SSLCertChain(); - - // Vector access methods. - size_t GetSize() const { return certs_.size(); } - - // Returns a temporary reference, only valid until the chain is destroyed. - const SSLCertificate& Get(size_t pos) const { return *(certs_[pos]); } - - // Returns a new SSLCertChain object instance wrapping the same underlying - // certificate chain. Caller is responsible for freeing the returned object. - SSLCertChain* Copy() const { - return new SSLCertChain(certs_); - } - - private: - // Helper function for duplicating a vector of certificates. - static SSLCertificate* DupCert(const SSLCertificate* cert) { - return cert->GetReference(); - } - - // Helper function for deleting a vector of certificates. - static void DeleteCert(SSLCertificate* cert) { delete cert; } - - std::vector certs_; - - RTC_DISALLOW_COPY_AND_ASSIGN(SSLCertChain); -}; - -// KT_LAST is intended for vector declarations and loops over all key types; -// it does not represent any key type in itself. -// KT_DEFAULT is used as the default KeyType for KeyParams. -enum KeyType { KT_RSA, KT_ECDSA, KT_LAST, KT_DEFAULT = KT_ECDSA }; - -static const int kRsaDefaultModSize = 1024; -static const int kRsaDefaultExponent = 0x10001; // = 2^16+1 = 65537 -static const int kRsaMinModSize = 1024; -static const int kRsaMaxModSize = 8192; - -// Certificate default validity lifetime. -static const int kDefaultCertificateLifetimeInSeconds = - 60 * 60 * 24 * 30; // 30 days -// Certificate validity window. -// This is to compensate for slightly incorrect system clocks. -static const int kCertificateWindowInSeconds = -60 * 60 * 24; - -struct RSAParams { - unsigned int mod_size; - unsigned int pub_exp; -}; - -enum ECCurve { EC_NIST_P256, /* EC_FANCY, */ EC_LAST }; - -class KeyParams { - public: - // Generate a KeyParams object from a simple KeyType, using default params. - explicit KeyParams(KeyType key_type = KT_DEFAULT); - - // Generate a a KeyParams for RSA with explicit parameters. - static KeyParams RSA(int mod_size = kRsaDefaultModSize, - int pub_exp = kRsaDefaultExponent); - - // Generate a a KeyParams for ECDSA specifying the curve. - static KeyParams ECDSA(ECCurve curve = EC_NIST_P256); - - // Check validity of a KeyParams object. Since the factory functions have - // no way of returning errors, this function can be called after creation - // to make sure the parameters are OK. - bool IsValid() const; - - RSAParams rsa_params() const; - - ECCurve ec_curve() const; - - KeyType type() const { return type_; } - - private: - KeyType type_; - union { - RSAParams rsa; - ECCurve curve; - } params_; -}; - -// TODO(hbos): Remove once rtc::KeyType (to be modified) and -// blink::WebRTCKeyType (to be landed) match. By using this function in Chromium -// appropriately we can change KeyType enum -> class without breaking Chromium. -KeyType IntKeyTypeFamilyToKeyType(int key_type_family); - -// Parameters for generating a certificate. If |common_name| is non-empty, it -// will be used for the certificate's subject and issuer name, otherwise a -// random string will be used. -struct SSLIdentityParams { - std::string common_name; - time_t not_before; // Absolute time since epoch in seconds. - time_t not_after; // Absolute time since epoch in seconds. - KeyParams key_params; -}; - -// Our identity in an SSL negotiation: a keypair and certificate (both -// with the same public key). -// This too is pretty much immutable once created. -class SSLIdentity { - public: - // Generates an identity (keypair and self-signed certificate). If - // |common_name| is non-empty, it will be used for the certificate's subject - // and issuer name, otherwise a random string will be used. The key type and - // parameters are defined in |key_param|. The certificate's lifetime in - // seconds from the current time is defined in |certificate_lifetime|; it - // should be a non-negative number. - // Returns null on failure. - // Caller is responsible for freeing the returned object. - static SSLIdentity* GenerateWithExpiration(const std::string& common_name, - const KeyParams& key_param, - time_t certificate_lifetime); - static SSLIdentity* Generate(const std::string& common_name, - const KeyParams& key_param); - static SSLIdentity* Generate(const std::string& common_name, - KeyType key_type); - - // Generates an identity with the specified validity period. - // TODO(torbjorng): Now that Generate() accepts relevant params, make tests - // use that instead of this function. - static SSLIdentity* GenerateForTest(const SSLIdentityParams& params); - - // Construct an identity from a private key and a certificate. - static SSLIdentity* FromPEMStrings(const std::string& private_key, - const std::string& certificate); - - virtual ~SSLIdentity() {} - - // Returns a new SSLIdentity object instance wrapping the same - // identity information. - // Caller is responsible for freeing the returned object. - // TODO(hbos,torbjorng): Rename to a less confusing name. - virtual SSLIdentity* GetReference() const = 0; - - // Returns a temporary reference to the certificate. - virtual const SSLCertificate& certificate() const = 0; - virtual std::string PrivateKeyToPEMString() const = 0; - virtual std::string PublicKeyToPEMString() const = 0; - - // Helpers for parsing converting between PEM and DER format. - static bool PemToDer(const std::string& pem_type, - const std::string& pem_string, - std::string* der); - static std::string DerToPem(const std::string& pem_type, - const unsigned char* data, - size_t length); -}; - -bool operator==(const SSLIdentity& a, const SSLIdentity& b); -bool operator!=(const SSLIdentity& a, const SSLIdentity& b); - -// Convert from ASN1 time as restricted by RFC 5280 to seconds from 1970-01-01 -// 00.00 ("epoch"). If the ASN1 time cannot be read, return -1. The data at -// |s| is not 0-terminated; its char count is defined by |length|. -int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format); - -extern const char kPemTypeCertificate[]; -extern const char kPemTypeRsaPrivateKey[]; -extern const char kPemTypeEcPrivateKey[]; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SSLIDENTITY_H_ diff --git a/webrtc/rtc_base/sslroots.h b/webrtc/rtc_base/sslroots.h deleted file mode 100644 index b4e3390839..0000000000 --- a/webrtc/rtc_base/sslroots.h +++ /dev/null @@ -1,4270 +0,0 @@ -#ifndef WEBRTC_RTC_BASE_SSLROOTS_H_ -#define WEBRTC_RTC_BASE_SSLROOTS_H_ - -// This file is the root certificates in C form that are needed to connect to -// Google. - -// It was generated with the following command line: -// > python tools/sslroots/generate_sslroots.py -// https://pki.google.com/roots.pem - -/* subject:/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA */ -/* issuer :/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA */ - - -const unsigned char GlobalSign_Root_CA_certificate[889]={ -0x30,0x82,0x03,0x75,0x30,0x82,0x02,0x5D,0xA0,0x03,0x02,0x01,0x02,0x02,0x0B,0x04, -0x00,0x00,0x00,0x00,0x01,0x15,0x4B,0x5A,0xC3,0x94,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x57,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x42,0x45,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04, -0x0A,0x13,0x10,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x6E,0x76, -0x2D,0x73,0x61,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x0B,0x13,0x07,0x52,0x6F, -0x6F,0x74,0x20,0x43,0x41,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x03,0x13,0x12, -0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x52,0x6F,0x6F,0x74,0x20, -0x43,0x41,0x30,0x1E,0x17,0x0D,0x39,0x38,0x30,0x39,0x30,0x31,0x31,0x32,0x30,0x30, -0x30,0x30,0x5A,0x17,0x0D,0x32,0x38,0x30,0x31,0x32,0x38,0x31,0x32,0x30,0x30,0x30, -0x30,0x5A,0x30,0x57,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x42, -0x45,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0A,0x13,0x10,0x47,0x6C,0x6F,0x62, -0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x6E,0x76,0x2D,0x73,0x61,0x31,0x10,0x30,0x0E, -0x06,0x03,0x55,0x04,0x0B,0x13,0x07,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x03,0x13,0x12,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53, -0x69,0x67,0x6E,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82, -0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xDA,0x0E,0xE6,0x99, -0x8D,0xCE,0xA3,0xE3,0x4F,0x8A,0x7E,0xFB,0xF1,0x8B,0x83,0x25,0x6B,0xEA,0x48,0x1F, -0xF1,0x2A,0xB0,0xB9,0x95,0x11,0x04,0xBD,0xF0,0x63,0xD1,0xE2,0x67,0x66,0xCF,0x1C, -0xDD,0xCF,0x1B,0x48,0x2B,0xEE,0x8D,0x89,0x8E,0x9A,0xAF,0x29,0x80,0x65,0xAB,0xE9, -0xC7,0x2D,0x12,0xCB,0xAB,0x1C,0x4C,0x70,0x07,0xA1,0x3D,0x0A,0x30,0xCD,0x15,0x8D, -0x4F,0xF8,0xDD,0xD4,0x8C,0x50,0x15,0x1C,0xEF,0x50,0xEE,0xC4,0x2E,0xF7,0xFC,0xE9, -0x52,0xF2,0x91,0x7D,0xE0,0x6D,0xD5,0x35,0x30,0x8E,0x5E,0x43,0x73,0xF2,0x41,0xE9, -0xD5,0x6A,0xE3,0xB2,0x89,0x3A,0x56,0x39,0x38,0x6F,0x06,0x3C,0x88,0x69,0x5B,0x2A, -0x4D,0xC5,0xA7,0x54,0xB8,0x6C,0x89,0xCC,0x9B,0xF9,0x3C,0xCA,0xE5,0xFD,0x89,0xF5, -0x12,0x3C,0x92,0x78,0x96,0xD6,0xDC,0x74,0x6E,0x93,0x44,0x61,0xD1,0x8D,0xC7,0x46, -0xB2,0x75,0x0E,0x86,0xE8,0x19,0x8A,0xD5,0x6D,0x6C,0xD5,0x78,0x16,0x95,0xA2,0xE9, -0xC8,0x0A,0x38,0xEB,0xF2,0x24,0x13,0x4F,0x73,0x54,0x93,0x13,0x85,0x3A,0x1B,0xBC, -0x1E,0x34,0xB5,0x8B,0x05,0x8C,0xB9,0x77,0x8B,0xB1,0xDB,0x1F,0x20,0x91,0xAB,0x09, -0x53,0x6E,0x90,0xCE,0x7B,0x37,0x74,0xB9,0x70,0x47,0x91,0x22,0x51,0x63,0x16,0x79, -0xAE,0xB1,0xAE,0x41,0x26,0x08,0xC8,0x19,0x2B,0xD1,0x46,0xAA,0x48,0xD6,0x64,0x2A, -0xD7,0x83,0x34,0xFF,0x2C,0x2A,0xC1,0x6C,0x19,0x43,0x4A,0x07,0x85,0xE7,0xD3,0x7C, -0xF6,0x21,0x68,0xEF,0xEA,0xF2,0x52,0x9F,0x7F,0x93,0x90,0xCF,0x02,0x03,0x01,0x00, -0x01,0xA3,0x42,0x30,0x40,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04, -0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0x60,0x7B,0x66,0x1A,0x45,0x0D,0x97,0xCA,0x89,0x50,0x2F,0x7D,0x04,0xCD,0x34, -0xA8,0xFF,0xFC,0xFD,0x4B,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0xD6,0x73,0xE7,0x7C,0x4F,0x76,0xD0, -0x8D,0xBF,0xEC,0xBA,0xA2,0xBE,0x34,0xC5,0x28,0x32,0xB5,0x7C,0xFC,0x6C,0x9C,0x2C, -0x2B,0xBD,0x09,0x9E,0x53,0xBF,0x6B,0x5E,0xAA,0x11,0x48,0xB6,0xE5,0x08,0xA3,0xB3, -0xCA,0x3D,0x61,0x4D,0xD3,0x46,0x09,0xB3,0x3E,0xC3,0xA0,0xE3,0x63,0x55,0x1B,0xF2, -0xBA,0xEF,0xAD,0x39,0xE1,0x43,0xB9,0x38,0xA3,0xE6,0x2F,0x8A,0x26,0x3B,0xEF,0xA0, -0x50,0x56,0xF9,0xC6,0x0A,0xFD,0x38,0xCD,0xC4,0x0B,0x70,0x51,0x94,0x97,0x98,0x04, -0xDF,0xC3,0x5F,0x94,0xD5,0x15,0xC9,0x14,0x41,0x9C,0xC4,0x5D,0x75,0x64,0x15,0x0D, -0xFF,0x55,0x30,0xEC,0x86,0x8F,0xFF,0x0D,0xEF,0x2C,0xB9,0x63,0x46,0xF6,0xAA,0xFC, -0xDF,0xBC,0x69,0xFD,0x2E,0x12,0x48,0x64,0x9A,0xE0,0x95,0xF0,0xA6,0xEF,0x29,0x8F, -0x01,0xB1,0x15,0xB5,0x0C,0x1D,0xA5,0xFE,0x69,0x2C,0x69,0x24,0x78,0x1E,0xB3,0xA7, -0x1C,0x71,0x62,0xEE,0xCA,0xC8,0x97,0xAC,0x17,0x5D,0x8A,0xC2,0xF8,0x47,0x86,0x6E, -0x2A,0xC4,0x56,0x31,0x95,0xD0,0x67,0x89,0x85,0x2B,0xF9,0x6C,0xA6,0x5D,0x46,0x9D, -0x0C,0xAA,0x82,0xE4,0x99,0x51,0xDD,0x70,0xB7,0xDB,0x56,0x3D,0x61,0xE4,0x6A,0xE1, -0x5C,0xD6,0xF6,0xFE,0x3D,0xDE,0x41,0xCC,0x07,0xAE,0x63,0x52,0xBF,0x53,0x53,0xF4, -0x2B,0xE9,0xC7,0xFD,0xB6,0xF7,0x82,0x5F,0x85,0xD2,0x41,0x18,0xDB,0x81,0xB3,0x04, -0x1C,0xC5,0x1F,0xA4,0x80,0x6F,0x15,0x20,0xC9,0xDE,0x0C,0x88,0x0A,0x1D,0xD6,0x66, -0x55,0xE2,0xFC,0x48,0xC9,0x29,0x26,0x69,0xE0, -}; - - -/* subject:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust RSA Certification Authority */ -/* issuer :/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust RSA Certification Authority */ - - -const unsigned char USERTrust_RSA_Certification_Authority_certificate[1506]={ -0x30,0x82,0x05,0xDE,0x30,0x82,0x03,0xC6,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x01, -0xFD,0x6D,0x30,0xFC,0xA3,0xCA,0x51,0xA8,0x1B,0xBC,0x64,0x0E,0x35,0x03,0x2D,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,0x05,0x00,0x30,0x81, -0x88,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x13, -0x30,0x11,0x06,0x03,0x55,0x04,0x08,0x13,0x0A,0x4E,0x65,0x77,0x20,0x4A,0x65,0x72, -0x73,0x65,0x79,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x07,0x13,0x0B,0x4A,0x65, -0x72,0x73,0x65,0x79,0x20,0x43,0x69,0x74,0x79,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55, -0x04,0x0A,0x13,0x15,0x54,0x68,0x65,0x20,0x55,0x53,0x45,0x52,0x54,0x52,0x55,0x53, -0x54,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x2E,0x30,0x2C,0x06,0x03,0x55, -0x04,0x03,0x13,0x25,0x55,0x53,0x45,0x52,0x54,0x72,0x75,0x73,0x74,0x20,0x52,0x53, -0x41,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20, -0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x31,0x30,0x30, -0x32,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31, -0x31,0x38,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0x88,0x31,0x0B,0x30,0x09, -0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x13,0x30,0x11,0x06,0x03,0x55, -0x04,0x08,0x13,0x0A,0x4E,0x65,0x77,0x20,0x4A,0x65,0x72,0x73,0x65,0x79,0x31,0x14, -0x30,0x12,0x06,0x03,0x55,0x04,0x07,0x13,0x0B,0x4A,0x65,0x72,0x73,0x65,0x79,0x20, -0x43,0x69,0x74,0x79,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55,0x04,0x0A,0x13,0x15,0x54, -0x68,0x65,0x20,0x55,0x53,0x45,0x52,0x54,0x52,0x55,0x53,0x54,0x20,0x4E,0x65,0x74, -0x77,0x6F,0x72,0x6B,0x31,0x2E,0x30,0x2C,0x06,0x03,0x55,0x04,0x03,0x13,0x25,0x55, -0x53,0x45,0x52,0x54,0x72,0x75,0x73,0x74,0x20,0x52,0x53,0x41,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F, -0x72,0x69,0x74,0x79,0x30,0x82,0x02,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x02,0x0F,0x00,0x30,0x82,0x02,0x0A, -0x02,0x82,0x02,0x01,0x00,0x80,0x12,0x65,0x17,0x36,0x0E,0xC3,0xDB,0x08,0xB3,0xD0, -0xAC,0x57,0x0D,0x76,0xED,0xCD,0x27,0xD3,0x4C,0xAD,0x50,0x83,0x61,0xE2,0xAA,0x20, -0x4D,0x09,0x2D,0x64,0x09,0xDC,0xCE,0x89,0x9F,0xCC,0x3D,0xA9,0xEC,0xF6,0xCF,0xC1, -0xDC,0xF1,0xD3,0xB1,0xD6,0x7B,0x37,0x28,0x11,0x2B,0x47,0xDA,0x39,0xC6,0xBC,0x3A, -0x19,0xB4,0x5F,0xA6,0xBD,0x7D,0x9D,0xA3,0x63,0x42,0xB6,0x76,0xF2,0xA9,0x3B,0x2B, -0x91,0xF8,0xE2,0x6F,0xD0,0xEC,0x16,0x20,0x90,0x09,0x3E,0xE2,0xE8,0x74,0xC9,0x18, -0xB4,0x91,0xD4,0x62,0x64,0xDB,0x7F,0xA3,0x06,0xF1,0x88,0x18,0x6A,0x90,0x22,0x3C, -0xBC,0xFE,0x13,0xF0,0x87,0x14,0x7B,0xF6,0xE4,0x1F,0x8E,0xD4,0xE4,0x51,0xC6,0x11, -0x67,0x46,0x08,0x51,0xCB,0x86,0x14,0x54,0x3F,0xBC,0x33,0xFE,0x7E,0x6C,0x9C,0xFF, -0x16,0x9D,0x18,0xBD,0x51,0x8E,0x35,0xA6,0xA7,0x66,0xC8,0x72,0x67,0xDB,0x21,0x66, -0xB1,0xD4,0x9B,0x78,0x03,0xC0,0x50,0x3A,0xE8,0xCC,0xF0,0xDC,0xBC,0x9E,0x4C,0xFE, -0xAF,0x05,0x96,0x35,0x1F,0x57,0x5A,0xB7,0xFF,0xCE,0xF9,0x3D,0xB7,0x2C,0xB6,0xF6, -0x54,0xDD,0xC8,0xE7,0x12,0x3A,0x4D,0xAE,0x4C,0x8A,0xB7,0x5C,0x9A,0xB4,0xB7,0x20, -0x3D,0xCA,0x7F,0x22,0x34,0xAE,0x7E,0x3B,0x68,0x66,0x01,0x44,0xE7,0x01,0x4E,0x46, -0x53,0x9B,0x33,0x60,0xF7,0x94,0xBE,0x53,0x37,0x90,0x73,0x43,0xF3,0x32,0xC3,0x53, -0xEF,0xDB,0xAA,0xFE,0x74,0x4E,0x69,0xC7,0x6B,0x8C,0x60,0x93,0xDE,0xC4,0xC7,0x0C, -0xDF,0xE1,0x32,0xAE,0xCC,0x93,0x3B,0x51,0x78,0x95,0x67,0x8B,0xEE,0x3D,0x56,0xFE, -0x0C,0xD0,0x69,0x0F,0x1B,0x0F,0xF3,0x25,0x26,0x6B,0x33,0x6D,0xF7,0x6E,0x47,0xFA, -0x73,0x43,0xE5,0x7E,0x0E,0xA5,0x66,0xB1,0x29,0x7C,0x32,0x84,0x63,0x55,0x89,0xC4, -0x0D,0xC1,0x93,0x54,0x30,0x19,0x13,0xAC,0xD3,0x7D,0x37,0xA7,0xEB,0x5D,0x3A,0x6C, -0x35,0x5C,0xDB,0x41,0xD7,0x12,0xDA,0xA9,0x49,0x0B,0xDF,0xD8,0x80,0x8A,0x09,0x93, -0x62,0x8E,0xB5,0x66,0xCF,0x25,0x88,0xCD,0x84,0xB8,0xB1,0x3F,0xA4,0x39,0x0F,0xD9, -0x02,0x9E,0xEB,0x12,0x4C,0x95,0x7C,0xF3,0x6B,0x05,0xA9,0x5E,0x16,0x83,0xCC,0xB8, -0x67,0xE2,0xE8,0x13,0x9D,0xCC,0x5B,0x82,0xD3,0x4C,0xB3,0xED,0x5B,0xFF,0xDE,0xE5, -0x73,0xAC,0x23,0x3B,0x2D,0x00,0xBF,0x35,0x55,0x74,0x09,0x49,0xD8,0x49,0x58,0x1A, -0x7F,0x92,0x36,0xE6,0x51,0x92,0x0E,0xF3,0x26,0x7D,0x1C,0x4D,0x17,0xBC,0xC9,0xEC, -0x43,0x26,0xD0,0xBF,0x41,0x5F,0x40,0xA9,0x44,0x44,0xF4,0x99,0xE7,0x57,0x87,0x9E, -0x50,0x1F,0x57,0x54,0xA8,0x3E,0xFD,0x74,0x63,0x2F,0xB1,0x50,0x65,0x09,0xE6,0x58, -0x42,0x2E,0x43,0x1A,0x4C,0xB4,0xF0,0x25,0x47,0x59,0xFA,0x04,0x1E,0x93,0xD4,0x26, -0x46,0x4A,0x50,0x81,0xB2,0xDE,0xBE,0x78,0xB7,0xFC,0x67,0x15,0xE1,0xC9,0x57,0x84, -0x1E,0x0F,0x63,0xD6,0xE9,0x62,0xBA,0xD6,0x5F,0x55,0x2E,0xEA,0x5C,0xC6,0x28,0x08, -0x04,0x25,0x39,0xB8,0x0E,0x2B,0xA9,0xF2,0x4C,0x97,0x1C,0x07,0x3F,0x0D,0x52,0xF5, -0xED,0xEF,0x2F,0x82,0x0F,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x1D, -0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x53,0x79,0xBF,0x5A,0xAA,0x2B,0x4A, -0xCF,0x54,0x80,0xE1,0xD8,0x9B,0xC0,0x9D,0xF2,0xB2,0x03,0x66,0xCB,0x30,0x0E,0x06, -0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06, -0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,0x05,0x00,0x03,0x82,0x02, -0x01,0x00,0x5C,0xD4,0x7C,0x0D,0xCF,0xF7,0x01,0x7D,0x41,0x99,0x65,0x0C,0x73,0xC5, -0x52,0x9F,0xCB,0xF8,0xCF,0x99,0x06,0x7F,0x1B,0xDA,0x43,0x15,0x9F,0x9E,0x02,0x55, -0x57,0x96,0x14,0xF1,0x52,0x3C,0x27,0x87,0x94,0x28,0xED,0x1F,0x3A,0x01,0x37,0xA2, -0x76,0xFC,0x53,0x50,0xC0,0x84,0x9B,0xC6,0x6B,0x4E,0xBA,0x8C,0x21,0x4F,0xA2,0x8E, -0x55,0x62,0x91,0xF3,0x69,0x15,0xD8,0xBC,0x88,0xE3,0xC4,0xAA,0x0B,0xFD,0xEF,0xA8, -0xE9,0x4B,0x55,0x2A,0x06,0x20,0x6D,0x55,0x78,0x29,0x19,0xEE,0x5F,0x30,0x5C,0x4B, -0x24,0x11,0x55,0xFF,0x24,0x9A,0x6E,0x5E,0x2A,0x2B,0xEE,0x0B,0x4D,0x9F,0x7F,0xF7, -0x01,0x38,0x94,0x14,0x95,0x43,0x07,0x09,0xFB,0x60,0xA9,0xEE,0x1C,0xAB,0x12,0x8C, -0xA0,0x9A,0x5E,0xA7,0x98,0x6A,0x59,0x6D,0x8B,0x3F,0x08,0xFB,0xC8,0xD1,0x45,0xAF, -0x18,0x15,0x64,0x90,0x12,0x0F,0x73,0x28,0x2E,0xC5,0xE2,0x24,0x4E,0xFC,0x58,0xEC, -0xF0,0xF4,0x45,0xFE,0x22,0xB3,0xEB,0x2F,0x8E,0xD2,0xD9,0x45,0x61,0x05,0xC1,0x97, -0x6F,0xA8,0x76,0x72,0x8F,0x8B,0x8C,0x36,0xAF,0xBF,0x0D,0x05,0xCE,0x71,0x8D,0xE6, -0xA6,0x6F,0x1F,0x6C,0xA6,0x71,0x62,0xC5,0xD8,0xD0,0x83,0x72,0x0C,0xF1,0x67,0x11, -0x89,0x0C,0x9C,0x13,0x4C,0x72,0x34,0xDF,0xBC,0xD5,0x71,0xDF,0xAA,0x71,0xDD,0xE1, -0xB9,0x6C,0x8C,0x3C,0x12,0x5D,0x65,0xDA,0xBD,0x57,0x12,0xB6,0x43,0x6B,0xFF,0xE5, -0xDE,0x4D,0x66,0x11,0x51,0xCF,0x99,0xAE,0xEC,0x17,0xB6,0xE8,0x71,0x91,0x8C,0xDE, -0x49,0xFE,0xDD,0x35,0x71,0xA2,0x15,0x27,0x94,0x1C,0xCF,0x61,0xE3,0x26,0xBB,0x6F, -0xA3,0x67,0x25,0x21,0x5D,0xE6,0xDD,0x1D,0x0B,0x2E,0x68,0x1B,0x3B,0x82,0xAF,0xEC, -0x83,0x67,0x85,0xD4,0x98,0x51,0x74,0xB1,0xB9,0x99,0x80,0x89,0xFF,0x7F,0x78,0x19, -0x5C,0x79,0x4A,0x60,0x2E,0x92,0x40,0xAE,0x4C,0x37,0x2A,0x2C,0xC9,0xC7,0x62,0xC8, -0x0E,0x5D,0xF7,0x36,0x5B,0xCA,0xE0,0x25,0x25,0x01,0xB4,0xDD,0x1A,0x07,0x9C,0x77, -0x00,0x3F,0xD0,0xDC,0xD5,0xEC,0x3D,0xD4,0xFA,0xBB,0x3F,0xCC,0x85,0xD6,0x6F,0x7F, -0xA9,0x2D,0xDF,0xB9,0x02,0xF7,0xF5,0x97,0x9A,0xB5,0x35,0xDA,0xC3,0x67,0xB0,0x87, -0x4A,0xA9,0x28,0x9E,0x23,0x8E,0xFF,0x5C,0x27,0x6B,0xE1,0xB0,0x4F,0xF3,0x07,0xEE, -0x00,0x2E,0xD4,0x59,0x87,0xCB,0x52,0x41,0x95,0xEA,0xF4,0x47,0xD7,0xEE,0x64,0x41, -0x55,0x7C,0x8D,0x59,0x02,0x95,0xDD,0x62,0x9D,0xC2,0xB9,0xEE,0x5A,0x28,0x74,0x84, -0xA5,0x9B,0xB7,0x90,0xC7,0x0C,0x07,0xDF,0xF5,0x89,0x36,0x74,0x32,0xD6,0x28,0xC1, -0xB0,0xB0,0x0B,0xE0,0x9C,0x4C,0xC3,0x1C,0xD6,0xFC,0xE3,0x69,0xB5,0x47,0x46,0x81, -0x2F,0xA2,0x82,0xAB,0xD3,0x63,0x44,0x70,0xC4,0x8D,0xFF,0x2D,0x33,0xBA,0xAD,0x8F, -0x7B,0xB5,0x70,0x88,0xAE,0x3E,0x19,0xCF,0x40,0x28,0xD8,0xFC,0xC8,0x90,0xBB,0x5D, -0x99,0x22,0xF5,0x52,0xE6,0x58,0xC5,0x1F,0x88,0x31,0x43,0xEE,0x88,0x1D,0xD7,0xC6, -0x8E,0x3C,0x43,0x6A,0x1D,0xA7,0x18,0xDE,0x7D,0x3D,0x16,0xF1,0x62,0xF9,0xCA,0x90, -0xA8,0xFD, -}; - - -/* subject:/C=US/O=Starfield Technologies, Inc./OU=Starfield Class 2 Certification Authority */ -/* issuer :/C=US/O=Starfield Technologies, Inc./OU=Starfield Class 2 Certification Authority */ - - -const unsigned char Starfield_Class_2_CA_certificate[1043]={ -0x30,0x82,0x04,0x0F,0x30,0x82,0x02,0xF7,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x00, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x68,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x25, -0x30,0x23,0x06,0x03,0x55,0x04,0x0A,0x13,0x1C,0x53,0x74,0x61,0x72,0x66,0x69,0x65, -0x6C,0x64,0x20,0x54,0x65,0x63,0x68,0x6E,0x6F,0x6C,0x6F,0x67,0x69,0x65,0x73,0x2C, -0x20,0x49,0x6E,0x63,0x2E,0x31,0x32,0x30,0x30,0x06,0x03,0x55,0x04,0x0B,0x13,0x29, -0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x43,0x6C,0x61,0x73,0x73,0x20, -0x32,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20, -0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x34,0x30, -0x36,0x32,0x39,0x31,0x37,0x33,0x39,0x31,0x36,0x5A,0x17,0x0D,0x33,0x34,0x30,0x36, -0x32,0x39,0x31,0x37,0x33,0x39,0x31,0x36,0x5A,0x30,0x68,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04, -0x0A,0x13,0x1C,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x54,0x65,0x63, -0x68,0x6E,0x6F,0x6C,0x6F,0x67,0x69,0x65,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31, -0x32,0x30,0x30,0x06,0x03,0x55,0x04,0x0B,0x13,0x29,0x53,0x74,0x61,0x72,0x66,0x69, -0x65,0x6C,0x64,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x30,0x82,0x01,0x20,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0D,0x00,0x30,0x82,0x01,0x08,0x02, -0x82,0x01,0x01,0x00,0xB7,0x32,0xC8,0xFE,0xE9,0x71,0xA6,0x04,0x85,0xAD,0x0C,0x11, -0x64,0xDF,0xCE,0x4D,0xEF,0xC8,0x03,0x18,0x87,0x3F,0xA1,0xAB,0xFB,0x3C,0xA6,0x9F, -0xF0,0xC3,0xA1,0xDA,0xD4,0xD8,0x6E,0x2B,0x53,0x90,0xFB,0x24,0xA4,0x3E,0x84,0xF0, -0x9E,0xE8,0x5F,0xEC,0xE5,0x27,0x44,0xF5,0x28,0xA6,0x3F,0x7B,0xDE,0xE0,0x2A,0xF0, -0xC8,0xAF,0x53,0x2F,0x9E,0xCA,0x05,0x01,0x93,0x1E,0x8F,0x66,0x1C,0x39,0xA7,0x4D, -0xFA,0x5A,0xB6,0x73,0x04,0x25,0x66,0xEB,0x77,0x7F,0xE7,0x59,0xC6,0x4A,0x99,0x25, -0x14,0x54,0xEB,0x26,0xC7,0xF3,0x7F,0x19,0xD5,0x30,0x70,0x8F,0xAF,0xB0,0x46,0x2A, -0xFF,0xAD,0xEB,0x29,0xED,0xD7,0x9F,0xAA,0x04,0x87,0xA3,0xD4,0xF9,0x89,0xA5,0x34, -0x5F,0xDB,0x43,0x91,0x82,0x36,0xD9,0x66,0x3C,0xB1,0xB8,0xB9,0x82,0xFD,0x9C,0x3A, -0x3E,0x10,0xC8,0x3B,0xEF,0x06,0x65,0x66,0x7A,0x9B,0x19,0x18,0x3D,0xFF,0x71,0x51, -0x3C,0x30,0x2E,0x5F,0xBE,0x3D,0x77,0x73,0xB2,0x5D,0x06,0x6C,0xC3,0x23,0x56,0x9A, -0x2B,0x85,0x26,0x92,0x1C,0xA7,0x02,0xB3,0xE4,0x3F,0x0D,0xAF,0x08,0x79,0x82,0xB8, -0x36,0x3D,0xEA,0x9C,0xD3,0x35,0xB3,0xBC,0x69,0xCA,0xF5,0xCC,0x9D,0xE8,0xFD,0x64, -0x8D,0x17,0x80,0x33,0x6E,0x5E,0x4A,0x5D,0x99,0xC9,0x1E,0x87,0xB4,0x9D,0x1A,0xC0, -0xD5,0x6E,0x13,0x35,0x23,0x5E,0xDF,0x9B,0x5F,0x3D,0xEF,0xD6,0xF7,0x76,0xC2,0xEA, -0x3E,0xBB,0x78,0x0D,0x1C,0x42,0x67,0x6B,0x04,0xD8,0xF8,0xD6,0xDA,0x6F,0x8B,0xF2, -0x44,0xA0,0x01,0xAB,0x02,0x01,0x03,0xA3,0x81,0xC5,0x30,0x81,0xC2,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xBF,0x5F,0xB7,0xD1,0xCE,0xDD,0x1F,0x86, -0xF4,0x5B,0x55,0xAC,0xDC,0xD7,0x10,0xC2,0x0E,0xA9,0x88,0xE7,0x30,0x81,0x92,0x06, -0x03,0x55,0x1D,0x23,0x04,0x81,0x8A,0x30,0x81,0x87,0x80,0x14,0xBF,0x5F,0xB7,0xD1, -0xCE,0xDD,0x1F,0x86,0xF4,0x5B,0x55,0xAC,0xDC,0xD7,0x10,0xC2,0x0E,0xA9,0x88,0xE7, -0xA1,0x6C,0xA4,0x6A,0x30,0x68,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x55,0x53,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x0A,0x13,0x1C,0x53,0x74, -0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x54,0x65,0x63,0x68,0x6E,0x6F,0x6C,0x6F, -0x67,0x69,0x65,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x32,0x30,0x30,0x06,0x03, -0x55,0x04,0x0B,0x13,0x29,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x43, -0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x82,0x01, -0x00,0x30,0x0C,0x06,0x03,0x55,0x1D,0x13,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82, -0x01,0x01,0x00,0x05,0x9D,0x3F,0x88,0x9D,0xD1,0xC9,0x1A,0x55,0xA1,0xAC,0x69,0xF3, -0xF3,0x59,0xDA,0x9B,0x01,0x87,0x1A,0x4F,0x57,0xA9,0xA1,0x79,0x09,0x2A,0xDB,0xF7, -0x2F,0xB2,0x1E,0xCC,0xC7,0x5E,0x6A,0xD8,0x83,0x87,0xA1,0x97,0xEF,0x49,0x35,0x3E, -0x77,0x06,0x41,0x58,0x62,0xBF,0x8E,0x58,0xB8,0x0A,0x67,0x3F,0xEC,0xB3,0xDD,0x21, -0x66,0x1F,0xC9,0x54,0xFA,0x72,0xCC,0x3D,0x4C,0x40,0xD8,0x81,0xAF,0x77,0x9E,0x83, -0x7A,0xBB,0xA2,0xC7,0xF5,0x34,0x17,0x8E,0xD9,0x11,0x40,0xF4,0xFC,0x2C,0x2A,0x4D, -0x15,0x7F,0xA7,0x62,0x5D,0x2E,0x25,0xD3,0x00,0x0B,0x20,0x1A,0x1D,0x68,0xF9,0x17, -0xB8,0xF4,0xBD,0x8B,0xED,0x28,0x59,0xDD,0x4D,0x16,0x8B,0x17,0x83,0xC8,0xB2,0x65, -0xC7,0x2D,0x7A,0xA5,0xAA,0xBC,0x53,0x86,0x6D,0xDD,0x57,0xA4,0xCA,0xF8,0x20,0x41, -0x0B,0x68,0xF0,0xF4,0xFB,0x74,0xBE,0x56,0x5D,0x7A,0x79,0xF5,0xF9,0x1D,0x85,0xE3, -0x2D,0x95,0xBE,0xF5,0x71,0x90,0x43,0xCC,0x8D,0x1F,0x9A,0x00,0x0A,0x87,0x29,0xE9, -0x55,0x22,0x58,0x00,0x23,0xEA,0xE3,0x12,0x43,0x29,0x5B,0x47,0x08,0xDD,0x8C,0x41, -0x6A,0x65,0x06,0xA8,0xE5,0x21,0xAA,0x41,0xB4,0x95,0x21,0x95,0xB9,0x7D,0xD1,0x34, -0xAB,0x13,0xD6,0xAD,0xBC,0xDC,0xE2,0x3D,0x39,0xCD,0xBD,0x3E,0x75,0x70,0xA1,0x18, -0x59,0x03,0xC9,0x22,0xB4,0x8F,0x9C,0xD5,0x5E,0x2A,0xD7,0xA5,0xB6,0xD4,0x0A,0x6D, -0xF8,0xB7,0x40,0x11,0x46,0x9A,0x1F,0x79,0x0E,0x62,0xBF,0x0F,0x97,0xEC,0xE0,0x2F, -0x1F,0x17,0x94, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 1999 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G3 */ -/* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 1999 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G3 */ - - -const unsigned char Verisign_Class_3_Public_Primary_Certification_Authority___G3_certificate[1054]={ -0x30,0x82,0x04,0x1A,0x30,0x82,0x03,0x02,0x02,0x11,0x00,0x9B,0x7E,0x06,0x49,0xA3, -0x3E,0x62,0xB9,0xD5,0xEE,0x90,0x48,0x71,0x29,0xEF,0x57,0x30,0x0D,0x06,0x09,0x2A, -0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81,0xCA,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03, -0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49, -0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65, -0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74, -0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28, -0x63,0x29,0x20,0x31,0x39,0x39,0x39,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74, -0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79, -0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69,0x53, -0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62,0x6C, -0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x20,0x2D,0x20,0x47,0x33,0x30,0x1E,0x17,0x0D,0x39,0x39,0x31,0x30,0x30, -0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x36,0x30,0x37,0x31,0x36, -0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xCA,0x31,0x0B,0x30,0x09,0x06,0x03, -0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A, -0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E, -0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65,0x72,0x69,0x53, -0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72, -0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28,0x63,0x29,0x20, -0x31,0x39,0x39,0x39,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49, -0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72, -0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x45,0x30, -0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E, -0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20, -0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20, -0x2D,0x20,0x47,0x33,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A, -0x02,0x82,0x01,0x01,0x00,0xCB,0xBA,0x9C,0x52,0xFC,0x78,0x1F,0x1A,0x1E,0x6F,0x1B, -0x37,0x73,0xBD,0xF8,0xC9,0x6B,0x94,0x12,0x30,0x4F,0xF0,0x36,0x47,0xF5,0xD0,0x91, -0x0A,0xF5,0x17,0xC8,0xA5,0x61,0xC1,0x16,0x40,0x4D,0xFB,0x8A,0x61,0x90,0xE5,0x76, -0x20,0xC1,0x11,0x06,0x7D,0xAB,0x2C,0x6E,0xA6,0xF5,0x11,0x41,0x8E,0xFA,0x2D,0xAD, -0x2A,0x61,0x59,0xA4,0x67,0x26,0x4C,0xD0,0xE8,0xBC,0x52,0x5B,0x70,0x20,0x04,0x58, -0xD1,0x7A,0xC9,0xA4,0x69,0xBC,0x83,0x17,0x64,0xAD,0x05,0x8B,0xBC,0xD0,0x58,0xCE, -0x8D,0x8C,0xF5,0xEB,0xF0,0x42,0x49,0x0B,0x9D,0x97,0x27,0x67,0x32,0x6E,0xE1,0xAE, -0x93,0x15,0x1C,0x70,0xBC,0x20,0x4D,0x2F,0x18,0xDE,0x92,0x88,0xE8,0x6C,0x85,0x57, -0x11,0x1A,0xE9,0x7E,0xE3,0x26,0x11,0x54,0xA2,0x45,0x96,0x55,0x83,0xCA,0x30,0x89, -0xE8,0xDC,0xD8,0xA3,0xED,0x2A,0x80,0x3F,0x7F,0x79,0x65,0x57,0x3E,0x15,0x20,0x66, -0x08,0x2F,0x95,0x93,0xBF,0xAA,0x47,0x2F,0xA8,0x46,0x97,0xF0,0x12,0xE2,0xFE,0xC2, -0x0A,0x2B,0x51,0xE6,0x76,0xE6,0xB7,0x46,0xB7,0xE2,0x0D,0xA6,0xCC,0xA8,0xC3,0x4C, -0x59,0x55,0x89,0xE6,0xE8,0x53,0x5C,0x1C,0xEA,0x9D,0xF0,0x62,0x16,0x0B,0xA7,0xC9, -0x5F,0x0C,0xF0,0xDE,0xC2,0x76,0xCE,0xAF,0xF7,0x6A,0xF2,0xFA,0x41,0xA6,0xA2,0x33, -0x14,0xC9,0xE5,0x7A,0x63,0xD3,0x9E,0x62,0x37,0xD5,0x85,0x65,0x9E,0x0E,0xE6,0x53, -0x24,0x74,0x1B,0x5E,0x1D,0x12,0x53,0x5B,0xC7,0x2C,0xE7,0x83,0x49,0x3B,0x15,0xAE, -0x8A,0x68,0xB9,0x57,0x97,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x11,0x14, -0x96,0xC1,0xAB,0x92,0x08,0xF7,0x3F,0x2F,0xC9,0xB2,0xFE,0xE4,0x5A,0x9F,0x64,0xDE, -0xDB,0x21,0x4F,0x86,0x99,0x34,0x76,0x36,0x57,0xDD,0xD0,0x15,0x2F,0xC5,0xAD,0x7F, -0x15,0x1F,0x37,0x62,0x73,0x3E,0xD4,0xE7,0x5F,0xCE,0x17,0x03,0xDB,0x35,0xFA,0x2B, -0xDB,0xAE,0x60,0x09,0x5F,0x1E,0x5F,0x8F,0x6E,0xBB,0x0B,0x3D,0xEA,0x5A,0x13,0x1E, -0x0C,0x60,0x6F,0xB5,0xC0,0xB5,0x23,0x22,0x2E,0x07,0x0B,0xCB,0xA9,0x74,0xCB,0x47, -0xBB,0x1D,0xC1,0xD7,0xA5,0x6B,0xCC,0x2F,0xD2,0x42,0xFD,0x49,0xDD,0xA7,0x89,0xCF, -0x53,0xBA,0xDA,0x00,0x5A,0x28,0xBF,0x82,0xDF,0xF8,0xBA,0x13,0x1D,0x50,0x86,0x82, -0xFD,0x8E,0x30,0x8F,0x29,0x46,0xB0,0x1E,0x3D,0x35,0xDA,0x38,0x62,0x16,0x18,0x4A, -0xAD,0xE6,0xB6,0x51,0x6C,0xDE,0xAF,0x62,0xEB,0x01,0xD0,0x1E,0x24,0xFE,0x7A,0x8F, -0x12,0x1A,0x12,0x68,0xB8,0xFB,0x66,0x99,0x14,0x14,0x45,0x5C,0xAE,0xE7,0xAE,0x69, -0x17,0x81,0x2B,0x5A,0x37,0xC9,0x5E,0x2A,0xF4,0xC6,0xE2,0xA1,0x5C,0x54,0x9B,0xA6, -0x54,0x00,0xCF,0xF0,0xF1,0xC1,0xC7,0x98,0x30,0x1A,0x3B,0x36,0x16,0xDB,0xA3,0x6E, -0xEA,0xFD,0xAD,0xB2,0xC2,0xDA,0xEF,0x02,0x47,0x13,0x8A,0xC0,0xF1,0xB3,0x31,0xAD, -0x4F,0x1C,0xE1,0x4F,0x9C,0xAF,0x0F,0x0C,0x9D,0xF7,0x78,0x0D,0xD8,0xF4,0x35,0x56, -0x80,0xDA,0xB7,0x6D,0x17,0x8F,0x9D,0x1E,0x81,0x64,0xE1,0xFE,0xC5,0x45,0xBA,0xAD, -0x6B,0xB9,0x0A,0x7A,0x4E,0x4F,0x4B,0x84,0xEE,0x4B,0xF1,0x7D,0xDD,0x11, -}; - - -/* subject:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust ECC Certification Authority */ -/* issuer :/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust ECC Certification Authority */ - - -const unsigned char USERTrust_ECC_Certification_Authority_certificate[659]={ -0x30,0x82,0x02,0x8F,0x30,0x82,0x02,0x15,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x5C, -0x8B,0x99,0xC5,0x5A,0x94,0xC5,0xD2,0x71,0x56,0xDE,0xCD,0x89,0x80,0xCC,0x26,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x81,0x88,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x13,0x30,0x11,0x06, -0x03,0x55,0x04,0x08,0x13,0x0A,0x4E,0x65,0x77,0x20,0x4A,0x65,0x72,0x73,0x65,0x79, -0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x07,0x13,0x0B,0x4A,0x65,0x72,0x73,0x65, -0x79,0x20,0x43,0x69,0x74,0x79,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55,0x04,0x0A,0x13, -0x15,0x54,0x68,0x65,0x20,0x55,0x53,0x45,0x52,0x54,0x52,0x55,0x53,0x54,0x20,0x4E, -0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x2E,0x30,0x2C,0x06,0x03,0x55,0x04,0x03,0x13, -0x25,0x55,0x53,0x45,0x52,0x54,0x72,0x75,0x73,0x74,0x20,0x45,0x43,0x43,0x20,0x43, -0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x31,0x30,0x30,0x32,0x30,0x31, -0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x38,0x32, -0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0x88,0x31,0x0B,0x30,0x09,0x06,0x03,0x55, -0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x08,0x13, -0x0A,0x4E,0x65,0x77,0x20,0x4A,0x65,0x72,0x73,0x65,0x79,0x31,0x14,0x30,0x12,0x06, -0x03,0x55,0x04,0x07,0x13,0x0B,0x4A,0x65,0x72,0x73,0x65,0x79,0x20,0x43,0x69,0x74, -0x79,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55,0x04,0x0A,0x13,0x15,0x54,0x68,0x65,0x20, -0x55,0x53,0x45,0x52,0x54,0x52,0x55,0x53,0x54,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72, -0x6B,0x31,0x2E,0x30,0x2C,0x06,0x03,0x55,0x04,0x03,0x13,0x25,0x55,0x53,0x45,0x52, -0x54,0x72,0x75,0x73,0x74,0x20,0x45,0x43,0x43,0x20,0x43,0x65,0x72,0x74,0x69,0x66, -0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74, -0x79,0x30,0x76,0x30,0x10,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05, -0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00,0x04,0x1A,0xAC,0x54,0x5A,0xA9,0xF9,0x68, -0x23,0xE7,0x7A,0xD5,0x24,0x6F,0x53,0xC6,0x5A,0xD8,0x4B,0xAB,0xC6,0xD5,0xB6,0xD1, -0xE6,0x73,0x71,0xAE,0xDD,0x9C,0xD6,0x0C,0x61,0xFD,0xDB,0xA0,0x89,0x03,0xB8,0x05, -0x14,0xEC,0x57,0xCE,0xEE,0x5D,0x3F,0xE2,0x21,0xB3,0xCE,0xF7,0xD4,0x8A,0x79,0xE0, -0xA3,0x83,0x7E,0x2D,0x97,0xD0,0x61,0xC4,0xF1,0x99,0xDC,0x25,0x91,0x63,0xAB,0x7F, -0x30,0xA3,0xB4,0x70,0xE2,0xC7,0xA1,0x33,0x9C,0xF3,0xBF,0x2E,0x5C,0x53,0xB1,0x5F, -0xB3,0x7D,0x32,0x7F,0x8A,0x34,0xE3,0x79,0x79,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x3A,0xE1,0x09,0x86,0xD4,0xCF,0x19,0xC2, -0x96,0x76,0x74,0x49,0x76,0xDC,0xE0,0x35,0xC6,0x63,0x63,0x9A,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03, -0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0A,0x06, -0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x03,0x68,0x00,0x30,0x65,0x02,0x30, -0x36,0x67,0xA1,0x16,0x08,0xDC,0xE4,0x97,0x00,0x41,0x1D,0x4E,0xBE,0xE1,0x63,0x01, -0xCF,0x3B,0xAA,0x42,0x11,0x64,0xA0,0x9D,0x94,0x39,0x02,0x11,0x79,0x5C,0x7B,0x1D, -0xFA,0x64,0xB9,0xEE,0x16,0x42,0xB3,0xBF,0x8A,0xC2,0x09,0xC4,0xEC,0xE4,0xB1,0x4D, -0x02,0x31,0x00,0xE9,0x2A,0x61,0x47,0x8C,0x52,0x4A,0x4B,0x4E,0x18,0x70,0xF6,0xD6, -0x44,0xD6,0x6E,0xF5,0x83,0xBA,0x6D,0x58,0xBD,0x24,0xD9,0x56,0x48,0xEA,0xEF,0xC4, -0xA2,0x46,0x81,0x88,0x6A,0x3A,0x46,0xD1,0xA9,0x9B,0x4D,0xC9,0x61,0xDA,0xD1,0x5D, -0x57,0x6A,0x18, -}; - - -/* subject:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA */ -/* issuer :/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA */ - - -const unsigned char GeoTrust_Global_CA_certificate[856]={ -0x30,0x82,0x03,0x54,0x30,0x82,0x02,0x3C,0xA0,0x03,0x02,0x01,0x02,0x02,0x03,0x02, -0x34,0x56,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05, -0x00,0x30,0x42,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53, -0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72, -0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04, -0x03,0x13,0x12,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,0x6F,0x62, -0x61,0x6C,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,0x30,0x32,0x30,0x35,0x32,0x31,0x30, -0x34,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x32,0x30,0x35,0x32,0x31,0x30,0x34, -0x30,0x30,0x30,0x30,0x5A,0x30,0x42,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47, -0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1B,0x30,0x19, -0x06,0x03,0x55,0x04,0x03,0x13,0x12,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20, -0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F, -0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xDA,0xCC,0x18,0x63,0x30,0xFD, -0xF4,0x17,0x23,0x1A,0x56,0x7E,0x5B,0xDF,0x3C,0x6C,0x38,0xE4,0x71,0xB7,0x78,0x91, -0xD4,0xBC,0xA1,0xD8,0x4C,0xF8,0xA8,0x43,0xB6,0x03,0xE9,0x4D,0x21,0x07,0x08,0x88, -0xDA,0x58,0x2F,0x66,0x39,0x29,0xBD,0x05,0x78,0x8B,0x9D,0x38,0xE8,0x05,0xB7,0x6A, -0x7E,0x71,0xA4,0xE6,0xC4,0x60,0xA6,0xB0,0xEF,0x80,0xE4,0x89,0x28,0x0F,0x9E,0x25, -0xD6,0xED,0x83,0xF3,0xAD,0xA6,0x91,0xC7,0x98,0xC9,0x42,0x18,0x35,0x14,0x9D,0xAD, -0x98,0x46,0x92,0x2E,0x4F,0xCA,0xF1,0x87,0x43,0xC1,0x16,0x95,0x57,0x2D,0x50,0xEF, -0x89,0x2D,0x80,0x7A,0x57,0xAD,0xF2,0xEE,0x5F,0x6B,0xD2,0x00,0x8D,0xB9,0x14,0xF8, -0x14,0x15,0x35,0xD9,0xC0,0x46,0xA3,0x7B,0x72,0xC8,0x91,0xBF,0xC9,0x55,0x2B,0xCD, -0xD0,0x97,0x3E,0x9C,0x26,0x64,0xCC,0xDF,0xCE,0x83,0x19,0x71,0xCA,0x4E,0xE6,0xD4, -0xD5,0x7B,0xA9,0x19,0xCD,0x55,0xDE,0xC8,0xEC,0xD2,0x5E,0x38,0x53,0xE5,0x5C,0x4F, -0x8C,0x2D,0xFE,0x50,0x23,0x36,0xFC,0x66,0xE6,0xCB,0x8E,0xA4,0x39,0x19,0x00,0xB7, -0x95,0x02,0x39,0x91,0x0B,0x0E,0xFE,0x38,0x2E,0xD1,0x1D,0x05,0x9A,0xF6,0x4D,0x3E, -0x6F,0x0F,0x07,0x1D,0xAF,0x2C,0x1E,0x8F,0x60,0x39,0xE2,0xFA,0x36,0x53,0x13,0x39, -0xD4,0x5E,0x26,0x2B,0xDB,0x3D,0xA8,0x14,0xBD,0x32,0xEB,0x18,0x03,0x28,0x52,0x04, -0x71,0xE5,0xAB,0x33,0x3D,0xE1,0x38,0xBB,0x07,0x36,0x84,0x62,0x9C,0x79,0xEA,0x16, -0x30,0xF4,0x5F,0xC0,0x2B,0xE8,0x71,0x6B,0xE4,0xF9,0x02,0x03,0x01,0x00,0x01,0xA3, -0x53,0x30,0x51,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xC0, -0x7A,0x98,0x68,0x8D,0x89,0xFB,0xAB,0x05,0x64,0x0C,0x11,0x7D,0xAA,0x7D,0x65,0xB8, -0xCA,0xCC,0x4E,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14, -0xC0,0x7A,0x98,0x68,0x8D,0x89,0xFB,0xAB,0x05,0x64,0x0C,0x11,0x7D,0xAA,0x7D,0x65, -0xB8,0xCA,0xCC,0x4E,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x35,0xE3,0x29,0x6A,0xE5,0x2F,0x5D,0x54, -0x8E,0x29,0x50,0x94,0x9F,0x99,0x1A,0x14,0xE4,0x8F,0x78,0x2A,0x62,0x94,0xA2,0x27, -0x67,0x9E,0xD0,0xCF,0x1A,0x5E,0x47,0xE9,0xC1,0xB2,0xA4,0xCF,0xDD,0x41,0x1A,0x05, -0x4E,0x9B,0x4B,0xEE,0x4A,0x6F,0x55,0x52,0xB3,0x24,0xA1,0x37,0x0A,0xEB,0x64,0x76, -0x2A,0x2E,0x2C,0xF3,0xFD,0x3B,0x75,0x90,0xBF,0xFA,0x71,0xD8,0xC7,0x3D,0x37,0xD2, -0xB5,0x05,0x95,0x62,0xB9,0xA6,0xDE,0x89,0x3D,0x36,0x7B,0x38,0x77,0x48,0x97,0xAC, -0xA6,0x20,0x8F,0x2E,0xA6,0xC9,0x0C,0xC2,0xB2,0x99,0x45,0x00,0xC7,0xCE,0x11,0x51, -0x22,0x22,0xE0,0xA5,0xEA,0xB6,0x15,0x48,0x09,0x64,0xEA,0x5E,0x4F,0x74,0xF7,0x05, -0x3E,0xC7,0x8A,0x52,0x0C,0xDB,0x15,0xB4,0xBD,0x6D,0x9B,0xE5,0xC6,0xB1,0x54,0x68, -0xA9,0xE3,0x69,0x90,0xB6,0x9A,0xA5,0x0F,0xB8,0xB9,0x3F,0x20,0x7D,0xAE,0x4A,0xB5, -0xB8,0x9C,0xE4,0x1D,0xB6,0xAB,0xE6,0x94,0xA5,0xC1,0xC7,0x83,0xAD,0xDB,0xF5,0x27, -0x87,0x0E,0x04,0x6C,0xD5,0xFF,0xDD,0xA0,0x5D,0xED,0x87,0x52,0xB7,0x2B,0x15,0x02, -0xAE,0x39,0xA6,0x6A,0x74,0xE9,0xDA,0xC4,0xE7,0xBC,0x4D,0x34,0x1E,0xA9,0x5C,0x4D, -0x33,0x5F,0x92,0x09,0x2F,0x88,0x66,0x5D,0x77,0x97,0xC7,0x1D,0x76,0x13,0xA9,0xD5, -0xE5,0xF1,0x16,0x09,0x11,0x35,0xD5,0xAC,0xDB,0x24,0x71,0x70,0x2C,0x98,0x56,0x0B, -0xD9,0x17,0xB4,0xD1,0xE3,0x51,0x2B,0x5E,0x75,0xE8,0xD5,0xD0,0xDC,0x4F,0x34,0xED, -0xC2,0x05,0x66,0x80,0xA1,0xCB,0xE6,0x33, -}; - - -/* subject:/C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./CN=Starfield Root Certificate Authority - G2 */ -/* issuer :/C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./CN=Starfield Root Certificate Authority - G2 */ - - -const unsigned char Starfield_Root_Certificate_Authority___G2_certificate[993]={ -0x30,0x82,0x03,0xDD,0x30,0x82,0x02,0xC5,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x00, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30, -0x81,0x8F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31, -0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x08,0x13,0x07,0x41,0x72,0x69,0x7A,0x6F,0x6E, -0x61,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x07,0x13,0x0A,0x53,0x63,0x6F,0x74, -0x74,0x73,0x64,0x61,0x6C,0x65,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x0A,0x13, -0x1C,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x54,0x65,0x63,0x68,0x6E, -0x6F,0x6C,0x6F,0x67,0x69,0x65,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x32,0x30, -0x30,0x06,0x03,0x55,0x04,0x03,0x13,0x29,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C, -0x64,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47, -0x32,0x30,0x1E,0x17,0x0D,0x30,0x39,0x30,0x39,0x30,0x31,0x30,0x30,0x30,0x30,0x30, -0x30,0x5A,0x17,0x0D,0x33,0x37,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39, -0x5A,0x30,0x81,0x8F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x08,0x13,0x07,0x41,0x72,0x69,0x7A, -0x6F,0x6E,0x61,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x07,0x13,0x0A,0x53,0x63, -0x6F,0x74,0x74,0x73,0x64,0x61,0x6C,0x65,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04, -0x0A,0x13,0x1C,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x54,0x65,0x63, -0x68,0x6E,0x6F,0x6C,0x6F,0x67,0x69,0x65,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31, -0x32,0x30,0x30,0x06,0x03,0x55,0x04,0x03,0x13,0x29,0x53,0x74,0x61,0x72,0x66,0x69, -0x65,0x6C,0x64,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69, -0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D, -0x20,0x47,0x32,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02, -0x82,0x01,0x01,0x00,0xBD,0xED,0xC1,0x03,0xFC,0xF6,0x8F,0xFC,0x02,0xB1,0x6F,0x5B, -0x9F,0x48,0xD9,0x9D,0x79,0xE2,0xA2,0xB7,0x03,0x61,0x56,0x18,0xC3,0x47,0xB6,0xD7, -0xCA,0x3D,0x35,0x2E,0x89,0x43,0xF7,0xA1,0x69,0x9B,0xDE,0x8A,0x1A,0xFD,0x13,0x20, -0x9C,0xB4,0x49,0x77,0x32,0x29,0x56,0xFD,0xB9,0xEC,0x8C,0xDD,0x22,0xFA,0x72,0xDC, -0x27,0x61,0x97,0xEE,0xF6,0x5A,0x84,0xEC,0x6E,0x19,0xB9,0x89,0x2C,0xDC,0x84,0x5B, -0xD5,0x74,0xFB,0x6B,0x5F,0xC5,0x89,0xA5,0x10,0x52,0x89,0x46,0x55,0xF4,0xB8,0x75, -0x1C,0xE6,0x7F,0xE4,0x54,0xAE,0x4B,0xF8,0x55,0x72,0x57,0x02,0x19,0xF8,0x17,0x71, -0x59,0xEB,0x1E,0x28,0x07,0x74,0xC5,0x9D,0x48,0xBE,0x6C,0xB4,0xF4,0xA4,0xB0,0xF3, -0x64,0x37,0x79,0x92,0xC0,0xEC,0x46,0x5E,0x7F,0xE1,0x6D,0x53,0x4C,0x62,0xAF,0xCD, -0x1F,0x0B,0x63,0xBB,0x3A,0x9D,0xFB,0xFC,0x79,0x00,0x98,0x61,0x74,0xCF,0x26,0x82, -0x40,0x63,0xF3,0xB2,0x72,0x6A,0x19,0x0D,0x99,0xCA,0xD4,0x0E,0x75,0xCC,0x37,0xFB, -0x8B,0x89,0xC1,0x59,0xF1,0x62,0x7F,0x5F,0xB3,0x5F,0x65,0x30,0xF8,0xA7,0xB7,0x4D, -0x76,0x5A,0x1E,0x76,0x5E,0x34,0xC0,0xE8,0x96,0x56,0x99,0x8A,0xB3,0xF0,0x7F,0xA4, -0xCD,0xBD,0xDC,0x32,0x31,0x7C,0x91,0xCF,0xE0,0x5F,0x11,0xF8,0x6B,0xAA,0x49,0x5C, -0xD1,0x99,0x94,0xD1,0xA2,0xE3,0x63,0x5B,0x09,0x76,0xB5,0x56,0x62,0xE1,0x4B,0x74, -0x1D,0x96,0xD4,0x26,0xD4,0x08,0x04,0x59,0xD0,0x98,0x0E,0x0E,0xE6,0xDE,0xFC,0xC3, -0xEC,0x1F,0x90,0xF1,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06, -0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E, -0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D, -0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x7C,0x0C,0x32,0x1F,0xA7,0xD9,0x30, -0x7F,0xC4,0x7D,0x68,0xA3,0x62,0xA8,0xA1,0xCE,0xAB,0x07,0x5B,0x27,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01, -0x00,0x11,0x59,0xFA,0x25,0x4F,0x03,0x6F,0x94,0x99,0x3B,0x9A,0x1F,0x82,0x85,0x39, -0xD4,0x76,0x05,0x94,0x5E,0xE1,0x28,0x93,0x6D,0x62,0x5D,0x09,0xC2,0xA0,0xA8,0xD4, -0xB0,0x75,0x38,0xF1,0x34,0x6A,0x9D,0xE4,0x9F,0x8A,0x86,0x26,0x51,0xE6,0x2C,0xD1, -0xC6,0x2D,0x6E,0x95,0x20,0x4A,0x92,0x01,0xEC,0xB8,0x8A,0x67,0x7B,0x31,0xE2,0x67, -0x2E,0x8C,0x95,0x03,0x26,0x2E,0x43,0x9D,0x4A,0x31,0xF6,0x0E,0xB5,0x0C,0xBB,0xB7, -0xE2,0x37,0x7F,0x22,0xBA,0x00,0xA3,0x0E,0x7B,0x52,0xFB,0x6B,0xBB,0x3B,0xC4,0xD3, -0x79,0x51,0x4E,0xCD,0x90,0xF4,0x67,0x07,0x19,0xC8,0x3C,0x46,0x7A,0x0D,0x01,0x7D, -0xC5,0x58,0xE7,0x6D,0xE6,0x85,0x30,0x17,0x9A,0x24,0xC4,0x10,0xE0,0x04,0xF7,0xE0, -0xF2,0x7F,0xD4,0xAA,0x0A,0xFF,0x42,0x1D,0x37,0xED,0x94,0xE5,0x64,0x59,0x12,0x20, -0x77,0x38,0xD3,0x32,0x3E,0x38,0x81,0x75,0x96,0x73,0xFA,0x68,0x8F,0xB1,0xCB,0xCE, -0x1F,0xC5,0xEC,0xFA,0x9C,0x7E,0xCF,0x7E,0xB1,0xF1,0x07,0x2D,0xB6,0xFC,0xBF,0xCA, -0xA4,0xBF,0xD0,0x97,0x05,0x4A,0xBC,0xEA,0x18,0x28,0x02,0x90,0xBD,0x54,0x78,0x09, -0x21,0x71,0xD3,0xD1,0x7D,0x1D,0xD9,0x16,0xB0,0xA9,0x61,0x3D,0xD0,0x0A,0x00,0x22, -0xFC,0xC7,0x7B,0xCB,0x09,0x64,0x45,0x0B,0x3B,0x40,0x81,0xF7,0x7D,0x7C,0x32,0xF5, -0x98,0xCA,0x58,0x8E,0x7D,0x2A,0xEE,0x90,0x59,0x73,0x64,0xF9,0x36,0x74,0x5E,0x25, -0xA1,0xF5,0x66,0x05,0x2E,0x7F,0x39,0x15,0xA9,0x2A,0xFB,0x50,0x8B,0x8E,0x85,0x69, -0xF4, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root G3 */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root G3 */ - - -const unsigned char DigiCert_Global_Root_G3_certificate[579]={ -0x30,0x82,0x02,0x3F,0x30,0x82,0x01,0xC5,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x05, -0x55,0x56,0xBC,0xF2,0x5E,0xA4,0x35,0x35,0xC3,0xA4,0x0F,0xD5,0xAB,0x45,0x72,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x61,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06,0x03, -0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x49,0x6E, -0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77,0x77,0x77,0x2E, -0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x20,0x30,0x1E, -0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20, -0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,0x6F,0x74,0x20,0x47,0x33,0x30,0x1E, -0x17,0x0D,0x31,0x33,0x30,0x38,0x30,0x31,0x31,0x32,0x30,0x30,0x30,0x30,0x5A,0x17, -0x0D,0x33,0x38,0x30,0x31,0x31,0x35,0x31,0x32,0x30,0x30,0x30,0x30,0x5A,0x30,0x61, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30, -0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77, -0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31, -0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x44,0x69,0x67,0x69,0x43,0x65, -0x72,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,0x6F,0x74,0x20,0x47, -0x33,0x30,0x76,0x30,0x10,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05, -0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00,0x04,0xDD,0xA7,0xD9,0xBB,0x8A,0xB8,0x0B, -0xFB,0x0B,0x7F,0x21,0xD2,0xF0,0xBE,0xBE,0x73,0xF3,0x33,0x5D,0x1A,0xBC,0x34,0xEA, -0xDE,0xC6,0x9B,0xBC,0xD0,0x95,0xF6,0xF0,0xCC,0xD0,0x0B,0xBA,0x61,0x5B,0x51,0x46, -0x7E,0x9E,0x2D,0x9F,0xEE,0x8E,0x63,0x0C,0x17,0xEC,0x07,0x70,0xF5,0xCF,0x84,0x2E, -0x40,0x83,0x9C,0xE8,0x3F,0x41,0x6D,0x3B,0xAD,0xD3,0xA4,0x14,0x59,0x36,0x78,0x9D, -0x03,0x43,0xEE,0x10,0x13,0x6C,0x72,0xDE,0xAE,0x88,0xA7,0xA1,0x6B,0xB5,0x43,0xCE, -0x67,0xDC,0x23,0xFF,0x03,0x1C,0xA3,0xE2,0x3E,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06, -0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E, -0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x1D, -0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xB3,0xDB,0x48,0xA4,0xF9,0xA1,0xC5, -0xD8,0xAE,0x36,0x41,0xCC,0x11,0x63,0x69,0x62,0x29,0xBC,0x4B,0xC6,0x30,0x0A,0x06, -0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x03,0x68,0x00,0x30,0x65,0x02,0x31, -0x00,0xAD,0xBC,0xF2,0x6C,0x3F,0x12,0x4A,0xD1,0x2D,0x39,0xC3,0x0A,0x09,0x97,0x73, -0xF4,0x88,0x36,0x8C,0x88,0x27,0xBB,0xE6,0x88,0x8D,0x50,0x85,0xA7,0x63,0xF9,0x9E, -0x32,0xDE,0x66,0x93,0x0F,0xF1,0xCC,0xB1,0x09,0x8F,0xDD,0x6C,0xAB,0xFA,0x6B,0x7F, -0xA0,0x02,0x30,0x39,0x66,0x5B,0xC2,0x64,0x8D,0xB8,0x9E,0x50,0xDC,0xA8,0xD5,0x49, -0xA2,0xED,0xC7,0xDC,0xD1,0x49,0x7F,0x17,0x01,0xB8,0xC8,0x86,0x8F,0x4E,0x8C,0x88, -0x2B,0xA8,0x9A,0xA9,0x8A,0xC5,0xD1,0x00,0xBD,0xF8,0x54,0xE2,0x9A,0xE5,0x5B,0x7C, -0xB3,0x27,0x17, -}; - - -/* subject:/C=US/O=thawte, Inc./OU=(c) 2007 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA - G2 */ -/* issuer :/C=US/O=thawte, Inc./OU=(c) 2007 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA - G2 */ - - -const unsigned char thawte_Primary_Root_CA___G2_certificate[652]={ -0x30,0x82,0x02,0x88,0x30,0x82,0x02,0x0D,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x35, -0xFC,0x26,0x5C,0xD9,0x84,0x4F,0xC9,0x3D,0x26,0x3D,0x57,0x9B,0xAE,0xD7,0x56,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x81,0x84,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E, -0x63,0x2E,0x31,0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x0B,0x13,0x2F,0x28,0x63,0x29, -0x20,0x32,0x30,0x30,0x37,0x20,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E, -0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69, -0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x24,0x30,0x22, -0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x74,0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72, -0x69,0x6D,0x61,0x72,0x79,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20, -0x47,0x32,0x30,0x1E,0x17,0x0D,0x30,0x37,0x31,0x31,0x30,0x35,0x30,0x30,0x30,0x30, -0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x38,0x32,0x33,0x35,0x39,0x35, -0x39,0x5A,0x30,0x81,0x84,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02, -0x55,0x53,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61, -0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x38,0x30,0x36,0x06,0x03,0x55, -0x04,0x0B,0x13,0x2F,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x37,0x20,0x74,0x68,0x61, -0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20, -0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F, -0x6E,0x6C,0x79,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x74,0x68, -0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x52,0x6F,0x6F, -0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x47,0x32,0x30,0x76,0x30,0x10,0x06,0x07,0x2A, -0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05,0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00, -0x04,0xA2,0xD5,0x9C,0x82,0x7B,0x95,0x9D,0xF1,0x52,0x78,0x87,0xFE,0x8A,0x16,0xBF, -0x05,0xE6,0xDF,0xA3,0x02,0x4F,0x0D,0x07,0xC6,0x00,0x51,0xBA,0x0C,0x02,0x52,0x2D, -0x22,0xA4,0x42,0x39,0xC4,0xFE,0x8F,0xEA,0xC9,0xC1,0xBE,0xD4,0x4D,0xFF,0x9F,0x7A, -0x9E,0xE2,0xB1,0x7C,0x9A,0xAD,0xA7,0x86,0x09,0x73,0x87,0xD1,0xE7,0x9A,0xE3,0x7A, -0xA5,0xAA,0x6E,0xFB,0xBA,0xB3,0x70,0xC0,0x67,0x88,0xA2,0x35,0xD4,0xA3,0x9A,0xB1, -0xFD,0xAD,0xC2,0xEF,0x31,0xFA,0xA8,0xB9,0xF3,0xFB,0x08,0xC6,0x91,0xD1,0xFB,0x29, -0x95,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0x9A,0xD8,0x00,0x30,0x00,0xE7,0x6B,0x7F,0x85,0x18,0xEE,0x8B,0xB6,0xCE,0x8A, -0x0C,0xF8,0x11,0xE1,0xBB,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03, -0x03,0x03,0x69,0x00,0x30,0x66,0x02,0x31,0x00,0xDD,0xF8,0xE0,0x57,0x47,0x5B,0xA7, -0xE6,0x0A,0xC3,0xBD,0xF5,0x80,0x8A,0x97,0x35,0x0D,0x1B,0x89,0x3C,0x54,0x86,0x77, -0x28,0xCA,0xA1,0xF4,0x79,0xDE,0xB5,0xE6,0x38,0xB0,0xF0,0x65,0x70,0x8C,0x7F,0x02, -0x54,0xC2,0xBF,0xFF,0xD8,0xA1,0x3E,0xD9,0xCF,0x02,0x31,0x00,0xC4,0x8D,0x94,0xFC, -0xDC,0x53,0xD2,0xDC,0x9D,0x78,0x16,0x1F,0x15,0x33,0x23,0x53,0x52,0xE3,0x5A,0x31, -0x5D,0x9D,0xCA,0xAE,0xBD,0x13,0x29,0x44,0x0D,0x27,0x5B,0xA8,0xE7,0x68,0x9C,0x12, -0xF7,0x58,0x3F,0x2E,0x72,0x02,0x57,0xA3,0x8F,0xA1,0x14,0x2E, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2008 VeriSign, Inc. - For authorized use only/CN=VeriSign Universal Root Certification Authority */ -/* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2008 VeriSign, Inc. - For authorized use only/CN=VeriSign Universal Root Certification Authority */ - - -const unsigned char VeriSign_Universal_Root_Certification_Authority_certificate[1213]={ -0x30,0x82,0x04,0xB9,0x30,0x82,0x03,0xA1,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x40, -0x1A,0xC4,0x64,0x21,0xB3,0x13,0x21,0x03,0x0E,0xBB,0xE4,0x12,0x1A,0xC5,0x1D,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x81, -0xBD,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17, -0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B, -0x13,0x16,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74, -0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04, -0x0B,0x13,0x31,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x38,0x20,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72, -0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20, -0x6F,0x6E,0x6C,0x79,0x31,0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x03,0x13,0x2F,0x56, -0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61, -0x6C,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E, -0x17,0x0D,0x30,0x38,0x30,0x34,0x30,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17, -0x0D,0x33,0x37,0x31,0x32,0x30,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81, -0xBD,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17, -0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B, -0x13,0x16,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74, -0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04, -0x0B,0x13,0x31,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x38,0x20,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72, -0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20, -0x6F,0x6E,0x6C,0x79,0x31,0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x03,0x13,0x2F,0x56, -0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61, -0x6C,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82, -0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05, -0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xC7, -0x61,0x37,0x5E,0xB1,0x01,0x34,0xDB,0x62,0xD7,0x15,0x9B,0xFF,0x58,0x5A,0x8C,0x23, -0x23,0xD6,0x60,0x8E,0x91,0xD7,0x90,0x98,0x83,0x7A,0xE6,0x58,0x19,0x38,0x8C,0xC5, -0xF6,0xE5,0x64,0x85,0xB4,0xA2,0x71,0xFB,0xED,0xBD,0xB9,0xDA,0xCD,0x4D,0x00,0xB4, -0xC8,0x2D,0x73,0xA5,0xC7,0x69,0x71,0x95,0x1F,0x39,0x3C,0xB2,0x44,0x07,0x9C,0xE8, -0x0E,0xFA,0x4D,0x4A,0xC4,0x21,0xDF,0x29,0x61,0x8F,0x32,0x22,0x61,0x82,0xC5,0x87, -0x1F,0x6E,0x8C,0x7C,0x5F,0x16,0x20,0x51,0x44,0xD1,0x70,0x4F,0x57,0xEA,0xE3,0x1C, -0xE3,0xCC,0x79,0xEE,0x58,0xD8,0x0E,0xC2,0xB3,0x45,0x93,0xC0,0x2C,0xE7,0x9A,0x17, -0x2B,0x7B,0x00,0x37,0x7A,0x41,0x33,0x78,0xE1,0x33,0xE2,0xF3,0x10,0x1A,0x7F,0x87, -0x2C,0xBE,0xF6,0xF5,0xF7,0x42,0xE2,0xE5,0xBF,0x87,0x62,0x89,0x5F,0x00,0x4B,0xDF, -0xC5,0xDD,0xE4,0x75,0x44,0x32,0x41,0x3A,0x1E,0x71,0x6E,0x69,0xCB,0x0B,0x75,0x46, -0x08,0xD1,0xCA,0xD2,0x2B,0x95,0xD0,0xCF,0xFB,0xB9,0x40,0x6B,0x64,0x8C,0x57,0x4D, -0xFC,0x13,0x11,0x79,0x84,0xED,0x5E,0x54,0xF6,0x34,0x9F,0x08,0x01,0xF3,0x10,0x25, -0x06,0x17,0x4A,0xDA,0xF1,0x1D,0x7A,0x66,0x6B,0x98,0x60,0x66,0xA4,0xD9,0xEF,0xD2, -0x2E,0x82,0xF1,0xF0,0xEF,0x09,0xEA,0x44,0xC9,0x15,0x6A,0xE2,0x03,0x6E,0x33,0xD3, -0xAC,0x9F,0x55,0x00,0xC7,0xF6,0x08,0x6A,0x94,0xB9,0x5F,0xDC,0xE0,0x33,0xF1,0x84, -0x60,0xF9,0x5B,0x27,0x11,0xB4,0xFC,0x16,0xF2,0xBB,0x56,0x6A,0x80,0x25,0x8D,0x02, -0x03,0x01,0x00,0x01,0xA3,0x81,0xB2,0x30,0x81,0xAF,0x30,0x0F,0x06,0x03,0x55,0x1D, -0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55, -0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x6D,0x06,0x08,0x2B, -0x06,0x01,0x05,0x05,0x07,0x01,0x0C,0x04,0x61,0x30,0x5F,0xA1,0x5D,0xA0,0x5B,0x30, -0x59,0x30,0x57,0x30,0x55,0x16,0x09,0x69,0x6D,0x61,0x67,0x65,0x2F,0x67,0x69,0x66, -0x30,0x21,0x30,0x1F,0x30,0x07,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x04,0x14,0x8F, -0xE5,0xD3,0x1A,0x86,0xAC,0x8D,0x8E,0x6B,0xC3,0xCF,0x80,0x6A,0xD4,0x48,0x18,0x2C, -0x7B,0x19,0x2E,0x30,0x25,0x16,0x23,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x6C,0x6F, -0x67,0x6F,0x2E,0x76,0x65,0x72,0x69,0x73,0x69,0x67,0x6E,0x2E,0x63,0x6F,0x6D,0x2F, -0x76,0x73,0x6C,0x6F,0x67,0x6F,0x2E,0x67,0x69,0x66,0x30,0x1D,0x06,0x03,0x55,0x1D, -0x0E,0x04,0x16,0x04,0x14,0xB6,0x77,0xFA,0x69,0x48,0x47,0x9F,0x53,0x12,0xD5,0xC2, -0xEA,0x07,0x32,0x76,0x07,0xD1,0x97,0x07,0x19,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x4A,0xF8,0xF8, -0xB0,0x03,0xE6,0x2C,0x67,0x7B,0xE4,0x94,0x77,0x63,0xCC,0x6E,0x4C,0xF9,0x7D,0x0E, -0x0D,0xDC,0xC8,0xB9,0x35,0xB9,0x70,0x4F,0x63,0xFA,0x24,0xFA,0x6C,0x83,0x8C,0x47, -0x9D,0x3B,0x63,0xF3,0x9A,0xF9,0x76,0x32,0x95,0x91,0xB1,0x77,0xBC,0xAC,0x9A,0xBE, -0xB1,0xE4,0x31,0x21,0xC6,0x81,0x95,0x56,0x5A,0x0E,0xB1,0xC2,0xD4,0xB1,0xA6,0x59, -0xAC,0xF1,0x63,0xCB,0xB8,0x4C,0x1D,0x59,0x90,0x4A,0xEF,0x90,0x16,0x28,0x1F,0x5A, -0xAE,0x10,0xFB,0x81,0x50,0x38,0x0C,0x6C,0xCC,0xF1,0x3D,0xC3,0xF5,0x63,0xE3,0xB3, -0xE3,0x21,0xC9,0x24,0x39,0xE9,0xFD,0x15,0x66,0x46,0xF4,0x1B,0x11,0xD0,0x4D,0x73, -0xA3,0x7D,0x46,0xF9,0x3D,0xED,0xA8,0x5F,0x62,0xD4,0xF1,0x3F,0xF8,0xE0,0x74,0x57, -0x2B,0x18,0x9D,0x81,0xB4,0xC4,0x28,0xDA,0x94,0x97,0xA5,0x70,0xEB,0xAC,0x1D,0xBE, -0x07,0x11,0xF0,0xD5,0xDB,0xDD,0xE5,0x8C,0xF0,0xD5,0x32,0xB0,0x83,0xE6,0x57,0xE2, -0x8F,0xBF,0xBE,0xA1,0xAA,0xBF,0x3D,0x1D,0xB5,0xD4,0x38,0xEA,0xD7,0xB0,0x5C,0x3A, -0x4F,0x6A,0x3F,0x8F,0xC0,0x66,0x6C,0x63,0xAA,0xE9,0xD9,0xA4,0x16,0xF4,0x81,0xD1, -0x95,0x14,0x0E,0x7D,0xCD,0x95,0x34,0xD9,0xD2,0x8F,0x70,0x73,0x81,0x7B,0x9C,0x7E, -0xBD,0x98,0x61,0xD8,0x45,0x87,0x98,0x90,0xC5,0xEB,0x86,0x30,0xC6,0x35,0xBF,0xF0, -0xFF,0xC3,0x55,0x88,0x83,0x4B,0xEF,0x05,0x92,0x06,0x71,0xF2,0xB8,0x98,0x93,0xB7, -0xEC,0xCD,0x82,0x61,0xF1,0x38,0xE6,0x4F,0x97,0x98,0x2A,0x5A,0x8D, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2007 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G4 */ -/* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2007 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G4 */ - - -const unsigned char VeriSign_Class_3_Public_Primary_Certification_Authority___G4_certificate[904]={ -0x30,0x82,0x03,0x84,0x30,0x82,0x03,0x0A,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x2F, -0x80,0xFE,0x23,0x8C,0x0E,0x22,0x0F,0x48,0x67,0x12,0x28,0x91,0x87,0xAC,0xB3,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x81,0xCA,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20, -0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56, -0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65, -0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31, -0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x37,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75, -0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C, -0x79,0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62, -0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x34,0x30,0x1E,0x17,0x0D,0x30,0x37,0x31,0x31, -0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31, -0x38,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xCA,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04, -0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F, -0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28,0x63,0x29, -0x20,0x32,0x30,0x30,0x37,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20, -0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F, -0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x45, -0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62,0x6C,0x69,0x63, -0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69, -0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79, -0x20,0x2D,0x20,0x47,0x34,0x30,0x76,0x30,0x10,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D, -0x02,0x01,0x06,0x05,0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00,0x04,0xA7,0x56,0x7A, -0x7C,0x52,0xDA,0x64,0x9B,0x0E,0x2D,0x5C,0xD8,0x5E,0xAC,0x92,0x3D,0xFE,0x01,0xE6, -0x19,0x4A,0x3D,0x14,0x03,0x4B,0xFA,0x60,0x27,0x20,0xD9,0x83,0x89,0x69,0xFA,0x54, -0xC6,0x9A,0x18,0x5E,0x55,0x2A,0x64,0xDE,0x06,0xF6,0x8D,0x4A,0x3B,0xAD,0x10,0x3C, -0x65,0x3D,0x90,0x88,0x04,0x89,0xE0,0x30,0x61,0xB3,0xAE,0x5D,0x01,0xA7,0x7B,0xDE, -0x7C,0xB2,0xBE,0xCA,0x65,0x61,0x00,0x86,0xAE,0xDA,0x8F,0x7B,0xD0,0x89,0xAD,0x4D, -0x1D,0x59,0x9A,0x41,0xB1,0xBC,0x47,0x80,0xDC,0x9E,0x62,0xC3,0xF9,0xA3,0x81,0xB2, -0x30,0x81,0xAF,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x06,0x30,0x6D,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0C, -0x04,0x61,0x30,0x5F,0xA1,0x5D,0xA0,0x5B,0x30,0x59,0x30,0x57,0x30,0x55,0x16,0x09, -0x69,0x6D,0x61,0x67,0x65,0x2F,0x67,0x69,0x66,0x30,0x21,0x30,0x1F,0x30,0x07,0x06, -0x05,0x2B,0x0E,0x03,0x02,0x1A,0x04,0x14,0x8F,0xE5,0xD3,0x1A,0x86,0xAC,0x8D,0x8E, -0x6B,0xC3,0xCF,0x80,0x6A,0xD4,0x48,0x18,0x2C,0x7B,0x19,0x2E,0x30,0x25,0x16,0x23, -0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x6C,0x6F,0x67,0x6F,0x2E,0x76,0x65,0x72,0x69, -0x73,0x69,0x67,0x6E,0x2E,0x63,0x6F,0x6D,0x2F,0x76,0x73,0x6C,0x6F,0x67,0x6F,0x2E, -0x67,0x69,0x66,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xB3,0x16, -0x91,0xFD,0xEE,0xA6,0x6E,0xE4,0xB5,0x2E,0x49,0x8F,0x87,0x78,0x81,0x80,0xEC,0xE5, -0xB1,0xB5,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x03,0x68, -0x00,0x30,0x65,0x02,0x30,0x66,0x21,0x0C,0x18,0x26,0x60,0x5A,0x38,0x7B,0x56,0x42, -0xE0,0xA7,0xFC,0x36,0x84,0x51,0x91,0x20,0x2C,0x76,0x4D,0x43,0x3D,0xC4,0x1D,0x84, -0x23,0xD0,0xAC,0xD6,0x7C,0x35,0x06,0xCE,0xCD,0x69,0xBD,0x90,0x0D,0xDB,0x6C,0x48, -0x42,0x1D,0x0E,0xAA,0x42,0x02,0x31,0x00,0x9C,0x3D,0x48,0x39,0x23,0x39,0x58,0x1A, -0x15,0x12,0x59,0x6A,0x9E,0xEF,0xD5,0x59,0xB2,0x1D,0x52,0x2C,0x99,0x71,0xCD,0xC7, -0x29,0xDF,0x1B,0x2A,0x61,0x7B,0x71,0xD1,0xDE,0xF3,0xC0,0xE5,0x0D,0x3A,0x4A,0xAA, -0x2D,0xA7,0xD8,0x86,0x2A,0xDD,0x2E,0x10, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root G2 */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root G2 */ - - -const unsigned char DigiCert_Global_Root_G2_certificate[914]={ -0x30,0x82,0x03,0x8E,0x30,0x82,0x02,0x76,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x03, -0x3A,0xF1,0xE6,0xA7,0x11,0xA9,0xA0,0xBB,0x28,0x64,0xB1,0x1D,0x09,0xFA,0xE5,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x61, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30, -0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77, -0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31, -0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x44,0x69,0x67,0x69,0x43,0x65, -0x72,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,0x6F,0x74,0x20,0x47, -0x32,0x30,0x1E,0x17,0x0D,0x31,0x33,0x30,0x38,0x30,0x31,0x31,0x32,0x30,0x30,0x30, -0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x35,0x31,0x32,0x30,0x30,0x30,0x30, -0x5A,0x30,0x61,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53, -0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43, -0x65,0x72,0x74,0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B, -0x13,0x10,0x77,0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63, -0x6F,0x6D,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x44,0x69,0x67, -0x69,0x43,0x65,0x72,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,0x6F, -0x74,0x20,0x47,0x32,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A, -0x02,0x82,0x01,0x01,0x00,0xBB,0x37,0xCD,0x34,0xDC,0x7B,0x6B,0xC9,0xB2,0x68,0x90, -0xAD,0x4A,0x75,0xFF,0x46,0xBA,0x21,0x0A,0x08,0x8D,0xF5,0x19,0x54,0xC9,0xFB,0x88, -0xDB,0xF3,0xAE,0xF2,0x3A,0x89,0x91,0x3C,0x7A,0xE6,0xAB,0x06,0x1A,0x6B,0xCF,0xAC, -0x2D,0xE8,0x5E,0x09,0x24,0x44,0xBA,0x62,0x9A,0x7E,0xD6,0xA3,0xA8,0x7E,0xE0,0x54, -0x75,0x20,0x05,0xAC,0x50,0xB7,0x9C,0x63,0x1A,0x6C,0x30,0xDC,0xDA,0x1F,0x19,0xB1, -0xD7,0x1E,0xDE,0xFD,0xD7,0xE0,0xCB,0x94,0x83,0x37,0xAE,0xEC,0x1F,0x43,0x4E,0xDD, -0x7B,0x2C,0xD2,0xBD,0x2E,0xA5,0x2F,0xE4,0xA9,0xB8,0xAD,0x3A,0xD4,0x99,0xA4,0xB6, -0x25,0xE9,0x9B,0x6B,0x00,0x60,0x92,0x60,0xFF,0x4F,0x21,0x49,0x18,0xF7,0x67,0x90, -0xAB,0x61,0x06,0x9C,0x8F,0xF2,0xBA,0xE9,0xB4,0xE9,0x92,0x32,0x6B,0xB5,0xF3,0x57, -0xE8,0x5D,0x1B,0xCD,0x8C,0x1D,0xAB,0x95,0x04,0x95,0x49,0xF3,0x35,0x2D,0x96,0xE3, -0x49,0x6D,0xDD,0x77,0xE3,0xFB,0x49,0x4B,0xB4,0xAC,0x55,0x07,0xA9,0x8F,0x95,0xB3, -0xB4,0x23,0xBB,0x4C,0x6D,0x45,0xF0,0xF6,0xA9,0xB2,0x95,0x30,0xB4,0xFD,0x4C,0x55, -0x8C,0x27,0x4A,0x57,0x14,0x7C,0x82,0x9D,0xCD,0x73,0x92,0xD3,0x16,0x4A,0x06,0x0C, -0x8C,0x50,0xD1,0x8F,0x1E,0x09,0xBE,0x17,0xA1,0xE6,0x21,0xCA,0xFD,0x83,0xE5,0x10, -0xBC,0x83,0xA5,0x0A,0xC4,0x67,0x28,0xF6,0x73,0x14,0x14,0x3D,0x46,0x76,0xC3,0x87, -0x14,0x89,0x21,0x34,0x4D,0xAF,0x0F,0x45,0x0C,0xA6,0x49,0xA1,0xBA,0xBB,0x9C,0xC5, -0xB1,0x33,0x83,0x29,0x85,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0F, -0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30, -0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30, -0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x4E,0x22,0x54,0x20,0x18,0x95, -0xE6,0xE3,0x6E,0xE6,0x0F,0xFA,0xFA,0xB9,0x12,0xED,0x06,0x17,0x8F,0x39,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01, -0x01,0x00,0x60,0x67,0x28,0x94,0x6F,0x0E,0x48,0x63,0xEB,0x31,0xDD,0xEA,0x67,0x18, -0xD5,0x89,0x7D,0x3C,0xC5,0x8B,0x4A,0x7F,0xE9,0xBE,0xDB,0x2B,0x17,0xDF,0xB0,0x5F, -0x73,0x77,0x2A,0x32,0x13,0x39,0x81,0x67,0x42,0x84,0x23,0xF2,0x45,0x67,0x35,0xEC, -0x88,0xBF,0xF8,0x8F,0xB0,0x61,0x0C,0x34,0xA4,0xAE,0x20,0x4C,0x84,0xC6,0xDB,0xF8, -0x35,0xE1,0x76,0xD9,0xDF,0xA6,0x42,0xBB,0xC7,0x44,0x08,0x86,0x7F,0x36,0x74,0x24, -0x5A,0xDA,0x6C,0x0D,0x14,0x59,0x35,0xBD,0xF2,0x49,0xDD,0xB6,0x1F,0xC9,0xB3,0x0D, -0x47,0x2A,0x3D,0x99,0x2F,0xBB,0x5C,0xBB,0xB5,0xD4,0x20,0xE1,0x99,0x5F,0x53,0x46, -0x15,0xDB,0x68,0x9B,0xF0,0xF3,0x30,0xD5,0x3E,0x31,0xE2,0x8D,0x84,0x9E,0xE3,0x8A, -0xDA,0xDA,0x96,0x3E,0x35,0x13,0xA5,0x5F,0xF0,0xF9,0x70,0x50,0x70,0x47,0x41,0x11, -0x57,0x19,0x4E,0xC0,0x8F,0xAE,0x06,0xC4,0x95,0x13,0x17,0x2F,0x1B,0x25,0x9F,0x75, -0xF2,0xB1,0x8E,0x99,0xA1,0x6F,0x13,0xB1,0x41,0x71,0xFE,0x88,0x2A,0xC8,0x4F,0x10, -0x20,0x55,0xD7,0xF3,0x14,0x45,0xE5,0xE0,0x44,0xF4,0xEA,0x87,0x95,0x32,0x93,0x0E, -0xFE,0x53,0x46,0xFA,0x2C,0x9D,0xFF,0x8B,0x22,0xB9,0x4B,0xD9,0x09,0x45,0xA4,0xDE, -0xA4,0xB8,0x9A,0x58,0xDD,0x1B,0x7D,0x52,0x9F,0x8E,0x59,0x43,0x88,0x81,0xA4,0x9E, -0x26,0xD5,0x6F,0xAD,0xDD,0x0D,0xC6,0x37,0x7D,0xED,0x03,0x92,0x1B,0xE5,0x77,0x5F, -0x76,0xEE,0x3C,0x8D,0xC4,0x5D,0x56,0x5B,0xA2,0xD9,0x66,0x6E,0xB3,0x35,0x37,0xE5, -0x32,0xB6, -}; - - -/* subject:/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Class 1 CA Root */ -/* issuer :/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Class 1 CA Root */ - - -const unsigned char AddTrust_Low_Value_Services_Root_certificate[1052]={ -0x30,0x82,0x04,0x18,0x30,0x82,0x03,0x00,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x65,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14, -0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73, -0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41, -0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77, -0x6F,0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x41,0x64, -0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x31,0x20,0x43, -0x41,0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E,0x17,0x0D,0x30,0x30,0x30,0x35,0x33,0x30, -0x31,0x30,0x33,0x38,0x33,0x31,0x5A,0x17,0x0D,0x32,0x30,0x30,0x35,0x33,0x30,0x31, -0x30,0x33,0x38,0x33,0x31,0x5A,0x30,0x65,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x53,0x45,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B, -0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06, -0x03,0x55,0x04,0x0B,0x13,0x14,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54, -0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03, -0x55,0x04,0x03,0x13,0x18,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x43,0x6C, -0x61,0x73,0x73,0x20,0x31,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x30,0x82,0x01, -0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00, -0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0x96,0x96, -0xD4,0x21,0x49,0x60,0xE2,0x6B,0xE8,0x41,0x07,0x0C,0xDE,0xC4,0xE0,0xDC,0x13,0x23, -0xCD,0xC1,0x35,0xC7,0xFB,0xD6,0x4E,0x11,0x0A,0x67,0x5E,0xF5,0x06,0x5B,0x6B,0xA5, -0x08,0x3B,0x5B,0x29,0x16,0x3A,0xE7,0x87,0xB2,0x34,0x06,0xC5,0xBC,0x05,0xA5,0x03, -0x7C,0x82,0xCB,0x29,0x10,0xAE,0xE1,0x88,0x81,0xBD,0xD6,0x9E,0xD3,0xFE,0x2D,0x56, -0xC1,0x15,0xCE,0xE3,0x26,0x9D,0x15,0x2E,0x10,0xFB,0x06,0x8F,0x30,0x04,0xDE,0xA7, -0xB4,0x63,0xB4,0xFF,0xB1,0x9C,0xAE,0x3C,0xAF,0x77,0xB6,0x56,0xC5,0xB5,0xAB,0xA2, -0xE9,0x69,0x3A,0x3D,0x0E,0x33,0x79,0x32,0x3F,0x70,0x82,0x92,0x99,0x61,0x6D,0x8D, -0x30,0x08,0x8F,0x71,0x3F,0xA6,0x48,0x57,0x19,0xF8,0x25,0xDC,0x4B,0x66,0x5C,0xA5, -0x74,0x8F,0x98,0xAE,0xC8,0xF9,0xC0,0x06,0x22,0xE7,0xAC,0x73,0xDF,0xA5,0x2E,0xFB, -0x52,0xDC,0xB1,0x15,0x65,0x20,0xFA,0x35,0x66,0x69,0xDE,0xDF,0x2C,0xF1,0x6E,0xBC, -0x30,0xDB,0x2C,0x24,0x12,0xDB,0xEB,0x35,0x35,0x68,0x90,0xCB,0x00,0xB0,0x97,0x21, -0x3D,0x74,0x21,0x23,0x65,0x34,0x2B,0xBB,0x78,0x59,0xA3,0xD6,0xE1,0x76,0x39,0x9A, -0xA4,0x49,0x8E,0x8C,0x74,0xAF,0x6E,0xA4,0x9A,0xA3,0xD9,0x9B,0xD2,0x38,0x5C,0x9B, -0xA2,0x18,0xCC,0x75,0x23,0x84,0xBE,0xEB,0xE2,0x4D,0x33,0x71,0x8E,0x1A,0xF0,0xC2, -0xF8,0xC7,0x1D,0xA2,0xAD,0x03,0x97,0x2C,0xF8,0xCF,0x25,0xC6,0xF6,0xB8,0x24,0x31, -0xB1,0x63,0x5D,0x92,0x7F,0x63,0xF0,0x25,0xC9,0x53,0x2E,0x1F,0xBF,0x4D,0x02,0x03, -0x01,0x00,0x01,0xA3,0x81,0xD2,0x30,0x81,0xCF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E, -0x04,0x16,0x04,0x14,0x95,0xB1,0xB4,0xF0,0x94,0xB6,0xBD,0xC7,0xDA,0xD1,0x11,0x09, -0x21,0xBE,0xC1,0xAF,0x49,0xFD,0x10,0x7B,0x30,0x0B,0x06,0x03,0x55,0x1D,0x0F,0x04, -0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x81,0x8F,0x06,0x03,0x55,0x1D,0x23,0x04,0x81, -0x87,0x30,0x81,0x84,0x80,0x14,0x95,0xB1,0xB4,0xF0,0x94,0xB6,0xBD,0xC7,0xDA,0xD1, -0x11,0x09,0x21,0xBE,0xC1,0xAF,0x49,0xFD,0x10,0x7B,0xA1,0x69,0xA4,0x67,0x30,0x65, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14,0x30, -0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74, -0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41,0x64, -0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F, -0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x41,0x64,0x64, -0x54,0x72,0x75,0x73,0x74,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x31,0x20,0x43,0x41, -0x20,0x52,0x6F,0x6F,0x74,0x82,0x01,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x2C,0x6D,0x64,0x1B, -0x1F,0xCD,0x0D,0xDD,0xB9,0x01,0xFA,0x96,0x63,0x34,0x32,0x48,0x47,0x99,0xAE,0x97, -0xED,0xFD,0x72,0x16,0xA6,0x73,0x47,0x5A,0xF4,0xEB,0xDD,0xE9,0xF5,0xD6,0xFB,0x45, -0xCC,0x29,0x89,0x44,0x5D,0xBF,0x46,0x39,0x3D,0xE8,0xEE,0xBC,0x4D,0x54,0x86,0x1E, -0x1D,0x6C,0xE3,0x17,0x27,0x43,0xE1,0x89,0x56,0x2B,0xA9,0x6F,0x72,0x4E,0x49,0x33, -0xE3,0x72,0x7C,0x2A,0x23,0x9A,0xBC,0x3E,0xFF,0x28,0x2A,0xED,0xA3,0xFF,0x1C,0x23, -0xBA,0x43,0x57,0x09,0x67,0x4D,0x4B,0x62,0x06,0x2D,0xF8,0xFF,0x6C,0x9D,0x60,0x1E, -0xD8,0x1C,0x4B,0x7D,0xB5,0x31,0x2F,0xD9,0xD0,0x7C,0x5D,0xF8,0xDE,0x6B,0x83,0x18, -0x78,0x37,0x57,0x2F,0xE8,0x33,0x07,0x67,0xDF,0x1E,0xC7,0x6B,0x2A,0x95,0x76,0xAE, -0x8F,0x57,0xA3,0xF0,0xF4,0x52,0xB4,0xA9,0x53,0x08,0xCF,0xE0,0x4F,0xD3,0x7A,0x53, -0x8B,0xFD,0xBB,0x1C,0x56,0x36,0xF2,0xFE,0xB2,0xB6,0xE5,0x76,0xBB,0xD5,0x22,0x65, -0xA7,0x3F,0xFE,0xD1,0x66,0xAD,0x0B,0xBC,0x6B,0x99,0x86,0xEF,0x3F,0x7D,0xF3,0x18, -0x32,0xCA,0x7B,0xC6,0xE3,0xAB,0x64,0x46,0x95,0xF8,0x26,0x69,0xD9,0x55,0x83,0x7B, -0x2C,0x96,0x07,0xFF,0x59,0x2C,0x44,0xA3,0xC6,0xE5,0xE9,0xA9,0xDC,0xA1,0x63,0x80, -0x5A,0x21,0x5E,0x21,0xCF,0x53,0x54,0xF0,0xBA,0x6F,0x89,0xDB,0xA8,0xAA,0x95,0xCF, -0x8B,0xE3,0x71,0xCC,0x1E,0x1B,0x20,0x44,0x08,0xC0,0x7A,0xB6,0x40,0xFD,0xC4,0xE4, -0x35,0xE1,0x1D,0x16,0x1C,0xD0,0xBC,0x2B,0x8E,0xD6,0x71,0xD9, -}; - - -/* subject:/C=US/O=AffirmTrust/CN=AffirmTrust Premium ECC */ -/* issuer :/C=US/O=AffirmTrust/CN=AffirmTrust Premium ECC */ - - -const unsigned char AffirmTrust_Premium_ECC_certificate[514]={ -0x30,0x82,0x01,0xFE,0x30,0x82,0x01,0x85,0xA0,0x03,0x02,0x01,0x02,0x02,0x08,0x74, -0x97,0x25,0x8A,0xC7,0x3F,0x7A,0x54,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D, -0x04,0x03,0x03,0x30,0x45,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02, -0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x0C,0x0B,0x41,0x66,0x66, -0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04, -0x03,0x0C,0x17,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x20,0x50, -0x72,0x65,0x6D,0x69,0x75,0x6D,0x20,0x45,0x43,0x43,0x30,0x1E,0x17,0x0D,0x31,0x30, -0x30,0x31,0x32,0x39,0x31,0x34,0x32,0x30,0x32,0x34,0x5A,0x17,0x0D,0x34,0x30,0x31, -0x32,0x33,0x31,0x31,0x34,0x32,0x30,0x32,0x34,0x5A,0x30,0x45,0x31,0x0B,0x30,0x09, -0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55, -0x04,0x0A,0x0C,0x0B,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31, -0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x0C,0x17,0x41,0x66,0x66,0x69,0x72,0x6D, -0x54,0x72,0x75,0x73,0x74,0x20,0x50,0x72,0x65,0x6D,0x69,0x75,0x6D,0x20,0x45,0x43, -0x43,0x30,0x76,0x30,0x10,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05, -0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00,0x04,0x0D,0x30,0x5E,0x1B,0x15,0x9D,0x03, -0xD0,0xA1,0x79,0x35,0xB7,0x3A,0x3C,0x92,0x7A,0xCA,0x15,0x1C,0xCD,0x62,0xF3,0x9C, -0x26,0x5C,0x07,0x3D,0xE5,0x54,0xFA,0xA3,0xD6,0xCC,0x12,0xEA,0xF4,0x14,0x5F,0xE8, -0x8E,0x19,0xAB,0x2F,0x2E,0x48,0xE6,0xAC,0x18,0x43,0x78,0xAC,0xD0,0x37,0xC3,0xBD, -0xB2,0xCD,0x2C,0xE6,0x47,0xE2,0x1A,0xE6,0x63,0xB8,0x3D,0x2E,0x2F,0x78,0xC4,0x4F, -0xDB,0xF4,0x0F,0xA4,0x68,0x4C,0x55,0x72,0x6B,0x95,0x1D,0x4E,0x18,0x42,0x95,0x78, -0xCC,0x37,0x3C,0x91,0xE2,0x9B,0x65,0x2B,0x29,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x9A,0xAF,0x29,0x7A,0xC0,0x11,0x35,0x35, -0x26,0x51,0x30,0x00,0xC3,0x6A,0xFE,0x40,0xD5,0xAE,0xD6,0x3C,0x30,0x0F,0x06,0x03, -0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06, -0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0A,0x06, -0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x03,0x67,0x00,0x30,0x64,0x02,0x30, -0x17,0x09,0xF3,0x87,0x88,0x50,0x5A,0xAF,0xC8,0xC0,0x42,0xBF,0x47,0x5F,0xF5,0x6C, -0x6A,0x86,0xE0,0xC4,0x27,0x74,0xE4,0x38,0x53,0xD7,0x05,0x7F,0x1B,0x34,0xE3,0xC6, -0x2F,0xB3,0xCA,0x09,0x3C,0x37,0x9D,0xD7,0xE7,0xB8,0x46,0xF1,0xFD,0xA1,0xE2,0x71, -0x02,0x30,0x42,0x59,0x87,0x43,0xD4,0x51,0xDF,0xBA,0xD3,0x09,0x32,0x5A,0xCE,0x88, -0x7E,0x57,0x3D,0x9C,0x5F,0x42,0x6B,0xF5,0x07,0x2D,0xB5,0xF0,0x82,0x93,0xF9,0x59, -0x6F,0xAE,0x64,0xFA,0x58,0xE5,0x8B,0x1E,0xE3,0x63,0xBE,0xB5,0x81,0xCD,0x6F,0x02, -0x8C,0x79, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 1999 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 4 Public Primary Certification Authority - G3 */ -/* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 1999 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 4 Public Primary Certification Authority - G3 */ - - -const unsigned char Verisign_Class_4_Public_Primary_Certification_Authority___G3_certificate[1054]={ -0x30,0x82,0x04,0x1A,0x30,0x82,0x03,0x02,0x02,0x11,0x00,0xEC,0xA0,0xA7,0x8B,0x6E, -0x75,0x6A,0x01,0xCF,0xC4,0x7C,0xCC,0x2F,0x94,0x5E,0xD7,0x30,0x0D,0x06,0x09,0x2A, -0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81,0xCA,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03, -0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49, -0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65, -0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74, -0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28, -0x63,0x29,0x20,0x31,0x39,0x39,0x39,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74, -0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79, -0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69,0x53, -0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x34,0x20,0x50,0x75,0x62,0x6C, -0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x20,0x2D,0x20,0x47,0x33,0x30,0x1E,0x17,0x0D,0x39,0x39,0x31,0x30,0x30, -0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x36,0x30,0x37,0x31,0x36, -0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xCA,0x31,0x0B,0x30,0x09,0x06,0x03, -0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A, -0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E, -0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65,0x72,0x69,0x53, -0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72, -0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28,0x63,0x29,0x20, -0x31,0x39,0x39,0x39,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49, -0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72, -0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x45,0x30, -0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E, -0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x34,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20, -0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20, -0x2D,0x20,0x47,0x33,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A, -0x02,0x82,0x01,0x01,0x00,0xAD,0xCB,0xA5,0x11,0x69,0xC6,0x59,0xAB,0xF1,0x8F,0xB5, -0x19,0x0F,0x56,0xCE,0xCC,0xB5,0x1F,0x20,0xE4,0x9E,0x26,0x25,0x4B,0xE0,0x73,0x65, -0x89,0x59,0xDE,0xD0,0x83,0xE4,0xF5,0x0F,0xB5,0xBB,0xAD,0xF1,0x7C,0xE8,0x21,0xFC, -0xE4,0xE8,0x0C,0xEE,0x7C,0x45,0x22,0x19,0x76,0x92,0xB4,0x13,0xB7,0x20,0x5B,0x09, -0xFA,0x61,0xAE,0xA8,0xF2,0xA5,0x8D,0x85,0xC2,0x2A,0xD6,0xDE,0x66,0x36,0xD2,0x9B, -0x02,0xF4,0xA8,0x92,0x60,0x7C,0x9C,0x69,0xB4,0x8F,0x24,0x1E,0xD0,0x86,0x52,0xF6, -0x32,0x9C,0x41,0x58,0x1E,0x22,0xBD,0xCD,0x45,0x62,0x95,0x08,0x6E,0xD0,0x66,0xDD, -0x53,0xA2,0xCC,0xF0,0x10,0xDC,0x54,0x73,0x8B,0x04,0xA1,0x46,0x33,0x33,0x5C,0x17, -0x40,0xB9,0x9E,0x4D,0xD3,0xF3,0xBE,0x55,0x83,0xE8,0xB1,0x89,0x8E,0x5A,0x7C,0x9A, -0x96,0x22,0x90,0x3B,0x88,0x25,0xF2,0xD2,0x53,0x88,0x02,0x0C,0x0B,0x78,0xF2,0xE6, -0x37,0x17,0x4B,0x30,0x46,0x07,0xE4,0x80,0x6D,0xA6,0xD8,0x96,0x2E,0xE8,0x2C,0xF8, -0x11,0xB3,0x38,0x0D,0x66,0xA6,0x9B,0xEA,0xC9,0x23,0x5B,0xDB,0x8E,0xE2,0xF3,0x13, -0x8E,0x1A,0x59,0x2D,0xAA,0x02,0xF0,0xEC,0xA4,0x87,0x66,0xDC,0xC1,0x3F,0xF5,0xD8, -0xB9,0xF4,0xEC,0x82,0xC6,0xD2,0x3D,0x95,0x1D,0xE5,0xC0,0x4F,0x84,0xC9,0xD9,0xA3, -0x44,0x28,0x06,0x6A,0xD7,0x45,0xAC,0xF0,0x6B,0x6A,0xEF,0x4E,0x5F,0xF8,0x11,0x82, -0x1E,0x38,0x63,0x34,0x66,0x50,0xD4,0x3E,0x93,0x73,0xFA,0x30,0xC3,0x66,0xAD,0xFF, -0x93,0x2D,0x97,0xEF,0x03,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x8F,0xFA, -0x25,0x6B,0x4F,0x5B,0xE4,0xA4,0x4E,0x27,0x55,0xAB,0x22,0x15,0x59,0x3C,0xCA,0xB5, -0x0A,0xD4,0x4A,0xDB,0xAB,0xDD,0xA1,0x5F,0x53,0xC5,0xA0,0x57,0x39,0xC2,0xCE,0x47, -0x2B,0xBE,0x3A,0xC8,0x56,0xBF,0xC2,0xD9,0x27,0x10,0x3A,0xB1,0x05,0x3C,0xC0,0x77, -0x31,0xBB,0x3A,0xD3,0x05,0x7B,0x6D,0x9A,0x1C,0x30,0x8C,0x80,0xCB,0x93,0x93,0x2A, -0x83,0xAB,0x05,0x51,0x82,0x02,0x00,0x11,0x67,0x6B,0xF3,0x88,0x61,0x47,0x5F,0x03, -0x93,0xD5,0x5B,0x0D,0xE0,0xF1,0xD4,0xA1,0x32,0x35,0x85,0xB2,0x3A,0xDB,0xB0,0x82, -0xAB,0xD1,0xCB,0x0A,0xBC,0x4F,0x8C,0x5B,0xC5,0x4B,0x00,0x3B,0x1F,0x2A,0x82,0xA6, -0x7E,0x36,0x85,0xDC,0x7E,0x3C,0x67,0x00,0xB5,0xE4,0x3B,0x52,0xE0,0xA8,0xEB,0x5D, -0x15,0xF9,0xC6,0x6D,0xF0,0xAD,0x1D,0x0E,0x85,0xB7,0xA9,0x9A,0x73,0x14,0x5A,0x5B, -0x8F,0x41,0x28,0xC0,0xD5,0xE8,0x2D,0x4D,0xA4,0x5E,0xCD,0xAA,0xD9,0xED,0xCE,0xDC, -0xD8,0xD5,0x3C,0x42,0x1D,0x17,0xC1,0x12,0x5D,0x45,0x38,0xC3,0x38,0xF3,0xFC,0x85, -0x2E,0x83,0x46,0x48,0xB2,0xD7,0x20,0x5F,0x92,0x36,0x8F,0xE7,0x79,0x0F,0x98,0x5E, -0x99,0xE8,0xF0,0xD0,0xA4,0xBB,0xF5,0x53,0xBD,0x2A,0xCE,0x59,0xB0,0xAF,0x6E,0x7F, -0x6C,0xBB,0xD2,0x1E,0x00,0xB0,0x21,0xED,0xF8,0x41,0x62,0x82,0xB9,0xD8,0xB2,0xC4, -0xBB,0x46,0x50,0xF3,0x31,0xC5,0x8F,0x01,0xA8,0x74,0xEB,0xF5,0x78,0x27,0xDA,0xE7, -0xF7,0x66,0x43,0xF3,0x9E,0x83,0x3E,0x20,0xAA,0xC3,0x35,0x60,0x91,0xCE, -}; - - -/* subject:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA */ -/* issuer :/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA */ - - -const unsigned char thawte_Primary_Root_CA_certificate[1060]={ -0x30,0x82,0x04,0x20,0x30,0x82,0x03,0x08,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x34, -0x4E,0xD5,0x57,0x20,0xD5,0xED,0xEC,0x49,0xF4,0x2F,0xCE,0x37,0xDB,0x2B,0x6D,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0xA9,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15, -0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61,0x77,0x74,0x65,0x2C, -0x20,0x49,0x6E,0x63,0x2E,0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13,0x1F, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x53,0x65, -0x72,0x76,0x69,0x63,0x65,0x73,0x20,0x44,0x69,0x76,0x69,0x73,0x69,0x6F,0x6E,0x31, -0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x0B,0x13,0x2F,0x28,0x63,0x29,0x20,0x32,0x30, -0x30,0x36,0x20,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20, -0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64, -0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55, -0x04,0x03,0x13,0x16,0x74,0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x69,0x6D,0x61, -0x72,0x79,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,0x30,0x36, -0x31,0x31,0x31,0x37,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x36,0x30, -0x37,0x31,0x36,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xA9,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06,0x03, -0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13,0x1F,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x53,0x65,0x72,0x76,0x69,0x63, -0x65,0x73,0x20,0x44,0x69,0x76,0x69,0x73,0x69,0x6F,0x6E,0x31,0x38,0x30,0x36,0x06, -0x03,0x55,0x04,0x0B,0x13,0x2F,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x74, -0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F, -0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65, -0x20,0x6F,0x6E,0x6C,0x79,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x13,0x16, -0x74,0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x52, -0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82, -0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xAC,0xA0,0xF0,0xFB,0x80,0x59,0xD4,0x9C,0xC7, -0xA4,0xCF,0x9D,0xA1,0x59,0x73,0x09,0x10,0x45,0x0C,0x0D,0x2C,0x6E,0x68,0xF1,0x6C, -0x5B,0x48,0x68,0x49,0x59,0x37,0xFC,0x0B,0x33,0x19,0xC2,0x77,0x7F,0xCC,0x10,0x2D, -0x95,0x34,0x1C,0xE6,0xEB,0x4D,0x09,0xA7,0x1C,0xD2,0xB8,0xC9,0x97,0x36,0x02,0xB7, -0x89,0xD4,0x24,0x5F,0x06,0xC0,0xCC,0x44,0x94,0x94,0x8D,0x02,0x62,0x6F,0xEB,0x5A, -0xDD,0x11,0x8D,0x28,0x9A,0x5C,0x84,0x90,0x10,0x7A,0x0D,0xBD,0x74,0x66,0x2F,0x6A, -0x38,0xA0,0xE2,0xD5,0x54,0x44,0xEB,0x1D,0x07,0x9F,0x07,0xBA,0x6F,0xEE,0xE9,0xFD, -0x4E,0x0B,0x29,0xF5,0x3E,0x84,0xA0,0x01,0xF1,0x9C,0xAB,0xF8,0x1C,0x7E,0x89,0xA4, -0xE8,0xA1,0xD8,0x71,0x65,0x0D,0xA3,0x51,0x7B,0xEE,0xBC,0xD2,0x22,0x60,0x0D,0xB9, -0x5B,0x9D,0xDF,0xBA,0xFC,0x51,0x5B,0x0B,0xAF,0x98,0xB2,0xE9,0x2E,0xE9,0x04,0xE8, -0x62,0x87,0xDE,0x2B,0xC8,0xD7,0x4E,0xC1,0x4C,0x64,0x1E,0xDD,0xCF,0x87,0x58,0xBA, -0x4A,0x4F,0xCA,0x68,0x07,0x1D,0x1C,0x9D,0x4A,0xC6,0xD5,0x2F,0x91,0xCC,0x7C,0x71, -0x72,0x1C,0xC5,0xC0,0x67,0xEB,0x32,0xFD,0xC9,0x92,0x5C,0x94,0xDA,0x85,0xC0,0x9B, -0xBF,0x53,0x7D,0x2B,0x09,0xF4,0x8C,0x9D,0x91,0x1F,0x97,0x6A,0x52,0xCB,0xDE,0x09, -0x36,0xA4,0x77,0xD8,0x7B,0x87,0x50,0x44,0xD5,0x3E,0x6E,0x29,0x69,0xFB,0x39,0x49, -0x26,0x1E,0x09,0xA5,0x80,0x7B,0x40,0x2D,0xEB,0xE8,0x27,0x85,0xC9,0xFE,0x61,0xFD, -0x7E,0xE6,0x7C,0x97,0x1D,0xD5,0x9D,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40, -0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01, -0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01, -0x06,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x7B,0x5B,0x45,0xCF, -0xAF,0xCE,0xCB,0x7A,0xFD,0x31,0x92,0x1A,0x6A,0xB6,0xF3,0x46,0xEB,0x57,0x48,0x50, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03, -0x82,0x01,0x01,0x00,0x79,0x11,0xC0,0x4B,0xB3,0x91,0xB6,0xFC,0xF0,0xE9,0x67,0xD4, -0x0D,0x6E,0x45,0xBE,0x55,0xE8,0x93,0xD2,0xCE,0x03,0x3F,0xED,0xDA,0x25,0xB0,0x1D, -0x57,0xCB,0x1E,0x3A,0x76,0xA0,0x4C,0xEC,0x50,0x76,0xE8,0x64,0x72,0x0C,0xA4,0xA9, -0xF1,0xB8,0x8B,0xD6,0xD6,0x87,0x84,0xBB,0x32,0xE5,0x41,0x11,0xC0,0x77,0xD9,0xB3, -0x60,0x9D,0xEB,0x1B,0xD5,0xD1,0x6E,0x44,0x44,0xA9,0xA6,0x01,0xEC,0x55,0x62,0x1D, -0x77,0xB8,0x5C,0x8E,0x48,0x49,0x7C,0x9C,0x3B,0x57,0x11,0xAC,0xAD,0x73,0x37,0x8E, -0x2F,0x78,0x5C,0x90,0x68,0x47,0xD9,0x60,0x60,0xE6,0xFC,0x07,0x3D,0x22,0x20,0x17, -0xC4,0xF7,0x16,0xE9,0xC4,0xD8,0x72,0xF9,0xC8,0x73,0x7C,0xDF,0x16,0x2F,0x15,0xA9, -0x3E,0xFD,0x6A,0x27,0xB6,0xA1,0xEB,0x5A,0xBA,0x98,0x1F,0xD5,0xE3,0x4D,0x64,0x0A, -0x9D,0x13,0xC8,0x61,0xBA,0xF5,0x39,0x1C,0x87,0xBA,0xB8,0xBD,0x7B,0x22,0x7F,0xF6, -0xFE,0xAC,0x40,0x79,0xE5,0xAC,0x10,0x6F,0x3D,0x8F,0x1B,0x79,0x76,0x8B,0xC4,0x37, -0xB3,0x21,0x18,0x84,0xE5,0x36,0x00,0xEB,0x63,0x20,0x99,0xB9,0xE9,0xFE,0x33,0x04, -0xBB,0x41,0xC8,0xC1,0x02,0xF9,0x44,0x63,0x20,0x9E,0x81,0xCE,0x42,0xD3,0xD6,0x3F, -0x2C,0x76,0xD3,0x63,0x9C,0x59,0xDD,0x8F,0xA6,0xE1,0x0E,0xA0,0x2E,0x41,0xF7,0x2E, -0x95,0x47,0xCF,0xBC,0xFD,0x33,0xF3,0xF6,0x0B,0x61,0x7E,0x7E,0x91,0x2B,0x81,0x47, -0xC2,0x27,0x30,0xEE,0xA7,0x10,0x5D,0x37,0x8F,0x5C,0x39,0x2B,0xE4,0x04,0xF0,0x7B, -0x8D,0x56,0x8C,0x68, -}; - - -/* subject:/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Public CA Root */ -/* issuer :/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Public CA Root */ - - -const unsigned char AddTrust_Public_Services_Root_certificate[1049]={ -0x30,0x82,0x04,0x15,0x30,0x82,0x02,0xFD,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x64,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14, -0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73, -0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41, -0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77, -0x6F,0x72,0x6B,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x41,0x64, -0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x43,0x41, -0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E,0x17,0x0D,0x30,0x30,0x30,0x35,0x33,0x30,0x31, -0x30,0x34,0x31,0x35,0x30,0x5A,0x17,0x0D,0x32,0x30,0x30,0x35,0x33,0x30,0x31,0x30, -0x34,0x31,0x35,0x30,0x5A,0x30,0x64,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x53,0x45,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41, -0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03, -0x55,0x04,0x0B,0x13,0x14,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54, -0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x20,0x30,0x1E,0x06,0x03,0x55, -0x04,0x03,0x13,0x17,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x50,0x75,0x62, -0x6C,0x69,0x63,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x30,0x82,0x01,0x22,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82, -0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xE9,0x1A,0x30,0x8F, -0x83,0x88,0x14,0xC1,0x20,0xD8,0x3C,0x9B,0x8F,0x1B,0x7E,0x03,0x74,0xBB,0xDA,0x69, -0xD3,0x46,0xA5,0xF8,0x8E,0xC2,0x0C,0x11,0x90,0x51,0xA5,0x2F,0x66,0x54,0x40,0x55, -0xEA,0xDB,0x1F,0x4A,0x56,0xEE,0x9F,0x23,0x6E,0xF4,0x39,0xCB,0xA1,0xB9,0x6F,0xF2, -0x7E,0xF9,0x5D,0x87,0x26,0x61,0x9E,0x1C,0xF8,0xE2,0xEC,0xA6,0x81,0xF8,0x21,0xC5, -0x24,0xCC,0x11,0x0C,0x3F,0xDB,0x26,0x72,0x7A,0xC7,0x01,0x97,0x07,0x17,0xF9,0xD7, -0x18,0x2C,0x30,0x7D,0x0E,0x7A,0x1E,0x62,0x1E,0xC6,0x4B,0xC0,0xFD,0x7D,0x62,0x77, -0xD3,0x44,0x1E,0x27,0xF6,0x3F,0x4B,0x44,0xB3,0xB7,0x38,0xD9,0x39,0x1F,0x60,0xD5, -0x51,0x92,0x73,0x03,0xB4,0x00,0x69,0xE3,0xF3,0x14,0x4E,0xEE,0xD1,0xDC,0x09,0xCF, -0x77,0x34,0x46,0x50,0xB0,0xF8,0x11,0xF2,0xFE,0x38,0x79,0xF7,0x07,0x39,0xFE,0x51, -0x92,0x97,0x0B,0x5B,0x08,0x5F,0x34,0x86,0x01,0xAD,0x88,0x97,0xEB,0x66,0xCD,0x5E, -0xD1,0xFF,0xDC,0x7D,0xF2,0x84,0xDA,0xBA,0x77,0xAD,0xDC,0x80,0x08,0xC7,0xA7,0x87, -0xD6,0x55,0x9F,0x97,0x6A,0xE8,0xC8,0x11,0x64,0xBA,0xE7,0x19,0x29,0x3F,0x11,0xB3, -0x78,0x90,0x84,0x20,0x52,0x5B,0x11,0xEF,0x78,0xD0,0x83,0xF6,0xD5,0x48,0x90,0xD0, -0x30,0x1C,0xCF,0x80,0xF9,0x60,0xFE,0x79,0xE4,0x88,0xF2,0xDD,0x00,0xEB,0x94,0x45, -0xEB,0x65,0x94,0x69,0x40,0xBA,0xC0,0xD5,0xB4,0xB8,0xBA,0x7D,0x04,0x11,0xA8,0xEB, -0x31,0x05,0x96,0x94,0x4E,0x58,0x21,0x8E,0x9F,0xD0,0x60,0xFD,0x02,0x03,0x01,0x00, -0x01,0xA3,0x81,0xD1,0x30,0x81,0xCE,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16, -0x04,0x14,0x81,0x3E,0x37,0xD8,0x92,0xB0,0x1F,0x77,0x9F,0x5C,0xB4,0xAB,0x73,0xAA, -0xE7,0xF6,0x34,0x60,0x2F,0xFA,0x30,0x0B,0x06,0x03,0x55,0x1D,0x0F,0x04,0x04,0x03, -0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x81,0x8E,0x06,0x03,0x55,0x1D,0x23,0x04,0x81,0x86,0x30, -0x81,0x83,0x80,0x14,0x81,0x3E,0x37,0xD8,0x92,0xB0,0x1F,0x77,0x9F,0x5C,0xB4,0xAB, -0x73,0xAA,0xE7,0xF6,0x34,0x60,0x2F,0xFA,0xA1,0x68,0xA4,0x66,0x30,0x64,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14,0x30,0x12,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x41, -0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41,0x64,0x64,0x54, -0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B, -0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x41,0x64,0x64,0x54,0x72, -0x75,0x73,0x74,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x43,0x41,0x20,0x52,0x6F, -0x6F,0x74,0x82,0x01,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x03,0xF7,0x15,0x4A,0xF8,0x24,0xDA, -0x23,0x56,0x16,0x93,0x76,0xDD,0x36,0x28,0xB9,0xAE,0x1B,0xB8,0xC3,0xF1,0x64,0xBA, -0x20,0x18,0x78,0x95,0x29,0x27,0x57,0x05,0xBC,0x7C,0x2A,0xF4,0xB9,0x51,0x55,0xDA, -0x87,0x02,0xDE,0x0F,0x16,0x17,0x31,0xF8,0xAA,0x79,0x2E,0x09,0x13,0xBB,0xAF,0xB2, -0x20,0x19,0x12,0xE5,0x93,0xF9,0x4B,0xF9,0x83,0xE8,0x44,0xD5,0xB2,0x41,0x25,0xBF, -0x88,0x75,0x6F,0xFF,0x10,0xFC,0x4A,0x54,0xD0,0x5F,0xF0,0xFA,0xEF,0x36,0x73,0x7D, -0x1B,0x36,0x45,0xC6,0x21,0x6D,0xB4,0x15,0xB8,0x4E,0xCF,0x9C,0x5C,0xA5,0x3D,0x5A, -0x00,0x8E,0x06,0xE3,0x3C,0x6B,0x32,0x7B,0xF2,0x9F,0xF0,0xB6,0xFD,0xDF,0xF0,0x28, -0x18,0x48,0xF0,0xC6,0xBC,0xD0,0xBF,0x34,0x80,0x96,0xC2,0x4A,0xB1,0x6D,0x8E,0xC7, -0x90,0x45,0xDE,0x2F,0x67,0xAC,0x45,0x04,0xA3,0x7A,0xDC,0x55,0x92,0xC9,0x47,0x66, -0xD8,0x1A,0x8C,0xC7,0xED,0x9C,0x4E,0x9A,0xE0,0x12,0xBB,0xB5,0x6A,0x4C,0x84,0xE1, -0xE1,0x22,0x0D,0x87,0x00,0x64,0xFE,0x8C,0x7D,0x62,0x39,0x65,0xA6,0xEF,0x42,0xB6, -0x80,0x25,0x12,0x61,0x01,0xA8,0x24,0x13,0x70,0x00,0x11,0x26,0x5F,0xFA,0x35,0x50, -0xC5,0x48,0xCC,0x06,0x47,0xE8,0x27,0xD8,0x70,0x8D,0x5F,0x64,0xE6,0xA1,0x44,0x26, -0x5E,0x22,0xEC,0x92,0xCD,0xFF,0x42,0x9A,0x44,0x21,0x6D,0x5C,0xC5,0xE3,0x22,0x1D, -0x5F,0x47,0x12,0xE7,0xCE,0x5F,0x5D,0xFA,0xD8,0xAA,0xB1,0x33,0x2D,0xD9,0x76,0xF2, -0x4E,0x3A,0x33,0x0C,0x2B,0xB3,0x2D,0x90,0x06, -}; - - -/* subject:/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Qualified CA Root */ -/* issuer :/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Qualified CA Root */ - - -const unsigned char AddTrust_Qualified_Certificates_Root_certificate[1058]={ -0x30,0x82,0x04,0x1E,0x30,0x82,0x03,0x06,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x67,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14, -0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73, -0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41, -0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77, -0x6F,0x72,0x6B,0x31,0x23,0x30,0x21,0x06,0x03,0x55,0x04,0x03,0x13,0x1A,0x41,0x64, -0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x51,0x75,0x61,0x6C,0x69,0x66,0x69,0x65,0x64, -0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E,0x17,0x0D,0x30,0x30,0x30,0x35, -0x33,0x30,0x31,0x30,0x34,0x34,0x35,0x30,0x5A,0x17,0x0D,0x32,0x30,0x30,0x35,0x33, -0x30,0x31,0x30,0x34,0x34,0x35,0x30,0x5A,0x30,0x67,0x31,0x0B,0x30,0x09,0x06,0x03, -0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A, -0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x41,0x42,0x31,0x1D,0x30, -0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74, -0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x23,0x30,0x21, -0x06,0x03,0x55,0x04,0x03,0x13,0x1A,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20, -0x51,0x75,0x61,0x6C,0x69,0x66,0x69,0x65,0x64,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F, -0x74,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01, -0x01,0x00,0xE4,0x1E,0x9A,0xFE,0xDC,0x09,0x5A,0x87,0xA4,0x9F,0x47,0xBE,0x11,0x5F, -0xAF,0x84,0x34,0xDB,0x62,0x3C,0x79,0x78,0xB7,0xE9,0x30,0xB5,0xEC,0x0C,0x1C,0x2A, -0xC4,0x16,0xFF,0xE0,0xEC,0x71,0xEB,0x8A,0xF5,0x11,0x6E,0xED,0x4F,0x0D,0x91,0xD2, -0x12,0x18,0x2D,0x49,0x15,0x01,0xC2,0xA4,0x22,0x13,0xC7,0x11,0x64,0xFF,0x22,0x12, -0x9A,0xB9,0x8E,0x5C,0x2F,0x08,0xCF,0x71,0x6A,0xB3,0x67,0x01,0x59,0xF1,0x5D,0x46, -0xF3,0xB0,0x78,0xA5,0xF6,0x0E,0x42,0x7A,0xE3,0x7F,0x1B,0xCC,0xD0,0xF0,0xB7,0x28, -0xFD,0x2A,0xEA,0x9E,0xB3,0xB0,0xB9,0x04,0xAA,0xFD,0xF6,0xC7,0xB4,0xB1,0xB8,0x2A, -0xA0,0xFB,0x58,0xF1,0x19,0xA0,0x6F,0x70,0x25,0x7E,0x3E,0x69,0x4A,0x7F,0x0F,0x22, -0xD8,0xEF,0xAD,0x08,0x11,0x9A,0x29,0x99,0xE1,0xAA,0x44,0x45,0x9A,0x12,0x5E,0x3E, -0x9D,0x6D,0x52,0xFC,0xE7,0xA0,0x3D,0x68,0x2F,0xF0,0x4B,0x70,0x7C,0x13,0x38,0xAD, -0xBC,0x15,0x25,0xF1,0xD6,0xCE,0xAB,0xA2,0xC0,0x31,0xD6,0x2F,0x9F,0xE0,0xFF,0x14, -0x59,0xFC,0x84,0x93,0xD9,0x87,0x7C,0x4C,0x54,0x13,0xEB,0x9F,0xD1,0x2D,0x11,0xF8, -0x18,0x3A,0x3A,0xDE,0x25,0xD9,0xF7,0xD3,0x40,0xED,0xA4,0x06,0x12,0xC4,0x3B,0xE1, -0x91,0xC1,0x56,0x35,0xF0,0x14,0xDC,0x65,0x36,0x09,0x6E,0xAB,0xA4,0x07,0xC7,0x35, -0xD1,0xC2,0x03,0x33,0x36,0x5B,0x75,0x26,0x6D,0x42,0xF1,0x12,0x6B,0x43,0x6F,0x4B, -0x71,0x94,0xFA,0x34,0x1D,0xED,0x13,0x6E,0xCA,0x80,0x7F,0x98,0x2F,0x6C,0xB9,0x65, -0xD8,0xE9,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xD4,0x30,0x81,0xD1,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x39,0x95,0x8B,0x62,0x8B,0x5C,0xC9,0xD4, -0x80,0xBA,0x58,0x0F,0x97,0x3F,0x15,0x08,0x43,0xCC,0x98,0xA7,0x30,0x0B,0x06,0x03, -0x55,0x1D,0x0F,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13, -0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x81,0x91,0x06,0x03,0x55, -0x1D,0x23,0x04,0x81,0x89,0x30,0x81,0x86,0x80,0x14,0x39,0x95,0x8B,0x62,0x8B,0x5C, -0xC9,0xD4,0x80,0xBA,0x58,0x0F,0x97,0x3F,0x15,0x08,0x43,0xCC,0x98,0xA7,0xA1,0x6B, -0xA4,0x69,0x30,0x67,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53, -0x45,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54, -0x72,0x75,0x73,0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B, -0x13,0x14,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E, -0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x23,0x30,0x21,0x06,0x03,0x55,0x04,0x03,0x13, -0x1A,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x51,0x75,0x61,0x6C,0x69,0x66, -0x69,0x65,0x64,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x82,0x01,0x01,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01, -0x01,0x00,0x19,0xAB,0x75,0xEA,0xF8,0x8B,0x65,0x61,0x95,0x13,0xBA,0x69,0x04,0xEF, -0x86,0xCA,0x13,0xA0,0xC7,0xAA,0x4F,0x64,0x1B,0x3F,0x18,0xF6,0xA8,0x2D,0x2C,0x55, -0x8F,0x05,0xB7,0x30,0xEA,0x42,0x6A,0x1D,0xC0,0x25,0x51,0x2D,0xA7,0xBF,0x0C,0xB3, -0xED,0xEF,0x08,0x7F,0x6C,0x3C,0x46,0x1A,0xEA,0x18,0x43,0xDF,0x76,0xCC,0xF9,0x66, -0x86,0x9C,0x2C,0x68,0xF5,0xE9,0x17,0xF8,0x31,0xB3,0x18,0xC4,0xD6,0x48,0x7D,0x23, -0x4C,0x68,0xC1,0x7E,0xBB,0x01,0x14,0x6F,0xC5,0xD9,0x6E,0xDE,0xBB,0x04,0x42,0x6A, -0xF8,0xF6,0x5C,0x7D,0xE5,0xDA,0xFA,0x87,0xEB,0x0D,0x35,0x52,0x67,0xD0,0x9E,0x97, -0x76,0x05,0x93,0x3F,0x95,0xC7,0x01,0xE6,0x69,0x55,0x38,0x7F,0x10,0x61,0x99,0xC9, -0xE3,0x5F,0xA6,0xCA,0x3E,0x82,0x63,0x48,0xAA,0xE2,0x08,0x48,0x3E,0xAA,0xF2,0xB2, -0x85,0x62,0xA6,0xB4,0xA7,0xD9,0xBD,0x37,0x9C,0x68,0xB5,0x2D,0x56,0x7D,0xB0,0xB7, -0x3F,0xA0,0xB1,0x07,0xD6,0xE9,0x4F,0xDC,0xDE,0x45,0x71,0x30,0x32,0x7F,0x1B,0x2E, -0x09,0xF9,0xBF,0x52,0xA1,0xEE,0xC2,0x80,0x3E,0x06,0x5C,0x2E,0x55,0x40,0xC1,0x1B, -0xF5,0x70,0x45,0xB0,0xDC,0x5D,0xFA,0xF6,0x72,0x5A,0x77,0xD2,0x63,0xCD,0xCF,0x58, -0x89,0x00,0x42,0x63,0x3F,0x79,0x39,0xD0,0x44,0xB0,0x82,0x6E,0x41,0x19,0xE8,0xDD, -0xE0,0xC1,0x88,0x5A,0xD1,0x1E,0x71,0x93,0x1F,0x24,0x30,0x74,0xE5,0x1E,0xA8,0xDE, -0x3C,0x27,0x37,0x7F,0x83,0xAE,0x9E,0x77,0xCF,0xF0,0x30,0xB1,0xFF,0x4B,0x99,0xE8, -0xC6,0xA1, -}; - - -/* subject:/C=US/O=GeoTrust Inc./OU=(c) 2008 GeoTrust Inc. - For authorized use only/CN=GeoTrust Primary Certification Authority - G3 */ -/* issuer :/C=US/O=GeoTrust Inc./OU=(c) 2008 GeoTrust Inc. - For authorized use only/CN=GeoTrust Primary Certification Authority - G3 */ - - -const unsigned char GeoTrust_Primary_Certification_Authority___G3_certificate[1026]={ -0x30,0x82,0x03,0xFE,0x30,0x82,0x02,0xE6,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x15, -0xAC,0x6E,0x94,0x19,0xB2,0x79,0x4B,0x41,0xF6,0x27,0xA9,0xC3,0x18,0x0F,0x1F,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x81, -0x98,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16, -0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73, -0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x39,0x30,0x37,0x06,0x03,0x55,0x04,0x0B,0x13, -0x30,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x38,0x20,0x47,0x65,0x6F,0x54,0x72,0x75, -0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75, -0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C, -0x79,0x31,0x36,0x30,0x34,0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x47,0x65,0x6F,0x54, -0x72,0x75,0x73,0x74,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F, -0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x33,0x30,0x1E,0x17,0x0D,0x30,0x38,0x30, -0x34,0x30,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x37,0x31,0x32, -0x30,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0x98,0x31,0x0B,0x30,0x09, -0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55, -0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x39,0x30,0x37,0x06,0x03,0x55,0x04,0x0B,0x13,0x30,0x28,0x63,0x29,0x20, -0x32,0x30,0x30,0x38,0x20,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E, -0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69, -0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x36,0x30,0x34, -0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20, -0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20, -0x2D,0x20,0x47,0x33,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A, -0x02,0x82,0x01,0x01,0x00,0xDC,0xE2,0x5E,0x62,0x58,0x1D,0x33,0x57,0x39,0x32,0x33, -0xFA,0xEB,0xCB,0x87,0x8C,0xA7,0xD4,0x4A,0xDD,0x06,0x88,0xEA,0x64,0x8E,0x31,0x98, -0xA5,0x38,0x90,0x1E,0x98,0xCF,0x2E,0x63,0x2B,0xF0,0x46,0xBC,0x44,0xB2,0x89,0xA1, -0xC0,0x28,0x0C,0x49,0x70,0x21,0x95,0x9F,0x64,0xC0,0xA6,0x93,0x12,0x02,0x65,0x26, -0x86,0xC6,0xA5,0x89,0xF0,0xFA,0xD7,0x84,0xA0,0x70,0xAF,0x4F,0x1A,0x97,0x3F,0x06, -0x44,0xD5,0xC9,0xEB,0x72,0x10,0x7D,0xE4,0x31,0x28,0xFB,0x1C,0x61,0xE6,0x28,0x07, -0x44,0x73,0x92,0x22,0x69,0xA7,0x03,0x88,0x6C,0x9D,0x63,0xC8,0x52,0xDA,0x98,0x27, -0xE7,0x08,0x4C,0x70,0x3E,0xB4,0xC9,0x12,0xC1,0xC5,0x67,0x83,0x5D,0x33,0xF3,0x03, -0x11,0xEC,0x6A,0xD0,0x53,0xE2,0xD1,0xBA,0x36,0x60,0x94,0x80,0xBB,0x61,0x63,0x6C, -0x5B,0x17,0x7E,0xDF,0x40,0x94,0x1E,0xAB,0x0D,0xC2,0x21,0x28,0x70,0x88,0xFF,0xD6, -0x26,0x6C,0x6C,0x60,0x04,0x25,0x4E,0x55,0x7E,0x7D,0xEF,0xBF,0x94,0x48,0xDE,0xB7, -0x1D,0xDD,0x70,0x8D,0x05,0x5F,0x88,0xA5,0x9B,0xF2,0xC2,0xEE,0xEA,0xD1,0x40,0x41, -0x6D,0x62,0x38,0x1D,0x56,0x06,0xC5,0x03,0x47,0x51,0x20,0x19,0xFC,0x7B,0x10,0x0B, -0x0E,0x62,0xAE,0x76,0x55,0xBF,0x5F,0x77,0xBE,0x3E,0x49,0x01,0x53,0x3D,0x98,0x25, -0x03,0x76,0x24,0x5A,0x1D,0xB4,0xDB,0x89,0xEA,0x79,0xE5,0xB6,0xB3,0x3B,0x3F,0xBA, -0x4C,0x28,0x41,0x7F,0x06,0xAC,0x6A,0x8E,0xC1,0xD0,0xF6,0x05,0x1D,0x7D,0xE6,0x42, -0x86,0xE3,0xA5,0xD5,0x47,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0F, -0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30, -0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30, -0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xC4,0x79,0xCA,0x8E,0xA1,0x4E, -0x03,0x1D,0x1C,0xDC,0x6B,0xDB,0x31,0x5B,0x94,0x3E,0x3F,0x30,0x7F,0x2D,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01, -0x01,0x00,0x2D,0xC5,0x13,0xCF,0x56,0x80,0x7B,0x7A,0x78,0xBD,0x9F,0xAE,0x2C,0x99, -0xE7,0xEF,0xDA,0xDF,0x94,0x5E,0x09,0x69,0xA7,0xE7,0x6E,0x68,0x8C,0xBD,0x72,0xBE, -0x47,0xA9,0x0E,0x97,0x12,0xB8,0x4A,0xF1,0x64,0xD3,0x39,0xDF,0x25,0x34,0xD4,0xC1, -0xCD,0x4E,0x81,0xF0,0x0F,0x04,0xC4,0x24,0xB3,0x34,0x96,0xC6,0xA6,0xAA,0x30,0xDF, -0x68,0x61,0x73,0xD7,0xF9,0x8E,0x85,0x89,0xEF,0x0E,0x5E,0x95,0x28,0x4A,0x2A,0x27, -0x8F,0x10,0x8E,0x2E,0x7C,0x86,0xC4,0x02,0x9E,0xDA,0x0C,0x77,0x65,0x0E,0x44,0x0D, -0x92,0xFD,0xFD,0xB3,0x16,0x36,0xFA,0x11,0x0D,0x1D,0x8C,0x0E,0x07,0x89,0x6A,0x29, -0x56,0xF7,0x72,0xF4,0xDD,0x15,0x9C,0x77,0x35,0x66,0x57,0xAB,0x13,0x53,0xD8,0x8E, -0xC1,0x40,0xC5,0xD7,0x13,0x16,0x5A,0x72,0xC7,0xB7,0x69,0x01,0xC4,0x7A,0xB1,0x83, -0x01,0x68,0x7D,0x8D,0x41,0xA1,0x94,0x18,0xC1,0x25,0x5C,0xFC,0xF0,0xFE,0x83,0x02, -0x87,0x7C,0x0D,0x0D,0xCF,0x2E,0x08,0x5C,0x4A,0x40,0x0D,0x3E,0xEC,0x81,0x61,0xE6, -0x24,0xDB,0xCA,0xE0,0x0E,0x2D,0x07,0xB2,0x3E,0x56,0xDC,0x8D,0xF5,0x41,0x85,0x07, -0x48,0x9B,0x0C,0x0B,0xCB,0x49,0x3F,0x7D,0xEC,0xB7,0xFD,0xCB,0x8D,0x67,0x89,0x1A, -0xAB,0xED,0xBB,0x1E,0xA3,0x00,0x08,0x08,0x17,0x2A,0x82,0x5C,0x31,0x5D,0x46,0x8A, -0x2D,0x0F,0x86,0x9B,0x74,0xD9,0x45,0xFB,0xD4,0x40,0xB1,0x7A,0xAA,0x68,0x2D,0x86, -0xB2,0x99,0x22,0xE1,0xC1,0x2B,0xC7,0x9C,0xF8,0xF3,0x5F,0xA8,0x82,0x12,0xEB,0x19, -0x11,0x2D, -}; - - -/* subject:/C=US/O=GeoTrust Inc./CN=GeoTrust Universal CA 2 */ -/* issuer :/C=US/O=GeoTrust Inc./CN=GeoTrust Universal CA 2 */ - - -const unsigned char GeoTrust_Universal_CA_2_certificate[1392]={ -0x30,0x82,0x05,0x6C,0x30,0x82,0x03,0x54,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x47,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16, -0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73, -0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13, -0x17,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x55,0x6E,0x69,0x76,0x65,0x72, -0x73,0x61,0x6C,0x20,0x43,0x41,0x20,0x32,0x30,0x1E,0x17,0x0D,0x30,0x34,0x30,0x33, -0x30,0x34,0x30,0x35,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x39,0x30,0x33,0x30, -0x34,0x30,0x35,0x30,0x30,0x30,0x30,0x5A,0x30,0x47,0x31,0x0B,0x30,0x09,0x06,0x03, -0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A, -0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31, -0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x47,0x65,0x6F,0x54,0x72,0x75, -0x73,0x74,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41,0x20, -0x32,0x30,0x82,0x02,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x82,0x02,0x0F,0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02, -0x01,0x00,0xB3,0x54,0x52,0xC1,0xC9,0x3E,0xF2,0xD9,0xDC,0xB1,0x53,0x1A,0x59,0x29, -0xE7,0xB1,0xC3,0x45,0x28,0xE5,0xD7,0xD1,0xED,0xC5,0xC5,0x4B,0xA1,0xAA,0x74,0x7B, -0x57,0xAF,0x4A,0x26,0xFC,0xD8,0xF5,0x5E,0xA7,0x6E,0x19,0xDB,0x74,0x0C,0x4F,0x35, -0x5B,0x32,0x0B,0x01,0xE3,0xDB,0xEB,0x7A,0x77,0x35,0xEA,0xAA,0x5A,0xE0,0xD6,0xE8, -0xA1,0x57,0x94,0xF0,0x90,0xA3,0x74,0x56,0x94,0x44,0x30,0x03,0x1E,0x5C,0x4E,0x2B, -0x85,0x26,0x74,0x82,0x7A,0x0C,0x76,0xA0,0x6F,0x4D,0xCE,0x41,0x2D,0xA0,0x15,0x06, -0x14,0x5F,0xB7,0x42,0xCD,0x7B,0x8F,0x58,0x61,0x34,0xDC,0x2A,0x08,0xF9,0x2E,0xC3, -0x01,0xA6,0x22,0x44,0x1C,0x4C,0x07,0x82,0xE6,0x5B,0xCE,0xD0,0x4A,0x7C,0x04,0xD3, -0x19,0x73,0x27,0xF0,0xAA,0x98,0x7F,0x2E,0xAF,0x4E,0xEB,0x87,0x1E,0x24,0x77,0x6A, -0x5D,0xB6,0xE8,0x5B,0x45,0xBA,0xDC,0xC3,0xA1,0x05,0x6F,0x56,0x8E,0x8F,0x10,0x26, -0xA5,0x49,0xC3,0x2E,0xD7,0x41,0x87,0x22,0xE0,0x4F,0x86,0xCA,0x60,0xB5,0xEA,0xA1, -0x63,0xC0,0x01,0x97,0x10,0x79,0xBD,0x00,0x3C,0x12,0x6D,0x2B,0x15,0xB1,0xAC,0x4B, -0xB1,0xEE,0x18,0xB9,0x4E,0x96,0xDC,0xDC,0x76,0xFF,0x3B,0xBE,0xCF,0x5F,0x03,0xC0, -0xFC,0x3B,0xE8,0xBE,0x46,0x1B,0xFF,0xDA,0x40,0xC2,0x52,0xF7,0xFE,0xE3,0x3A,0xF7, -0x6A,0x77,0x35,0xD0,0xDA,0x8D,0xEB,0x5E,0x18,0x6A,0x31,0xC7,0x1E,0xBA,0x3C,0x1B, -0x28,0xD6,0x6B,0x54,0xC6,0xAA,0x5B,0xD7,0xA2,0x2C,0x1B,0x19,0xCC,0xA2,0x02,0xF6, -0x9B,0x59,0xBD,0x37,0x6B,0x86,0xB5,0x6D,0x82,0xBA,0xD8,0xEA,0xC9,0x56,0xBC,0xA9, -0x36,0x58,0xFD,0x3E,0x19,0xF3,0xED,0x0C,0x26,0xA9,0x93,0x38,0xF8,0x4F,0xC1,0x5D, -0x22,0x06,0xD0,0x97,0xEA,0xE1,0xAD,0xC6,0x55,0xE0,0x81,0x2B,0x28,0x83,0x3A,0xFA, -0xF4,0x7B,0x21,0x51,0x00,0xBE,0x52,0x38,0xCE,0xCD,0x66,0x79,0xA8,0xF4,0x81,0x56, -0xE2,0xD0,0x83,0x09,0x47,0x51,0x5B,0x50,0x6A,0xCF,0xDB,0x48,0x1A,0x5D,0x3E,0xF7, -0xCB,0xF6,0x65,0xF7,0x6C,0xF1,0x95,0xF8,0x02,0x3B,0x32,0x56,0x82,0x39,0x7A,0x5B, -0xBD,0x2F,0x89,0x1B,0xBF,0xA1,0xB4,0xE8,0xFF,0x7F,0x8D,0x8C,0xDF,0x03,0xF1,0x60, -0x4E,0x58,0x11,0x4C,0xEB,0xA3,0x3F,0x10,0x2B,0x83,0x9A,0x01,0x73,0xD9,0x94,0x6D, -0x84,0x00,0x27,0x66,0xAC,0xF0,0x70,0x40,0x09,0x42,0x92,0xAD,0x4F,0x93,0x0D,0x61, -0x09,0x51,0x24,0xD8,0x92,0xD5,0x0B,0x94,0x61,0xB2,0x87,0xB2,0xED,0xFF,0x9A,0x35, -0xFF,0x85,0x54,0xCA,0xED,0x44,0x43,0xAC,0x1B,0x3C,0x16,0x6B,0x48,0x4A,0x0A,0x1C, -0x40,0x88,0x1F,0x92,0xC2,0x0B,0x00,0x05,0xFF,0xF2,0xC8,0x02,0x4A,0xA4,0xAA,0xA9, -0xCC,0x99,0x96,0x9C,0x2F,0x58,0xE0,0x7D,0xE1,0xBE,0xBB,0x07,0xDC,0x5F,0x04,0x72, -0x5C,0x31,0x34,0xC3,0xEC,0x5F,0x2D,0xE0,0x3D,0x64,0x90,0x22,0xE6,0xD1,0xEC,0xB8, -0x2E,0xDD,0x59,0xAE,0xD9,0xA1,0x37,0xBF,0x54,0x35,0xDC,0x73,0x32,0x4F,0x8C,0x04, -0x1E,0x33,0xB2,0xC9,0x46,0xF1,0xD8,0x5C,0xC8,0x55,0x50,0xC9,0x68,0xBD,0xA8,0xBA, -0x36,0x09,0x02,0x03,0x01,0x00,0x01,0xA3,0x63,0x30,0x61,0x30,0x0F,0x06,0x03,0x55, -0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03, -0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x76,0xF3,0x55,0xE1,0xFA,0xA4,0x36,0xFB,0xF0, -0x9F,0x5C,0x62,0x71,0xED,0x3C,0xF4,0x47,0x38,0x10,0x2B,0x30,0x1F,0x06,0x03,0x55, -0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x76,0xF3,0x55,0xE1,0xFA,0xA4,0x36,0xFB, -0xF0,0x9F,0x5C,0x62,0x71,0xED,0x3C,0xF4,0x47,0x38,0x10,0x2B,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x02,0x01,0x00, -0x66,0xC1,0xC6,0x23,0xF3,0xD9,0xE0,0x2E,0x6E,0x5F,0xE8,0xCF,0xAE,0xB0,0xB0,0x25, -0x4D,0x2B,0xF8,0x3B,0x58,0x9B,0x40,0x24,0x37,0x5A,0xCB,0xAB,0x16,0x49,0xFF,0xB3, -0x75,0x79,0x33,0xA1,0x2F,0x6D,0x70,0x17,0x34,0x91,0xFE,0x67,0x7E,0x8F,0xEC,0x9B, -0xE5,0x5E,0x82,0xA9,0x55,0x1F,0x2F,0xDC,0xD4,0x51,0x07,0x12,0xFE,0xAC,0x16,0x3E, -0x2C,0x35,0xC6,0x63,0xFC,0xDC,0x10,0xEB,0x0D,0xA3,0xAA,0xD0,0x7C,0xCC,0xD1,0xD0, -0x2F,0x51,0x2E,0xC4,0x14,0x5A,0xDE,0xE8,0x19,0xE1,0x3E,0xC6,0xCC,0xA4,0x29,0xE7, -0x2E,0x84,0xAA,0x06,0x30,0x78,0x76,0x54,0x73,0x28,0x98,0x59,0x38,0xE0,0x00,0x0D, -0x62,0xD3,0x42,0x7D,0x21,0x9F,0xAE,0x3D,0x3A,0x8C,0xD5,0xFA,0x77,0x0D,0x18,0x2B, -0x16,0x0E,0x5F,0x36,0xE1,0xFC,0x2A,0xB5,0x30,0x24,0xCF,0xE0,0x63,0x0C,0x7B,0x58, -0x1A,0xFE,0x99,0xBA,0x42,0x12,0xB1,0x91,0xF4,0x7C,0x68,0xE2,0xC8,0xE8,0xAF,0x2C, -0xEA,0xC9,0x7E,0xAE,0xBB,0x2A,0x3D,0x0D,0x15,0xDC,0x34,0x95,0xB6,0x18,0x74,0xA8, -0x6A,0x0F,0xC7,0xB4,0xF4,0x13,0xC4,0xE4,0x5B,0xED,0x0A,0xD2,0xA4,0x97,0x4C,0x2A, -0xED,0x2F,0x6C,0x12,0x89,0x3D,0xF1,0x27,0x70,0xAA,0x6A,0x03,0x52,0x21,0x9F,0x40, -0xA8,0x67,0x50,0xF2,0xF3,0x5A,0x1F,0xDF,0xDF,0x23,0xF6,0xDC,0x78,0x4E,0xE6,0x98, -0x4F,0x55,0x3A,0x53,0xE3,0xEF,0xF2,0xF4,0x9F,0xC7,0x7C,0xD8,0x58,0xAF,0x29,0x22, -0x97,0xB8,0xE0,0xBD,0x91,0x2E,0xB0,0x76,0xEC,0x57,0x11,0xCF,0xEF,0x29,0x44,0xF3, -0xE9,0x85,0x7A,0x60,0x63,0xE4,0x5D,0x33,0x89,0x17,0xD9,0x31,0xAA,0xDA,0xD6,0xF3, -0x18,0x35,0x72,0xCF,0x87,0x2B,0x2F,0x63,0x23,0x84,0x5D,0x84,0x8C,0x3F,0x57,0xA0, -0x88,0xFC,0x99,0x91,0x28,0x26,0x69,0x99,0xD4,0x8F,0x97,0x44,0xBE,0x8E,0xD5,0x48, -0xB1,0xA4,0x28,0x29,0xF1,0x15,0xB4,0xE1,0xE5,0x9E,0xDD,0xF8,0x8F,0xA6,0x6F,0x26, -0xD7,0x09,0x3C,0x3A,0x1C,0x11,0x0E,0xA6,0x6C,0x37,0xF7,0xAD,0x44,0x87,0x2C,0x28, -0xC7,0xD8,0x74,0x82,0xB3,0xD0,0x6F,0x4A,0x57,0xBB,0x35,0x29,0x27,0xA0,0x8B,0xE8, -0x21,0xA7,0x87,0x64,0x36,0x5D,0xCC,0xD8,0x16,0xAC,0xC7,0xB2,0x27,0x40,0x92,0x55, -0x38,0x28,0x8D,0x51,0x6E,0xDD,0x14,0x67,0x53,0x6C,0x71,0x5C,0x26,0x84,0x4D,0x75, -0x5A,0xB6,0x7E,0x60,0x56,0xA9,0x4D,0xAD,0xFB,0x9B,0x1E,0x97,0xF3,0x0D,0xD9,0xD2, -0x97,0x54,0x77,0xDA,0x3D,0x12,0xB7,0xE0,0x1E,0xEF,0x08,0x06,0xAC,0xF9,0x85,0x87, -0xE9,0xA2,0xDC,0xAF,0x7E,0x18,0x12,0x83,0xFD,0x56,0x17,0x41,0x2E,0xD5,0x29,0x82, -0x7D,0x99,0xF4,0x31,0xF6,0x71,0xA9,0xCF,0x2C,0x01,0x27,0xA5,0x05,0xB9,0xAA,0xB2, -0x48,0x4E,0x2A,0xEF,0x9F,0x93,0x52,0x51,0x95,0x3C,0x52,0x73,0x8E,0x56,0x4C,0x17, -0x40,0xC0,0x09,0x28,0xE4,0x8B,0x6A,0x48,0x53,0xDB,0xEC,0xCD,0x55,0x55,0xF1,0xC6, -0xF8,0xE9,0xA2,0x2C,0x4C,0xA6,0xD1,0x26,0x5F,0x7E,0xAF,0x5A,0x4C,0xDA,0x1F,0xA6, -0xF2,0x1C,0x2C,0x7E,0xAE,0x02,0x16,0xD2,0x56,0xD0,0x2F,0x57,0x53,0x47,0xE8,0x92, -}; - - -/* subject:/C=IE/O=Baltimore/OU=CyberTrust/CN=Baltimore CyberTrust Root */ -/* issuer :/C=IE/O=Baltimore/OU=CyberTrust/CN=Baltimore CyberTrust Root */ - - -const unsigned char Baltimore_CyberTrust_Root_certificate[891]={ -0x30,0x82,0x03,0x77,0x30,0x82,0x02,0x5F,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x02, -0x00,0x00,0xB9,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x30,0x5A,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x49, -0x45,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x0A,0x13,0x09,0x42,0x61,0x6C,0x74, -0x69,0x6D,0x6F,0x72,0x65,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0B,0x13,0x0A, -0x43,0x79,0x62,0x65,0x72,0x54,0x72,0x75,0x73,0x74,0x31,0x22,0x30,0x20,0x06,0x03, -0x55,0x04,0x03,0x13,0x19,0x42,0x61,0x6C,0x74,0x69,0x6D,0x6F,0x72,0x65,0x20,0x43, -0x79,0x62,0x65,0x72,0x54,0x72,0x75,0x73,0x74,0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E, -0x17,0x0D,0x30,0x30,0x30,0x35,0x31,0x32,0x31,0x38,0x34,0x36,0x30,0x30,0x5A,0x17, -0x0D,0x32,0x35,0x30,0x35,0x31,0x32,0x32,0x33,0x35,0x39,0x30,0x30,0x5A,0x30,0x5A, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x49,0x45,0x31,0x12,0x30, -0x10,0x06,0x03,0x55,0x04,0x0A,0x13,0x09,0x42,0x61,0x6C,0x74,0x69,0x6D,0x6F,0x72, -0x65,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0B,0x13,0x0A,0x43,0x79,0x62,0x65, -0x72,0x54,0x72,0x75,0x73,0x74,0x31,0x22,0x30,0x20,0x06,0x03,0x55,0x04,0x03,0x13, -0x19,0x42,0x61,0x6C,0x74,0x69,0x6D,0x6F,0x72,0x65,0x20,0x43,0x79,0x62,0x65,0x72, -0x54,0x72,0x75,0x73,0x74,0x20,0x52,0x6F,0x6F,0x74,0x30,0x82,0x01,0x22,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01, -0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xA3,0x04,0xBB,0x22,0xAB, -0x98,0x3D,0x57,0xE8,0x26,0x72,0x9A,0xB5,0x79,0xD4,0x29,0xE2,0xE1,0xE8,0x95,0x80, -0xB1,0xB0,0xE3,0x5B,0x8E,0x2B,0x29,0x9A,0x64,0xDF,0xA1,0x5D,0xED,0xB0,0x09,0x05, -0x6D,0xDB,0x28,0x2E,0xCE,0x62,0xA2,0x62,0xFE,0xB4,0x88,0xDA,0x12,0xEB,0x38,0xEB, -0x21,0x9D,0xC0,0x41,0x2B,0x01,0x52,0x7B,0x88,0x77,0xD3,0x1C,0x8F,0xC7,0xBA,0xB9, -0x88,0xB5,0x6A,0x09,0xE7,0x73,0xE8,0x11,0x40,0xA7,0xD1,0xCC,0xCA,0x62,0x8D,0x2D, -0xE5,0x8F,0x0B,0xA6,0x50,0xD2,0xA8,0x50,0xC3,0x28,0xEA,0xF5,0xAB,0x25,0x87,0x8A, -0x9A,0x96,0x1C,0xA9,0x67,0xB8,0x3F,0x0C,0xD5,0xF7,0xF9,0x52,0x13,0x2F,0xC2,0x1B, -0xD5,0x70,0x70,0xF0,0x8F,0xC0,0x12,0xCA,0x06,0xCB,0x9A,0xE1,0xD9,0xCA,0x33,0x7A, -0x77,0xD6,0xF8,0xEC,0xB9,0xF1,0x68,0x44,0x42,0x48,0x13,0xD2,0xC0,0xC2,0xA4,0xAE, -0x5E,0x60,0xFE,0xB6,0xA6,0x05,0xFC,0xB4,0xDD,0x07,0x59,0x02,0xD4,0x59,0x18,0x98, -0x63,0xF5,0xA5,0x63,0xE0,0x90,0x0C,0x7D,0x5D,0xB2,0x06,0x7A,0xF3,0x85,0xEA,0xEB, -0xD4,0x03,0xAE,0x5E,0x84,0x3E,0x5F,0xFF,0x15,0xED,0x69,0xBC,0xF9,0x39,0x36,0x72, -0x75,0xCF,0x77,0x52,0x4D,0xF3,0xC9,0x90,0x2C,0xB9,0x3D,0xE5,0xC9,0x23,0x53,0x3F, -0x1F,0x24,0x98,0x21,0x5C,0x07,0x99,0x29,0xBD,0xC6,0x3A,0xEC,0xE7,0x6E,0x86,0x3A, -0x6B,0x97,0x74,0x63,0x33,0xBD,0x68,0x18,0x31,0xF0,0x78,0x8D,0x76,0xBF,0xFC,0x9E, -0x8E,0x5D,0x2A,0x86,0xA7,0x4D,0x90,0xDC,0x27,0x1A,0x39,0x02,0x03,0x01,0x00,0x01, -0xA3,0x45,0x30,0x43,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xE5, -0x9D,0x59,0x30,0x82,0x47,0x58,0xCC,0xAC,0xFA,0x08,0x54,0x36,0x86,0x7B,0x3A,0xB5, -0x04,0x4D,0xF0,0x30,0x12,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x08,0x30, -0x06,0x01,0x01,0xFF,0x02,0x01,0x03,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01, -0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x85,0x0C,0x5D,0x8E,0xE4, -0x6F,0x51,0x68,0x42,0x05,0xA0,0xDD,0xBB,0x4F,0x27,0x25,0x84,0x03,0xBD,0xF7,0x64, -0xFD,0x2D,0xD7,0x30,0xE3,0xA4,0x10,0x17,0xEB,0xDA,0x29,0x29,0xB6,0x79,0x3F,0x76, -0xF6,0x19,0x13,0x23,0xB8,0x10,0x0A,0xF9,0x58,0xA4,0xD4,0x61,0x70,0xBD,0x04,0x61, -0x6A,0x12,0x8A,0x17,0xD5,0x0A,0xBD,0xC5,0xBC,0x30,0x7C,0xD6,0xE9,0x0C,0x25,0x8D, -0x86,0x40,0x4F,0xEC,0xCC,0xA3,0x7E,0x38,0xC6,0x37,0x11,0x4F,0xED,0xDD,0x68,0x31, -0x8E,0x4C,0xD2,0xB3,0x01,0x74,0xEE,0xBE,0x75,0x5E,0x07,0x48,0x1A,0x7F,0x70,0xFF, -0x16,0x5C,0x84,0xC0,0x79,0x85,0xB8,0x05,0xFD,0x7F,0xBE,0x65,0x11,0xA3,0x0F,0xC0, -0x02,0xB4,0xF8,0x52,0x37,0x39,0x04,0xD5,0xA9,0x31,0x7A,0x18,0xBF,0xA0,0x2A,0xF4, -0x12,0x99,0xF7,0xA3,0x45,0x82,0xE3,0x3C,0x5E,0xF5,0x9D,0x9E,0xB5,0xC8,0x9E,0x7C, -0x2E,0xC8,0xA4,0x9E,0x4E,0x08,0x14,0x4B,0x6D,0xFD,0x70,0x6D,0x6B,0x1A,0x63,0xBD, -0x64,0xE6,0x1F,0xB7,0xCE,0xF0,0xF2,0x9F,0x2E,0xBB,0x1B,0xB7,0xF2,0x50,0x88,0x73, -0x92,0xC2,0xE2,0xE3,0x16,0x8D,0x9A,0x32,0x02,0xAB,0x8E,0x18,0xDD,0xE9,0x10,0x11, -0xEE,0x7E,0x35,0xAB,0x90,0xAF,0x3E,0x30,0x94,0x7A,0xD0,0x33,0x3D,0xA7,0x65,0x0F, -0xF5,0xFC,0x8E,0x9E,0x62,0xCF,0x47,0x44,0x2C,0x01,0x5D,0xBB,0x1D,0xB5,0x32,0xD2, -0x47,0xD2,0x38,0x2E,0xD0,0xFE,0x81,0xDC,0x32,0x6A,0x1E,0xB5,0xEE,0x3C,0xD5,0xFC, -0xE7,0x81,0x1D,0x19,0xC3,0x24,0x42,0xEA,0x63,0x39,0xA9, -}; - - -/* subject:/OU=GlobalSign Root CA - R2/O=GlobalSign/CN=GlobalSign */ -/* issuer :/OU=GlobalSign Root CA - R2/O=GlobalSign/CN=GlobalSign */ - - -const unsigned char GlobalSign_Root_CA___R2_certificate[958]={ -0x30,0x82,0x03,0xBA,0x30,0x82,0x02,0xA2,0xA0,0x03,0x02,0x01,0x02,0x02,0x0B,0x04, -0x00,0x00,0x00,0x00,0x01,0x0F,0x86,0x26,0xE6,0x0D,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x4C,0x31,0x20,0x30,0x1E,0x06, -0x03,0x55,0x04,0x0B,0x13,0x17,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E, -0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x52,0x32,0x31,0x13,0x30, -0x11,0x06,0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69, -0x67,0x6E,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F, -0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x32,0x31, -0x35,0x30,0x38,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x31,0x31,0x32,0x31,0x35, -0x30,0x38,0x30,0x30,0x30,0x30,0x5A,0x30,0x4C,0x31,0x20,0x30,0x1E,0x06,0x03,0x55, -0x04,0x0B,0x13,0x17,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x52, -0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x52,0x32,0x31,0x13,0x30,0x11,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E, -0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61, -0x6C,0x53,0x69,0x67,0x6E,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01, -0x0A,0x02,0x82,0x01,0x01,0x00,0xA6,0xCF,0x24,0x0E,0xBE,0x2E,0x6F,0x28,0x99,0x45, -0x42,0xC4,0xAB,0x3E,0x21,0x54,0x9B,0x0B,0xD3,0x7F,0x84,0x70,0xFA,0x12,0xB3,0xCB, -0xBF,0x87,0x5F,0xC6,0x7F,0x86,0xD3,0xB2,0x30,0x5C,0xD6,0xFD,0xAD,0xF1,0x7B,0xDC, -0xE5,0xF8,0x60,0x96,0x09,0x92,0x10,0xF5,0xD0,0x53,0xDE,0xFB,0x7B,0x7E,0x73,0x88, -0xAC,0x52,0x88,0x7B,0x4A,0xA6,0xCA,0x49,0xA6,0x5E,0xA8,0xA7,0x8C,0x5A,0x11,0xBC, -0x7A,0x82,0xEB,0xBE,0x8C,0xE9,0xB3,0xAC,0x96,0x25,0x07,0x97,0x4A,0x99,0x2A,0x07, -0x2F,0xB4,0x1E,0x77,0xBF,0x8A,0x0F,0xB5,0x02,0x7C,0x1B,0x96,0xB8,0xC5,0xB9,0x3A, -0x2C,0xBC,0xD6,0x12,0xB9,0xEB,0x59,0x7D,0xE2,0xD0,0x06,0x86,0x5F,0x5E,0x49,0x6A, -0xB5,0x39,0x5E,0x88,0x34,0xEC,0xBC,0x78,0x0C,0x08,0x98,0x84,0x6C,0xA8,0xCD,0x4B, -0xB4,0xA0,0x7D,0x0C,0x79,0x4D,0xF0,0xB8,0x2D,0xCB,0x21,0xCA,0xD5,0x6C,0x5B,0x7D, -0xE1,0xA0,0x29,0x84,0xA1,0xF9,0xD3,0x94,0x49,0xCB,0x24,0x62,0x91,0x20,0xBC,0xDD, -0x0B,0xD5,0xD9,0xCC,0xF9,0xEA,0x27,0x0A,0x2B,0x73,0x91,0xC6,0x9D,0x1B,0xAC,0xC8, -0xCB,0xE8,0xE0,0xA0,0xF4,0x2F,0x90,0x8B,0x4D,0xFB,0xB0,0x36,0x1B,0xF6,0x19,0x7A, -0x85,0xE0,0x6D,0xF2,0x61,0x13,0x88,0x5C,0x9F,0xE0,0x93,0x0A,0x51,0x97,0x8A,0x5A, -0xCE,0xAF,0xAB,0xD5,0xF7,0xAA,0x09,0xAA,0x60,0xBD,0xDC,0xD9,0x5F,0xDF,0x72,0xA9, -0x60,0x13,0x5E,0x00,0x01,0xC9,0x4A,0xFA,0x3F,0xA4,0xEA,0x07,0x03,0x21,0x02,0x8E, -0x82,0xCA,0x03,0xC2,0x9B,0x8F,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0x9C,0x30,0x81, -0x99,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01, -0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01, -0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x9B,0xE2,0x07, -0x57,0x67,0x1C,0x1E,0xC0,0x6A,0x06,0xDE,0x59,0xB4,0x9A,0x2D,0xDF,0xDC,0x19,0x86, -0x2E,0x30,0x36,0x06,0x03,0x55,0x1D,0x1F,0x04,0x2F,0x30,0x2D,0x30,0x2B,0xA0,0x29, -0xA0,0x27,0x86,0x25,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x67, -0x6C,0x6F,0x62,0x61,0x6C,0x73,0x69,0x67,0x6E,0x2E,0x6E,0x65,0x74,0x2F,0x72,0x6F, -0x6F,0x74,0x2D,0x72,0x32,0x2E,0x63,0x72,0x6C,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23, -0x04,0x18,0x30,0x16,0x80,0x14,0x9B,0xE2,0x07,0x57,0x67,0x1C,0x1E,0xC0,0x6A,0x06, -0xDE,0x59,0xB4,0x9A,0x2D,0xDF,0xDC,0x19,0x86,0x2E,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x99,0x81, -0x53,0x87,0x1C,0x68,0x97,0x86,0x91,0xEC,0xE0,0x4A,0xB8,0x44,0x0B,0xAB,0x81,0xAC, -0x27,0x4F,0xD6,0xC1,0xB8,0x1C,0x43,0x78,0xB3,0x0C,0x9A,0xFC,0xEA,0x2C,0x3C,0x6E, -0x61,0x1B,0x4D,0x4B,0x29,0xF5,0x9F,0x05,0x1D,0x26,0xC1,0xB8,0xE9,0x83,0x00,0x62, -0x45,0xB6,0xA9,0x08,0x93,0xB9,0xA9,0x33,0x4B,0x18,0x9A,0xC2,0xF8,0x87,0x88,0x4E, -0xDB,0xDD,0x71,0x34,0x1A,0xC1,0x54,0xDA,0x46,0x3F,0xE0,0xD3,0x2A,0xAB,0x6D,0x54, -0x22,0xF5,0x3A,0x62,0xCD,0x20,0x6F,0xBA,0x29,0x89,0xD7,0xDD,0x91,0xEE,0xD3,0x5C, -0xA2,0x3E,0xA1,0x5B,0x41,0xF5,0xDF,0xE5,0x64,0x43,0x2D,0xE9,0xD5,0x39,0xAB,0xD2, -0xA2,0xDF,0xB7,0x8B,0xD0,0xC0,0x80,0x19,0x1C,0x45,0xC0,0x2D,0x8C,0xE8,0xF8,0x2D, -0xA4,0x74,0x56,0x49,0xC5,0x05,0xB5,0x4F,0x15,0xDE,0x6E,0x44,0x78,0x39,0x87,0xA8, -0x7E,0xBB,0xF3,0x79,0x18,0x91,0xBB,0xF4,0x6F,0x9D,0xC1,0xF0,0x8C,0x35,0x8C,0x5D, -0x01,0xFB,0xC3,0x6D,0xB9,0xEF,0x44,0x6D,0x79,0x46,0x31,0x7E,0x0A,0xFE,0xA9,0x82, -0xC1,0xFF,0xEF,0xAB,0x6E,0x20,0xC4,0x50,0xC9,0x5F,0x9D,0x4D,0x9B,0x17,0x8C,0x0C, -0xE5,0x01,0xC9,0xA0,0x41,0x6A,0x73,0x53,0xFA,0xA5,0x50,0xB4,0x6E,0x25,0x0F,0xFB, -0x4C,0x18,0xF4,0xFD,0x52,0xD9,0x8E,0x69,0xB1,0xE8,0x11,0x0F,0xDE,0x88,0xD8,0xFB, -0x1D,0x49,0xF7,0xAA,0xDE,0x95,0xCF,0x20,0x78,0xC2,0x60,0x12,0xDB,0x25,0x40,0x8C, -0x6A,0xFC,0x7E,0x42,0x38,0x40,0x64,0x12,0xF7,0x9E,0x81,0xE1,0x93,0x2E, -}; - - -/* subject:/OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign */ -/* issuer :/OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign */ - - -const unsigned char GlobalSign_Root_CA___R3_certificate[867]={ -0x30,0x82,0x03,0x5F,0x30,0x82,0x02,0x47,0xA0,0x03,0x02,0x01,0x02,0x02,0x0B,0x04, -0x00,0x00,0x00,0x00,0x01,0x21,0x58,0x53,0x08,0xA2,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x4C,0x31,0x20,0x30,0x1E,0x06, -0x03,0x55,0x04,0x0B,0x13,0x17,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E, -0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x52,0x33,0x31,0x13,0x30, -0x11,0x06,0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69, -0x67,0x6E,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F, -0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x30,0x1E,0x17,0x0D,0x30,0x39,0x30,0x33,0x31, -0x38,0x31,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x39,0x30,0x33,0x31,0x38, -0x31,0x30,0x30,0x30,0x30,0x30,0x5A,0x30,0x4C,0x31,0x20,0x30,0x1E,0x06,0x03,0x55, -0x04,0x0B,0x13,0x17,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x52, -0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x52,0x33,0x31,0x13,0x30,0x11,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E, -0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61, -0x6C,0x53,0x69,0x67,0x6E,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01, -0x0A,0x02,0x82,0x01,0x01,0x00,0xCC,0x25,0x76,0x90,0x79,0x06,0x78,0x22,0x16,0xF5, -0xC0,0x83,0xB6,0x84,0xCA,0x28,0x9E,0xFD,0x05,0x76,0x11,0xC5,0xAD,0x88,0x72,0xFC, -0x46,0x02,0x43,0xC7,0xB2,0x8A,0x9D,0x04,0x5F,0x24,0xCB,0x2E,0x4B,0xE1,0x60,0x82, -0x46,0xE1,0x52,0xAB,0x0C,0x81,0x47,0x70,0x6C,0xDD,0x64,0xD1,0xEB,0xF5,0x2C,0xA3, -0x0F,0x82,0x3D,0x0C,0x2B,0xAE,0x97,0xD7,0xB6,0x14,0x86,0x10,0x79,0xBB,0x3B,0x13, -0x80,0x77,0x8C,0x08,0xE1,0x49,0xD2,0x6A,0x62,0x2F,0x1F,0x5E,0xFA,0x96,0x68,0xDF, -0x89,0x27,0x95,0x38,0x9F,0x06,0xD7,0x3E,0xC9,0xCB,0x26,0x59,0x0D,0x73,0xDE,0xB0, -0xC8,0xE9,0x26,0x0E,0x83,0x15,0xC6,0xEF,0x5B,0x8B,0xD2,0x04,0x60,0xCA,0x49,0xA6, -0x28,0xF6,0x69,0x3B,0xF6,0xCB,0xC8,0x28,0x91,0xE5,0x9D,0x8A,0x61,0x57,0x37,0xAC, -0x74,0x14,0xDC,0x74,0xE0,0x3A,0xEE,0x72,0x2F,0x2E,0x9C,0xFB,0xD0,0xBB,0xBF,0xF5, -0x3D,0x00,0xE1,0x06,0x33,0xE8,0x82,0x2B,0xAE,0x53,0xA6,0x3A,0x16,0x73,0x8C,0xDD, -0x41,0x0E,0x20,0x3A,0xC0,0xB4,0xA7,0xA1,0xE9,0xB2,0x4F,0x90,0x2E,0x32,0x60,0xE9, -0x57,0xCB,0xB9,0x04,0x92,0x68,0x68,0xE5,0x38,0x26,0x60,0x75,0xB2,0x9F,0x77,0xFF, -0x91,0x14,0xEF,0xAE,0x20,0x49,0xFC,0xAD,0x40,0x15,0x48,0xD1,0x02,0x31,0x61,0x19, -0x5E,0xB8,0x97,0xEF,0xAD,0x77,0xB7,0x64,0x9A,0x7A,0xBF,0x5F,0xC1,0x13,0xEF,0x9B, -0x62,0xFB,0x0D,0x6C,0xE0,0x54,0x69,0x16,0xA9,0x03,0xDA,0x6E,0xE9,0x83,0x93,0x71, -0x76,0xC6,0x69,0x85,0x82,0x17,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30, -0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30, -0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF, -0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x8F,0xF0,0x4B,0x7F,0xA8, -0x2E,0x45,0x24,0xAE,0x4D,0x50,0xFA,0x63,0x9A,0x8B,0xDE,0xE2,0xDD,0x1B,0xBC,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82, -0x01,0x01,0x00,0x4B,0x40,0xDB,0xC0,0x50,0xAA,0xFE,0xC8,0x0C,0xEF,0xF7,0x96,0x54, -0x45,0x49,0xBB,0x96,0x00,0x09,0x41,0xAC,0xB3,0x13,0x86,0x86,0x28,0x07,0x33,0xCA, -0x6B,0xE6,0x74,0xB9,0xBA,0x00,0x2D,0xAE,0xA4,0x0A,0xD3,0xF5,0xF1,0xF1,0x0F,0x8A, -0xBF,0x73,0x67,0x4A,0x83,0xC7,0x44,0x7B,0x78,0xE0,0xAF,0x6E,0x6C,0x6F,0x03,0x29, -0x8E,0x33,0x39,0x45,0xC3,0x8E,0xE4,0xB9,0x57,0x6C,0xAA,0xFC,0x12,0x96,0xEC,0x53, -0xC6,0x2D,0xE4,0x24,0x6C,0xB9,0x94,0x63,0xFB,0xDC,0x53,0x68,0x67,0x56,0x3E,0x83, -0xB8,0xCF,0x35,0x21,0xC3,0xC9,0x68,0xFE,0xCE,0xDA,0xC2,0x53,0xAA,0xCC,0x90,0x8A, -0xE9,0xF0,0x5D,0x46,0x8C,0x95,0xDD,0x7A,0x58,0x28,0x1A,0x2F,0x1D,0xDE,0xCD,0x00, -0x37,0x41,0x8F,0xED,0x44,0x6D,0xD7,0x53,0x28,0x97,0x7E,0xF3,0x67,0x04,0x1E,0x15, -0xD7,0x8A,0x96,0xB4,0xD3,0xDE,0x4C,0x27,0xA4,0x4C,0x1B,0x73,0x73,0x76,0xF4,0x17, -0x99,0xC2,0x1F,0x7A,0x0E,0xE3,0x2D,0x08,0xAD,0x0A,0x1C,0x2C,0xFF,0x3C,0xAB,0x55, -0x0E,0x0F,0x91,0x7E,0x36,0xEB,0xC3,0x57,0x49,0xBE,0xE1,0x2E,0x2D,0x7C,0x60,0x8B, -0xC3,0x41,0x51,0x13,0x23,0x9D,0xCE,0xF7,0x32,0x6B,0x94,0x01,0xA8,0x99,0xE7,0x2C, -0x33,0x1F,0x3A,0x3B,0x25,0xD2,0x86,0x40,0xCE,0x3B,0x2C,0x86,0x78,0xC9,0x61,0x2F, -0x14,0xBA,0xEE,0xDB,0x55,0x6F,0xDF,0x84,0xEE,0x05,0x09,0x4D,0xBD,0x28,0xD8,0x72, -0xCE,0xD3,0x62,0x50,0x65,0x1E,0xEB,0x92,0x97,0x83,0x31,0xD9,0xB3,0xB5,0xCA,0x47, -0x58,0x3F,0x5F, -}; - - -/* subject:/C=US/O=AffirmTrust/CN=AffirmTrust Networking */ -/* issuer :/C=US/O=AffirmTrust/CN=AffirmTrust Networking */ - - -const unsigned char AffirmTrust_Networking_certificate[848]={ -0x30,0x82,0x03,0x4C,0x30,0x82,0x02,0x34,0xA0,0x03,0x02,0x01,0x02,0x02,0x08,0x7C, -0x4F,0x04,0x39,0x1C,0xD4,0x99,0x2D,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x44,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x0C,0x0B, -0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31,0x1F,0x30,0x1D,0x06, -0x03,0x55,0x04,0x03,0x0C,0x16,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73, -0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x69,0x6E,0x67,0x30,0x1E,0x17,0x0D, -0x31,0x30,0x30,0x31,0x32,0x39,0x31,0x34,0x30,0x38,0x32,0x34,0x5A,0x17,0x0D,0x33, -0x30,0x31,0x32,0x33,0x31,0x31,0x34,0x30,0x38,0x32,0x34,0x5A,0x30,0x44,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06, -0x03,0x55,0x04,0x0A,0x0C,0x0B,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73, -0x74,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x0C,0x16,0x41,0x66,0x66,0x69, -0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x69, -0x6E,0x67,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82, -0x01,0x01,0x00,0xB4,0x84,0xCC,0x33,0x17,0x2E,0x6B,0x94,0x6C,0x6B,0x61,0x52,0xA0, -0xEB,0xA3,0xCF,0x79,0x94,0x4C,0xE5,0x94,0x80,0x99,0xCB,0x55,0x64,0x44,0x65,0x8F, -0x67,0x64,0xE2,0x06,0xE3,0x5C,0x37,0x49,0xF6,0x2F,0x9B,0x84,0x84,0x1E,0x2D,0xF2, -0x60,0x9D,0x30,0x4E,0xCC,0x84,0x85,0xE2,0x2C,0xCF,0x1E,0x9E,0xFE,0x36,0xAB,0x33, -0x77,0x35,0x44,0xD8,0x35,0x96,0x1A,0x3D,0x36,0xE8,0x7A,0x0E,0xD8,0xD5,0x47,0xA1, -0x6A,0x69,0x8B,0xD9,0xFC,0xBB,0x3A,0xAE,0x79,0x5A,0xD5,0xF4,0xD6,0x71,0xBB,0x9A, -0x90,0x23,0x6B,0x9A,0xB7,0x88,0x74,0x87,0x0C,0x1E,0x5F,0xB9,0x9E,0x2D,0xFA,0xAB, -0x53,0x2B,0xDC,0xBB,0x76,0x3E,0x93,0x4C,0x08,0x08,0x8C,0x1E,0xA2,0x23,0x1C,0xD4, -0x6A,0xAD,0x22,0xBA,0x99,0x01,0x2E,0x6D,0x65,0xCB,0xBE,0x24,0x66,0x55,0x24,0x4B, -0x40,0x44,0xB1,0x1B,0xD7,0xE1,0xC2,0x85,0xC0,0xDE,0x10,0x3F,0x3D,0xED,0xB8,0xFC, -0xF1,0xF1,0x23,0x53,0xDC,0xBF,0x65,0x97,0x6F,0xD9,0xF9,0x40,0x71,0x8D,0x7D,0xBD, -0x95,0xD4,0xCE,0xBE,0xA0,0x5E,0x27,0x23,0xDE,0xFD,0xA6,0xD0,0x26,0x0E,0x00,0x29, -0xEB,0x3C,0x46,0xF0,0x3D,0x60,0xBF,0x3F,0x50,0xD2,0xDC,0x26,0x41,0x51,0x9E,0x14, -0x37,0x42,0x04,0xA3,0x70,0x57,0xA8,0x1B,0x87,0xED,0x2D,0xFA,0x7B,0xEE,0x8C,0x0A, -0xE3,0xA9,0x66,0x89,0x19,0xCB,0x41,0xF9,0xDD,0x44,0x36,0x61,0xCF,0xE2,0x77,0x46, -0xC8,0x7D,0xF6,0xF4,0x92,0x81,0x36,0xFD,0xDB,0x34,0xF1,0x72,0x7E,0xF3,0x0C,0x16, -0xBD,0xB4,0x15,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06,0x03, -0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x07,0x1F,0xD2,0xE7,0x9C,0xDA,0xC2,0x6E,0xA2, -0x40,0xB4,0xB0,0x7A,0x50,0x10,0x50,0x74,0xC4,0xC8,0xBD,0x30,0x0F,0x06,0x03,0x55, -0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00, -0x89,0x57,0xB2,0x16,0x7A,0xA8,0xC2,0xFD,0xD6,0xD9,0x9B,0x9B,0x34,0xC2,0x9C,0xB4, -0x32,0x14,0x4D,0xA7,0xA4,0xDF,0xEC,0xBE,0xA7,0xBE,0xF8,0x43,0xDB,0x91,0x37,0xCE, -0xB4,0x32,0x2E,0x50,0x55,0x1A,0x35,0x4E,0x76,0x43,0x71,0x20,0xEF,0x93,0x77,0x4E, -0x15,0x70,0x2E,0x87,0xC3,0xC1,0x1D,0x6D,0xDC,0xCB,0xB5,0x27,0xD4,0x2C,0x56,0xD1, -0x52,0x53,0x3A,0x44,0xD2,0x73,0xC8,0xC4,0x1B,0x05,0x65,0x5A,0x62,0x92,0x9C,0xEE, -0x41,0x8D,0x31,0xDB,0xE7,0x34,0xEA,0x59,0x21,0xD5,0x01,0x7A,0xD7,0x64,0xB8,0x64, -0x39,0xCD,0xC9,0xED,0xAF,0xED,0x4B,0x03,0x48,0xA7,0xA0,0x99,0x01,0x80,0xDC,0x65, -0xA3,0x36,0xAE,0x65,0x59,0x48,0x4F,0x82,0x4B,0xC8,0x65,0xF1,0x57,0x1D,0xE5,0x59, -0x2E,0x0A,0x3F,0x6C,0xD8,0xD1,0xF5,0xE5,0x09,0xB4,0x6C,0x54,0x00,0x0A,0xE0,0x15, -0x4D,0x87,0x75,0x6D,0xB7,0x58,0x96,0x5A,0xDD,0x6D,0xD2,0x00,0xA0,0xF4,0x9B,0x48, -0xBE,0xC3,0x37,0xA4,0xBA,0x36,0xE0,0x7C,0x87,0x85,0x97,0x1A,0x15,0xA2,0xDE,0x2E, -0xA2,0x5B,0xBD,0xAF,0x18,0xF9,0x90,0x50,0xCD,0x70,0x59,0xF8,0x27,0x67,0x47,0xCB, -0xC7,0xA0,0x07,0x3A,0x7D,0xD1,0x2C,0x5D,0x6C,0x19,0x3A,0x66,0xB5,0x7D,0xFD,0x91, -0x6F,0x82,0xB1,0xBE,0x08,0x93,0xDB,0x14,0x47,0xF1,0xA2,0x37,0xC7,0x45,0x9E,0x3C, -0xC7,0x77,0xAF,0x64,0xA8,0x93,0xDF,0xF6,0x69,0x83,0x82,0x60,0xF2,0x49,0x42,0x34, -0xED,0x5A,0x00,0x54,0x85,0x1C,0x16,0x36,0x92,0x0C,0x5C,0xFA,0xA6,0xAD,0xBF,0xDB, -}; - - -/* subject:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root */ -/* issuer :/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root */ - - -const unsigned char AddTrust_External_Root_certificate[1082]={ -0x30,0x82,0x04,0x36,0x30,0x82,0x03,0x1E,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x6F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14, -0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73, -0x74,0x20,0x41,0x42,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x0B,0x13,0x1D,0x41, -0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x45,0x78,0x74,0x65,0x72,0x6E,0x61,0x6C, -0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x22,0x30,0x20, -0x06,0x03,0x55,0x04,0x03,0x13,0x19,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20, -0x45,0x78,0x74,0x65,0x72,0x6E,0x61,0x6C,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74, -0x30,0x1E,0x17,0x0D,0x30,0x30,0x30,0x35,0x33,0x30,0x31,0x30,0x34,0x38,0x33,0x38, -0x5A,0x17,0x0D,0x32,0x30,0x30,0x35,0x33,0x30,0x31,0x30,0x34,0x38,0x33,0x38,0x5A, -0x30,0x6F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31, -0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75, -0x73,0x74,0x20,0x41,0x42,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x0B,0x13,0x1D, -0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x45,0x78,0x74,0x65,0x72,0x6E,0x61, -0x6C,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x22,0x30, -0x20,0x06,0x03,0x55,0x04,0x03,0x13,0x19,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74, -0x20,0x45,0x78,0x74,0x65,0x72,0x6E,0x61,0x6C,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F, -0x74,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01, -0x01,0x00,0xB7,0xF7,0x1A,0x33,0xE6,0xF2,0x00,0x04,0x2D,0x39,0xE0,0x4E,0x5B,0xED, -0x1F,0xBC,0x6C,0x0F,0xCD,0xB5,0xFA,0x23,0xB6,0xCE,0xDE,0x9B,0x11,0x33,0x97,0xA4, -0x29,0x4C,0x7D,0x93,0x9F,0xBD,0x4A,0xBC,0x93,0xED,0x03,0x1A,0xE3,0x8F,0xCF,0xE5, -0x6D,0x50,0x5A,0xD6,0x97,0x29,0x94,0x5A,0x80,0xB0,0x49,0x7A,0xDB,0x2E,0x95,0xFD, -0xB8,0xCA,0xBF,0x37,0x38,0x2D,0x1E,0x3E,0x91,0x41,0xAD,0x70,0x56,0xC7,0xF0,0x4F, -0x3F,0xE8,0x32,0x9E,0x74,0xCA,0xC8,0x90,0x54,0xE9,0xC6,0x5F,0x0F,0x78,0x9D,0x9A, -0x40,0x3C,0x0E,0xAC,0x61,0xAA,0x5E,0x14,0x8F,0x9E,0x87,0xA1,0x6A,0x50,0xDC,0xD7, -0x9A,0x4E,0xAF,0x05,0xB3,0xA6,0x71,0x94,0x9C,0x71,0xB3,0x50,0x60,0x0A,0xC7,0x13, -0x9D,0x38,0x07,0x86,0x02,0xA8,0xE9,0xA8,0x69,0x26,0x18,0x90,0xAB,0x4C,0xB0,0x4F, -0x23,0xAB,0x3A,0x4F,0x84,0xD8,0xDF,0xCE,0x9F,0xE1,0x69,0x6F,0xBB,0xD7,0x42,0xD7, -0x6B,0x44,0xE4,0xC7,0xAD,0xEE,0x6D,0x41,0x5F,0x72,0x5A,0x71,0x08,0x37,0xB3,0x79, -0x65,0xA4,0x59,0xA0,0x94,0x37,0xF7,0x00,0x2F,0x0D,0xC2,0x92,0x72,0xDA,0xD0,0x38, -0x72,0xDB,0x14,0xA8,0x45,0xC4,0x5D,0x2A,0x7D,0xB7,0xB4,0xD6,0xC4,0xEE,0xAC,0xCD, -0x13,0x44,0xB7,0xC9,0x2B,0xDD,0x43,0x00,0x25,0xFA,0x61,0xB9,0x69,0x6A,0x58,0x23, -0x11,0xB7,0xA7,0x33,0x8F,0x56,0x75,0x59,0xF5,0xCD,0x29,0xD7,0x46,0xB7,0x0A,0x2B, -0x65,0xB6,0xD3,0x42,0x6F,0x15,0xB2,0xB8,0x7B,0xFB,0xEF,0xE9,0x5D,0x53,0xD5,0x34, -0x5A,0x27,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xDC,0x30,0x81,0xD9,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xAD,0xBD,0x98,0x7A,0x34,0xB4,0x26,0xF7, -0xFA,0xC4,0x26,0x54,0xEF,0x03,0xBD,0xE0,0x24,0xCB,0x54,0x1A,0x30,0x0B,0x06,0x03, -0x55,0x1D,0x0F,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13, -0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x81,0x99,0x06,0x03,0x55, -0x1D,0x23,0x04,0x81,0x91,0x30,0x81,0x8E,0x80,0x14,0xAD,0xBD,0x98,0x7A,0x34,0xB4, -0x26,0xF7,0xFA,0xC4,0x26,0x54,0xEF,0x03,0xBD,0xE0,0x24,0xCB,0x54,0x1A,0xA1,0x73, -0xA4,0x71,0x30,0x6F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53, -0x45,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54, -0x72,0x75,0x73,0x74,0x20,0x41,0x42,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x0B, -0x13,0x1D,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x45,0x78,0x74,0x65,0x72, -0x6E,0x61,0x6C,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31, -0x22,0x30,0x20,0x06,0x03,0x55,0x04,0x03,0x13,0x19,0x41,0x64,0x64,0x54,0x72,0x75, -0x73,0x74,0x20,0x45,0x78,0x74,0x65,0x72,0x6E,0x61,0x6C,0x20,0x43,0x41,0x20,0x52, -0x6F,0x6F,0x74,0x82,0x01,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0xB0,0x9B,0xE0,0x85,0x25,0xC2, -0xD6,0x23,0xE2,0x0F,0x96,0x06,0x92,0x9D,0x41,0x98,0x9C,0xD9,0x84,0x79,0x81,0xD9, -0x1E,0x5B,0x14,0x07,0x23,0x36,0x65,0x8F,0xB0,0xD8,0x77,0xBB,0xAC,0x41,0x6C,0x47, -0x60,0x83,0x51,0xB0,0xF9,0x32,0x3D,0xE7,0xFC,0xF6,0x26,0x13,0xC7,0x80,0x16,0xA5, -0xBF,0x5A,0xFC,0x87,0xCF,0x78,0x79,0x89,0x21,0x9A,0xE2,0x4C,0x07,0x0A,0x86,0x35, -0xBC,0xF2,0xDE,0x51,0xC4,0xD2,0x96,0xB7,0xDC,0x7E,0x4E,0xEE,0x70,0xFD,0x1C,0x39, -0xEB,0x0C,0x02,0x51,0x14,0x2D,0x8E,0xBD,0x16,0xE0,0xC1,0xDF,0x46,0x75,0xE7,0x24, -0xAD,0xEC,0xF4,0x42,0xB4,0x85,0x93,0x70,0x10,0x67,0xBA,0x9D,0x06,0x35,0x4A,0x18, -0xD3,0x2B,0x7A,0xCC,0x51,0x42,0xA1,0x7A,0x63,0xD1,0xE6,0xBB,0xA1,0xC5,0x2B,0xC2, -0x36,0xBE,0x13,0x0D,0xE6,0xBD,0x63,0x7E,0x79,0x7B,0xA7,0x09,0x0D,0x40,0xAB,0x6A, -0xDD,0x8F,0x8A,0xC3,0xF6,0xF6,0x8C,0x1A,0x42,0x05,0x51,0xD4,0x45,0xF5,0x9F,0xA7, -0x62,0x21,0x68,0x15,0x20,0x43,0x3C,0x99,0xE7,0x7C,0xBD,0x24,0xD8,0xA9,0x91,0x17, -0x73,0x88,0x3F,0x56,0x1B,0x31,0x38,0x18,0xB4,0x71,0x0F,0x9A,0xCD,0xC8,0x0E,0x9E, -0x8E,0x2E,0x1B,0xE1,0x8C,0x98,0x83,0xCB,0x1F,0x31,0xF1,0x44,0x4C,0xC6,0x04,0x73, -0x49,0x76,0x60,0x0F,0xC7,0xF8,0xBD,0x17,0x80,0x6B,0x2E,0xE9,0xCC,0x4C,0x0E,0x5A, -0x9A,0x79,0x0F,0x20,0x0A,0x2E,0xD5,0x9E,0x63,0x26,0x1E,0x55,0x92,0x94,0xD8,0x82, -0x17,0x5A,0x7B,0xD0,0xBC,0xC7,0x8F,0x4E,0x86,0x04, -}; - - -/* subject:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2008 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA - G3 */ -/* issuer :/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2008 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA - G3 */ - - -const unsigned char thawte_Primary_Root_CA___G3_certificate[1070]={ -0x30,0x82,0x04,0x2A,0x30,0x82,0x03,0x12,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x60, -0x01,0x97,0xB7,0x46,0xA7,0xEA,0xB4,0xB4,0x9A,0xD6,0x4B,0x2F,0xF7,0x90,0xFB,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x81, -0xAE,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15, -0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61,0x77,0x74,0x65,0x2C, -0x20,0x49,0x6E,0x63,0x2E,0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13,0x1F, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x53,0x65, -0x72,0x76,0x69,0x63,0x65,0x73,0x20,0x44,0x69,0x76,0x69,0x73,0x69,0x6F,0x6E,0x31, -0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x0B,0x13,0x2F,0x28,0x63,0x29,0x20,0x32,0x30, -0x30,0x38,0x20,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20, -0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64, -0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x24,0x30,0x22,0x06,0x03,0x55, -0x04,0x03,0x13,0x1B,0x74,0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x69,0x6D,0x61, -0x72,0x79,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x47,0x33,0x30, -0x1E,0x17,0x0D,0x30,0x38,0x30,0x34,0x30,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x5A, -0x17,0x0D,0x33,0x37,0x31,0x32,0x30,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30, -0x81,0xAE,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31, -0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61,0x77,0x74,0x65, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13, -0x1F,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x53, -0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x20,0x44,0x69,0x76,0x69,0x73,0x69,0x6F,0x6E, -0x31,0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x0B,0x13,0x2F,0x28,0x63,0x29,0x20,0x32, -0x30,0x30,0x38,0x20,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E, -0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65, -0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x24,0x30,0x22,0x06,0x03, -0x55,0x04,0x03,0x13,0x1B,0x74,0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x69,0x6D, -0x61,0x72,0x79,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x47,0x33, -0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01, -0x00,0xB2,0xBF,0x27,0x2C,0xFB,0xDB,0xD8,0x5B,0xDD,0x78,0x7B,0x1B,0x9E,0x77,0x66, -0x81,0xCB,0x3E,0xBC,0x7C,0xAE,0xF3,0xA6,0x27,0x9A,0x34,0xA3,0x68,0x31,0x71,0x38, -0x33,0x62,0xE4,0xF3,0x71,0x66,0x79,0xB1,0xA9,0x65,0xA3,0xA5,0x8B,0xD5,0x8F,0x60, -0x2D,0x3F,0x42,0xCC,0xAA,0x6B,0x32,0xC0,0x23,0xCB,0x2C,0x41,0xDD,0xE4,0xDF,0xFC, -0x61,0x9C,0xE2,0x73,0xB2,0x22,0x95,0x11,0x43,0x18,0x5F,0xC4,0xB6,0x1F,0x57,0x6C, -0x0A,0x05,0x58,0x22,0xC8,0x36,0x4C,0x3A,0x7C,0xA5,0xD1,0xCF,0x86,0xAF,0x88,0xA7, -0x44,0x02,0x13,0x74,0x71,0x73,0x0A,0x42,0x59,0x02,0xF8,0x1B,0x14,0x6B,0x42,0xDF, -0x6F,0x5F,0xBA,0x6B,0x82,0xA2,0x9D,0x5B,0xE7,0x4A,0xBD,0x1E,0x01,0x72,0xDB,0x4B, -0x74,0xE8,0x3B,0x7F,0x7F,0x7D,0x1F,0x04,0xB4,0x26,0x9B,0xE0,0xB4,0x5A,0xAC,0x47, -0x3D,0x55,0xB8,0xD7,0xB0,0x26,0x52,0x28,0x01,0x31,0x40,0x66,0xD8,0xD9,0x24,0xBD, -0xF6,0x2A,0xD8,0xEC,0x21,0x49,0x5C,0x9B,0xF6,0x7A,0xE9,0x7F,0x55,0x35,0x7E,0x96, -0x6B,0x8D,0x93,0x93,0x27,0xCB,0x92,0xBB,0xEA,0xAC,0x40,0xC0,0x9F,0xC2,0xF8,0x80, -0xCF,0x5D,0xF4,0x5A,0xDC,0xCE,0x74,0x86,0xA6,0x3E,0x6C,0x0B,0x53,0xCA,0xBD,0x92, -0xCE,0x19,0x06,0x72,0xE6,0x0C,0x5C,0x38,0x69,0xC7,0x04,0xD6,0xBC,0x6C,0xCE,0x5B, -0xF6,0xF7,0x68,0x9C,0xDC,0x25,0x15,0x48,0x88,0xA1,0xE9,0xA9,0xF8,0x98,0x9C,0xE0, -0xF3,0xD5,0x31,0x28,0x61,0x11,0x6C,0x67,0x96,0x8D,0x39,0x99,0xCB,0xC2,0x45,0x24, -0x39,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06,0x03,0x55,0x1D, -0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55, -0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03,0x55, -0x1D,0x0E,0x04,0x16,0x04,0x14,0xAD,0x6C,0xAA,0x94,0x60,0x9C,0xED,0xE4,0xFF,0xFA, -0x3E,0x0A,0x74,0x2B,0x63,0x03,0xF7,0xB6,0x59,0xBF,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x1A,0x40, -0xD8,0x95,0x65,0xAC,0x09,0x92,0x89,0xC6,0x39,0xF4,0x10,0xE5,0xA9,0x0E,0x66,0x53, -0x5D,0x78,0xDE,0xFA,0x24,0x91,0xBB,0xE7,0x44,0x51,0xDF,0xC6,0x16,0x34,0x0A,0xEF, -0x6A,0x44,0x51,0xEA,0x2B,0x07,0x8A,0x03,0x7A,0xC3,0xEB,0x3F,0x0A,0x2C,0x52,0x16, -0xA0,0x2B,0x43,0xB9,0x25,0x90,0x3F,0x70,0xA9,0x33,0x25,0x6D,0x45,0x1A,0x28,0x3B, -0x27,0xCF,0xAA,0xC3,0x29,0x42,0x1B,0xDF,0x3B,0x4C,0xC0,0x33,0x34,0x5B,0x41,0x88, -0xBF,0x6B,0x2B,0x65,0xAF,0x28,0xEF,0xB2,0xF5,0xC3,0xAA,0x66,0xCE,0x7B,0x56,0xEE, -0xB7,0xC8,0xCB,0x67,0xC1,0xC9,0x9C,0x1A,0x18,0xB8,0xC4,0xC3,0x49,0x03,0xF1,0x60, -0x0E,0x50,0xCD,0x46,0xC5,0xF3,0x77,0x79,0xF7,0xB6,0x15,0xE0,0x38,0xDB,0xC7,0x2F, -0x28,0xA0,0x0C,0x3F,0x77,0x26,0x74,0xD9,0x25,0x12,0xDA,0x31,0xDA,0x1A,0x1E,0xDC, -0x29,0x41,0x91,0x22,0x3C,0x69,0xA7,0xBB,0x02,0xF2,0xB6,0x5C,0x27,0x03,0x89,0xF4, -0x06,0xEA,0x9B,0xE4,0x72,0x82,0xE3,0xA1,0x09,0xC1,0xE9,0x00,0x19,0xD3,0x3E,0xD4, -0x70,0x6B,0xBA,0x71,0xA6,0xAA,0x58,0xAE,0xF4,0xBB,0xE9,0x6C,0xB6,0xEF,0x87,0xCC, -0x9B,0xBB,0xFF,0x39,0xE6,0x56,0x61,0xD3,0x0A,0xA7,0xC4,0x5C,0x4C,0x60,0x7B,0x05, -0x77,0x26,0x7A,0xBF,0xD8,0x07,0x52,0x2C,0x62,0xF7,0x70,0x63,0xD9,0x39,0xBC,0x6F, -0x1C,0xC2,0x79,0xDC,0x76,0x29,0xAF,0xCE,0xC5,0x2C,0x64,0x04,0x5E,0x88,0x36,0x6E, -0x31,0xD4,0x40,0x1A,0x62,0x34,0x36,0x3F,0x35,0x01,0xAE,0xAC,0x63,0xA0, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Assured ID Root CA */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Assured ID Root CA */ - - -const unsigned char DigiCert_Assured_ID_Root_CA_certificate[955]={ -0x30,0x82,0x03,0xB7,0x30,0x82,0x02,0x9F,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x0C, -0xE7,0xE0,0xE5,0x17,0xD8,0x46,0xFE,0x8F,0xE5,0x60,0xFC,0x1B,0xF0,0x30,0x39,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x65, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30, -0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77, -0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31, -0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x44,0x69,0x67,0x69,0x43,0x65, -0x72,0x74,0x20,0x41,0x73,0x73,0x75,0x72,0x65,0x64,0x20,0x49,0x44,0x20,0x52,0x6F, -0x6F,0x74,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x31,0x31,0x30,0x30, -0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x31,0x31,0x31,0x31,0x30,0x30,0x30, -0x30,0x30,0x30,0x30,0x5A,0x30,0x65,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44, -0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06, -0x03,0x55,0x04,0x0B,0x13,0x10,0x77,0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65, -0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13, -0x1B,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x41,0x73,0x73,0x75,0x72,0x65, -0x64,0x20,0x49,0x44,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03, -0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xAD,0x0E,0x15, -0xCE,0xE4,0x43,0x80,0x5C,0xB1,0x87,0xF3,0xB7,0x60,0xF9,0x71,0x12,0xA5,0xAE,0xDC, -0x26,0x94,0x88,0xAA,0xF4,0xCE,0xF5,0x20,0x39,0x28,0x58,0x60,0x0C,0xF8,0x80,0xDA, -0xA9,0x15,0x95,0x32,0x61,0x3C,0xB5,0xB1,0x28,0x84,0x8A,0x8A,0xDC,0x9F,0x0A,0x0C, -0x83,0x17,0x7A,0x8F,0x90,0xAC,0x8A,0xE7,0x79,0x53,0x5C,0x31,0x84,0x2A,0xF6,0x0F, -0x98,0x32,0x36,0x76,0xCC,0xDE,0xDD,0x3C,0xA8,0xA2,0xEF,0x6A,0xFB,0x21,0xF2,0x52, -0x61,0xDF,0x9F,0x20,0xD7,0x1F,0xE2,0xB1,0xD9,0xFE,0x18,0x64,0xD2,0x12,0x5B,0x5F, -0xF9,0x58,0x18,0x35,0xBC,0x47,0xCD,0xA1,0x36,0xF9,0x6B,0x7F,0xD4,0xB0,0x38,0x3E, -0xC1,0x1B,0xC3,0x8C,0x33,0xD9,0xD8,0x2F,0x18,0xFE,0x28,0x0F,0xB3,0xA7,0x83,0xD6, -0xC3,0x6E,0x44,0xC0,0x61,0x35,0x96,0x16,0xFE,0x59,0x9C,0x8B,0x76,0x6D,0xD7,0xF1, -0xA2,0x4B,0x0D,0x2B,0xFF,0x0B,0x72,0xDA,0x9E,0x60,0xD0,0x8E,0x90,0x35,0xC6,0x78, -0x55,0x87,0x20,0xA1,0xCF,0xE5,0x6D,0x0A,0xC8,0x49,0x7C,0x31,0x98,0x33,0x6C,0x22, -0xE9,0x87,0xD0,0x32,0x5A,0xA2,0xBA,0x13,0x82,0x11,0xED,0x39,0x17,0x9D,0x99,0x3A, -0x72,0xA1,0xE6,0xFA,0xA4,0xD9,0xD5,0x17,0x31,0x75,0xAE,0x85,0x7D,0x22,0xAE,0x3F, -0x01,0x46,0x86,0xF6,0x28,0x79,0xC8,0xB1,0xDA,0xE4,0x57,0x17,0xC4,0x7E,0x1C,0x0E, -0xB0,0xB4,0x92,0xA6,0x56,0xB3,0xBD,0xB2,0x97,0xED,0xAA,0xA7,0xF0,0xB7,0xC5,0xA8, -0x3F,0x95,0x16,0xD0,0xFF,0xA1,0x96,0xEB,0x08,0x5F,0x18,0x77,0x4F,0x02,0x03,0x01, -0x00,0x01,0xA3,0x63,0x30,0x61,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF, -0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16, -0x04,0x14,0x45,0xEB,0xA2,0xAF,0xF4,0x92,0xCB,0x82,0x31,0x2D,0x51,0x8B,0xA7,0xA7, -0x21,0x9D,0xF3,0x6D,0xC8,0x0F,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30, -0x16,0x80,0x14,0x45,0xEB,0xA2,0xAF,0xF4,0x92,0xCB,0x82,0x31,0x2D,0x51,0x8B,0xA7, -0xA7,0x21,0x9D,0xF3,0x6D,0xC8,0x0F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0xA2,0x0E,0xBC,0xDF,0xE2, -0xED,0xF0,0xE3,0x72,0x73,0x7A,0x64,0x94,0xBF,0xF7,0x72,0x66,0xD8,0x32,0xE4,0x42, -0x75,0x62,0xAE,0x87,0xEB,0xF2,0xD5,0xD9,0xDE,0x56,0xB3,0x9F,0xCC,0xCE,0x14,0x28, -0xB9,0x0D,0x97,0x60,0x5C,0x12,0x4C,0x58,0xE4,0xD3,0x3D,0x83,0x49,0x45,0x58,0x97, -0x35,0x69,0x1A,0xA8,0x47,0xEA,0x56,0xC6,0x79,0xAB,0x12,0xD8,0x67,0x81,0x84,0xDF, -0x7F,0x09,0x3C,0x94,0xE6,0xB8,0x26,0x2C,0x20,0xBD,0x3D,0xB3,0x28,0x89,0xF7,0x5F, -0xFF,0x22,0xE2,0x97,0x84,0x1F,0xE9,0x65,0xEF,0x87,0xE0,0xDF,0xC1,0x67,0x49,0xB3, -0x5D,0xEB,0xB2,0x09,0x2A,0xEB,0x26,0xED,0x78,0xBE,0x7D,0x3F,0x2B,0xF3,0xB7,0x26, -0x35,0x6D,0x5F,0x89,0x01,0xB6,0x49,0x5B,0x9F,0x01,0x05,0x9B,0xAB,0x3D,0x25,0xC1, -0xCC,0xB6,0x7F,0xC2,0xF1,0x6F,0x86,0xC6,0xFA,0x64,0x68,0xEB,0x81,0x2D,0x94,0xEB, -0x42,0xB7,0xFA,0x8C,0x1E,0xDD,0x62,0xF1,0xBE,0x50,0x67,0xB7,0x6C,0xBD,0xF3,0xF1, -0x1F,0x6B,0x0C,0x36,0x07,0x16,0x7F,0x37,0x7C,0xA9,0x5B,0x6D,0x7A,0xF1,0x12,0x46, -0x60,0x83,0xD7,0x27,0x04,0xBE,0x4B,0xCE,0x97,0xBE,0xC3,0x67,0x2A,0x68,0x11,0xDF, -0x80,0xE7,0x0C,0x33,0x66,0xBF,0x13,0x0D,0x14,0x6E,0xF3,0x7F,0x1F,0x63,0x10,0x1E, -0xFA,0x8D,0x1B,0x25,0x6D,0x6C,0x8F,0xA5,0xB7,0x61,0x01,0xB1,0xD2,0xA3,0x26,0xA1, -0x10,0x71,0x9D,0xAD,0xE2,0xC3,0xF9,0xC3,0x99,0x51,0xB7,0x2B,0x07,0x08,0xCE,0x2E, -0xE6,0x50,0xB2,0xA7,0xFA,0x0A,0x45,0x2F,0xA2,0xF0,0xF2, -}; - - -/* subject:/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority */ -/* issuer :/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority */ - - -const unsigned char Go_Daddy_Class_2_CA_certificate[1028]={ -0x30,0x82,0x04,0x00,0x30,0x82,0x02,0xE8,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x00, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x63,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x21, -0x30,0x1F,0x06,0x03,0x55,0x04,0x0A,0x13,0x18,0x54,0x68,0x65,0x20,0x47,0x6F,0x20, -0x44,0x61,0x64,0x64,0x79,0x20,0x47,0x72,0x6F,0x75,0x70,0x2C,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x31,0x30,0x2F,0x06,0x03,0x55,0x04,0x0B,0x13,0x28,0x47,0x6F,0x20,0x44, -0x61,0x64,0x64,0x79,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F, -0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x34,0x30,0x36,0x32,0x39,0x31,0x37, -0x30,0x36,0x32,0x30,0x5A,0x17,0x0D,0x33,0x34,0x30,0x36,0x32,0x39,0x31,0x37,0x30, -0x36,0x32,0x30,0x5A,0x30,0x63,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x55,0x53,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x0A,0x13,0x18,0x54,0x68, -0x65,0x20,0x47,0x6F,0x20,0x44,0x61,0x64,0x64,0x79,0x20,0x47,0x72,0x6F,0x75,0x70, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x31,0x30,0x2F,0x06,0x03,0x55,0x04,0x0B,0x13, -0x28,0x47,0x6F,0x20,0x44,0x61,0x64,0x64,0x79,0x20,0x43,0x6C,0x61,0x73,0x73,0x20, -0x32,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20, -0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82,0x01,0x20,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0D, -0x00,0x30,0x82,0x01,0x08,0x02,0x82,0x01,0x01,0x00,0xDE,0x9D,0xD7,0xEA,0x57,0x18, -0x49,0xA1,0x5B,0xEB,0xD7,0x5F,0x48,0x86,0xEA,0xBE,0xDD,0xFF,0xE4,0xEF,0x67,0x1C, -0xF4,0x65,0x68,0xB3,0x57,0x71,0xA0,0x5E,0x77,0xBB,0xED,0x9B,0x49,0xE9,0x70,0x80, -0x3D,0x56,0x18,0x63,0x08,0x6F,0xDA,0xF2,0xCC,0xD0,0x3F,0x7F,0x02,0x54,0x22,0x54, -0x10,0xD8,0xB2,0x81,0xD4,0xC0,0x75,0x3D,0x4B,0x7F,0xC7,0x77,0xC3,0x3E,0x78,0xAB, -0x1A,0x03,0xB5,0x20,0x6B,0x2F,0x6A,0x2B,0xB1,0xC5,0x88,0x7E,0xC4,0xBB,0x1E,0xB0, -0xC1,0xD8,0x45,0x27,0x6F,0xAA,0x37,0x58,0xF7,0x87,0x26,0xD7,0xD8,0x2D,0xF6,0xA9, -0x17,0xB7,0x1F,0x72,0x36,0x4E,0xA6,0x17,0x3F,0x65,0x98,0x92,0xDB,0x2A,0x6E,0x5D, -0xA2,0xFE,0x88,0xE0,0x0B,0xDE,0x7F,0xE5,0x8D,0x15,0xE1,0xEB,0xCB,0x3A,0xD5,0xE2, -0x12,0xA2,0x13,0x2D,0xD8,0x8E,0xAF,0x5F,0x12,0x3D,0xA0,0x08,0x05,0x08,0xB6,0x5C, -0xA5,0x65,0x38,0x04,0x45,0x99,0x1E,0xA3,0x60,0x60,0x74,0xC5,0x41,0xA5,0x72,0x62, -0x1B,0x62,0xC5,0x1F,0x6F,0x5F,0x1A,0x42,0xBE,0x02,0x51,0x65,0xA8,0xAE,0x23,0x18, -0x6A,0xFC,0x78,0x03,0xA9,0x4D,0x7F,0x80,0xC3,0xFA,0xAB,0x5A,0xFC,0xA1,0x40,0xA4, -0xCA,0x19,0x16,0xFE,0xB2,0xC8,0xEF,0x5E,0x73,0x0D,0xEE,0x77,0xBD,0x9A,0xF6,0x79, -0x98,0xBC,0xB1,0x07,0x67,0xA2,0x15,0x0D,0xDD,0xA0,0x58,0xC6,0x44,0x7B,0x0A,0x3E, -0x62,0x28,0x5F,0xBA,0x41,0x07,0x53,0x58,0xCF,0x11,0x7E,0x38,0x74,0xC5,0xF8,0xFF, -0xB5,0x69,0x90,0x8F,0x84,0x74,0xEA,0x97,0x1B,0xAF,0x02,0x01,0x03,0xA3,0x81,0xC0, -0x30,0x81,0xBD,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xD2,0xC4, -0xB0,0xD2,0x91,0xD4,0x4C,0x11,0x71,0xB3,0x61,0xCB,0x3D,0xA1,0xFE,0xDD,0xA8,0x6A, -0xD4,0xE3,0x30,0x81,0x8D,0x06,0x03,0x55,0x1D,0x23,0x04,0x81,0x85,0x30,0x81,0x82, -0x80,0x14,0xD2,0xC4,0xB0,0xD2,0x91,0xD4,0x4C,0x11,0x71,0xB3,0x61,0xCB,0x3D,0xA1, -0xFE,0xDD,0xA8,0x6A,0xD4,0xE3,0xA1,0x67,0xA4,0x65,0x30,0x63,0x31,0x0B,0x30,0x09, -0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x21,0x30,0x1F,0x06,0x03,0x55, -0x04,0x0A,0x13,0x18,0x54,0x68,0x65,0x20,0x47,0x6F,0x20,0x44,0x61,0x64,0x64,0x79, -0x20,0x47,0x72,0x6F,0x75,0x70,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x31,0x30,0x2F, -0x06,0x03,0x55,0x04,0x0B,0x13,0x28,0x47,0x6F,0x20,0x44,0x61,0x64,0x64,0x79,0x20, -0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x82, -0x01,0x00,0x30,0x0C,0x06,0x03,0x55,0x1D,0x13,0x04,0x05,0x30,0x03,0x01,0x01,0xFF, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03, -0x82,0x01,0x01,0x00,0x32,0x4B,0xF3,0xB2,0xCA,0x3E,0x91,0xFC,0x12,0xC6,0xA1,0x07, -0x8C,0x8E,0x77,0xA0,0x33,0x06,0x14,0x5C,0x90,0x1E,0x18,0xF7,0x08,0xA6,0x3D,0x0A, -0x19,0xF9,0x87,0x80,0x11,0x6E,0x69,0xE4,0x96,0x17,0x30,0xFF,0x34,0x91,0x63,0x72, -0x38,0xEE,0xCC,0x1C,0x01,0xA3,0x1D,0x94,0x28,0xA4,0x31,0xF6,0x7A,0xC4,0x54,0xD7, -0xF6,0xE5,0x31,0x58,0x03,0xA2,0xCC,0xCE,0x62,0xDB,0x94,0x45,0x73,0xB5,0xBF,0x45, -0xC9,0x24,0xB5,0xD5,0x82,0x02,0xAD,0x23,0x79,0x69,0x8D,0xB8,0xB6,0x4D,0xCE,0xCF, -0x4C,0xCA,0x33,0x23,0xE8,0x1C,0x88,0xAA,0x9D,0x8B,0x41,0x6E,0x16,0xC9,0x20,0xE5, -0x89,0x9E,0xCD,0x3B,0xDA,0x70,0xF7,0x7E,0x99,0x26,0x20,0x14,0x54,0x25,0xAB,0x6E, -0x73,0x85,0xE6,0x9B,0x21,0x9D,0x0A,0x6C,0x82,0x0E,0xA8,0xF8,0xC2,0x0C,0xFA,0x10, -0x1E,0x6C,0x96,0xEF,0x87,0x0D,0xC4,0x0F,0x61,0x8B,0xAD,0xEE,0x83,0x2B,0x95,0xF8, -0x8E,0x92,0x84,0x72,0x39,0xEB,0x20,0xEA,0x83,0xED,0x83,0xCD,0x97,0x6E,0x08,0xBC, -0xEB,0x4E,0x26,0xB6,0x73,0x2B,0xE4,0xD3,0xF6,0x4C,0xFE,0x26,0x71,0xE2,0x61,0x11, -0x74,0x4A,0xFF,0x57,0x1A,0x87,0x0F,0x75,0x48,0x2E,0xCF,0x51,0x69,0x17,0xA0,0x02, -0x12,0x61,0x95,0xD5,0xD1,0x40,0xB2,0x10,0x4C,0xEE,0xC4,0xAC,0x10,0x43,0xA6,0xA5, -0x9E,0x0A,0xD5,0x95,0x62,0x9A,0x0D,0xCF,0x88,0x82,0xC5,0x32,0x0C,0xE4,0x2B,0x9F, -0x45,0xE6,0x0D,0x9F,0x28,0x9C,0xB1,0xB9,0x2A,0x5A,0x57,0xAD,0x37,0x0F,0xAF,0x1D, -0x7F,0xDB,0xBD,0x9F, -}; - - -/* subject:/C=US/O=GeoTrust Inc./CN=GeoTrust Primary Certification Authority */ -/* issuer :/C=US/O=GeoTrust Inc./CN=GeoTrust Primary Certification Authority */ - - -const unsigned char GeoTrust_Primary_Certification_Authority_certificate[896]={ -0x30,0x82,0x03,0x7C,0x30,0x82,0x02,0x64,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x18, -0xAC,0xB5,0x6A,0xFD,0x69,0xB6,0x15,0x3A,0x63,0x6C,0xAF,0xDA,0xFA,0xC4,0xA1,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x58, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30, -0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74, -0x20,0x49,0x6E,0x63,0x2E,0x31,0x31,0x30,0x2F,0x06,0x03,0x55,0x04,0x03,0x13,0x28, -0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79, -0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41, -0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x31, -0x32,0x37,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x36,0x30,0x37,0x31, -0x36,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x58,0x31,0x0B,0x30,0x09,0x06,0x03, -0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A, -0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31, -0x31,0x30,0x2F,0x06,0x03,0x55,0x04,0x03,0x13,0x28,0x47,0x65,0x6F,0x54,0x72,0x75, -0x73,0x74,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82, -0x01,0x01,0x00,0xBE,0xB8,0x15,0x7B,0xFF,0xD4,0x7C,0x7D,0x67,0xAD,0x83,0x64,0x7B, -0xC8,0x42,0x53,0x2D,0xDF,0xF6,0x84,0x08,0x20,0x61,0xD6,0x01,0x59,0x6A,0x9C,0x44, -0x11,0xAF,0xEF,0x76,0xFD,0x95,0x7E,0xCE,0x61,0x30,0xBB,0x7A,0x83,0x5F,0x02,0xBD, -0x01,0x66,0xCA,0xEE,0x15,0x8D,0x6F,0xA1,0x30,0x9C,0xBD,0xA1,0x85,0x9E,0x94,0x3A, -0xF3,0x56,0x88,0x00,0x31,0xCF,0xD8,0xEE,0x6A,0x96,0x02,0xD9,0xED,0x03,0x8C,0xFB, -0x75,0x6D,0xE7,0xEA,0xB8,0x55,0x16,0x05,0x16,0x9A,0xF4,0xE0,0x5E,0xB1,0x88,0xC0, -0x64,0x85,0x5C,0x15,0x4D,0x88,0xC7,0xB7,0xBA,0xE0,0x75,0xE9,0xAD,0x05,0x3D,0x9D, -0xC7,0x89,0x48,0xE0,0xBB,0x28,0xC8,0x03,0xE1,0x30,0x93,0x64,0x5E,0x52,0xC0,0x59, -0x70,0x22,0x35,0x57,0x88,0x8A,0xF1,0x95,0x0A,0x83,0xD7,0xBC,0x31,0x73,0x01,0x34, -0xED,0xEF,0x46,0x71,0xE0,0x6B,0x02,0xA8,0x35,0x72,0x6B,0x97,0x9B,0x66,0xE0,0xCB, -0x1C,0x79,0x5F,0xD8,0x1A,0x04,0x68,0x1E,0x47,0x02,0xE6,0x9D,0x60,0xE2,0x36,0x97, -0x01,0xDF,0xCE,0x35,0x92,0xDF,0xBE,0x67,0xC7,0x6D,0x77,0x59,0x3B,0x8F,0x9D,0xD6, -0x90,0x15,0x94,0xBC,0x42,0x34,0x10,0xC1,0x39,0xF9,0xB1,0x27,0x3E,0x7E,0xD6,0x8A, -0x75,0xC5,0xB2,0xAF,0x96,0xD3,0xA2,0xDE,0x9B,0xE4,0x98,0xBE,0x7D,0xE1,0xE9,0x81, -0xAD,0xB6,0x6F,0xFC,0xD7,0x0E,0xDA,0xE0,0x34,0xB0,0x0D,0x1A,0x77,0xE7,0xE3,0x08, -0x98,0xEF,0x58,0xFA,0x9C,0x84,0xB7,0x36,0xAF,0xC2,0xDF,0xAC,0xD2,0xF4,0x10,0x06, -0x70,0x71,0x35,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06,0x03, -0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06, -0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x2C,0xD5,0x50,0x41,0x97,0x15,0x8B,0xF0, -0x8F,0x36,0x61,0x5B,0x4A,0xFB,0x6B,0xD9,0x99,0xC9,0x33,0x92,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00, -0x5A,0x70,0x7F,0x2C,0xDD,0xB7,0x34,0x4F,0xF5,0x86,0x51,0xA9,0x26,0xBE,0x4B,0xB8, -0xAA,0xF1,0x71,0x0D,0xDC,0x61,0xC7,0xA0,0xEA,0x34,0x1E,0x7A,0x77,0x0F,0x04,0x35, -0xE8,0x27,0x8F,0x6C,0x90,0xBF,0x91,0x16,0x24,0x46,0x3E,0x4A,0x4E,0xCE,0x2B,0x16, -0xD5,0x0B,0x52,0x1D,0xFC,0x1F,0x67,0xA2,0x02,0x45,0x31,0x4F,0xCE,0xF3,0xFA,0x03, -0xA7,0x79,0x9D,0x53,0x6A,0xD9,0xDA,0x63,0x3A,0xF8,0x80,0xD7,0xD3,0x99,0xE1,0xA5, -0xE1,0xBE,0xD4,0x55,0x71,0x98,0x35,0x3A,0xBE,0x93,0xEA,0xAE,0xAD,0x42,0xB2,0x90, -0x6F,0xE0,0xFC,0x21,0x4D,0x35,0x63,0x33,0x89,0x49,0xD6,0x9B,0x4E,0xCA,0xC7,0xE7, -0x4E,0x09,0x00,0xF7,0xDA,0xC7,0xEF,0x99,0x62,0x99,0x77,0xB6,0x95,0x22,0x5E,0x8A, -0xA0,0xAB,0xF4,0xB8,0x78,0x98,0xCA,0x38,0x19,0x99,0xC9,0x72,0x9E,0x78,0xCD,0x4B, -0xAC,0xAF,0x19,0xA0,0x73,0x12,0x2D,0xFC,0xC2,0x41,0xBA,0x81,0x91,0xDA,0x16,0x5A, -0x31,0xB7,0xF9,0xB4,0x71,0x80,0x12,0x48,0x99,0x72,0x73,0x5A,0x59,0x53,0xC1,0x63, -0x52,0x33,0xED,0xA7,0xC9,0xD2,0x39,0x02,0x70,0xFA,0xE0,0xB1,0x42,0x66,0x29,0xAA, -0x9B,0x51,0xED,0x30,0x54,0x22,0x14,0x5F,0xD9,0xAB,0x1D,0xC1,0xE4,0x94,0xF0,0xF8, -0xF5,0x2B,0xF7,0xEA,0xCA,0x78,0x46,0xD6,0xB8,0x91,0xFD,0xA6,0x0D,0x2B,0x1A,0x14, -0x01,0x3E,0x80,0xF0,0x42,0xA0,0x95,0x07,0x5E,0x6D,0xCD,0xCC,0x4B,0xA4,0x45,0x8D, -0xAB,0x12,0xE8,0xB3,0xDE,0x5A,0xE5,0xA0,0x7C,0xE8,0x0F,0x22,0x1D,0x5A,0xE9,0x59, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5 */ -/* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5 */ - - -const unsigned char VeriSign_Class_3_Public_Primary_Certification_Authority___G5_certificate[1239]={ -0x30,0x82,0x04,0xD3,0x30,0x82,0x03,0xBB,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x18, -0xDA,0xD1,0x9E,0x26,0x7D,0xE8,0xBB,0x4A,0x21,0x58,0xCD,0xCC,0x6B,0x3B,0x4A,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0xCA,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17, -0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B, -0x13,0x16,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74, -0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04, -0x0B,0x13,0x31,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72, -0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20, -0x6F,0x6E,0x6C,0x79,0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56, -0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20, -0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43, -0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x35,0x30,0x1E,0x17,0x0D,0x30, -0x36,0x31,0x31,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x36, -0x30,0x37,0x31,0x36,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xCA,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20, -0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56, -0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65, -0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31, -0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75, -0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C, -0x79,0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62, -0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x35,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00, -0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xAF,0x24,0x08,0x08,0x29,0x7A,0x35, -0x9E,0x60,0x0C,0xAA,0xE7,0x4B,0x3B,0x4E,0xDC,0x7C,0xBC,0x3C,0x45,0x1C,0xBB,0x2B, -0xE0,0xFE,0x29,0x02,0xF9,0x57,0x08,0xA3,0x64,0x85,0x15,0x27,0xF5,0xF1,0xAD,0xC8, -0x31,0x89,0x5D,0x22,0xE8,0x2A,0xAA,0xA6,0x42,0xB3,0x8F,0xF8,0xB9,0x55,0xB7,0xB1, -0xB7,0x4B,0xB3,0xFE,0x8F,0x7E,0x07,0x57,0xEC,0xEF,0x43,0xDB,0x66,0x62,0x15,0x61, -0xCF,0x60,0x0D,0xA4,0xD8,0xDE,0xF8,0xE0,0xC3,0x62,0x08,0x3D,0x54,0x13,0xEB,0x49, -0xCA,0x59,0x54,0x85,0x26,0xE5,0x2B,0x8F,0x1B,0x9F,0xEB,0xF5,0xA1,0x91,0xC2,0x33, -0x49,0xD8,0x43,0x63,0x6A,0x52,0x4B,0xD2,0x8F,0xE8,0x70,0x51,0x4D,0xD1,0x89,0x69, -0x7B,0xC7,0x70,0xF6,0xB3,0xDC,0x12,0x74,0xDB,0x7B,0x5D,0x4B,0x56,0xD3,0x96,0xBF, -0x15,0x77,0xA1,0xB0,0xF4,0xA2,0x25,0xF2,0xAF,0x1C,0x92,0x67,0x18,0xE5,0xF4,0x06, -0x04,0xEF,0x90,0xB9,0xE4,0x00,0xE4,0xDD,0x3A,0xB5,0x19,0xFF,0x02,0xBA,0xF4,0x3C, -0xEE,0xE0,0x8B,0xEB,0x37,0x8B,0xEC,0xF4,0xD7,0xAC,0xF2,0xF6,0xF0,0x3D,0xAF,0xDD, -0x75,0x91,0x33,0x19,0x1D,0x1C,0x40,0xCB,0x74,0x24,0x19,0x21,0x93,0xD9,0x14,0xFE, -0xAC,0x2A,0x52,0xC7,0x8F,0xD5,0x04,0x49,0xE4,0x8D,0x63,0x47,0x88,0x3C,0x69,0x83, -0xCB,0xFE,0x47,0xBD,0x2B,0x7E,0x4F,0xC5,0x95,0xAE,0x0E,0x9D,0xD4,0xD1,0x43,0xC0, -0x67,0x73,0xE3,0x14,0x08,0x7E,0xE5,0x3F,0x9F,0x73,0xB8,0x33,0x0A,0xCF,0x5D,0x3F, -0x34,0x87,0x96,0x8A,0xEE,0x53,0xE8,0x25,0x15,0x02,0x03,0x01,0x00,0x01,0xA3,0x81, -0xB2,0x30,0x81,0xAF,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04, -0x04,0x03,0x02,0x01,0x06,0x30,0x6D,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x01, -0x0C,0x04,0x61,0x30,0x5F,0xA1,0x5D,0xA0,0x5B,0x30,0x59,0x30,0x57,0x30,0x55,0x16, -0x09,0x69,0x6D,0x61,0x67,0x65,0x2F,0x67,0x69,0x66,0x30,0x21,0x30,0x1F,0x30,0x07, -0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x04,0x14,0x8F,0xE5,0xD3,0x1A,0x86,0xAC,0x8D, -0x8E,0x6B,0xC3,0xCF,0x80,0x6A,0xD4,0x48,0x18,0x2C,0x7B,0x19,0x2E,0x30,0x25,0x16, -0x23,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x6C,0x6F,0x67,0x6F,0x2E,0x76,0x65,0x72, -0x69,0x73,0x69,0x67,0x6E,0x2E,0x63,0x6F,0x6D,0x2F,0x76,0x73,0x6C,0x6F,0x67,0x6F, -0x2E,0x67,0x69,0x66,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x7F, -0xD3,0x65,0xA7,0xC2,0xDD,0xEC,0xBB,0xF0,0x30,0x09,0xF3,0x43,0x39,0xFA,0x02,0xAF, -0x33,0x31,0x33,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x93,0x24,0x4A,0x30,0x5F,0x62,0xCF,0xD8,0x1A, -0x98,0x2F,0x3D,0xEA,0xDC,0x99,0x2D,0xBD,0x77,0xF6,0xA5,0x79,0x22,0x38,0xEC,0xC4, -0xA7,0xA0,0x78,0x12,0xAD,0x62,0x0E,0x45,0x70,0x64,0xC5,0xE7,0x97,0x66,0x2D,0x98, -0x09,0x7E,0x5F,0xAF,0xD6,0xCC,0x28,0x65,0xF2,0x01,0xAA,0x08,0x1A,0x47,0xDE,0xF9, -0xF9,0x7C,0x92,0x5A,0x08,0x69,0x20,0x0D,0xD9,0x3E,0x6D,0x6E,0x3C,0x0D,0x6E,0xD8, -0xE6,0x06,0x91,0x40,0x18,0xB9,0xF8,0xC1,0xED,0xDF,0xDB,0x41,0xAA,0xE0,0x96,0x20, -0xC9,0xCD,0x64,0x15,0x38,0x81,0xC9,0x94,0xEE,0xA2,0x84,0x29,0x0B,0x13,0x6F,0x8E, -0xDB,0x0C,0xDD,0x25,0x02,0xDB,0xA4,0x8B,0x19,0x44,0xD2,0x41,0x7A,0x05,0x69,0x4A, -0x58,0x4F,0x60,0xCA,0x7E,0x82,0x6A,0x0B,0x02,0xAA,0x25,0x17,0x39,0xB5,0xDB,0x7F, -0xE7,0x84,0x65,0x2A,0x95,0x8A,0xBD,0x86,0xDE,0x5E,0x81,0x16,0x83,0x2D,0x10,0xCC, -0xDE,0xFD,0xA8,0x82,0x2A,0x6D,0x28,0x1F,0x0D,0x0B,0xC4,0xE5,0xE7,0x1A,0x26,0x19, -0xE1,0xF4,0x11,0x6F,0x10,0xB5,0x95,0xFC,0xE7,0x42,0x05,0x32,0xDB,0xCE,0x9D,0x51, -0x5E,0x28,0xB6,0x9E,0x85,0xD3,0x5B,0xEF,0xA5,0x7D,0x45,0x40,0x72,0x8E,0xB7,0x0E, -0x6B,0x0E,0x06,0xFB,0x33,0x35,0x48,0x71,0xB8,0x9D,0x27,0x8B,0xC4,0x65,0x5F,0x0D, -0x86,0x76,0x9C,0x44,0x7A,0xF6,0x95,0x5C,0xF6,0x5D,0x32,0x08,0x33,0xA4,0x54,0xB6, -0x18,0x3F,0x68,0x5C,0xF2,0x42,0x4A,0x85,0x38,0x54,0x83,0x5F,0xD1,0xE8,0x2C,0xF2, -0xAC,0x11,0xD6,0xA8,0xED,0x63,0x6A, -}; - - -/* subject:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority */ -/* issuer :/C=US/O=Equifax/OU=Equifax Secure Certificate Authority */ - - -const unsigned char Equifax_Secure_CA_certificate[804]={ -0x30,0x82,0x03,0x20,0x30,0x82,0x02,0x89,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x35, -0xDE,0xF4,0xCF,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x30,0x4E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x0A,0x13,0x07,0x45,0x71,0x75,0x69, -0x66,0x61,0x78,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04,0x0B,0x13,0x24,0x45,0x71, -0x75,0x69,0x66,0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x30,0x1E,0x17,0x0D,0x39,0x38,0x30,0x38,0x32,0x32,0x31,0x36,0x34,0x31, -0x35,0x31,0x5A,0x17,0x0D,0x31,0x38,0x30,0x38,0x32,0x32,0x31,0x36,0x34,0x31,0x35, -0x31,0x5A,0x30,0x4E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x0A,0x13,0x07,0x45,0x71,0x75,0x69, -0x66,0x61,0x78,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04,0x0B,0x13,0x24,0x45,0x71, -0x75,0x69,0x66,0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xC1, -0x5D,0xB1,0x58,0x67,0x08,0x62,0xEE,0xA0,0x9A,0x2D,0x1F,0x08,0x6D,0x91,0x14,0x68, -0x98,0x0A,0x1E,0xFE,0xDA,0x04,0x6F,0x13,0x84,0x62,0x21,0xC3,0xD1,0x7C,0xCE,0x9F, -0x05,0xE0,0xB8,0x01,0xF0,0x4E,0x34,0xEC,0xE2,0x8A,0x95,0x04,0x64,0xAC,0xF1,0x6B, -0x53,0x5F,0x05,0xB3,0xCB,0x67,0x80,0xBF,0x42,0x02,0x8E,0xFE,0xDD,0x01,0x09,0xEC, -0xE1,0x00,0x14,0x4F,0xFC,0xFB,0xF0,0x0C,0xDD,0x43,0xBA,0x5B,0x2B,0xE1,0x1F,0x80, -0x70,0x99,0x15,0x57,0x93,0x16,0xF1,0x0F,0x97,0x6A,0xB7,0xC2,0x68,0x23,0x1C,0xCC, -0x4D,0x59,0x30,0xAC,0x51,0x1E,0x3B,0xAF,0x2B,0xD6,0xEE,0x63,0x45,0x7B,0xC5,0xD9, -0x5F,0x50,0xD2,0xE3,0x50,0x0F,0x3A,0x88,0xE7,0xBF,0x14,0xFD,0xE0,0xC7,0xB9,0x02, -0x03,0x01,0x00,0x01,0xA3,0x82,0x01,0x09,0x30,0x82,0x01,0x05,0x30,0x70,0x06,0x03, -0x55,0x1D,0x1F,0x04,0x69,0x30,0x67,0x30,0x65,0xA0,0x63,0xA0,0x61,0xA4,0x5F,0x30, -0x5D,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x10, -0x30,0x0E,0x06,0x03,0x55,0x04,0x0A,0x13,0x07,0x45,0x71,0x75,0x69,0x66,0x61,0x78, -0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04,0x0B,0x13,0x24,0x45,0x71,0x75,0x69,0x66, -0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x43,0x65,0x72,0x74,0x69,0x66, -0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x31, -0x0D,0x30,0x0B,0x06,0x03,0x55,0x04,0x03,0x13,0x04,0x43,0x52,0x4C,0x31,0x30,0x1A, -0x06,0x03,0x55,0x1D,0x10,0x04,0x13,0x30,0x11,0x81,0x0F,0x32,0x30,0x31,0x38,0x30, -0x38,0x32,0x32,0x31,0x36,0x34,0x31,0x35,0x31,0x5A,0x30,0x0B,0x06,0x03,0x55,0x1D, -0x0F,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18, -0x30,0x16,0x80,0x14,0x48,0xE6,0x68,0xF9,0x2B,0xD2,0xB2,0x95,0xD7,0x47,0xD8,0x23, -0x20,0x10,0x4F,0x33,0x98,0x90,0x9F,0xD4,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04, -0x16,0x04,0x14,0x48,0xE6,0x68,0xF9,0x2B,0xD2,0xB2,0x95,0xD7,0x47,0xD8,0x23,0x20, -0x10,0x4F,0x33,0x98,0x90,0x9F,0xD4,0x30,0x0C,0x06,0x03,0x55,0x1D,0x13,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x1A,0x06,0x09,0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07, -0x41,0x00,0x04,0x0D,0x30,0x0B,0x1B,0x05,0x56,0x33,0x2E,0x30,0x63,0x03,0x02,0x06, -0xC0,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00, -0x03,0x81,0x81,0x00,0x58,0xCE,0x29,0xEA,0xFC,0xF7,0xDE,0xB5,0xCE,0x02,0xB9,0x17, -0xB5,0x85,0xD1,0xB9,0xE3,0xE0,0x95,0xCC,0x25,0x31,0x0D,0x00,0xA6,0x92,0x6E,0x7F, -0xB6,0x92,0x63,0x9E,0x50,0x95,0xD1,0x9A,0x6F,0xE4,0x11,0xDE,0x63,0x85,0x6E,0x98, -0xEE,0xA8,0xFF,0x5A,0xC8,0xD3,0x55,0xB2,0x66,0x71,0x57,0xDE,0xC0,0x21,0xEB,0x3D, -0x2A,0xA7,0x23,0x49,0x01,0x04,0x86,0x42,0x7B,0xFC,0xEE,0x7F,0xA2,0x16,0x52,0xB5, -0x67,0x67,0xD3,0x40,0xDB,0x3B,0x26,0x58,0xB2,0x28,0x77,0x3D,0xAE,0x14,0x77,0x61, -0xD6,0xFA,0x2A,0x66,0x27,0xA0,0x0D,0xFA,0xA7,0x73,0x5C,0xEA,0x70,0xF1,0x94,0x21, -0x65,0x44,0x5F,0xFA,0xFC,0xEF,0x29,0x68,0xA9,0xA2,0x87,0x79,0xEF,0x79,0xEF,0x4F, -0xAC,0x07,0x77,0x38, -}; - - -/* subject:/O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification Authority (2048) */ -/* issuer :/O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification Authority (2048) */ - - -const unsigned char Entrust_net_Premium_2048_Secure_Server_CA_certificate[1120]={ -0x30,0x82,0x04,0x5C,0x30,0x82,0x03,0x44,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x38, -0x63,0xB9,0x66,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x30,0x81,0xB4,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B, -0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x31,0x40,0x30,0x3E,0x06, -0x03,0x55,0x04,0x0B,0x14,0x37,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74,0x72,0x75,0x73, -0x74,0x2E,0x6E,0x65,0x74,0x2F,0x43,0x50,0x53,0x5F,0x32,0x30,0x34,0x38,0x20,0x69, -0x6E,0x63,0x6F,0x72,0x70,0x2E,0x20,0x62,0x79,0x20,0x72,0x65,0x66,0x2E,0x20,0x28, -0x6C,0x69,0x6D,0x69,0x74,0x73,0x20,0x6C,0x69,0x61,0x62,0x2E,0x29,0x31,0x25,0x30, -0x23,0x06,0x03,0x55,0x04,0x0B,0x13,0x1C,0x28,0x63,0x29,0x20,0x31,0x39,0x39,0x39, -0x20,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x20,0x4C,0x69,0x6D, -0x69,0x74,0x65,0x64,0x31,0x33,0x30,0x31,0x06,0x03,0x55,0x04,0x03,0x13,0x2A,0x45, -0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x20,0x28,0x32,0x30,0x34,0x38,0x29,0x30,0x1E,0x17,0x0D,0x39,0x39,0x31, -0x32,0x32,0x34,0x31,0x37,0x35,0x30,0x35,0x31,0x5A,0x17,0x0D,0x31,0x39,0x31,0x32, -0x32,0x34,0x31,0x38,0x32,0x30,0x35,0x31,0x5A,0x30,0x81,0xB4,0x31,0x14,0x30,0x12, -0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E, -0x65,0x74,0x31,0x40,0x30,0x3E,0x06,0x03,0x55,0x04,0x0B,0x14,0x37,0x77,0x77,0x77, -0x2E,0x65,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x2F,0x43,0x50,0x53, -0x5F,0x32,0x30,0x34,0x38,0x20,0x69,0x6E,0x63,0x6F,0x72,0x70,0x2E,0x20,0x62,0x79, -0x20,0x72,0x65,0x66,0x2E,0x20,0x28,0x6C,0x69,0x6D,0x69,0x74,0x73,0x20,0x6C,0x69, -0x61,0x62,0x2E,0x29,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x0B,0x13,0x1C,0x28, -0x63,0x29,0x20,0x31,0x39,0x39,0x39,0x20,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E, -0x6E,0x65,0x74,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x33,0x30,0x31,0x06, -0x03,0x55,0x04,0x03,0x13,0x2A,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65, -0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20, -0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x28,0x32,0x30,0x34,0x38,0x29, -0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01, -0x00,0xAD,0x4D,0x4B,0xA9,0x12,0x86,0xB2,0xEA,0xA3,0x20,0x07,0x15,0x16,0x64,0x2A, -0x2B,0x4B,0xD1,0xBF,0x0B,0x4A,0x4D,0x8E,0xED,0x80,0x76,0xA5,0x67,0xB7,0x78,0x40, -0xC0,0x73,0x42,0xC8,0x68,0xC0,0xDB,0x53,0x2B,0xDD,0x5E,0xB8,0x76,0x98,0x35,0x93, -0x8B,0x1A,0x9D,0x7C,0x13,0x3A,0x0E,0x1F,0x5B,0xB7,0x1E,0xCF,0xE5,0x24,0x14,0x1E, -0xB1,0x81,0xA9,0x8D,0x7D,0xB8,0xCC,0x6B,0x4B,0x03,0xF1,0x02,0x0C,0xDC,0xAB,0xA5, -0x40,0x24,0x00,0x7F,0x74,0x94,0xA1,0x9D,0x08,0x29,0xB3,0x88,0x0B,0xF5,0x87,0x77, -0x9D,0x55,0xCD,0xE4,0xC3,0x7E,0xD7,0x6A,0x64,0xAB,0x85,0x14,0x86,0x95,0x5B,0x97, -0x32,0x50,0x6F,0x3D,0xC8,0xBA,0x66,0x0C,0xE3,0xFC,0xBD,0xB8,0x49,0xC1,0x76,0x89, -0x49,0x19,0xFD,0xC0,0xA8,0xBD,0x89,0xA3,0x67,0x2F,0xC6,0x9F,0xBC,0x71,0x19,0x60, -0xB8,0x2D,0xE9,0x2C,0xC9,0x90,0x76,0x66,0x7B,0x94,0xE2,0xAF,0x78,0xD6,0x65,0x53, -0x5D,0x3C,0xD6,0x9C,0xB2,0xCF,0x29,0x03,0xF9,0x2F,0xA4,0x50,0xB2,0xD4,0x48,0xCE, -0x05,0x32,0x55,0x8A,0xFD,0xB2,0x64,0x4C,0x0E,0xE4,0x98,0x07,0x75,0xDB,0x7F,0xDF, -0xB9,0x08,0x55,0x60,0x85,0x30,0x29,0xF9,0x7B,0x48,0xA4,0x69,0x86,0xE3,0x35,0x3F, -0x1E,0x86,0x5D,0x7A,0x7A,0x15,0xBD,0xEF,0x00,0x8E,0x15,0x22,0x54,0x17,0x00,0x90, -0x26,0x93,0xBC,0x0E,0x49,0x68,0x91,0xBF,0xF8,0x47,0xD3,0x9D,0x95,0x42,0xC1,0x0E, -0x4D,0xDF,0x6F,0x26,0xCF,0xC3,0x18,0x21,0x62,0x66,0x43,0x70,0xD6,0xD5,0xC0,0x07, -0xE1,0x02,0x03,0x01,0x00,0x01,0xA3,0x74,0x30,0x72,0x30,0x11,0x06,0x09,0x60,0x86, -0x48,0x01,0x86,0xF8,0x42,0x01,0x01,0x04,0x04,0x03,0x02,0x00,0x07,0x30,0x1F,0x06, -0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x55,0xE4,0x81,0xD1,0x11,0x80, -0xBE,0xD8,0x89,0xB9,0x08,0xA3,0x31,0xF9,0xA1,0x24,0x09,0x16,0xB9,0x70,0x30,0x1D, -0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x55,0xE4,0x81,0xD1,0x11,0x80,0xBE, -0xD8,0x89,0xB9,0x08,0xA3,0x31,0xF9,0xA1,0x24,0x09,0x16,0xB9,0x70,0x30,0x1D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x41,0x00,0x04,0x10,0x30,0x0E,0x1B,0x08, -0x56,0x35,0x2E,0x30,0x3A,0x34,0x2E,0x30,0x03,0x02,0x04,0x90,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00, -0x59,0x47,0xAC,0x21,0x84,0x8A,0x17,0xC9,0x9C,0x89,0x53,0x1E,0xBA,0x80,0x85,0x1A, -0xC6,0x3C,0x4E,0x3E,0xB1,0x9C,0xB6,0x7C,0xC6,0x92,0x5D,0x18,0x64,0x02,0xE3,0xD3, -0x06,0x08,0x11,0x61,0x7C,0x63,0xE3,0x2B,0x9D,0x31,0x03,0x70,0x76,0xD2,0xA3,0x28, -0xA0,0xF4,0xBB,0x9A,0x63,0x73,0xED,0x6D,0xE5,0x2A,0xDB,0xED,0x14,0xA9,0x2B,0xC6, -0x36,0x11,0xD0,0x2B,0xEB,0x07,0x8B,0xA5,0xDA,0x9E,0x5C,0x19,0x9D,0x56,0x12,0xF5, -0x54,0x29,0xC8,0x05,0xED,0xB2,0x12,0x2A,0x8D,0xF4,0x03,0x1B,0xFF,0xE7,0x92,0x10, -0x87,0xB0,0x3A,0xB5,0xC3,0x9D,0x05,0x37,0x12,0xA3,0xC7,0xF4,0x15,0xB9,0xD5,0xA4, -0x39,0x16,0x9B,0x53,0x3A,0x23,0x91,0xF1,0xA8,0x82,0xA2,0x6A,0x88,0x68,0xC1,0x79, -0x02,0x22,0xBC,0xAA,0xA6,0xD6,0xAE,0xDF,0xB0,0x14,0x5F,0xB8,0x87,0xD0,0xDD,0x7C, -0x7F,0x7B,0xFF,0xAF,0x1C,0xCF,0xE6,0xDB,0x07,0xAD,0x5E,0xDB,0x85,0x9D,0xD0,0x2B, -0x0D,0x33,0xDB,0x04,0xD1,0xE6,0x49,0x40,0x13,0x2B,0x76,0xFB,0x3E,0xE9,0x9C,0x89, -0x0F,0x15,0xCE,0x18,0xB0,0x85,0x78,0x21,0x4F,0x6B,0x4F,0x0E,0xFA,0x36,0x67,0xCD, -0x07,0xF2,0xFF,0x08,0xD0,0xE2,0xDE,0xD9,0xBF,0x2A,0xAF,0xB8,0x87,0x86,0x21,0x3C, -0x04,0xCA,0xB7,0x94,0x68,0x7F,0xCF,0x3C,0xE9,0x98,0xD7,0x38,0xFF,0xEC,0xC0,0xD9, -0x50,0xF0,0x2E,0x4B,0x58,0xAE,0x46,0x6F,0xD0,0x2E,0xC3,0x60,0xDA,0x72,0x55,0x72, -0xBD,0x4C,0x45,0x9E,0x61,0xBA,0xBF,0x84,0x81,0x92,0x03,0xD1,0xD2,0x69,0x7C,0xC5, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Assured ID Root G3 */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Assured ID Root G3 */ - - -const unsigned char DigiCert_Assured_ID_Root_G3_certificate[586]={ -0x30,0x82,0x02,0x46,0x30,0x82,0x01,0xCD,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x0B, -0xA1,0x5A,0xFA,0x1D,0xDF,0xA0,0xB5,0x49,0x44,0xAF,0xCD,0x24,0xA0,0x6C,0xEC,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x65,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06,0x03, -0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x49,0x6E, -0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77,0x77,0x77,0x2E, -0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x24,0x30,0x22, -0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20, -0x41,0x73,0x73,0x75,0x72,0x65,0x64,0x20,0x49,0x44,0x20,0x52,0x6F,0x6F,0x74,0x20, -0x47,0x33,0x30,0x1E,0x17,0x0D,0x31,0x33,0x30,0x38,0x30,0x31,0x31,0x32,0x30,0x30, -0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x35,0x31,0x32,0x30,0x30,0x30, -0x30,0x5A,0x30,0x65,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69, -0x43,0x65,0x72,0x74,0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04, -0x0B,0x13,0x10,0x77,0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E, -0x63,0x6F,0x6D,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x44,0x69, -0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x41,0x73,0x73,0x75,0x72,0x65,0x64,0x20,0x49, -0x44,0x20,0x52,0x6F,0x6F,0x74,0x20,0x47,0x33,0x30,0x76,0x30,0x10,0x06,0x07,0x2A, -0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05,0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00, -0x04,0x19,0xE7,0xBC,0xAC,0x44,0x65,0xED,0xCD,0xB8,0x3F,0x58,0xFB,0x8D,0xB1,0x57, -0xA9,0x44,0x2D,0x05,0x15,0xF2,0xEF,0x0B,0xFF,0x10,0x74,0x9F,0xB5,0x62,0x52,0x5F, -0x66,0x7E,0x1F,0xE5,0xDC,0x1B,0x45,0x79,0x0B,0xCC,0xC6,0x53,0x0A,0x9D,0x8D,0x5D, -0x02,0xD9,0xA9,0x59,0xDE,0x02,0x5A,0xF6,0x95,0x2A,0x0E,0x8D,0x38,0x4A,0x8A,0x49, -0xC6,0xBC,0xC6,0x03,0x38,0x07,0x5F,0x55,0xDA,0x7E,0x09,0x6E,0xE2,0x7F,0x5E,0xD0, -0x45,0x20,0x0F,0x59,0x76,0x10,0xD6,0xA0,0x24,0xF0,0x2D,0xDE,0x36,0xF2,0x6C,0x29, -0x39,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0xCB,0xD0,0xBD,0xA9,0xE1,0x98,0x05,0x51,0xA1,0x4D,0x37,0xA2,0x83,0x79,0xCE, -0x8D,0x1D,0x2A,0xE4,0x84,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03, -0x03,0x03,0x67,0x00,0x30,0x64,0x02,0x30,0x25,0xA4,0x81,0x45,0x02,0x6B,0x12,0x4B, -0x75,0x74,0x4F,0xC8,0x23,0xE3,0x70,0xF2,0x75,0x72,0xDE,0x7C,0x89,0xF0,0xCF,0x91, -0x72,0x61,0x9E,0x5E,0x10,0x92,0x59,0x56,0xB9,0x83,0xC7,0x10,0xE7,0x38,0xE9,0x58, -0x26,0x36,0x7D,0xD5,0xE4,0x34,0x86,0x39,0x02,0x30,0x7C,0x36,0x53,0xF0,0x30,0xE5, -0x62,0x63,0x3A,0x99,0xE2,0xB6,0xA3,0x3B,0x9B,0x34,0xFA,0x1E,0xDA,0x10,0x92,0x71, -0x5E,0x91,0x13,0xA7,0xDD,0xA4,0x6E,0x92,0xCC,0x32,0xD6,0xF5,0x21,0x66,0xC7,0x2F, -0xEA,0x96,0x63,0x6A,0x65,0x45,0x92,0x95,0x01,0xB4, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO Certification Authority */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO Certification Authority */ - - -const unsigned char COMODO_Certification_Authority_certificate[1057]={ -0x30,0x82,0x04,0x1D,0x30,0x82,0x03,0x05,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x4E, -0x81,0x2D,0x8A,0x82,0x65,0xE0,0x0B,0x02,0xEE,0x3E,0x35,0x02,0x46,0xE5,0x3D,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0x81,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x13,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x13,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x13,0x11,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x27,0x30,0x25,0x06,0x03,0x55, -0x04,0x03,0x13,0x1E,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x32,0x30,0x31,0x30,0x30,0x30,0x30, -0x30,0x30,0x5A,0x17,0x0D,0x32,0x39,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35, -0x39,0x5A,0x30,0x81,0x81,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02, -0x47,0x42,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x13,0x12,0x47,0x72,0x65, -0x61,0x74,0x65,0x72,0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31, -0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x07,0x13,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72, -0x64,0x31,0x1A,0x30,0x18,0x06,0x03,0x55,0x04,0x0A,0x13,0x11,0x43,0x4F,0x4D,0x4F, -0x44,0x4F,0x20,0x43,0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x27,0x30, -0x25,0x06,0x03,0x55,0x04,0x03,0x13,0x1E,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x43, -0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82, -0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xD0,0x40,0x8B,0x8B,0x72,0xE3,0x91,0x1B,0xF7, -0x51,0xC1,0x1B,0x54,0x04,0x98,0xD3,0xA9,0xBF,0xC1,0xE6,0x8A,0x5D,0x3B,0x87,0xFB, -0xBB,0x88,0xCE,0x0D,0xE3,0x2F,0x3F,0x06,0x96,0xF0,0xA2,0x29,0x50,0x99,0xAE,0xDB, -0x3B,0xA1,0x57,0xB0,0x74,0x51,0x71,0xCD,0xED,0x42,0x91,0x4D,0x41,0xFE,0xA9,0xC8, -0xD8,0x6A,0x86,0x77,0x44,0xBB,0x59,0x66,0x97,0x50,0x5E,0xB4,0xD4,0x2C,0x70,0x44, -0xCF,0xDA,0x37,0x95,0x42,0x69,0x3C,0x30,0xC4,0x71,0xB3,0x52,0xF0,0x21,0x4D,0xA1, -0xD8,0xBA,0x39,0x7C,0x1C,0x9E,0xA3,0x24,0x9D,0xF2,0x83,0x16,0x98,0xAA,0x16,0x7C, -0x43,0x9B,0x15,0x5B,0xB7,0xAE,0x34,0x91,0xFE,0xD4,0x62,0x26,0x18,0x46,0x9A,0x3F, -0xEB,0xC1,0xF9,0xF1,0x90,0x57,0xEB,0xAC,0x7A,0x0D,0x8B,0xDB,0x72,0x30,0x6A,0x66, -0xD5,0xE0,0x46,0xA3,0x70,0xDC,0x68,0xD9,0xFF,0x04,0x48,0x89,0x77,0xDE,0xB5,0xE9, -0xFB,0x67,0x6D,0x41,0xE9,0xBC,0x39,0xBD,0x32,0xD9,0x62,0x02,0xF1,0xB1,0xA8,0x3D, -0x6E,0x37,0x9C,0xE2,0x2F,0xE2,0xD3,0xA2,0x26,0x8B,0xC6,0xB8,0x55,0x43,0x88,0xE1, -0x23,0x3E,0xA5,0xD2,0x24,0x39,0x6A,0x47,0xAB,0x00,0xD4,0xA1,0xB3,0xA9,0x25,0xFE, -0x0D,0x3F,0xA7,0x1D,0xBA,0xD3,0x51,0xC1,0x0B,0xA4,0xDA,0xAC,0x38,0xEF,0x55,0x50, -0x24,0x05,0x65,0x46,0x93,0x34,0x4F,0x2D,0x8D,0xAD,0xC6,0xD4,0x21,0x19,0xD2,0x8E, -0xCA,0x05,0x61,0x71,0x07,0x73,0x47,0xE5,0x8A,0x19,0x12,0xBD,0x04,0x4D,0xCE,0x4E, -0x9C,0xA5,0x48,0xAC,0xBB,0x26,0xF7,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0x8E,0x30, -0x81,0x8B,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x0B,0x58,0xE5, -0x8B,0xC6,0x4C,0x15,0x37,0xA4,0x40,0xA9,0x30,0xA9,0x21,0xBE,0x47,0x36,0x5A,0x56, -0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01, -0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01, -0x01,0xFF,0x30,0x49,0x06,0x03,0x55,0x1D,0x1F,0x04,0x42,0x30,0x40,0x30,0x3E,0xA0, -0x3C,0xA0,0x3A,0x86,0x38,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E, -0x63,0x6F,0x6D,0x6F,0x64,0x6F,0x63,0x61,0x2E,0x63,0x6F,0x6D,0x2F,0x43,0x4F,0x4D, -0x4F,0x44,0x4F,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E, -0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x2E,0x63,0x72,0x6C,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01, -0x00,0x3E,0x98,0x9E,0x9B,0xF6,0x1B,0xE9,0xD7,0x39,0xB7,0x78,0xAE,0x1D,0x72,0x18, -0x49,0xD3,0x87,0xE4,0x43,0x82,0xEB,0x3F,0xC9,0xAA,0xF5,0xA8,0xB5,0xEF,0x55,0x7C, -0x21,0x52,0x65,0xF9,0xD5,0x0D,0xE1,0x6C,0xF4,0x3E,0x8C,0x93,0x73,0x91,0x2E,0x02, -0xC4,0x4E,0x07,0x71,0x6F,0xC0,0x8F,0x38,0x61,0x08,0xA8,0x1E,0x81,0x0A,0xC0,0x2F, -0x20,0x2F,0x41,0x8B,0x91,0xDC,0x48,0x45,0xBC,0xF1,0xC6,0xDE,0xBA,0x76,0x6B,0x33, -0xC8,0x00,0x2D,0x31,0x46,0x4C,0xED,0xE7,0x9D,0xCF,0x88,0x94,0xFF,0x33,0xC0,0x56, -0xE8,0x24,0x86,0x26,0xB8,0xD8,0x38,0x38,0xDF,0x2A,0x6B,0xDD,0x12,0xCC,0xC7,0x3F, -0x47,0x17,0x4C,0xA2,0xC2,0x06,0x96,0x09,0xD6,0xDB,0xFE,0x3F,0x3C,0x46,0x41,0xDF, -0x58,0xE2,0x56,0x0F,0x3C,0x3B,0xC1,0x1C,0x93,0x35,0xD9,0x38,0x52,0xAC,0xEE,0xC8, -0xEC,0x2E,0x30,0x4E,0x94,0x35,0xB4,0x24,0x1F,0x4B,0x78,0x69,0xDA,0xF2,0x02,0x38, -0xCC,0x95,0x52,0x93,0xF0,0x70,0x25,0x59,0x9C,0x20,0x67,0xC4,0xEE,0xF9,0x8B,0x57, -0x61,0xF4,0x92,0x76,0x7D,0x3F,0x84,0x8D,0x55,0xB7,0xE8,0xE5,0xAC,0xD5,0xF1,0xF5, -0x19,0x56,0xA6,0x5A,0xFB,0x90,0x1C,0xAF,0x93,0xEB,0xE5,0x1C,0xD4,0x67,0x97,0x5D, -0x04,0x0E,0xBE,0x0B,0x83,0xA6,0x17,0x83,0xB9,0x30,0x12,0xA0,0xC5,0x33,0x15,0x05, -0xB9,0x0D,0xFB,0xC7,0x05,0x76,0xE3,0xD8,0x4A,0x8D,0xFC,0x34,0x17,0xA3,0xC6,0x21, -0x28,0xBE,0x30,0x45,0x31,0x1E,0xC7,0x78,0xBE,0x58,0x61,0x38,0xAC,0x3B,0xE2,0x01, -0x65, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root CA */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root CA */ - - -const unsigned char DigiCert_Global_Root_CA_certificate[947]={ -0x30,0x82,0x03,0xAF,0x30,0x82,0x02,0x97,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x08, -0x3B,0xE0,0x56,0x90,0x42,0x46,0xB1,0xA1,0x75,0x6A,0xC9,0x59,0x91,0xC7,0x4A,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x61, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30, -0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77, -0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31, -0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x44,0x69,0x67,0x69,0x43,0x65, -0x72,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43, -0x41,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x31,0x31,0x30,0x30,0x30,0x30,0x30,0x30, -0x30,0x5A,0x17,0x0D,0x33,0x31,0x31,0x31,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30, -0x5A,0x30,0x61,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53, -0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43, -0x65,0x72,0x74,0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B, -0x13,0x10,0x77,0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63, -0x6F,0x6D,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x44,0x69,0x67, -0x69,0x43,0x65,0x72,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,0x6F, -0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A, -0x02,0x82,0x01,0x01,0x00,0xE2,0x3B,0xE1,0x11,0x72,0xDE,0xA8,0xA4,0xD3,0xA3,0x57, -0xAA,0x50,0xA2,0x8F,0x0B,0x77,0x90,0xC9,0xA2,0xA5,0xEE,0x12,0xCE,0x96,0x5B,0x01, -0x09,0x20,0xCC,0x01,0x93,0xA7,0x4E,0x30,0xB7,0x53,0xF7,0x43,0xC4,0x69,0x00,0x57, -0x9D,0xE2,0x8D,0x22,0xDD,0x87,0x06,0x40,0x00,0x81,0x09,0xCE,0xCE,0x1B,0x83,0xBF, -0xDF,0xCD,0x3B,0x71,0x46,0xE2,0xD6,0x66,0xC7,0x05,0xB3,0x76,0x27,0x16,0x8F,0x7B, -0x9E,0x1E,0x95,0x7D,0xEE,0xB7,0x48,0xA3,0x08,0xDA,0xD6,0xAF,0x7A,0x0C,0x39,0x06, -0x65,0x7F,0x4A,0x5D,0x1F,0xBC,0x17,0xF8,0xAB,0xBE,0xEE,0x28,0xD7,0x74,0x7F,0x7A, -0x78,0x99,0x59,0x85,0x68,0x6E,0x5C,0x23,0x32,0x4B,0xBF,0x4E,0xC0,0xE8,0x5A,0x6D, -0xE3,0x70,0xBF,0x77,0x10,0xBF,0xFC,0x01,0xF6,0x85,0xD9,0xA8,0x44,0x10,0x58,0x32, -0xA9,0x75,0x18,0xD5,0xD1,0xA2,0xBE,0x47,0xE2,0x27,0x6A,0xF4,0x9A,0x33,0xF8,0x49, -0x08,0x60,0x8B,0xD4,0x5F,0xB4,0x3A,0x84,0xBF,0xA1,0xAA,0x4A,0x4C,0x7D,0x3E,0xCF, -0x4F,0x5F,0x6C,0x76,0x5E,0xA0,0x4B,0x37,0x91,0x9E,0xDC,0x22,0xE6,0x6D,0xCE,0x14, -0x1A,0x8E,0x6A,0xCB,0xFE,0xCD,0xB3,0x14,0x64,0x17,0xC7,0x5B,0x29,0x9E,0x32,0xBF, -0xF2,0xEE,0xFA,0xD3,0x0B,0x42,0xD4,0xAB,0xB7,0x41,0x32,0xDA,0x0C,0xD4,0xEF,0xF8, -0x81,0xD5,0xBB,0x8D,0x58,0x3F,0xB5,0x1B,0xE8,0x49,0x28,0xA2,0x70,0xDA,0x31,0x04, -0xDD,0xF7,0xB2,0x16,0xF2,0x4C,0x0A,0x4E,0x07,0xA8,0xED,0x4A,0x3D,0x5E,0xB5,0x7F, -0xA3,0x90,0xC3,0xAF,0x27,0x02,0x03,0x01,0x00,0x01,0xA3,0x63,0x30,0x61,0x30,0x0E, -0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0F, -0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30, -0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x03,0xDE,0x50,0x35,0x56,0xD1, -0x4C,0xBB,0x66,0xF0,0xA3,0xE2,0x1B,0x1B,0xC3,0x97,0xB2,0x3D,0xD1,0x55,0x30,0x1F, -0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x03,0xDE,0x50,0x35,0x56, -0xD1,0x4C,0xBB,0x66,0xF0,0xA3,0xE2,0x1B,0x1B,0xC3,0x97,0xB2,0x3D,0xD1,0x55,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82, -0x01,0x01,0x00,0xCB,0x9C,0x37,0xAA,0x48,0x13,0x12,0x0A,0xFA,0xDD,0x44,0x9C,0x4F, -0x52,0xB0,0xF4,0xDF,0xAE,0x04,0xF5,0x79,0x79,0x08,0xA3,0x24,0x18,0xFC,0x4B,0x2B, -0x84,0xC0,0x2D,0xB9,0xD5,0xC7,0xFE,0xF4,0xC1,0x1F,0x58,0xCB,0xB8,0x6D,0x9C,0x7A, -0x74,0xE7,0x98,0x29,0xAB,0x11,0xB5,0xE3,0x70,0xA0,0xA1,0xCD,0x4C,0x88,0x99,0x93, -0x8C,0x91,0x70,0xE2,0xAB,0x0F,0x1C,0xBE,0x93,0xA9,0xFF,0x63,0xD5,0xE4,0x07,0x60, -0xD3,0xA3,0xBF,0x9D,0x5B,0x09,0xF1,0xD5,0x8E,0xE3,0x53,0xF4,0x8E,0x63,0xFA,0x3F, -0xA7,0xDB,0xB4,0x66,0xDF,0x62,0x66,0xD6,0xD1,0x6E,0x41,0x8D,0xF2,0x2D,0xB5,0xEA, -0x77,0x4A,0x9F,0x9D,0x58,0xE2,0x2B,0x59,0xC0,0x40,0x23,0xED,0x2D,0x28,0x82,0x45, -0x3E,0x79,0x54,0x92,0x26,0x98,0xE0,0x80,0x48,0xA8,0x37,0xEF,0xF0,0xD6,0x79,0x60, -0x16,0xDE,0xAC,0xE8,0x0E,0xCD,0x6E,0xAC,0x44,0x17,0x38,0x2F,0x49,0xDA,0xE1,0x45, -0x3E,0x2A,0xB9,0x36,0x53,0xCF,0x3A,0x50,0x06,0xF7,0x2E,0xE8,0xC4,0x57,0x49,0x6C, -0x61,0x21,0x18,0xD5,0x04,0xAD,0x78,0x3C,0x2C,0x3A,0x80,0x6B,0xA7,0xEB,0xAF,0x15, -0x14,0xE9,0xD8,0x89,0xC1,0xB9,0x38,0x6C,0xE2,0x91,0x6C,0x8A,0xFF,0x64,0xB9,0x77, -0x25,0x57,0x30,0xC0,0x1B,0x24,0xA3,0xE1,0xDC,0xE9,0xDF,0x47,0x7C,0xB5,0xB4,0x24, -0x08,0x05,0x30,0xEC,0x2D,0xBD,0x0B,0xBF,0x45,0xBF,0x50,0xB9,0xA9,0xF3,0xEB,0x98, -0x01,0x12,0xAD,0xC8,0x88,0xC6,0x98,0x34,0x5F,0x8D,0x0A,0x3C,0xC6,0xE9,0xD5,0x95, -0x95,0x6D,0xDE, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=AAA Certificate Services */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=AAA Certificate Services */ - - -const unsigned char Comodo_AAA_Services_root_certificate[1078]={ -0x30,0x82,0x04,0x32,0x30,0x82,0x03,0x1A,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x7B,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x21,0x30,0x1F,0x06,0x03,0x55, -0x04,0x03,0x0C,0x18,0x41,0x41,0x41,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x30,0x1E,0x17,0x0D, -0x30,0x34,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32, -0x38,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x7B,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B,0x30,0x19,0x06, -0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72,0x20,0x4D,0x61, -0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04, -0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30,0x18,0x06,0x03, -0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20,0x43,0x41,0x20,0x4C, -0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x0C, -0x18,0x41,0x41,0x41,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65, -0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x30,0x82,0x01,0x22,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F, -0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xBE,0x40,0x9D,0xF4,0x6E,0xE1, -0xEA,0x76,0x87,0x1C,0x4D,0x45,0x44,0x8E,0xBE,0x46,0xC8,0x83,0x06,0x9D,0xC1,0x2A, -0xFE,0x18,0x1F,0x8E,0xE4,0x02,0xFA,0xF3,0xAB,0x5D,0x50,0x8A,0x16,0x31,0x0B,0x9A, -0x06,0xD0,0xC5,0x70,0x22,0xCD,0x49,0x2D,0x54,0x63,0xCC,0xB6,0x6E,0x68,0x46,0x0B, -0x53,0xEA,0xCB,0x4C,0x24,0xC0,0xBC,0x72,0x4E,0xEA,0xF1,0x15,0xAE,0xF4,0x54,0x9A, -0x12,0x0A,0xC3,0x7A,0xB2,0x33,0x60,0xE2,0xDA,0x89,0x55,0xF3,0x22,0x58,0xF3,0xDE, -0xDC,0xCF,0xEF,0x83,0x86,0xA2,0x8C,0x94,0x4F,0x9F,0x68,0xF2,0x98,0x90,0x46,0x84, -0x27,0xC7,0x76,0xBF,0xE3,0xCC,0x35,0x2C,0x8B,0x5E,0x07,0x64,0x65,0x82,0xC0,0x48, -0xB0,0xA8,0x91,0xF9,0x61,0x9F,0x76,0x20,0x50,0xA8,0x91,0xC7,0x66,0xB5,0xEB,0x78, -0x62,0x03,0x56,0xF0,0x8A,0x1A,0x13,0xEA,0x31,0xA3,0x1E,0xA0,0x99,0xFD,0x38,0xF6, -0xF6,0x27,0x32,0x58,0x6F,0x07,0xF5,0x6B,0xB8,0xFB,0x14,0x2B,0xAF,0xB7,0xAA,0xCC, -0xD6,0x63,0x5F,0x73,0x8C,0xDA,0x05,0x99,0xA8,0x38,0xA8,0xCB,0x17,0x78,0x36,0x51, -0xAC,0xE9,0x9E,0xF4,0x78,0x3A,0x8D,0xCF,0x0F,0xD9,0x42,0xE2,0x98,0x0C,0xAB,0x2F, -0x9F,0x0E,0x01,0xDE,0xEF,0x9F,0x99,0x49,0xF1,0x2D,0xDF,0xAC,0x74,0x4D,0x1B,0x98, -0xB5,0x47,0xC5,0xE5,0x29,0xD1,0xF9,0x90,0x18,0xC7,0x62,0x9C,0xBE,0x83,0xC7,0x26, -0x7B,0x3E,0x8A,0x25,0xC7,0xC0,0xDD,0x9D,0xE6,0x35,0x68,0x10,0x20,0x9D,0x8F,0xD8, -0xDE,0xD2,0xC3,0x84,0x9C,0x0D,0x5E,0xE8,0x2F,0xC9,0x02,0x03,0x01,0x00,0x01,0xA3, -0x81,0xC0,0x30,0x81,0xBD,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14, -0xA0,0x11,0x0A,0x23,0x3E,0x96,0xF1,0x07,0xEC,0xE2,0xAF,0x29,0xEF,0x82,0xA5,0x7F, -0xD0,0x30,0xA4,0xB4,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x7B,0x06,0x03,0x55,0x1D,0x1F,0x04,0x74,0x30,0x72, -0x30,0x38,0xA0,0x36,0xA0,0x34,0x86,0x32,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63, -0x72,0x6C,0x2E,0x63,0x6F,0x6D,0x6F,0x64,0x6F,0x63,0x61,0x2E,0x63,0x6F,0x6D,0x2F, -0x41,0x41,0x41,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x53,0x65, -0x72,0x76,0x69,0x63,0x65,0x73,0x2E,0x63,0x72,0x6C,0x30,0x36,0xA0,0x34,0xA0,0x32, -0x86,0x30,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x63,0x6F,0x6D, -0x6F,0x64,0x6F,0x2E,0x6E,0x65,0x74,0x2F,0x41,0x41,0x41,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x2E,0x63, -0x72,0x6C,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05, -0x00,0x03,0x82,0x01,0x01,0x00,0x08,0x56,0xFC,0x02,0xF0,0x9B,0xE8,0xFF,0xA4,0xFA, -0xD6,0x7B,0xC6,0x44,0x80,0xCE,0x4F,0xC4,0xC5,0xF6,0x00,0x58,0xCC,0xA6,0xB6,0xBC, -0x14,0x49,0x68,0x04,0x76,0xE8,0xE6,0xEE,0x5D,0xEC,0x02,0x0F,0x60,0xD6,0x8D,0x50, -0x18,0x4F,0x26,0x4E,0x01,0xE3,0xE6,0xB0,0xA5,0xEE,0xBF,0xBC,0x74,0x54,0x41,0xBF, -0xFD,0xFC,0x12,0xB8,0xC7,0x4F,0x5A,0xF4,0x89,0x60,0x05,0x7F,0x60,0xB7,0x05,0x4A, -0xF3,0xF6,0xF1,0xC2,0xBF,0xC4,0xB9,0x74,0x86,0xB6,0x2D,0x7D,0x6B,0xCC,0xD2,0xF3, -0x46,0xDD,0x2F,0xC6,0xE0,0x6A,0xC3,0xC3,0x34,0x03,0x2C,0x7D,0x96,0xDD,0x5A,0xC2, -0x0E,0xA7,0x0A,0x99,0xC1,0x05,0x8B,0xAB,0x0C,0x2F,0xF3,0x5C,0x3A,0xCF,0x6C,0x37, -0x55,0x09,0x87,0xDE,0x53,0x40,0x6C,0x58,0xEF,0xFC,0xB6,0xAB,0x65,0x6E,0x04,0xF6, -0x1B,0xDC,0x3C,0xE0,0x5A,0x15,0xC6,0x9E,0xD9,0xF1,0x59,0x48,0x30,0x21,0x65,0x03, -0x6C,0xEC,0xE9,0x21,0x73,0xEC,0x9B,0x03,0xA1,0xE0,0x37,0xAD,0xA0,0x15,0x18,0x8F, -0xFA,0xBA,0x02,0xCE,0xA7,0x2C,0xA9,0x10,0x13,0x2C,0xD4,0xE5,0x08,0x26,0xAB,0x22, -0x97,0x60,0xF8,0x90,0x5E,0x74,0xD4,0xA2,0x9A,0x53,0xBD,0xF2,0xA9,0x68,0xE0,0xA2, -0x6E,0xC2,0xD7,0x6C,0xB1,0xA3,0x0F,0x9E,0xBF,0xEB,0x68,0xE7,0x56,0xF2,0xAE,0xF2, -0xE3,0x2B,0x38,0x3A,0x09,0x81,0xB5,0x6B,0x85,0xD7,0xBE,0x2D,0xED,0x3F,0x1A,0xB7, -0xB2,0x63,0xE2,0xF5,0x62,0x2C,0x82,0xD4,0x6A,0x00,0x41,0x50,0xF1,0x39,0x83,0x9F, -0x95,0xE9,0x36,0x96,0x98,0x6E, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA */ - - -const unsigned char DigiCert_High_Assurance_EV_Root_CA_certificate[969]={ -0x30,0x82,0x03,0xC5,0x30,0x82,0x02,0xAD,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x02, -0xAC,0x5C,0x26,0x6A,0x0B,0x40,0x9B,0x8F,0x0B,0x79,0xF2,0xAE,0x46,0x25,0x77,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x6C, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30, -0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77, -0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31, -0x2B,0x30,0x29,0x06,0x03,0x55,0x04,0x03,0x13,0x22,0x44,0x69,0x67,0x69,0x43,0x65, -0x72,0x74,0x20,0x48,0x69,0x67,0x68,0x20,0x41,0x73,0x73,0x75,0x72,0x61,0x6E,0x63, -0x65,0x20,0x45,0x56,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D, -0x30,0x36,0x31,0x31,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33, -0x31,0x31,0x31,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x30,0x6C,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x49, -0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77,0x77,0x77, -0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x2B,0x30, -0x29,0x06,0x03,0x55,0x04,0x03,0x13,0x22,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x48,0x69,0x67,0x68,0x20,0x41,0x73,0x73,0x75,0x72,0x61,0x6E,0x63,0x65,0x20, -0x45,0x56,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01, -0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xC6,0xCC,0xE5,0x73,0xE6, -0xFB,0xD4,0xBB,0xE5,0x2D,0x2D,0x32,0xA6,0xDF,0xE5,0x81,0x3F,0xC9,0xCD,0x25,0x49, -0xB6,0x71,0x2A,0xC3,0xD5,0x94,0x34,0x67,0xA2,0x0A,0x1C,0xB0,0x5F,0x69,0xA6,0x40, -0xB1,0xC4,0xB7,0xB2,0x8F,0xD0,0x98,0xA4,0xA9,0x41,0x59,0x3A,0xD3,0xDC,0x94,0xD6, -0x3C,0xDB,0x74,0x38,0xA4,0x4A,0xCC,0x4D,0x25,0x82,0xF7,0x4A,0xA5,0x53,0x12,0x38, -0xEE,0xF3,0x49,0x6D,0x71,0x91,0x7E,0x63,0xB6,0xAB,0xA6,0x5F,0xC3,0xA4,0x84,0xF8, -0x4F,0x62,0x51,0xBE,0xF8,0xC5,0xEC,0xDB,0x38,0x92,0xE3,0x06,0xE5,0x08,0x91,0x0C, -0xC4,0x28,0x41,0x55,0xFB,0xCB,0x5A,0x89,0x15,0x7E,0x71,0xE8,0x35,0xBF,0x4D,0x72, -0x09,0x3D,0xBE,0x3A,0x38,0x50,0x5B,0x77,0x31,0x1B,0x8D,0xB3,0xC7,0x24,0x45,0x9A, -0xA7,0xAC,0x6D,0x00,0x14,0x5A,0x04,0xB7,0xBA,0x13,0xEB,0x51,0x0A,0x98,0x41,0x41, -0x22,0x4E,0x65,0x61,0x87,0x81,0x41,0x50,0xA6,0x79,0x5C,0x89,0xDE,0x19,0x4A,0x57, -0xD5,0x2E,0xE6,0x5D,0x1C,0x53,0x2C,0x7E,0x98,0xCD,0x1A,0x06,0x16,0xA4,0x68,0x73, -0xD0,0x34,0x04,0x13,0x5C,0xA1,0x71,0xD3,0x5A,0x7C,0x55,0xDB,0x5E,0x64,0xE1,0x37, -0x87,0x30,0x56,0x04,0xE5,0x11,0xB4,0x29,0x80,0x12,0xF1,0x79,0x39,0x88,0xA2,0x02, -0x11,0x7C,0x27,0x66,0xB7,0x88,0xB7,0x78,0xF2,0xCA,0x0A,0xA8,0x38,0xAB,0x0A,0x64, -0xC2,0xBF,0x66,0x5D,0x95,0x84,0xC1,0xA1,0x25,0x1E,0x87,0x5D,0x1A,0x50,0x0B,0x20, -0x12,0xCC,0x41,0xBB,0x6E,0x0B,0x51,0x38,0xB8,0x4B,0xCB,0x02,0x03,0x01,0x00,0x01, -0xA3,0x63,0x30,0x61,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x86,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14, -0xB1,0x3E,0xC3,0x69,0x03,0xF8,0xBF,0x47,0x01,0xD4,0x98,0x26,0x1A,0x08,0x02,0xEF, -0x63,0x64,0x2B,0xC3,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80, -0x14,0xB1,0x3E,0xC3,0x69,0x03,0xF8,0xBF,0x47,0x01,0xD4,0x98,0x26,0x1A,0x08,0x02, -0xEF,0x63,0x64,0x2B,0xC3,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x1C,0x1A,0x06,0x97,0xDC,0xD7,0x9C, -0x9F,0x3C,0x88,0x66,0x06,0x08,0x57,0x21,0xDB,0x21,0x47,0xF8,0x2A,0x67,0xAA,0xBF, -0x18,0x32,0x76,0x40,0x10,0x57,0xC1,0x8A,0xF3,0x7A,0xD9,0x11,0x65,0x8E,0x35,0xFA, -0x9E,0xFC,0x45,0xB5,0x9E,0xD9,0x4C,0x31,0x4B,0xB8,0x91,0xE8,0x43,0x2C,0x8E,0xB3, -0x78,0xCE,0xDB,0xE3,0x53,0x79,0x71,0xD6,0xE5,0x21,0x94,0x01,0xDA,0x55,0x87,0x9A, -0x24,0x64,0xF6,0x8A,0x66,0xCC,0xDE,0x9C,0x37,0xCD,0xA8,0x34,0xB1,0x69,0x9B,0x23, -0xC8,0x9E,0x78,0x22,0x2B,0x70,0x43,0xE3,0x55,0x47,0x31,0x61,0x19,0xEF,0x58,0xC5, -0x85,0x2F,0x4E,0x30,0xF6,0xA0,0x31,0x16,0x23,0xC8,0xE7,0xE2,0x65,0x16,0x33,0xCB, -0xBF,0x1A,0x1B,0xA0,0x3D,0xF8,0xCA,0x5E,0x8B,0x31,0x8B,0x60,0x08,0x89,0x2D,0x0C, -0x06,0x5C,0x52,0xB7,0xC4,0xF9,0x0A,0x98,0xD1,0x15,0x5F,0x9F,0x12,0xBE,0x7C,0x36, -0x63,0x38,0xBD,0x44,0xA4,0x7F,0xE4,0x26,0x2B,0x0A,0xC4,0x97,0x69,0x0D,0xE9,0x8C, -0xE2,0xC0,0x10,0x57,0xB8,0xC8,0x76,0x12,0x91,0x55,0xF2,0x48,0x69,0xD8,0xBC,0x2A, -0x02,0x5B,0x0F,0x44,0xD4,0x20,0x31,0xDB,0xF4,0xBA,0x70,0x26,0x5D,0x90,0x60,0x9E, -0xBC,0x4B,0x17,0x09,0x2F,0xB4,0xCB,0x1E,0x43,0x68,0xC9,0x07,0x27,0xC1,0xD2,0x5C, -0xF7,0xEA,0x21,0xB9,0x68,0x12,0x9C,0x3C,0x9C,0xBF,0x9E,0xFC,0x80,0x5C,0x9B,0x63, -0xCD,0xEC,0x47,0xAA,0x25,0x27,0x67,0xA0,0x37,0xF3,0x00,0x82,0x7D,0x54,0xD7,0xA9, -0xF8,0xE9,0x2E,0x13,0xA3,0x77,0xE8,0x1F,0x4A, -}; - - -/* subject:/C=US/O=GeoTrust Inc./CN=GeoTrust Universal CA */ -/* issuer :/C=US/O=GeoTrust Inc./CN=GeoTrust Universal CA */ - - -const unsigned char GeoTrust_Universal_CA_certificate[1388]={ -0x30,0x82,0x05,0x68,0x30,0x82,0x03,0x50,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x45,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16, -0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73, -0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55,0x04,0x03,0x13, -0x15,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x55,0x6E,0x69,0x76,0x65,0x72, -0x73,0x61,0x6C,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,0x30,0x34,0x30,0x33,0x30,0x34, -0x30,0x35,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x39,0x30,0x33,0x30,0x34,0x30, -0x35,0x30,0x30,0x30,0x30,0x5A,0x30,0x45,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D, -0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1E,0x30, -0x1C,0x06,0x03,0x55,0x04,0x03,0x13,0x15,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74, -0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41,0x30,0x82,0x02, -0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00, -0x03,0x82,0x02,0x0F,0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02,0x01,0x00,0xA6,0x15, -0x55,0xA0,0xA3,0xC6,0xE0,0x1F,0x8C,0x9D,0x21,0x50,0xD7,0xC1,0xBE,0x2B,0x5B,0xB5, -0xA4,0x9E,0xA1,0xD9,0x72,0x58,0xBD,0x00,0x1B,0x4C,0xBF,0x61,0xC9,0x14,0x1D,0x45, -0x82,0xAB,0xC6,0x1D,0x80,0xD6,0x3D,0xEB,0x10,0x9C,0x3A,0xAF,0x6D,0x24,0xF8,0xBC, -0x71,0x01,0x9E,0x06,0xF5,0x7C,0x5F,0x1E,0xC1,0x0E,0x55,0xCA,0x83,0x9A,0x59,0x30, -0xAE,0x19,0xCB,0x30,0x48,0x95,0xED,0x22,0x37,0x8D,0xF4,0x4A,0x9A,0x72,0x66,0x3E, -0xAD,0x95,0xC0,0xE0,0x16,0x00,0xE0,0x10,0x1F,0x2B,0x31,0x0E,0xD7,0x94,0x54,0xD3, -0x42,0x33,0xA0,0x34,0x1D,0x1E,0x45,0x76,0xDD,0x4F,0xCA,0x18,0x37,0xEC,0x85,0x15, -0x7A,0x19,0x08,0xFC,0xD5,0xC7,0x9C,0xF0,0xF2,0xA9,0x2E,0x10,0xA9,0x92,0xE6,0x3D, -0x58,0x3D,0xA9,0x16,0x68,0x3C,0x2F,0x75,0x21,0x18,0x7F,0x28,0x77,0xA5,0xE1,0x61, -0x17,0xB7,0xA6,0xE9,0xF8,0x1E,0x99,0xDB,0x73,0x6E,0xF4,0x0A,0xA2,0x21,0x6C,0xEE, -0xDA,0xAA,0x85,0x92,0x66,0xAF,0xF6,0x7A,0x6B,0x82,0xDA,0xBA,0x22,0x08,0x35,0x0F, -0xCF,0x42,0xF1,0x35,0xFA,0x6A,0xEE,0x7E,0x2B,0x25,0xCC,0x3A,0x11,0xE4,0x6D,0xAF, -0x73,0xB2,0x76,0x1D,0xAD,0xD0,0xB2,0x78,0x67,0x1A,0xA4,0x39,0x1C,0x51,0x0B,0x67, -0x56,0x83,0xFD,0x38,0x5D,0x0D,0xCE,0xDD,0xF0,0xBB,0x2B,0x96,0x1F,0xDE,0x7B,0x32, -0x52,0xFD,0x1D,0xBB,0xB5,0x06,0xA1,0xB2,0x21,0x5E,0xA5,0xD6,0x95,0x68,0x7F,0xF0, -0x99,0x9E,0xDC,0x45,0x08,0x3E,0xE7,0xD2,0x09,0x0D,0x35,0x94,0xDD,0x80,0x4E,0x53, -0x97,0xD7,0xB5,0x09,0x44,0x20,0x64,0x16,0x17,0x03,0x02,0x4C,0x53,0x0D,0x68,0xDE, -0xD5,0xAA,0x72,0x4D,0x93,0x6D,0x82,0x0E,0xDB,0x9C,0xBD,0xCF,0xB4,0xF3,0x5C,0x5D, -0x54,0x7A,0x69,0x09,0x96,0xD6,0xDB,0x11,0xC1,0x8D,0x75,0xA8,0xB4,0xCF,0x39,0xC8, -0xCE,0x3C,0xBC,0x24,0x7C,0xE6,0x62,0xCA,0xE1,0xBD,0x7D,0xA7,0xBD,0x57,0x65,0x0B, -0xE4,0xFE,0x25,0xED,0xB6,0x69,0x10,0xDC,0x28,0x1A,0x46,0xBD,0x01,0x1D,0xD0,0x97, -0xB5,0xE1,0x98,0x3B,0xC0,0x37,0x64,0xD6,0x3D,0x94,0xEE,0x0B,0xE1,0xF5,0x28,0xAE, -0x0B,0x56,0xBF,0x71,0x8B,0x23,0x29,0x41,0x8E,0x86,0xC5,0x4B,0x52,0x7B,0xD8,0x71, -0xAB,0x1F,0x8A,0x15,0xA6,0x3B,0x83,0x5A,0xD7,0x58,0x01,0x51,0xC6,0x4C,0x41,0xD9, -0x7F,0xD8,0x41,0x67,0x72,0xA2,0x28,0xDF,0x60,0x83,0xA9,0x9E,0xC8,0x7B,0xFC,0x53, -0x73,0x72,0x59,0xF5,0x93,0x7A,0x17,0x76,0x0E,0xCE,0xF7,0xE5,0x5C,0xD9,0x0B,0x55, -0x34,0xA2,0xAA,0x5B,0xB5,0x6A,0x54,0xE7,0x13,0xCA,0x57,0xEC,0x97,0x6D,0xF4,0x5E, -0x06,0x2F,0x45,0x8B,0x58,0xD4,0x23,0x16,0x92,0xE4,0x16,0x6E,0x28,0x63,0x59,0x30, -0xDF,0x50,0x01,0x9C,0x63,0x89,0x1A,0x9F,0xDB,0x17,0x94,0x82,0x70,0x37,0xC3,0x24, -0x9E,0x9A,0x47,0xD6,0x5A,0xCA,0x4E,0xA8,0x69,0x89,0x72,0x1F,0x91,0x6C,0xDB,0x7E, -0x9E,0x1B,0xAD,0xC7,0x1F,0x73,0xDD,0x2C,0x4F,0x19,0x65,0xFD,0x7F,0x93,0x40,0x10, -0x2E,0xD2,0xF0,0xED,0x3C,0x9E,0x2E,0x28,0x3E,0x69,0x26,0x33,0xC5,0x7B,0x02,0x03, -0x01,0x00,0x01,0xA3,0x63,0x30,0x61,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01, -0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04, -0x16,0x04,0x14,0xDA,0xBB,0x2E,0xAA,0xB0,0x0C,0xB8,0x88,0x26,0x51,0x74,0x5C,0x6D, -0x03,0xD3,0xC0,0xD8,0x8F,0x7A,0xD6,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18, -0x30,0x16,0x80,0x14,0xDA,0xBB,0x2E,0xAA,0xB0,0x0C,0xB8,0x88,0x26,0x51,0x74,0x5C, -0x6D,0x03,0xD3,0xC0,0xD8,0x8F,0x7A,0xD6,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01, -0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x02,0x01,0x00,0x31,0x78,0xE6,0xC7, -0xB5,0xDF,0xB8,0x94,0x40,0xC9,0x71,0xC4,0xA8,0x35,0xEC,0x46,0x1D,0xC2,0x85,0xF3, -0x28,0x58,0x86,0xB0,0x0B,0xFC,0x8E,0xB2,0x39,0x8F,0x44,0x55,0xAB,0x64,0x84,0x5C, -0x69,0xA9,0xD0,0x9A,0x38,0x3C,0xFA,0xE5,0x1F,0x35,0xE5,0x44,0xE3,0x80,0x79,0x94, -0x68,0xA4,0xBB,0xC4,0x9F,0x3D,0xE1,0x34,0xCD,0x30,0x46,0x8B,0x54,0x2B,0x95,0xA5, -0xEF,0xF7,0x3F,0x99,0x84,0xFD,0x35,0xE6,0xCF,0x31,0xC6,0xDC,0x6A,0xBF,0xA7,0xD7, -0x23,0x08,0xE1,0x98,0x5E,0xC3,0x5A,0x08,0x76,0xA9,0xA6,0xAF,0x77,0x2F,0xB7,0x60, -0xBD,0x44,0x46,0x6A,0xEF,0x97,0xFF,0x73,0x95,0xC1,0x8E,0xE8,0x93,0xFB,0xFD,0x31, -0xB7,0xEC,0x57,0x11,0x11,0x45,0x9B,0x30,0xF1,0x1A,0x88,0x39,0xC1,0x4F,0x3C,0xA7, -0x00,0xD5,0xC7,0xFC,0xAB,0x6D,0x80,0x22,0x70,0xA5,0x0C,0xE0,0x5D,0x04,0x29,0x02, -0xFB,0xCB,0xA0,0x91,0xD1,0x7C,0xD6,0xC3,0x7E,0x50,0xD5,0x9D,0x58,0xBE,0x41,0x38, -0xEB,0xB9,0x75,0x3C,0x15,0xD9,0x9B,0xC9,0x4A,0x83,0x59,0xC0,0xDA,0x53,0xFD,0x33, -0xBB,0x36,0x18,0x9B,0x85,0x0F,0x15,0xDD,0xEE,0x2D,0xAC,0x76,0x93,0xB9,0xD9,0x01, -0x8D,0x48,0x10,0xA8,0xFB,0xF5,0x38,0x86,0xF1,0xDB,0x0A,0xC6,0xBD,0x84,0xA3,0x23, -0x41,0xDE,0xD6,0x77,0x6F,0x85,0xD4,0x85,0x1C,0x50,0xE0,0xAE,0x51,0x8A,0xBA,0x8D, -0x3E,0x76,0xE2,0xB9,0xCA,0x27,0xF2,0x5F,0x9F,0xEF,0x6E,0x59,0x0D,0x06,0xD8,0x2B, -0x17,0xA4,0xD2,0x7C,0x6B,0xBB,0x5F,0x14,0x1A,0x48,0x8F,0x1A,0x4C,0xE7,0xB3,0x47, -0x1C,0x8E,0x4C,0x45,0x2B,0x20,0xEE,0x48,0xDF,0xE7,0xDD,0x09,0x8E,0x18,0xA8,0xDA, -0x40,0x8D,0x92,0x26,0x11,0x53,0x61,0x73,0x5D,0xEB,0xBD,0xE7,0xC4,0x4D,0x29,0x37, -0x61,0xEB,0xAC,0x39,0x2D,0x67,0x2E,0x16,0xD6,0xF5,0x00,0x83,0x85,0xA1,0xCC,0x7F, -0x76,0xC4,0x7D,0xE4,0xB7,0x4B,0x66,0xEF,0x03,0x45,0x60,0x69,0xB6,0x0C,0x52,0x96, -0x92,0x84,0x5E,0xA6,0xA3,0xB5,0xA4,0x3E,0x2B,0xD9,0xCC,0xD8,0x1B,0x47,0xAA,0xF2, -0x44,0xDA,0x4F,0xF9,0x03,0xE8,0xF0,0x14,0xCB,0x3F,0xF3,0x83,0xDE,0xD0,0xC1,0x54, -0xE3,0xB7,0xE8,0x0A,0x37,0x4D,0x8B,0x20,0x59,0x03,0x30,0x19,0xA1,0x2C,0xC8,0xBD, -0x11,0x1F,0xDF,0xAE,0xC9,0x4A,0xC5,0xF3,0x27,0x66,0x66,0x86,0xAC,0x68,0x91,0xFF, -0xD9,0xE6,0x53,0x1C,0x0F,0x8B,0x5C,0x69,0x65,0x0A,0x26,0xC8,0x1E,0x34,0xC3,0x5D, -0x51,0x7B,0xD7,0xA9,0x9C,0x06,0xA1,0x36,0xDD,0xD5,0x89,0x94,0xBC,0xD9,0xE4,0x2D, -0x0C,0x5E,0x09,0x6C,0x08,0x97,0x7C,0xA3,0x3D,0x7C,0x93,0xFF,0x3F,0xA1,0x14,0xA7, -0xCF,0xB5,0x5D,0xEB,0xDB,0xDB,0x1C,0xC4,0x76,0xDF,0x88,0xB9,0xBD,0x45,0x05,0x95, -0x1B,0xAE,0xFC,0x46,0x6A,0x4C,0xAF,0x48,0xE3,0xCE,0xAE,0x0F,0xD2,0x7E,0xEB,0xE6, -0x6C,0x9C,0x4F,0x81,0x6A,0x7A,0x64,0xAC,0xBB,0x3E,0xD5,0xE7,0xCB,0x76,0x2E,0xC5, -0xA7,0x48,0xC1,0x5C,0x90,0x0F,0xCB,0xC8,0x3F,0xFA,0xE6,0x32,0xE1,0x8D,0x1B,0x6F, -0xA4,0xE6,0x8E,0xD8,0xF9,0x29,0x48,0x8A,0xCE,0x73,0xFE,0x2C, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO ECC Certification Authority */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO ECC Certification Authority */ - - -const unsigned char COMODO_ECC_Certification_Authority_certificate[653]={ -0x30,0x82,0x02,0x89,0x30,0x82,0x02,0x0F,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x1F, -0x47,0xAF,0xAA,0x62,0x00,0x70,0x50,0x54,0x4C,0x01,0x9E,0x9B,0x63,0x99,0x2A,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x81,0x85,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B,0x30,0x19,0x06, -0x03,0x55,0x04,0x08,0x13,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72,0x20,0x4D,0x61, -0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04, -0x07,0x13,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30,0x18,0x06,0x03, -0x55,0x04,0x0A,0x13,0x11,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x43,0x41,0x20,0x4C, -0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x2B,0x30,0x29,0x06,0x03,0x55,0x04,0x03,0x13, -0x22,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x45,0x43,0x43,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x38,0x30,0x33,0x30,0x36,0x30,0x30,0x30, -0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x38,0x32,0x33,0x35,0x39, -0x35,0x39,0x5A,0x30,0x81,0x85,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x47,0x42,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x13,0x12,0x47,0x72, -0x65,0x61,0x74,0x65,0x72,0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72, -0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x07,0x13,0x07,0x53,0x61,0x6C,0x66,0x6F, -0x72,0x64,0x31,0x1A,0x30,0x18,0x06,0x03,0x55,0x04,0x0A,0x13,0x11,0x43,0x4F,0x4D, -0x4F,0x44,0x4F,0x20,0x43,0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x2B, -0x30,0x29,0x06,0x03,0x55,0x04,0x03,0x13,0x22,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20, -0x45,0x43,0x43,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F, -0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x76,0x30,0x10,0x06, -0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05,0x2B,0x81,0x04,0x00,0x22,0x03, -0x62,0x00,0x04,0x03,0x47,0x7B,0x2F,0x75,0xC9,0x82,0x15,0x85,0xFB,0x75,0xE4,0x91, -0x16,0xD4,0xAB,0x62,0x99,0xF5,0x3E,0x52,0x0B,0x06,0xCE,0x41,0x00,0x7F,0x97,0xE1, -0x0A,0x24,0x3C,0x1D,0x01,0x04,0xEE,0x3D,0xD2,0x8D,0x09,0x97,0x0C,0xE0,0x75,0xE4, -0xFA,0xFB,0x77,0x8A,0x2A,0xF5,0x03,0x60,0x4B,0x36,0x8B,0x16,0x23,0x16,0xAD,0x09, -0x71,0xF4,0x4A,0xF4,0x28,0x50,0xB4,0xFE,0x88,0x1C,0x6E,0x3F,0x6C,0x2F,0x2F,0x09, -0x59,0x5B,0xA5,0x5B,0x0B,0x33,0x99,0xE2,0xC3,0x3D,0x89,0xF9,0x6A,0x2C,0xEF,0xB2, -0xD3,0x06,0xE9,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16, -0x04,0x14,0x75,0x71,0xA7,0x19,0x48,0x19,0xBC,0x9D,0x9D,0xEA,0x41,0x47,0xDF,0x94, -0xC4,0x48,0x77,0x99,0xD3,0x79,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF, -0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D, -0x04,0x03,0x03,0x03,0x68,0x00,0x30,0x65,0x02,0x31,0x00,0xEF,0x03,0x5B,0x7A,0xAC, -0xB7,0x78,0x0A,0x72,0xB7,0x88,0xDF,0xFF,0xB5,0x46,0x14,0x09,0x0A,0xFA,0xA0,0xE6, -0x7D,0x08,0xC6,0x1A,0x87,0xBD,0x18,0xA8,0x73,0xBD,0x26,0xCA,0x60,0x0C,0x9D,0xCE, -0x99,0x9F,0xCF,0x5C,0x0F,0x30,0xE1,0xBE,0x14,0x31,0xEA,0x02,0x30,0x14,0xF4,0x93, -0x3C,0x49,0xA7,0x33,0x7A,0x90,0x46,0x47,0xB3,0x63,0x7D,0x13,0x9B,0x4E,0xB7,0x6F, -0x18,0x37,0x80,0x53,0xFE,0xDD,0x20,0xE0,0x35,0x9A,0x36,0xD1,0xC7,0x01,0xB9,0xE6, -0xDC,0xDD,0xF3,0xFF,0x1D,0x2C,0x3A,0x16,0x57,0xD9,0x92,0x39,0xD6, -}; - - -/* subject:/C=US/O=Entrust, Inc./OU=See www.entrust.net/legal-terms/OU=(c) 2009 Entrust, Inc. - for authorized use only/CN=Entrust Root Certification Authority - G2 */ -/* issuer :/C=US/O=Entrust, Inc./OU=See www.entrust.net/legal-terms/OU=(c) 2009 Entrust, Inc. - for authorized use only/CN=Entrust Root Certification Authority - G2 */ - - -const unsigned char Entrust_Root_Certification_Authority___G2_certificate[1090]={ -0x30,0x82,0x04,0x3E,0x30,0x82,0x03,0x26,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x4A, -0x53,0x8C,0x28,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B, -0x05,0x00,0x30,0x81,0xBE,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02, -0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x45,0x6E,0x74, -0x72,0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x28,0x30,0x26,0x06,0x03, -0x55,0x04,0x0B,0x13,0x1F,0x53,0x65,0x65,0x20,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74, -0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x2F,0x6C,0x65,0x67,0x61,0x6C,0x2D,0x74, -0x65,0x72,0x6D,0x73,0x31,0x39,0x30,0x37,0x06,0x03,0x55,0x04,0x0B,0x13,0x30,0x28, -0x63,0x29,0x20,0x32,0x30,0x30,0x39,0x20,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2C, -0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x66,0x6F,0x72,0x20,0x61,0x75,0x74,0x68, -0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31, -0x32,0x30,0x30,0x06,0x03,0x55,0x04,0x03,0x13,0x29,0x45,0x6E,0x74,0x72,0x75,0x73, -0x74,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D, -0x20,0x47,0x32,0x30,0x1E,0x17,0x0D,0x30,0x39,0x30,0x37,0x30,0x37,0x31,0x37,0x32, -0x35,0x35,0x34,0x5A,0x17,0x0D,0x33,0x30,0x31,0x32,0x30,0x37,0x31,0x37,0x35,0x35, -0x35,0x34,0x5A,0x30,0x81,0xBE,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x45,0x6E, -0x74,0x72,0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x28,0x30,0x26,0x06, -0x03,0x55,0x04,0x0B,0x13,0x1F,0x53,0x65,0x65,0x20,0x77,0x77,0x77,0x2E,0x65,0x6E, -0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x2F,0x6C,0x65,0x67,0x61,0x6C,0x2D, -0x74,0x65,0x72,0x6D,0x73,0x31,0x39,0x30,0x37,0x06,0x03,0x55,0x04,0x0B,0x13,0x30, -0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x39,0x20,0x45,0x6E,0x74,0x72,0x75,0x73,0x74, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x66,0x6F,0x72,0x20,0x61,0x75,0x74, -0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79, -0x31,0x32,0x30,0x30,0x06,0x03,0x55,0x04,0x03,0x13,0x29,0x45,0x6E,0x74,0x72,0x75, -0x73,0x74,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20, -0x2D,0x20,0x47,0x32,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A, -0x02,0x82,0x01,0x01,0x00,0xBA,0x84,0xB6,0x72,0xDB,0x9E,0x0C,0x6B,0xE2,0x99,0xE9, -0x30,0x01,0xA7,0x76,0xEA,0x32,0xB8,0x95,0x41,0x1A,0xC9,0xDA,0x61,0x4E,0x58,0x72, -0xCF,0xFE,0xF6,0x82,0x79,0xBF,0x73,0x61,0x06,0x0A,0xA5,0x27,0xD8,0xB3,0x5F,0xD3, -0x45,0x4E,0x1C,0x72,0xD6,0x4E,0x32,0xF2,0x72,0x8A,0x0F,0xF7,0x83,0x19,0xD0,0x6A, -0x80,0x80,0x00,0x45,0x1E,0xB0,0xC7,0xE7,0x9A,0xBF,0x12,0x57,0x27,0x1C,0xA3,0x68, -0x2F,0x0A,0x87,0xBD,0x6A,0x6B,0x0E,0x5E,0x65,0xF3,0x1C,0x77,0xD5,0xD4,0x85,0x8D, -0x70,0x21,0xB4,0xB3,0x32,0xE7,0x8B,0xA2,0xD5,0x86,0x39,0x02,0xB1,0xB8,0xD2,0x47, -0xCE,0xE4,0xC9,0x49,0xC4,0x3B,0xA7,0xDE,0xFB,0x54,0x7D,0x57,0xBE,0xF0,0xE8,0x6E, -0xC2,0x79,0xB2,0x3A,0x0B,0x55,0xE2,0x50,0x98,0x16,0x32,0x13,0x5C,0x2F,0x78,0x56, -0xC1,0xC2,0x94,0xB3,0xF2,0x5A,0xE4,0x27,0x9A,0x9F,0x24,0xD7,0xC6,0xEC,0xD0,0x9B, -0x25,0x82,0xE3,0xCC,0xC2,0xC4,0x45,0xC5,0x8C,0x97,0x7A,0x06,0x6B,0x2A,0x11,0x9F, -0xA9,0x0A,0x6E,0x48,0x3B,0x6F,0xDB,0xD4,0x11,0x19,0x42,0xF7,0x8F,0x07,0xBF,0xF5, -0x53,0x5F,0x9C,0x3E,0xF4,0x17,0x2C,0xE6,0x69,0xAC,0x4E,0x32,0x4C,0x62,0x77,0xEA, -0xB7,0xE8,0xE5,0xBB,0x34,0xBC,0x19,0x8B,0xAE,0x9C,0x51,0xE7,0xB7,0x7E,0xB5,0x53, -0xB1,0x33,0x22,0xE5,0x6D,0xCF,0x70,0x3C,0x1A,0xFA,0xE2,0x9B,0x67,0xB6,0x83,0xF4, -0x8D,0xA5,0xAF,0x62,0x4C,0x4D,0xE0,0x58,0xAC,0x64,0x34,0x12,0x03,0xF8,0xB6,0x8D, -0x94,0x63,0x24,0xA4,0x71,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0E, -0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F, -0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30, -0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x6A,0x72,0x26,0x7A,0xD0,0x1E, -0xEF,0x7D,0xE7,0x3B,0x69,0x51,0xD4,0x6C,0x8D,0x9F,0x90,0x12,0x66,0xAB,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01, -0x01,0x00,0x79,0x9F,0x1D,0x96,0xC6,0xB6,0x79,0x3F,0x22,0x8D,0x87,0xD3,0x87,0x03, -0x04,0x60,0x6A,0x6B,0x9A,0x2E,0x59,0x89,0x73,0x11,0xAC,0x43,0xD1,0xF5,0x13,0xFF, -0x8D,0x39,0x2B,0xC0,0xF2,0xBD,0x4F,0x70,0x8C,0xA9,0x2F,0xEA,0x17,0xC4,0x0B,0x54, -0x9E,0xD4,0x1B,0x96,0x98,0x33,0x3C,0xA8,0xAD,0x62,0xA2,0x00,0x76,0xAB,0x59,0x69, -0x6E,0x06,0x1D,0x7E,0xC4,0xB9,0x44,0x8D,0x98,0xAF,0x12,0xD4,0x61,0xDB,0x0A,0x19, -0x46,0x47,0xF3,0xEB,0xF7,0x63,0xC1,0x40,0x05,0x40,0xA5,0xD2,0xB7,0xF4,0xB5,0x9A, -0x36,0xBF,0xA9,0x88,0x76,0x88,0x04,0x55,0x04,0x2B,0x9C,0x87,0x7F,0x1A,0x37,0x3C, -0x7E,0x2D,0xA5,0x1A,0xD8,0xD4,0x89,0x5E,0xCA,0xBD,0xAC,0x3D,0x6C,0xD8,0x6D,0xAF, -0xD5,0xF3,0x76,0x0F,0xCD,0x3B,0x88,0x38,0x22,0x9D,0x6C,0x93,0x9A,0xC4,0x3D,0xBF, -0x82,0x1B,0x65,0x3F,0xA6,0x0F,0x5D,0xAA,0xFC,0xE5,0xB2,0x15,0xCA,0xB5,0xAD,0xC6, -0xBC,0x3D,0xD0,0x84,0xE8,0xEA,0x06,0x72,0xB0,0x4D,0x39,0x32,0x78,0xBF,0x3E,0x11, -0x9C,0x0B,0xA4,0x9D,0x9A,0x21,0xF3,0xF0,0x9B,0x0B,0x30,0x78,0xDB,0xC1,0xDC,0x87, -0x43,0xFE,0xBC,0x63,0x9A,0xCA,0xC5,0xC2,0x1C,0xC9,0xC7,0x8D,0xFF,0x3B,0x12,0x58, -0x08,0xE6,0xB6,0x3D,0xEC,0x7A,0x2C,0x4E,0xFB,0x83,0x96,0xCE,0x0C,0x3C,0x69,0x87, -0x54,0x73,0xA4,0x73,0xC2,0x93,0xFF,0x51,0x10,0xAC,0x15,0x54,0x01,0xD8,0xFC,0x05, -0xB1,0x89,0xA1,0x7F,0x74,0x83,0x9A,0x49,0xD7,0xDC,0x4E,0x7B,0x8A,0x48,0x6F,0x8B, -0x45,0xF6, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Assured ID Root G2 */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Assured ID Root G2 */ - - -const unsigned char DigiCert_Assured_ID_Root_G2_certificate[922]={ -0x30,0x82,0x03,0x96,0x30,0x82,0x02,0x7E,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x0B, -0x93,0x1C,0x3A,0xD6,0x39,0x67,0xEA,0x67,0x23,0xBF,0xC3,0xAF,0x9A,0xF4,0x4B,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x65, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30, -0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77, -0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31, -0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x44,0x69,0x67,0x69,0x43,0x65, -0x72,0x74,0x20,0x41,0x73,0x73,0x75,0x72,0x65,0x64,0x20,0x49,0x44,0x20,0x52,0x6F, -0x6F,0x74,0x20,0x47,0x32,0x30,0x1E,0x17,0x0D,0x31,0x33,0x30,0x38,0x30,0x31,0x31, -0x32,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x35,0x31,0x32, -0x30,0x30,0x30,0x30,0x5A,0x30,0x65,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44, -0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06, -0x03,0x55,0x04,0x0B,0x13,0x10,0x77,0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65, -0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13, -0x1B,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x41,0x73,0x73,0x75,0x72,0x65, -0x64,0x20,0x49,0x44,0x20,0x52,0x6F,0x6F,0x74,0x20,0x47,0x32,0x30,0x82,0x01,0x22, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03, -0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xD9,0xE7,0x28, -0x2F,0x52,0x3F,0x36,0x72,0x49,0x88,0x93,0x34,0xF3,0xF8,0x6A,0x1E,0x31,0x54,0x80, -0x9F,0xAD,0x54,0x41,0xB5,0x47,0xDF,0x96,0xA8,0xD4,0xAF,0x80,0x2D,0xB9,0x0A,0xCF, -0x75,0xFD,0x89,0xA5,0x7D,0x24,0xFA,0xE3,0x22,0x0C,0x2B,0xBC,0x95,0x17,0x0B,0x33, -0xBF,0x19,0x4D,0x41,0x06,0x90,0x00,0xBD,0x0C,0x4D,0x10,0xFE,0x07,0xB5,0xE7,0x1C, -0x6E,0x22,0x55,0x31,0x65,0x97,0xBD,0xD3,0x17,0xD2,0x1E,0x62,0xF3,0xDB,0xEA,0x6C, -0x50,0x8C,0x3F,0x84,0x0C,0x96,0xCF,0xB7,0xCB,0x03,0xE0,0xCA,0x6D,0xA1,0x14,0x4C, -0x1B,0x89,0xDD,0xED,0x00,0xB0,0x52,0x7C,0xAF,0x91,0x6C,0xB1,0x38,0x13,0xD1,0xE9, -0x12,0x08,0xC0,0x00,0xB0,0x1C,0x2B,0x11,0xDA,0x77,0x70,0x36,0x9B,0xAE,0xCE,0x79, -0x87,0xDC,0x82,0x70,0xE6,0x09,0x74,0x70,0x55,0x69,0xAF,0xA3,0x68,0x9F,0xBF,0xDD, -0xB6,0x79,0xB3,0xF2,0x9D,0x70,0x29,0x55,0xF4,0xAB,0xFF,0x95,0x61,0xF3,0xC9,0x40, -0x6F,0x1D,0xD1,0xBE,0x93,0xBB,0xD3,0x88,0x2A,0xBB,0x9D,0xBF,0x72,0x5A,0x56,0x71, -0x3B,0x3F,0xD4,0xF3,0xD1,0x0A,0xFE,0x28,0xEF,0xA3,0xEE,0xD9,0x99,0xAF,0x03,0xD3, -0x8F,0x60,0xB7,0xF2,0x92,0xA1,0xB1,0xBD,0x89,0x89,0x1F,0x30,0xCD,0xC3,0xA6,0x2E, -0x62,0x33,0xAE,0x16,0x02,0x77,0x44,0x5A,0xE7,0x81,0x0A,0x3C,0xA7,0x44,0x2E,0x79, -0xB8,0x3F,0x04,0xBC,0x5C,0xA0,0x87,0xE1,0x1B,0xAF,0x51,0x8E,0xCD,0xEC,0x2C,0xFA, -0xF8,0xFE,0x6D,0xF0,0x3A,0x7C,0xAA,0x8B,0xE4,0x67,0x95,0x31,0x8D,0x02,0x03,0x01, -0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF, -0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01, -0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16, -0x04,0x14,0xCE,0xC3,0x4A,0xB9,0x99,0x55,0xF2,0xB8,0xDB,0x60,0xBF,0xA9,0x7E,0xBD, -0x56,0xB5,0x97,0x36,0xA7,0xD6,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0xCA,0xA5,0x55,0x8C,0xE3,0xC8, -0x41,0x6E,0x69,0x27,0xA7,0x75,0x11,0xEF,0x3C,0x86,0x36,0x6F,0xD2,0x9D,0xC6,0x78, -0x38,0x1D,0x69,0x96,0xA2,0x92,0x69,0x2E,0x38,0x6C,0x9B,0x7D,0x04,0xD4,0x89,0xA5, -0xB1,0x31,0x37,0x8A,0xC9,0x21,0xCC,0xAB,0x6C,0xCD,0x8B,0x1C,0x9A,0xD6,0xBF,0x48, -0xD2,0x32,0x66,0xC1,0x8A,0xC0,0xF3,0x2F,0x3A,0xEF,0xC0,0xE3,0xD4,0x91,0x86,0xD1, -0x50,0xE3,0x03,0xDB,0x73,0x77,0x6F,0x4A,0x39,0x53,0xED,0xDE,0x26,0xC7,0xB5,0x7D, -0xAF,0x2B,0x42,0xD1,0x75,0x62,0xE3,0x4A,0x2B,0x02,0xC7,0x50,0x4B,0xE0,0x69,0xE2, -0x96,0x6C,0x0E,0x44,0x66,0x10,0x44,0x8F,0xAD,0x05,0xEB,0xF8,0x79,0xAC,0xA6,0x1B, -0xE8,0x37,0x34,0x9D,0x53,0xC9,0x61,0xAA,0xA2,0x52,0xAF,0x4A,0x70,0x16,0x86,0xC2, -0x3A,0xC8,0xB1,0x13,0x70,0x36,0xD8,0xCF,0xEE,0xF4,0x0A,0x34,0xD5,0x5B,0x4C,0xFD, -0x07,0x9C,0xA2,0xBA,0xD9,0x01,0x72,0x5C,0xF3,0x4D,0xC1,0xDD,0x0E,0xB1,0x1C,0x0D, -0xC4,0x63,0xBE,0xAD,0xF4,0x14,0xFB,0x89,0xEC,0xA2,0x41,0x0E,0x4C,0xCC,0xC8,0x57, -0x40,0xD0,0x6E,0x03,0xAA,0xCD,0x0C,0x8E,0x89,0x99,0x99,0x6C,0xF0,0x3C,0x30,0xAF, -0x38,0xDF,0x6F,0xBC,0xA3,0xBE,0x29,0x20,0x27,0xAB,0x74,0xFF,0x13,0x22,0x78,0xDE, -0x97,0x52,0x55,0x1E,0x83,0xB5,0x54,0x20,0x03,0xEE,0xAE,0xC0,0x4F,0x56,0xDE,0x37, -0xCC,0xC3,0x7F,0xAA,0x04,0x27,0xBB,0xD3,0x77,0xB8,0x62,0xDB,0x17,0x7C,0x9C,0x28, -0x22,0x13,0x73,0x6C,0xCF,0x26,0xF5,0x8A,0x29,0xE7, -}; - - -/* subject:/C=US/O=AffirmTrust/CN=AffirmTrust Commercial */ -/* issuer :/C=US/O=AffirmTrust/CN=AffirmTrust Commercial */ - - -const unsigned char AffirmTrust_Commercial_certificate[848]={ -0x30,0x82,0x03,0x4C,0x30,0x82,0x02,0x34,0xA0,0x03,0x02,0x01,0x02,0x02,0x08,0x77, -0x77,0x06,0x27,0x26,0xA9,0xB1,0x7C,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x44,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x0C,0x0B, -0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31,0x1F,0x30,0x1D,0x06, -0x03,0x55,0x04,0x03,0x0C,0x16,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73, -0x74,0x20,0x43,0x6F,0x6D,0x6D,0x65,0x72,0x63,0x69,0x61,0x6C,0x30,0x1E,0x17,0x0D, -0x31,0x30,0x30,0x31,0x32,0x39,0x31,0x34,0x30,0x36,0x30,0x36,0x5A,0x17,0x0D,0x33, -0x30,0x31,0x32,0x33,0x31,0x31,0x34,0x30,0x36,0x30,0x36,0x5A,0x30,0x44,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06, -0x03,0x55,0x04,0x0A,0x0C,0x0B,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73, -0x74,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x0C,0x16,0x41,0x66,0x66,0x69, -0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x20,0x43,0x6F,0x6D,0x6D,0x65,0x72,0x63,0x69, -0x61,0x6C,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82, -0x01,0x01,0x00,0xF6,0x1B,0x4F,0x67,0x07,0x2B,0xA1,0x15,0xF5,0x06,0x22,0xCB,0x1F, -0x01,0xB2,0xE3,0x73,0x45,0x06,0x44,0x49,0x2C,0xBB,0x49,0x25,0x14,0xD6,0xCE,0xC3, -0xB7,0xAB,0x2C,0x4F,0xC6,0x41,0x32,0x94,0x57,0xFA,0x12,0xA7,0x5B,0x0E,0xE2,0x8F, -0x1F,0x1E,0x86,0x19,0xA7,0xAA,0xB5,0x2D,0xB9,0x5F,0x0D,0x8A,0xC2,0xAF,0x85,0x35, -0x79,0x32,0x2D,0xBB,0x1C,0x62,0x37,0xF2,0xB1,0x5B,0x4A,0x3D,0xCA,0xCD,0x71,0x5F, -0xE9,0x42,0xBE,0x94,0xE8,0xC8,0xDE,0xF9,0x22,0x48,0x64,0xC6,0xE5,0xAB,0xC6,0x2B, -0x6D,0xAD,0x05,0xF0,0xFA,0xD5,0x0B,0xCF,0x9A,0xE5,0xF0,0x50,0xA4,0x8B,0x3B,0x47, -0xA5,0x23,0x5B,0x7A,0x7A,0xF8,0x33,0x3F,0xB8,0xEF,0x99,0x97,0xE3,0x20,0xC1,0xD6, -0x28,0x89,0xCF,0x94,0xFB,0xB9,0x45,0xED,0xE3,0x40,0x17,0x11,0xD4,0x74,0xF0,0x0B, -0x31,0xE2,0x2B,0x26,0x6A,0x9B,0x4C,0x57,0xAE,0xAC,0x20,0x3E,0xBA,0x45,0x7A,0x05, -0xF3,0xBD,0x9B,0x69,0x15,0xAE,0x7D,0x4E,0x20,0x63,0xC4,0x35,0x76,0x3A,0x07,0x02, -0xC9,0x37,0xFD,0xC7,0x47,0xEE,0xE8,0xF1,0x76,0x1D,0x73,0x15,0xF2,0x97,0xA4,0xB5, -0xC8,0x7A,0x79,0xD9,0x42,0xAA,0x2B,0x7F,0x5C,0xFE,0xCE,0x26,0x4F,0xA3,0x66,0x81, -0x35,0xAF,0x44,0xBA,0x54,0x1E,0x1C,0x30,0x32,0x65,0x9D,0xE6,0x3C,0x93,0x5E,0x50, -0x4E,0x7A,0xE3,0x3A,0xD4,0x6E,0xCC,0x1A,0xFB,0xF9,0xD2,0x37,0xAE,0x24,0x2A,0xAB, -0x57,0x03,0x22,0x28,0x0D,0x49,0x75,0x7F,0xB7,0x28,0xDA,0x75,0xBF,0x8E,0xE3,0xDC, -0x0E,0x79,0x31,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06,0x03, -0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x9D,0x93,0xC6,0x53,0x8B,0x5E,0xCA,0xAF,0x3F, -0x9F,0x1E,0x0F,0xE5,0x99,0x95,0xBC,0x24,0xF6,0x94,0x8F,0x30,0x0F,0x06,0x03,0x55, -0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00, -0x58,0xAC,0xF4,0x04,0x0E,0xCD,0xC0,0x0D,0xFF,0x0A,0xFD,0xD4,0xBA,0x16,0x5F,0x29, -0xBD,0x7B,0x68,0x99,0x58,0x49,0xD2,0xB4,0x1D,0x37,0x4D,0x7F,0x27,0x7D,0x46,0x06, -0x5D,0x43,0xC6,0x86,0x2E,0x3E,0x73,0xB2,0x26,0x7D,0x4F,0x93,0xA9,0xB6,0xC4,0x2A, -0x9A,0xAB,0x21,0x97,0x14,0xB1,0xDE,0x8C,0xD3,0xAB,0x89,0x15,0xD8,0x6B,0x24,0xD4, -0xF1,0x16,0xAE,0xD8,0xA4,0x5C,0xD4,0x7F,0x51,0x8E,0xED,0x18,0x01,0xB1,0x93,0x63, -0xBD,0xBC,0xF8,0x61,0x80,0x9A,0x9E,0xB1,0xCE,0x42,0x70,0xE2,0xA9,0x7D,0x06,0x25, -0x7D,0x27,0xA1,0xFE,0x6F,0xEC,0xB3,0x1E,0x24,0xDA,0xE3,0x4B,0x55,0x1A,0x00,0x3B, -0x35,0xB4,0x3B,0xD9,0xD7,0x5D,0x30,0xFD,0x81,0x13,0x89,0xF2,0xC2,0x06,0x2B,0xED, -0x67,0xC4,0x8E,0xC9,0x43,0xB2,0x5C,0x6B,0x15,0x89,0x02,0xBC,0x62,0xFC,0x4E,0xF2, -0xB5,0x33,0xAA,0xB2,0x6F,0xD3,0x0A,0xA2,0x50,0xE3,0xF6,0x3B,0xE8,0x2E,0x44,0xC2, -0xDB,0x66,0x38,0xA9,0x33,0x56,0x48,0xF1,0x6D,0x1B,0x33,0x8D,0x0D,0x8C,0x3F,0x60, -0x37,0x9D,0xD3,0xCA,0x6D,0x7E,0x34,0x7E,0x0D,0x9F,0x72,0x76,0x8B,0x1B,0x9F,0x72, -0xFD,0x52,0x35,0x41,0x45,0x02,0x96,0x2F,0x1C,0xB2,0x9A,0x73,0x49,0x21,0xB1,0x49, -0x47,0x45,0x47,0xB4,0xEF,0x6A,0x34,0x11,0xC9,0x4D,0x9A,0xCC,0x59,0xB7,0xD6,0x02, -0x9E,0x5A,0x4E,0x65,0xB5,0x94,0xAE,0x1B,0xDF,0x29,0xB0,0x16,0xF1,0xBF,0x00,0x9E, -0x07,0x3A,0x17,0x64,0xB5,0x04,0xB5,0x23,0x21,0x99,0x0A,0x95,0x3B,0x97,0x7C,0xEF, -}; - - -/* subject:/C=US/O=AffirmTrust/CN=AffirmTrust Premium */ -/* issuer :/C=US/O=AffirmTrust/CN=AffirmTrust Premium */ - - -const unsigned char AffirmTrust_Premium_certificate[1354]={ -0x30,0x82,0x05,0x46,0x30,0x82,0x03,0x2E,0xA0,0x03,0x02,0x01,0x02,0x02,0x08,0x6D, -0x8C,0x14,0x46,0xB1,0xA6,0x0A,0xEE,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x0C,0x05,0x00,0x30,0x41,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x0C,0x0B, -0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31,0x1C,0x30,0x1A,0x06, -0x03,0x55,0x04,0x03,0x0C,0x13,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73, -0x74,0x20,0x50,0x72,0x65,0x6D,0x69,0x75,0x6D,0x30,0x1E,0x17,0x0D,0x31,0x30,0x30, -0x31,0x32,0x39,0x31,0x34,0x31,0x30,0x33,0x36,0x5A,0x17,0x0D,0x34,0x30,0x31,0x32, -0x33,0x31,0x31,0x34,0x31,0x30,0x33,0x36,0x5A,0x30,0x41,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04, -0x0A,0x0C,0x0B,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31,0x1C, -0x30,0x1A,0x06,0x03,0x55,0x04,0x03,0x0C,0x13,0x41,0x66,0x66,0x69,0x72,0x6D,0x54, -0x72,0x75,0x73,0x74,0x20,0x50,0x72,0x65,0x6D,0x69,0x75,0x6D,0x30,0x82,0x02,0x22, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03, -0x82,0x02,0x0F,0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02,0x01,0x00,0xC4,0x12,0xDF, -0xA9,0x5F,0xFE,0x41,0xDD,0xDD,0xF5,0x9F,0x8A,0xE3,0xF6,0xAC,0xE1,0x3C,0x78,0x9A, -0xBC,0xD8,0xF0,0x7F,0x7A,0xA0,0x33,0x2A,0xDC,0x8D,0x20,0x5B,0xAE,0x2D,0x6F,0xE7, -0x93,0xD9,0x36,0x70,0x6A,0x68,0xCF,0x8E,0x51,0xA3,0x85,0x5B,0x67,0x04,0xA0,0x10, -0x24,0x6F,0x5D,0x28,0x82,0xC1,0x97,0x57,0xD8,0x48,0x29,0x13,0xB6,0xE1,0xBE,0x91, -0x4D,0xDF,0x85,0x0C,0x53,0x18,0x9A,0x1E,0x24,0xA2,0x4F,0x8F,0xF0,0xA2,0x85,0x0B, -0xCB,0xF4,0x29,0x7F,0xD2,0xA4,0x58,0xEE,0x26,0x4D,0xC9,0xAA,0xA8,0x7B,0x9A,0xD9, -0xFA,0x38,0xDE,0x44,0x57,0x15,0xE5,0xF8,0x8C,0xC8,0xD9,0x48,0xE2,0x0D,0x16,0x27, -0x1D,0x1E,0xC8,0x83,0x85,0x25,0xB7,0xBA,0xAA,0x55,0x41,0xCC,0x03,0x22,0x4B,0x2D, -0x91,0x8D,0x8B,0xE6,0x89,0xAF,0x66,0xC7,0xE9,0xFF,0x2B,0xE9,0x3C,0xAC,0xDA,0xD2, -0xB3,0xC3,0xE1,0x68,0x9C,0x89,0xF8,0x7A,0x00,0x56,0xDE,0xF4,0x55,0x95,0x6C,0xFB, -0xBA,0x64,0xDD,0x62,0x8B,0xDF,0x0B,0x77,0x32,0xEB,0x62,0xCC,0x26,0x9A,0x9B,0xBB, -0xAA,0x62,0x83,0x4C,0xB4,0x06,0x7A,0x30,0xC8,0x29,0xBF,0xED,0x06,0x4D,0x97,0xB9, -0x1C,0xC4,0x31,0x2B,0xD5,0x5F,0xBC,0x53,0x12,0x17,0x9C,0x99,0x57,0x29,0x66,0x77, -0x61,0x21,0x31,0x07,0x2E,0x25,0x49,0x9D,0x18,0xF2,0xEE,0xF3,0x2B,0x71,0x8C,0xB5, -0xBA,0x39,0x07,0x49,0x77,0xFC,0xEF,0x2E,0x92,0x90,0x05,0x8D,0x2D,0x2F,0x77,0x7B, -0xEF,0x43,0xBF,0x35,0xBB,0x9A,0xD8,0xF9,0x73,0xA7,0x2C,0xF2,0xD0,0x57,0xEE,0x28, -0x4E,0x26,0x5F,0x8F,0x90,0x68,0x09,0x2F,0xB8,0xF8,0xDC,0x06,0xE9,0x2E,0x9A,0x3E, -0x51,0xA7,0xD1,0x22,0xC4,0x0A,0xA7,0x38,0x48,0x6C,0xB3,0xF9,0xFF,0x7D,0xAB,0x86, -0x57,0xE3,0xBA,0xD6,0x85,0x78,0x77,0xBA,0x43,0xEA,0x48,0x7F,0xF6,0xD8,0xBE,0x23, -0x6D,0x1E,0xBF,0xD1,0x36,0x6C,0x58,0x5C,0xF1,0xEE,0xA4,0x19,0x54,0x1A,0xF5,0x03, -0xD2,0x76,0xE6,0xE1,0x8C,0xBD,0x3C,0xB3,0xD3,0x48,0x4B,0xE2,0xC8,0xF8,0x7F,0x92, -0xA8,0x76,0x46,0x9C,0x42,0x65,0x3E,0xA4,0x1E,0xC1,0x07,0x03,0x5A,0x46,0x2D,0xB8, -0x97,0xF3,0xB7,0xD5,0xB2,0x55,0x21,0xEF,0xBA,0xDC,0x4C,0x00,0x97,0xFB,0x14,0x95, -0x27,0x33,0xBF,0xE8,0x43,0x47,0x46,0xD2,0x08,0x99,0x16,0x60,0x3B,0x9A,0x7E,0xD2, -0xE6,0xED,0x38,0xEA,0xEC,0x01,0x1E,0x3C,0x48,0x56,0x49,0x09,0xC7,0x4C,0x37,0x00, -0x9E,0x88,0x0E,0xC0,0x73,0xE1,0x6F,0x66,0xE9,0x72,0x47,0x30,0x3E,0x10,0xE5,0x0B, -0x03,0xC9,0x9A,0x42,0x00,0x6C,0xC5,0x94,0x7E,0x61,0xC4,0x8A,0xDF,0x7F,0x82,0x1A, -0x0B,0x59,0xC4,0x59,0x32,0x77,0xB3,0xBC,0x60,0x69,0x56,0x39,0xFD,0xB4,0x06,0x7B, -0x2C,0xD6,0x64,0x36,0xD9,0xBD,0x48,0xED,0x84,0x1F,0x7E,0xA5,0x22,0x8F,0x2A,0xB8, -0x42,0xF4,0x82,0xB7,0xD4,0x53,0x90,0x78,0x4E,0x2D,0x1A,0xFD,0x81,0x6F,0x44,0xD7, -0x3B,0x01,0x74,0x96,0x42,0xE0,0x00,0xE2,0x2E,0x6B,0xEA,0xC5,0xEE,0x72,0xAC,0xBB, -0xBF,0xFE,0xEA,0xAA,0xA8,0xF8,0xDC,0xF6,0xB2,0x79,0x8A,0xB6,0x67,0x02,0x03,0x01, -0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0x9D,0xC0,0x67,0xA6,0x0C,0x22,0xD9,0x26,0xF5,0x45,0xAB,0xA6,0x65,0x52,0x11, -0x27,0xD8,0x45,0xAC,0x63,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x0C,0x05,0x00,0x03,0x82,0x02,0x01,0x00,0xB3,0x57,0x4D,0x10,0x62,0x4E, -0x3A,0xE4,0xAC,0xEA,0xB8,0x1C,0xAF,0x32,0x23,0xC8,0xB3,0x49,0x5A,0x51,0x9C,0x76, -0x28,0x8D,0x79,0xAA,0x57,0x46,0x17,0xD5,0xF5,0x52,0xF6,0xB7,0x44,0xE8,0x08,0x44, -0xBF,0x18,0x84,0xD2,0x0B,0x80,0xCD,0xC5,0x12,0xFD,0x00,0x55,0x05,0x61,0x87,0x41, -0xDC,0xB5,0x24,0x9E,0x3C,0xC4,0xD8,0xC8,0xFB,0x70,0x9E,0x2F,0x78,0x96,0x83,0x20, -0x36,0xDE,0x7C,0x0F,0x69,0x13,0x88,0xA5,0x75,0x36,0x98,0x08,0xA6,0xC6,0xDF,0xAC, -0xCE,0xE3,0x58,0xD6,0xB7,0x3E,0xDE,0xBA,0xF3,0xEB,0x34,0x40,0xD8,0xA2,0x81,0xF5, -0x78,0x3F,0x2F,0xD5,0xA5,0xFC,0xD9,0xA2,0xD4,0x5E,0x04,0x0E,0x17,0xAD,0xFE,0x41, -0xF0,0xE5,0xB2,0x72,0xFA,0x44,0x82,0x33,0x42,0xE8,0x2D,0x58,0xF7,0x56,0x8C,0x62, -0x3F,0xBA,0x42,0xB0,0x9C,0x0C,0x5C,0x7E,0x2E,0x65,0x26,0x5C,0x53,0x4F,0x00,0xB2, -0x78,0x7E,0xA1,0x0D,0x99,0x2D,0x8D,0xB8,0x1D,0x8E,0xA2,0xC4,0xB0,0xFD,0x60,0xD0, -0x30,0xA4,0x8E,0xC8,0x04,0x62,0xA9,0xC4,0xED,0x35,0xDE,0x7A,0x97,0xED,0x0E,0x38, -0x5E,0x92,0x2F,0x93,0x70,0xA5,0xA9,0x9C,0x6F,0xA7,0x7D,0x13,0x1D,0x7E,0xC6,0x08, -0x48,0xB1,0x5E,0x67,0xEB,0x51,0x08,0x25,0xE9,0xE6,0x25,0x6B,0x52,0x29,0x91,0x9C, -0xD2,0x39,0x73,0x08,0x57,0xDE,0x99,0x06,0xB4,0x5B,0x9D,0x10,0x06,0xE1,0xC2,0x00, -0xA8,0xB8,0x1C,0x4A,0x02,0x0A,0x14,0xD0,0xC1,0x41,0xCA,0xFB,0x8C,0x35,0x21,0x7D, -0x82,0x38,0xF2,0xA9,0x54,0x91,0x19,0x35,0x93,0x94,0x6D,0x6A,0x3A,0xC5,0xB2,0xD0, -0xBB,0x89,0x86,0x93,0xE8,0x9B,0xC9,0x0F,0x3A,0xA7,0x7A,0xB8,0xA1,0xF0,0x78,0x46, -0xFA,0xFC,0x37,0x2F,0xE5,0x8A,0x84,0xF3,0xDF,0xFE,0x04,0xD9,0xA1,0x68,0xA0,0x2F, -0x24,0xE2,0x09,0x95,0x06,0xD5,0x95,0xCA,0xE1,0x24,0x96,0xEB,0x7C,0xF6,0x93,0x05, -0xBB,0xED,0x73,0xE9,0x2D,0xD1,0x75,0x39,0xD7,0xE7,0x24,0xDB,0xD8,0x4E,0x5F,0x43, -0x8F,0x9E,0xD0,0x14,0x39,0xBF,0x55,0x70,0x48,0x99,0x57,0x31,0xB4,0x9C,0xEE,0x4A, -0x98,0x03,0x96,0x30,0x1F,0x60,0x06,0xEE,0x1B,0x23,0xFE,0x81,0x60,0x23,0x1A,0x47, -0x62,0x85,0xA5,0xCC,0x19,0x34,0x80,0x6F,0xB3,0xAC,0x1A,0xE3,0x9F,0xF0,0x7B,0x48, -0xAD,0xD5,0x01,0xD9,0x67,0xB6,0xA9,0x72,0x93,0xEA,0x2D,0x66,0xB5,0xB2,0xB8,0xE4, -0x3D,0x3C,0xB2,0xEF,0x4C,0x8C,0xEA,0xEB,0x07,0xBF,0xAB,0x35,0x9A,0x55,0x86,0xBC, -0x18,0xA6,0xB5,0xA8,0x5E,0xB4,0x83,0x6C,0x6B,0x69,0x40,0xD3,0x9F,0xDC,0xF1,0xC3, -0x69,0x6B,0xB9,0xE1,0x6D,0x09,0xF4,0xF1,0xAA,0x50,0x76,0x0A,0x7A,0x7D,0x7A,0x17, -0xA1,0x55,0x96,0x42,0x99,0x31,0x09,0xDD,0x60,0x11,0x8D,0x05,0x30,0x7E,0xE6,0x8E, -0x46,0xD1,0x9D,0x14,0xDA,0xC7,0x17,0xE4,0x05,0x96,0x8C,0xC4,0x24,0xB5,0x1B,0xCF, -0x14,0x07,0xB2,0x40,0xF8,0xA3,0x9E,0x41,0x86,0xBC,0x04,0xD0,0x6B,0x96,0xC8,0x2A, -0x80,0x34,0xFD,0xBF,0xEF,0x06,0xA3,0xDD,0x58,0xC5,0x85,0x3D,0x3E,0x8F,0xFE,0x9E, -0x29,0xE0,0xB6,0xB8,0x09,0x68,0x19,0x1C,0x18,0x43, -}; - - -/* subject:/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./CN=Go Daddy Root Certificate Authority - G2 */ -/* issuer :/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./CN=Go Daddy Root Certificate Authority - G2 */ - - -const unsigned char Go_Daddy_Root_Certificate_Authority___G2_certificate[969]={ -0x30,0x82,0x03,0xC5,0x30,0x82,0x02,0xAD,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x00, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30, -0x81,0x83,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31, -0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x08,0x13,0x07,0x41,0x72,0x69,0x7A,0x6F,0x6E, -0x61,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x07,0x13,0x0A,0x53,0x63,0x6F,0x74, -0x74,0x73,0x64,0x61,0x6C,0x65,0x31,0x1A,0x30,0x18,0x06,0x03,0x55,0x04,0x0A,0x13, -0x11,0x47,0x6F,0x44,0x61,0x64,0x64,0x79,0x2E,0x63,0x6F,0x6D,0x2C,0x20,0x49,0x6E, -0x63,0x2E,0x31,0x31,0x30,0x2F,0x06,0x03,0x55,0x04,0x03,0x13,0x28,0x47,0x6F,0x20, -0x44,0x61,0x64,0x64,0x79,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79, -0x20,0x2D,0x20,0x47,0x32,0x30,0x1E,0x17,0x0D,0x30,0x39,0x30,0x39,0x30,0x31,0x30, -0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x37,0x31,0x32,0x33,0x31,0x32,0x33, -0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0x83,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x08,0x13,0x07, -0x41,0x72,0x69,0x7A,0x6F,0x6E,0x61,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x07, -0x13,0x0A,0x53,0x63,0x6F,0x74,0x74,0x73,0x64,0x61,0x6C,0x65,0x31,0x1A,0x30,0x18, -0x06,0x03,0x55,0x04,0x0A,0x13,0x11,0x47,0x6F,0x44,0x61,0x64,0x64,0x79,0x2E,0x63, -0x6F,0x6D,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x31,0x30,0x2F,0x06,0x03,0x55,0x04, -0x03,0x13,0x28,0x47,0x6F,0x20,0x44,0x61,0x64,0x64,0x79,0x20,0x52,0x6F,0x6F,0x74, -0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x32,0x30,0x82,0x01,0x22,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82, -0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xBF,0x71,0x62,0x08, -0xF1,0xFA,0x59,0x34,0xF7,0x1B,0xC9,0x18,0xA3,0xF7,0x80,0x49,0x58,0xE9,0x22,0x83, -0x13,0xA6,0xC5,0x20,0x43,0x01,0x3B,0x84,0xF1,0xE6,0x85,0x49,0x9F,0x27,0xEA,0xF6, -0x84,0x1B,0x4E,0xA0,0xB4,0xDB,0x70,0x98,0xC7,0x32,0x01,0xB1,0x05,0x3E,0x07,0x4E, -0xEE,0xF4,0xFA,0x4F,0x2F,0x59,0x30,0x22,0xE7,0xAB,0x19,0x56,0x6B,0xE2,0x80,0x07, -0xFC,0xF3,0x16,0x75,0x80,0x39,0x51,0x7B,0xE5,0xF9,0x35,0xB6,0x74,0x4E,0xA9,0x8D, -0x82,0x13,0xE4,0xB6,0x3F,0xA9,0x03,0x83,0xFA,0xA2,0xBE,0x8A,0x15,0x6A,0x7F,0xDE, -0x0B,0xC3,0xB6,0x19,0x14,0x05,0xCA,0xEA,0xC3,0xA8,0x04,0x94,0x3B,0x46,0x7C,0x32, -0x0D,0xF3,0x00,0x66,0x22,0xC8,0x8D,0x69,0x6D,0x36,0x8C,0x11,0x18,0xB7,0xD3,0xB2, -0x1C,0x60,0xB4,0x38,0xFA,0x02,0x8C,0xCE,0xD3,0xDD,0x46,0x07,0xDE,0x0A,0x3E,0xEB, -0x5D,0x7C,0xC8,0x7C,0xFB,0xB0,0x2B,0x53,0xA4,0x92,0x62,0x69,0x51,0x25,0x05,0x61, -0x1A,0x44,0x81,0x8C,0x2C,0xA9,0x43,0x96,0x23,0xDF,0xAC,0x3A,0x81,0x9A,0x0E,0x29, -0xC5,0x1C,0xA9,0xE9,0x5D,0x1E,0xB6,0x9E,0x9E,0x30,0x0A,0x39,0xCE,0xF1,0x88,0x80, -0xFB,0x4B,0x5D,0xCC,0x32,0xEC,0x85,0x62,0x43,0x25,0x34,0x02,0x56,0x27,0x01,0x91, -0xB4,0x3B,0x70,0x2A,0x3F,0x6E,0xB1,0xE8,0x9C,0x88,0x01,0x7D,0x9F,0xD4,0xF9,0xDB, -0x53,0x6D,0x60,0x9D,0xBF,0x2C,0xE7,0x58,0xAB,0xB8,0x5F,0x46,0xFC,0xCE,0xC4,0x1B, -0x03,0x3C,0x09,0xEB,0x49,0x31,0x5C,0x69,0x46,0xB3,0xE0,0x47,0x02,0x03,0x01,0x00, -0x01,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0x3A,0x9A,0x85,0x07,0x10,0x67,0x28,0xB6,0xEF,0xF6,0xBD,0x05,0x41,0x6E,0x20, -0xC1,0x94,0xDA,0x0F,0xDE,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x99,0xDB,0x5D,0x79,0xD5,0xF9,0x97, -0x59,0x67,0x03,0x61,0xF1,0x7E,0x3B,0x06,0x31,0x75,0x2D,0xA1,0x20,0x8E,0x4F,0x65, -0x87,0xB4,0xF7,0xA6,0x9C,0xBC,0xD8,0xE9,0x2F,0xD0,0xDB,0x5A,0xEE,0xCF,0x74,0x8C, -0x73,0xB4,0x38,0x42,0xDA,0x05,0x7B,0xF8,0x02,0x75,0xB8,0xFD,0xA5,0xB1,0xD7,0xAE, -0xF6,0xD7,0xDE,0x13,0xCB,0x53,0x10,0x7E,0x8A,0x46,0xD1,0x97,0xFA,0xB7,0x2E,0x2B, -0x11,0xAB,0x90,0xB0,0x27,0x80,0xF9,0xE8,0x9F,0x5A,0xE9,0x37,0x9F,0xAB,0xE4,0xDF, -0x6C,0xB3,0x85,0x17,0x9D,0x3D,0xD9,0x24,0x4F,0x79,0x91,0x35,0xD6,0x5F,0x04,0xEB, -0x80,0x83,0xAB,0x9A,0x02,0x2D,0xB5,0x10,0xF4,0xD8,0x90,0xC7,0x04,0x73,0x40,0xED, -0x72,0x25,0xA0,0xA9,0x9F,0xEC,0x9E,0xAB,0x68,0x12,0x99,0x57,0xC6,0x8F,0x12,0x3A, -0x09,0xA4,0xBD,0x44,0xFD,0x06,0x15,0x37,0xC1,0x9B,0xE4,0x32,0xA3,0xED,0x38,0xE8, -0xD8,0x64,0xF3,0x2C,0x7E,0x14,0xFC,0x02,0xEA,0x9F,0xCD,0xFF,0x07,0x68,0x17,0xDB, -0x22,0x90,0x38,0x2D,0x7A,0x8D,0xD1,0x54,0xF1,0x69,0xE3,0x5F,0x33,0xCA,0x7A,0x3D, -0x7B,0x0A,0xE3,0xCA,0x7F,0x5F,0x39,0xE5,0xE2,0x75,0xBA,0xC5,0x76,0x18,0x33,0xCE, -0x2C,0xF0,0x2F,0x4C,0xAD,0xF7,0xB1,0xE7,0xCE,0x4F,0xA8,0xC4,0x9B,0x4A,0x54,0x06, -0xC5,0x7F,0x7D,0xD5,0x08,0x0F,0xE2,0x1C,0xFE,0x7E,0x17,0xB8,0xAC,0x5E,0xF6,0xD4, -0x16,0xB2,0x43,0x09,0x0C,0x4D,0xF6,0xA7,0x6B,0xB4,0x99,0x84,0x65,0xCA,0x7A,0x88, -0xE2,0xE2,0x44,0xBE,0x5C,0xF7,0xEA,0x1C,0xF5, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=Secure Certificate Services */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=Secure Certificate Services */ - - -const unsigned char Comodo_Secure_Services_root_certificate[1091]={ -0x30,0x82,0x04,0x3F,0x30,0x82,0x03,0x27,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x7E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x24,0x30,0x22,0x06,0x03,0x55, -0x04,0x03,0x0C,0x1B,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x30, -0x1E,0x17,0x0D,0x30,0x34,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A, -0x17,0x0D,0x32,0x38,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30, -0x7E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x24,0x30,0x22,0x06,0x03,0x55, -0x04,0x03,0x0C,0x1B,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x30, -0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01, -0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00, -0xC0,0x71,0x33,0x82,0x8A,0xD0,0x70,0xEB,0x73,0x87,0x82,0x40,0xD5,0x1D,0xE4,0xCB, -0xC9,0x0E,0x42,0x90,0xF9,0xDE,0x34,0xB9,0xA1,0xBA,0x11,0xF4,0x25,0x85,0xF3,0xCC, -0x72,0x6D,0xF2,0x7B,0x97,0x6B,0xB3,0x07,0xF1,0x77,0x24,0x91,0x5F,0x25,0x8F,0xF6, -0x74,0x3D,0xE4,0x80,0xC2,0xF8,0x3C,0x0D,0xF3,0xBF,0x40,0xEA,0xF7,0xC8,0x52,0xD1, -0x72,0x6F,0xEF,0xC8,0xAB,0x41,0xB8,0x6E,0x2E,0x17,0x2A,0x95,0x69,0x0C,0xCD,0xD2, -0x1E,0x94,0x7B,0x2D,0x94,0x1D,0xAA,0x75,0xD7,0xB3,0x98,0xCB,0xAC,0xBC,0x64,0x53, -0x40,0xBC,0x8F,0xAC,0xAC,0x36,0xCB,0x5C,0xAD,0xBB,0xDD,0xE0,0x94,0x17,0xEC,0xD1, -0x5C,0xD0,0xBF,0xEF,0xA5,0x95,0xC9,0x90,0xC5,0xB0,0xAC,0xFB,0x1B,0x43,0xDF,0x7A, -0x08,0x5D,0xB7,0xB8,0xF2,0x40,0x1B,0x2B,0x27,0x9E,0x50,0xCE,0x5E,0x65,0x82,0x88, -0x8C,0x5E,0xD3,0x4E,0x0C,0x7A,0xEA,0x08,0x91,0xB6,0x36,0xAA,0x2B,0x42,0xFB,0xEA, -0xC2,0xA3,0x39,0xE5,0xDB,0x26,0x38,0xAD,0x8B,0x0A,0xEE,0x19,0x63,0xC7,0x1C,0x24, -0xDF,0x03,0x78,0xDA,0xE6,0xEA,0xC1,0x47,0x1A,0x0B,0x0B,0x46,0x09,0xDD,0x02,0xFC, -0xDE,0xCB,0x87,0x5F,0xD7,0x30,0x63,0x68,0xA1,0xAE,0xDC,0x32,0xA1,0xBA,0xBE,0xFE, -0x44,0xAB,0x68,0xB6,0xA5,0x17,0x15,0xFD,0xBD,0xD5,0xA7,0xA7,0x9A,0xE4,0x44,0x33, -0xE9,0x88,0x8E,0xFC,0xED,0x51,0xEB,0x93,0x71,0x4E,0xAD,0x01,0xE7,0x44,0x8E,0xAB, -0x2D,0xCB,0xA8,0xFE,0x01,0x49,0x48,0xF0,0xC0,0xDD,0xC7,0x68,0xD8,0x92,0xFE,0x3D, -0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xC7,0x30,0x81,0xC4,0x30,0x1D,0x06,0x03,0x55, -0x1D,0x0E,0x04,0x16,0x04,0x14,0x3C,0xD8,0x93,0x88,0xC2,0xC0,0x82,0x09,0xCC,0x01, -0x99,0x06,0x93,0x20,0xE9,0x9E,0x70,0x09,0x63,0x4F,0x30,0x0E,0x06,0x03,0x55,0x1D, -0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D, -0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x81,0x81,0x06,0x03, -0x55,0x1D,0x1F,0x04,0x7A,0x30,0x78,0x30,0x3B,0xA0,0x39,0xA0,0x37,0x86,0x35,0x68, -0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x63,0x6F,0x6D,0x6F,0x64,0x6F, -0x63,0x61,0x2E,0x63,0x6F,0x6D,0x2F,0x53,0x65,0x63,0x75,0x72,0x65,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73, -0x2E,0x63,0x72,0x6C,0x30,0x39,0xA0,0x37,0xA0,0x35,0x86,0x33,0x68,0x74,0x74,0x70, -0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x63,0x6F,0x6D,0x6F,0x64,0x6F,0x2E,0x6E,0x65, -0x74,0x2F,0x53,0x65,0x63,0x75,0x72,0x65,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x65,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x2E,0x63,0x72,0x6C,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82, -0x01,0x01,0x00,0x87,0x01,0x6D,0x23,0x1D,0x7E,0x5B,0x17,0x7D,0xC1,0x61,0x32,0xCF, -0x8F,0xE7,0xF3,0x8A,0x94,0x59,0x66,0xE0,0x9E,0x28,0xA8,0x5E,0xD3,0xB7,0xF4,0x34, -0xE6,0xAA,0x39,0xB2,0x97,0x16,0xC5,0x82,0x6F,0x32,0xA4,0xE9,0x8C,0xE7,0xAF,0xFD, -0xEF,0xC2,0xE8,0xB9,0x4B,0xAA,0xA3,0xF4,0xE6,0xDA,0x8D,0x65,0x21,0xFB,0xBA,0x80, -0xEB,0x26,0x28,0x85,0x1A,0xFE,0x39,0x8C,0xDE,0x5B,0x04,0x04,0xB4,0x54,0xF9,0xA3, -0x67,0x9E,0x41,0xFA,0x09,0x52,0xCC,0x05,0x48,0xA8,0xC9,0x3F,0x21,0x04,0x1E,0xCE, -0x48,0x6B,0xFC,0x85,0xE8,0xC2,0x7B,0xAF,0x7F,0xB7,0xCC,0xF8,0x5F,0x3A,0xFD,0x35, -0xC6,0x0D,0xEF,0x97,0xDC,0x4C,0xAB,0x11,0xE1,0x6B,0xCB,0x31,0xD1,0x6C,0xFB,0x48, -0x80,0xAB,0xDC,0x9C,0x37,0xB8,0x21,0x14,0x4B,0x0D,0x71,0x3D,0xEC,0x83,0x33,0x6E, -0xD1,0x6E,0x32,0x16,0xEC,0x98,0xC7,0x16,0x8B,0x59,0xA6,0x34,0xAB,0x05,0x57,0x2D, -0x93,0xF7,0xAA,0x13,0xCB,0xD2,0x13,0xE2,0xB7,0x2E,0x3B,0xCD,0x6B,0x50,0x17,0x09, -0x68,0x3E,0xB5,0x26,0x57,0xEE,0xB6,0xE0,0xB6,0xDD,0xB9,0x29,0x80,0x79,0x7D,0x8F, -0xA3,0xF0,0xA4,0x28,0xA4,0x15,0xC4,0x85,0xF4,0x27,0xD4,0x6B,0xBF,0xE5,0x5C,0xE4, -0x65,0x02,0x76,0x54,0xB4,0xE3,0x37,0x66,0x24,0xD3,0x19,0x61,0xC8,0x52,0x10,0xE5, -0x8B,0x37,0x9A,0xB9,0xA9,0xF9,0x1D,0xBF,0xEA,0x99,0x92,0x61,0x96,0xFF,0x01,0xCD, -0xA1,0x5F,0x0D,0xBC,0x71,0xBC,0x0E,0xAC,0x0B,0x1D,0x47,0x45,0x1D,0xC1,0xEC,0x7C, -0xEC,0xFD,0x29, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Trusted Root G4 */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Trusted Root G4 */ - - -const unsigned char DigiCert_Trusted_Root_G4_certificate[1428]={ -0x30,0x82,0x05,0x90,0x30,0x82,0x03,0x78,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x05, -0x9B,0x1B,0x57,0x9E,0x8E,0x21,0x32,0xE2,0x39,0x07,0xBD,0xA7,0x77,0x75,0x5C,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,0x05,0x00,0x30,0x62, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30, -0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77, -0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31, -0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x44,0x69,0x67,0x69,0x43,0x65, -0x72,0x74,0x20,0x54,0x72,0x75,0x73,0x74,0x65,0x64,0x20,0x52,0x6F,0x6F,0x74,0x20, -0x47,0x34,0x30,0x1E,0x17,0x0D,0x31,0x33,0x30,0x38,0x30,0x31,0x31,0x32,0x30,0x30, -0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x35,0x31,0x32,0x30,0x30,0x30, -0x30,0x5A,0x30,0x62,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69, -0x43,0x65,0x72,0x74,0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04, -0x0B,0x13,0x10,0x77,0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E, -0x63,0x6F,0x6D,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x44,0x69, -0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x54,0x72,0x75,0x73,0x74,0x65,0x64,0x20,0x52, -0x6F,0x6F,0x74,0x20,0x47,0x34,0x30,0x82,0x02,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x02,0x0F,0x00,0x30,0x82, -0x02,0x0A,0x02,0x82,0x02,0x01,0x00,0xBF,0xE6,0x90,0x73,0x68,0xDE,0xBB,0xE4,0x5D, -0x4A,0x3C,0x30,0x22,0x30,0x69,0x33,0xEC,0xC2,0xA7,0x25,0x2E,0xC9,0x21,0x3D,0xF2, -0x8A,0xD8,0x59,0xC2,0xE1,0x29,0xA7,0x3D,0x58,0xAB,0x76,0x9A,0xCD,0xAE,0x7B,0x1B, -0x84,0x0D,0xC4,0x30,0x1F,0xF3,0x1B,0xA4,0x38,0x16,0xEB,0x56,0xC6,0x97,0x6D,0x1D, -0xAB,0xB2,0x79,0xF2,0xCA,0x11,0xD2,0xE4,0x5F,0xD6,0x05,0x3C,0x52,0x0F,0x52,0x1F, -0xC6,0x9E,0x15,0xA5,0x7E,0xBE,0x9F,0xA9,0x57,0x16,0x59,0x55,0x72,0xAF,0x68,0x93, -0x70,0xC2,0xB2,0xBA,0x75,0x99,0x6A,0x73,0x32,0x94,0xD1,0x10,0x44,0x10,0x2E,0xDF, -0x82,0xF3,0x07,0x84,0xE6,0x74,0x3B,0x6D,0x71,0xE2,0x2D,0x0C,0x1B,0xEE,0x20,0xD5, -0xC9,0x20,0x1D,0x63,0x29,0x2D,0xCE,0xEC,0x5E,0x4E,0xC8,0x93,0xF8,0x21,0x61,0x9B, -0x34,0xEB,0x05,0xC6,0x5E,0xEC,0x5B,0x1A,0xBC,0xEB,0xC9,0xCF,0xCD,0xAC,0x34,0x40, -0x5F,0xB1,0x7A,0x66,0xEE,0x77,0xC8,0x48,0xA8,0x66,0x57,0x57,0x9F,0x54,0x58,0x8E, -0x0C,0x2B,0xB7,0x4F,0xA7,0x30,0xD9,0x56,0xEE,0xCA,0x7B,0x5D,0xE3,0xAD,0xC9,0x4F, -0x5E,0xE5,0x35,0xE7,0x31,0xCB,0xDA,0x93,0x5E,0xDC,0x8E,0x8F,0x80,0xDA,0xB6,0x91, -0x98,0x40,0x90,0x79,0xC3,0x78,0xC7,0xB6,0xB1,0xC4,0xB5,0x6A,0x18,0x38,0x03,0x10, -0x8D,0xD8,0xD4,0x37,0xA4,0x2E,0x05,0x7D,0x88,0xF5,0x82,0x3E,0x10,0x91,0x70,0xAB, -0x55,0x82,0x41,0x32,0xD7,0xDB,0x04,0x73,0x2A,0x6E,0x91,0x01,0x7C,0x21,0x4C,0xD4, -0xBC,0xAE,0x1B,0x03,0x75,0x5D,0x78,0x66,0xD9,0x3A,0x31,0x44,0x9A,0x33,0x40,0xBF, -0x08,0xD7,0x5A,0x49,0xA4,0xC2,0xE6,0xA9,0xA0,0x67,0xDD,0xA4,0x27,0xBC,0xA1,0x4F, -0x39,0xB5,0x11,0x58,0x17,0xF7,0x24,0x5C,0x46,0x8F,0x64,0xF7,0xC1,0x69,0x88,0x76, -0x98,0x76,0x3D,0x59,0x5D,0x42,0x76,0x87,0x89,0x97,0x69,0x7A,0x48,0xF0,0xE0,0xA2, -0x12,0x1B,0x66,0x9A,0x74,0xCA,0xDE,0x4B,0x1E,0xE7,0x0E,0x63,0xAE,0xE6,0xD4,0xEF, -0x92,0x92,0x3A,0x9E,0x3D,0xDC,0x00,0xE4,0x45,0x25,0x89,0xB6,0x9A,0x44,0x19,0x2B, -0x7E,0xC0,0x94,0xB4,0xD2,0x61,0x6D,0xEB,0x33,0xD9,0xC5,0xDF,0x4B,0x04,0x00,0xCC, -0x7D,0x1C,0x95,0xC3,0x8F,0xF7,0x21,0xB2,0xB2,0x11,0xB7,0xBB,0x7F,0xF2,0xD5,0x8C, -0x70,0x2C,0x41,0x60,0xAA,0xB1,0x63,0x18,0x44,0x95,0x1A,0x76,0x62,0x7E,0xF6,0x80, -0xB0,0xFB,0xE8,0x64,0xA6,0x33,0xD1,0x89,0x07,0xE1,0xBD,0xB7,0xE6,0x43,0xA4,0x18, -0xB8,0xA6,0x77,0x01,0xE1,0x0F,0x94,0x0C,0x21,0x1D,0xB2,0x54,0x29,0x25,0x89,0x6C, -0xE5,0x0E,0x52,0x51,0x47,0x74,0xBE,0x26,0xAC,0xB6,0x41,0x75,0xDE,0x7A,0xAC,0x5F, -0x8D,0x3F,0xC9,0xBC,0xD3,0x41,0x11,0x12,0x5B,0xE5,0x10,0x50,0xEB,0x31,0xC5,0xCA, -0x72,0x16,0x22,0x09,0xDF,0x7C,0x4C,0x75,0x3F,0x63,0xEC,0x21,0x5F,0xC4,0x20,0x51, -0x6B,0x6F,0xB1,0xAB,0x86,0x8B,0x4F,0xC2,0xD6,0x45,0x5F,0x9D,0x20,0xFC,0xA1,0x1E, -0xC5,0xC0,0x8F,0xA2,0xB1,0x7E,0x0A,0x26,0x99,0xF5,0xE4,0x69,0x2F,0x98,0x1D,0x2D, -0xF5,0xD9,0xA9,0xB2,0x1D,0xE5,0x1B,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40, -0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01, -0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01, -0x86,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xEC,0xD7,0xE3,0x82, -0xD2,0x71,0x5D,0x64,0x4C,0xDF,0x2E,0x67,0x3F,0xE7,0xBA,0x98,0xAE,0x1C,0x0F,0x4F, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,0x05,0x00,0x03, -0x82,0x02,0x01,0x00,0xBB,0x61,0xD9,0x7D,0xA9,0x6C,0xBE,0x17,0xC4,0x91,0x1B,0xC3, -0xA1,0xA2,0x00,0x8D,0xE3,0x64,0x68,0x0F,0x56,0xCF,0x77,0xAE,0x70,0xF9,0xFD,0x9A, -0x4A,0x99,0xB9,0xC9,0x78,0x5C,0x0C,0x0C,0x5F,0xE4,0xE6,0x14,0x29,0x56,0x0B,0x36, -0x49,0x5D,0x44,0x63,0xE0,0xAD,0x9C,0x96,0x18,0x66,0x1B,0x23,0x0D,0x3D,0x79,0xE9, -0x6D,0x6B,0xD6,0x54,0xF8,0xD2,0x3C,0xC1,0x43,0x40,0xAE,0x1D,0x50,0xF5,0x52,0xFC, -0x90,0x3B,0xBB,0x98,0x99,0x69,0x6B,0xC7,0xC1,0xA7,0xA8,0x68,0xA4,0x27,0xDC,0x9D, -0xF9,0x27,0xAE,0x30,0x85,0xB9,0xF6,0x67,0x4D,0x3A,0x3E,0x8F,0x59,0x39,0x22,0x53, -0x44,0xEB,0xC8,0x5D,0x03,0xCA,0xED,0x50,0x7A,0x7D,0x62,0x21,0x0A,0x80,0xC8,0x73, -0x66,0xD1,0xA0,0x05,0x60,0x5F,0xE8,0xA5,0xB4,0xA7,0xAF,0xA8,0xF7,0x6D,0x35,0x9C, -0x7C,0x5A,0x8A,0xD6,0xA2,0x38,0x99,0xF3,0x78,0x8B,0xF4,0x4D,0xD2,0x20,0x0B,0xDE, -0x04,0xEE,0x8C,0x9B,0x47,0x81,0x72,0x0D,0xC0,0x14,0x32,0xEF,0x30,0x59,0x2E,0xAE, -0xE0,0x71,0xF2,0x56,0xE4,0x6A,0x97,0x6F,0x92,0x50,0x6D,0x96,0x8D,0x68,0x7A,0x9A, -0xB2,0x36,0x14,0x7A,0x06,0xF2,0x24,0xB9,0x09,0x11,0x50,0xD7,0x08,0xB1,0xB8,0x89, -0x7A,0x84,0x23,0x61,0x42,0x29,0xE5,0xA3,0xCD,0xA2,0x20,0x41,0xD7,0xD1,0x9C,0x64, -0xD9,0xEA,0x26,0xA1,0x8B,0x14,0xD7,0x4C,0x19,0xB2,0x50,0x41,0x71,0x3D,0x3F,0x4D, -0x70,0x23,0x86,0x0C,0x4A,0xDC,0x81,0xD2,0xCC,0x32,0x94,0x84,0x0D,0x08,0x09,0x97, -0x1C,0x4F,0xC0,0xEE,0x6B,0x20,0x74,0x30,0xD2,0xE0,0x39,0x34,0x10,0x85,0x21,0x15, -0x01,0x08,0xE8,0x55,0x32,0xDE,0x71,0x49,0xD9,0x28,0x17,0x50,0x4D,0xE6,0xBE,0x4D, -0xD1,0x75,0xAC,0xD0,0xCA,0xFB,0x41,0xB8,0x43,0xA5,0xAA,0xD3,0xC3,0x05,0x44,0x4F, -0x2C,0x36,0x9B,0xE2,0xFA,0xE2,0x45,0xB8,0x23,0x53,0x6C,0x06,0x6F,0x67,0x55,0x7F, -0x46,0xB5,0x4C,0x3F,0x6E,0x28,0x5A,0x79,0x26,0xD2,0xA4,0xA8,0x62,0x97,0xD2,0x1E, -0xE2,0xED,0x4A,0x8B,0xBC,0x1B,0xFD,0x47,0x4A,0x0D,0xDF,0x67,0x66,0x7E,0xB2,0x5B, -0x41,0xD0,0x3B,0xE4,0xF4,0x3B,0xF4,0x04,0x63,0xE9,0xEF,0xC2,0x54,0x00,0x51,0xA0, -0x8A,0x2A,0xC9,0xCE,0x78,0xCC,0xD5,0xEA,0x87,0x04,0x18,0xB3,0xCE,0xAF,0x49,0x88, -0xAF,0xF3,0x92,0x99,0xB6,0xB3,0xE6,0x61,0x0F,0xD2,0x85,0x00,0xE7,0x50,0x1A,0xE4, -0x1B,0x95,0x9D,0x19,0xA1,0xB9,0x9C,0xB1,0x9B,0xB1,0x00,0x1E,0xEF,0xD0,0x0F,0x4F, -0x42,0x6C,0xC9,0x0A,0xBC,0xEE,0x43,0xFA,0x3A,0x71,0xA5,0xC8,0x4D,0x26,0xA5,0x35, -0xFD,0x89,0x5D,0xBC,0x85,0x62,0x1D,0x32,0xD2,0xA0,0x2B,0x54,0xED,0x9A,0x57,0xC1, -0xDB,0xFA,0x10,0xCF,0x19,0xB7,0x8B,0x4A,0x1B,0x8F,0x01,0xB6,0x27,0x95,0x53,0xE8, -0xB6,0x89,0x6D,0x5B,0xBC,0x68,0xD4,0x23,0xE8,0x8B,0x51,0xA2,0x56,0xF9,0xF0,0xA6, -0x80,0xA0,0xD6,0x1E,0xB3,0xBC,0x0F,0x0F,0x53,0x75,0x29,0xAA,0xEA,0x13,0x77,0xE4, -0xDE,0x8C,0x81,0x21,0xAD,0x07,0x10,0x47,0x11,0xAD,0x87,0x3D,0x07,0xD1,0x75,0xBC, -0xCF,0xF3,0x66,0x7E, -}; - - -/* subject:/OU=GlobalSign ECC Root CA - R5/O=GlobalSign/CN=GlobalSign */ -/* issuer :/OU=GlobalSign ECC Root CA - R5/O=GlobalSign/CN=GlobalSign */ - - -const unsigned char GlobalSign_ECC_Root_CA___R5_certificate[546]={ -0x30,0x82,0x02,0x1E,0x30,0x82,0x01,0xA4,0xA0,0x03,0x02,0x01,0x02,0x02,0x11,0x60, -0x59,0x49,0xE0,0x26,0x2E,0xBB,0x55,0xF9,0x0A,0x77,0x8A,0x71,0xF9,0x4A,0xD8,0x6C, -0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x50,0x31,0x24, -0x30,0x22,0x06,0x03,0x55,0x04,0x0B,0x13,0x1B,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53, -0x69,0x67,0x6E,0x20,0x45,0x43,0x43,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20, -0x2D,0x20,0x52,0x35,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0A,0x13,0x0A,0x47, -0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x31,0x13,0x30,0x11,0x06,0x03,0x55, -0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x30,0x1E, -0x17,0x0D,0x31,0x32,0x31,0x31,0x31,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17, -0x0D,0x33,0x38,0x30,0x31,0x31,0x39,0x30,0x33,0x31,0x34,0x30,0x37,0x5A,0x30,0x50, -0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x0B,0x13,0x1B,0x47,0x6C,0x6F,0x62,0x61, -0x6C,0x53,0x69,0x67,0x6E,0x20,0x45,0x43,0x43,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43, -0x41,0x20,0x2D,0x20,0x52,0x35,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0A,0x13, -0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x31,0x13,0x30,0x11,0x06, -0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E, -0x30,0x76,0x30,0x10,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05,0x2B, -0x81,0x04,0x00,0x22,0x03,0x62,0x00,0x04,0x47,0x45,0x0E,0x96,0xFB,0x7D,0x5D,0xBF, -0xE9,0x39,0xD1,0x21,0xF8,0x9F,0x0B,0xB6,0xD5,0x7B,0x1E,0x92,0x3A,0x48,0x59,0x1C, -0xF0,0x62,0x31,0x2D,0xC0,0x7A,0x28,0xFE,0x1A,0xA7,0x5C,0xB3,0xB6,0xCC,0x97,0xE7, -0x45,0xD4,0x58,0xFA,0xD1,0x77,0x6D,0x43,0xA2,0xC0,0x87,0x65,0x34,0x0A,0x1F,0x7A, -0xDD,0xEB,0x3C,0x33,0xA1,0xC5,0x9D,0x4D,0xA4,0x6F,0x41,0x95,0x38,0x7F,0xC9,0x1E, -0x84,0xEB,0xD1,0x9E,0x49,0x92,0x87,0x94,0x87,0x0C,0x3A,0x85,0x4A,0x66,0x9F,0x9D, -0x59,0x93,0x4D,0x97,0x61,0x06,0x86,0x4A,0xA3,0x42,0x30,0x40,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03, -0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x3D,0xE6,0x29,0x48,0x9B,0xEA,0x07,0xCA, -0x21,0x44,0x4A,0x26,0xDE,0x6E,0xDE,0xD2,0x83,0xD0,0x9F,0x59,0x30,0x0A,0x06,0x08, -0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x03,0x68,0x00,0x30,0x65,0x02,0x31,0x00, -0xE5,0x69,0x12,0xC9,0x6E,0xDB,0xC6,0x31,0xBA,0x09,0x41,0xE1,0x97,0xF8,0xFB,0xFD, -0x9A,0xE2,0x7D,0x12,0xC9,0xED,0x7C,0x64,0xD3,0xCB,0x05,0x25,0x8B,0x56,0xD9,0xA0, -0xE7,0x5E,0x5D,0x4E,0x0B,0x83,0x9C,0x5B,0x76,0x29,0xA0,0x09,0x26,0x21,0x6A,0x62, -0x02,0x30,0x71,0xD2,0xB5,0x8F,0x5C,0xEA,0x3B,0xE1,0x78,0x09,0x85,0xA8,0x75,0x92, -0x3B,0xC8,0x5C,0xFD,0x48,0xEF,0x0D,0x74,0x22,0xA8,0x08,0xE2,0x6E,0xC5,0x49,0xCE, -0xC7,0x0C,0xBC,0xA7,0x61,0x69,0xF1,0xF7,0x3B,0xE1,0x2A,0xCB,0xF9,0x2B,0xF3,0x66, -0x90,0x37, -}; - - -/* subject:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware */ -/* issuer :/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware */ - - -const unsigned char UTN_USERFirst_Hardware_Root_CA_certificate[1144]={ -0x30,0x82,0x04,0x74,0x30,0x82,0x03,0x5C,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x44, -0xBE,0x0C,0x8B,0x50,0x00,0x24,0xB4,0x11,0xD3,0x36,0x2A,0xFE,0x65,0x0A,0xFD,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0x97,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x08,0x13,0x02,0x55,0x54,0x31,0x17,0x30,0x15,0x06, -0x03,0x55,0x04,0x07,0x13,0x0E,0x53,0x61,0x6C,0x74,0x20,0x4C,0x61,0x6B,0x65,0x20, -0x43,0x69,0x74,0x79,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55,0x04,0x0A,0x13,0x15,0x54, -0x68,0x65,0x20,0x55,0x53,0x45,0x52,0x54,0x52,0x55,0x53,0x54,0x20,0x4E,0x65,0x74, -0x77,0x6F,0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x0B,0x13,0x18,0x68, -0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x75,0x73,0x65,0x72,0x74,0x72, -0x75,0x73,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03, -0x13,0x16,0x55,0x54,0x4E,0x2D,0x55,0x53,0x45,0x52,0x46,0x69,0x72,0x73,0x74,0x2D, -0x48,0x61,0x72,0x64,0x77,0x61,0x72,0x65,0x30,0x1E,0x17,0x0D,0x39,0x39,0x30,0x37, -0x30,0x39,0x31,0x38,0x31,0x30,0x34,0x32,0x5A,0x17,0x0D,0x31,0x39,0x30,0x37,0x30, -0x39,0x31,0x38,0x31,0x39,0x32,0x32,0x5A,0x30,0x81,0x97,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x08,0x13,0x02,0x55,0x54,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x07,0x13,0x0E, -0x53,0x61,0x6C,0x74,0x20,0x4C,0x61,0x6B,0x65,0x20,0x43,0x69,0x74,0x79,0x31,0x1E, -0x30,0x1C,0x06,0x03,0x55,0x04,0x0A,0x13,0x15,0x54,0x68,0x65,0x20,0x55,0x53,0x45, -0x52,0x54,0x52,0x55,0x53,0x54,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x21, -0x30,0x1F,0x06,0x03,0x55,0x04,0x0B,0x13,0x18,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F, -0x77,0x77,0x77,0x2E,0x75,0x73,0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x2E,0x63,0x6F, -0x6D,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x13,0x16,0x55,0x54,0x4E,0x2D, -0x55,0x53,0x45,0x52,0x46,0x69,0x72,0x73,0x74,0x2D,0x48,0x61,0x72,0x64,0x77,0x61, -0x72,0x65,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82, -0x01,0x01,0x00,0xB1,0xF7,0xC3,0x38,0x3F,0xB4,0xA8,0x7F,0xCF,0x39,0x82,0x51,0x67, -0xD0,0x6D,0x9F,0xD2,0xFF,0x58,0xF3,0xE7,0x9F,0x2B,0xEC,0x0D,0x89,0x54,0x99,0xB9, -0x38,0x99,0x16,0xF7,0xE0,0x21,0x79,0x48,0xC2,0xBB,0x61,0x74,0x12,0x96,0x1D,0x3C, -0x6A,0x72,0xD5,0x3C,0x10,0x67,0x3A,0x39,0xED,0x2B,0x13,0xCD,0x66,0xEB,0x95,0x09, -0x33,0xA4,0x6C,0x97,0xB1,0xE8,0xC6,0xEC,0xC1,0x75,0x79,0x9C,0x46,0x5E,0x8D,0xAB, -0xD0,0x6A,0xFD,0xB9,0x2A,0x55,0x17,0x10,0x54,0xB3,0x19,0xF0,0x9A,0xF6,0xF1,0xB1, -0x5D,0xB6,0xA7,0x6D,0xFB,0xE0,0x71,0x17,0x6B,0xA2,0x88,0xFB,0x00,0xDF,0xFE,0x1A, -0x31,0x77,0x0C,0x9A,0x01,0x7A,0xB1,0x32,0xE3,0x2B,0x01,0x07,0x38,0x6E,0xC3,0xA5, -0x5E,0x23,0xBC,0x45,0x9B,0x7B,0x50,0xC1,0xC9,0x30,0x8F,0xDB,0xE5,0x2B,0x7A,0xD3, -0x5B,0xFB,0x33,0x40,0x1E,0xA0,0xD5,0x98,0x17,0xBC,0x8B,0x87,0xC3,0x89,0xD3,0x5D, -0xA0,0x8E,0xB2,0xAA,0xAA,0xF6,0x8E,0x69,0x88,0x06,0xC5,0xFA,0x89,0x21,0xF3,0x08, -0x9D,0x69,0x2E,0x09,0x33,0x9B,0x29,0x0D,0x46,0x0F,0x8C,0xCC,0x49,0x34,0xB0,0x69, -0x51,0xBD,0xF9,0x06,0xCD,0x68,0xAD,0x66,0x4C,0xBC,0x3E,0xAC,0x61,0xBD,0x0A,0x88, -0x0E,0xC8,0xDF,0x3D,0xEE,0x7C,0x04,0x4C,0x9D,0x0A,0x5E,0x6B,0x91,0xD6,0xEE,0xC7, -0xED,0x28,0x8D,0xAB,0x4D,0x87,0x89,0x73,0xD0,0x6E,0xA4,0xD0,0x1E,0x16,0x8B,0x14, -0xE1,0x76,0x44,0x03,0x7F,0x63,0xAC,0xE4,0xCD,0x49,0x9C,0xC5,0x92,0xF4,0xAB,0x32, -0xA1,0x48,0x5B,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xB9,0x30,0x81,0xB6,0x30,0x0B, -0x06,0x03,0x55,0x1D,0x0F,0x04,0x04,0x03,0x02,0x01,0xC6,0x30,0x0F,0x06,0x03,0x55, -0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03, -0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xA1,0x72,0x5F,0x26,0x1B,0x28,0x98,0x43,0x95, -0x5D,0x07,0x37,0xD5,0x85,0x96,0x9D,0x4B,0xD2,0xC3,0x45,0x30,0x44,0x06,0x03,0x55, -0x1D,0x1F,0x04,0x3D,0x30,0x3B,0x30,0x39,0xA0,0x37,0xA0,0x35,0x86,0x33,0x68,0x74, -0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x75,0x73,0x65,0x72,0x74,0x72,0x75, -0x73,0x74,0x2E,0x63,0x6F,0x6D,0x2F,0x55,0x54,0x4E,0x2D,0x55,0x53,0x45,0x52,0x46, -0x69,0x72,0x73,0x74,0x2D,0x48,0x61,0x72,0x64,0x77,0x61,0x72,0x65,0x2E,0x63,0x72, -0x6C,0x30,0x31,0x06,0x03,0x55,0x1D,0x25,0x04,0x2A,0x30,0x28,0x06,0x08,0x2B,0x06, -0x01,0x05,0x05,0x07,0x03,0x01,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x05, -0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x06,0x06,0x08,0x2B,0x06,0x01,0x05, -0x05,0x07,0x03,0x07,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x47,0x19,0x0F,0xDE,0x74,0xC6,0x99,0x97, -0xAF,0xFC,0xAD,0x28,0x5E,0x75,0x8E,0xEB,0x2D,0x67,0xEE,0x4E,0x7B,0x2B,0xD7,0x0C, -0xFF,0xF6,0xDE,0xCB,0x55,0xA2,0x0A,0xE1,0x4C,0x54,0x65,0x93,0x60,0x6B,0x9F,0x12, -0x9C,0xAD,0x5E,0x83,0x2C,0xEB,0x5A,0xAE,0xC0,0xE4,0x2D,0xF4,0x00,0x63,0x1D,0xB8, -0xC0,0x6C,0xF2,0xCF,0x49,0xBB,0x4D,0x93,0x6F,0x06,0xA6,0x0A,0x22,0xB2,0x49,0x62, -0x08,0x4E,0xFF,0xC8,0xC8,0x14,0xB2,0x88,0x16,0x5D,0xE7,0x01,0xE4,0x12,0x95,0xE5, -0x45,0x34,0xB3,0x8B,0x69,0xBD,0xCF,0xB4,0x85,0x8F,0x75,0x51,0x9E,0x7D,0x3A,0x38, -0x3A,0x14,0x48,0x12,0xC6,0xFB,0xA7,0x3B,0x1A,0x8D,0x0D,0x82,0x40,0x07,0xE8,0x04, -0x08,0x90,0xA1,0x89,0xCB,0x19,0x50,0xDF,0xCA,0x1C,0x01,0xBC,0x1D,0x04,0x19,0x7B, -0x10,0x76,0x97,0x3B,0xEE,0x90,0x90,0xCA,0xC4,0x0E,0x1F,0x16,0x6E,0x75,0xEF,0x33, -0xF8,0xD3,0x6F,0x5B,0x1E,0x96,0xE3,0xE0,0x74,0x77,0x74,0x7B,0x8A,0xA2,0x6E,0x2D, -0xDD,0x76,0xD6,0x39,0x30,0x82,0xF0,0xAB,0x9C,0x52,0xF2,0x2A,0xC7,0xAF,0x49,0x5E, -0x7E,0xC7,0x68,0xE5,0x82,0x81,0xC8,0x6A,0x27,0xF9,0x27,0x88,0x2A,0xD5,0x58,0x50, -0x95,0x1F,0xF0,0x3B,0x1C,0x57,0xBB,0x7D,0x14,0x39,0x62,0x2B,0x9A,0xC9,0x94,0x92, -0x2A,0xA3,0x22,0x0C,0xFF,0x89,0x26,0x7D,0x5F,0x23,0x2B,0x47,0xD7,0x15,0x1D,0xA9, -0x6A,0x9E,0x51,0x0D,0x2A,0x51,0x9E,0x81,0xF9,0xD4,0x3B,0x5E,0x70,0x12,0x7F,0x10, -0x32,0x9C,0x1E,0xBB,0x9D,0xF8,0x66,0xA8, -}; - - -/* subject:/OU=GlobalSign ECC Root CA - R4/O=GlobalSign/CN=GlobalSign */ -/* issuer :/OU=GlobalSign ECC Root CA - R4/O=GlobalSign/CN=GlobalSign */ - - -const unsigned char GlobalSign_ECC_Root_CA___R4_certificate[485]={ -0x30,0x82,0x01,0xE1,0x30,0x82,0x01,0x87,0xA0,0x03,0x02,0x01,0x02,0x02,0x11,0x2A, -0x38,0xA4,0x1C,0x96,0x0A,0x04,0xDE,0x42,0xB2,0x28,0xA5,0x0B,0xE8,0x34,0x98,0x02, -0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,0x30,0x50,0x31,0x24, -0x30,0x22,0x06,0x03,0x55,0x04,0x0B,0x13,0x1B,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53, -0x69,0x67,0x6E,0x20,0x45,0x43,0x43,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20, -0x2D,0x20,0x52,0x34,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0A,0x13,0x0A,0x47, -0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x31,0x13,0x30,0x11,0x06,0x03,0x55, -0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x30,0x1E, -0x17,0x0D,0x31,0x32,0x31,0x31,0x31,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17, -0x0D,0x33,0x38,0x30,0x31,0x31,0x39,0x30,0x33,0x31,0x34,0x30,0x37,0x5A,0x30,0x50, -0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x0B,0x13,0x1B,0x47,0x6C,0x6F,0x62,0x61, -0x6C,0x53,0x69,0x67,0x6E,0x20,0x45,0x43,0x43,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43, -0x41,0x20,0x2D,0x20,0x52,0x34,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0A,0x13, -0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x31,0x13,0x30,0x11,0x06, -0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E, -0x30,0x59,0x30,0x13,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x08,0x2A, -0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,0x03,0x42,0x00,0x04,0xB8,0xC6,0x79,0xD3,0x8F, -0x6C,0x25,0x0E,0x9F,0x2E,0x39,0x19,0x1C,0x03,0xA4,0xAE,0x9A,0xE5,0x39,0x07,0x09, -0x16,0xCA,0x63,0xB1,0xB9,0x86,0xF8,0x8A,0x57,0xC1,0x57,0xCE,0x42,0xFA,0x73,0xA1, -0xF7,0x65,0x42,0xFF,0x1E,0xC1,0x00,0xB2,0x6E,0x73,0x0E,0xFF,0xC7,0x21,0xE5,0x18, -0xA4,0xAA,0xD9,0x71,0x3F,0xA8,0xD4,0xB9,0xCE,0x8C,0x1D,0xA3,0x42,0x30,0x40,0x30, -0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30, -0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF, -0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x54,0xB0,0x7B,0xAD,0x45, -0xB8,0xE2,0x40,0x7F,0xFB,0x0A,0x6E,0xFB,0xBE,0x33,0xC9,0x3C,0xA3,0x84,0xD5,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,0x03,0x48,0x00,0x30,0x45, -0x02,0x21,0x00,0xDC,0x92,0xA1,0xA0,0x13,0xA6,0xCF,0x03,0xB0,0xE6,0xC4,0x21,0x97, -0x90,0xFA,0x14,0x57,0x2D,0x03,0xEC,0xEE,0x3C,0xD3,0x6E,0xCA,0xA8,0x6C,0x76,0xBC, -0xA2,0xDE,0xBB,0x02,0x20,0x27,0xA8,0x85,0x27,0x35,0x9B,0x56,0xC6,0xA3,0xF2,0x47, -0xD2,0xB7,0x6E,0x1B,0x02,0x00,0x17,0xAA,0x67,0xA6,0x15,0x91,0xDE,0xFA,0x94,0xEC, -0x7B,0x0B,0xF8,0x9F,0x84, -}; - - -/* subject:/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Universal CA/CN=TC TrustCenter Universal CA I */ -/* issuer :/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Universal CA/CN=TC TrustCenter Universal CA I */ - - -const unsigned char TC_TrustCenter_Universal_CA_I_certificate[993]={ -0x30,0x82,0x03,0xDD,0x30,0x82,0x02,0xC5,0xA0,0x03,0x02,0x01,0x02,0x02,0x0E,0x1D, -0xA2,0x00,0x01,0x00,0x02,0xEC,0xB7,0x60,0x80,0x78,0x8D,0xB6,0x06,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x79,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06, -0x03,0x55,0x04,0x0A,0x13,0x13,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65, -0x6E,0x74,0x65,0x72,0x20,0x47,0x6D,0x62,0x48,0x31,0x24,0x30,0x22,0x06,0x03,0x55, -0x04,0x0B,0x13,0x1B,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74, -0x65,0x72,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41,0x31, -0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x03,0x13,0x1D,0x54,0x43,0x20,0x54,0x72,0x75, -0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73, -0x61,0x6C,0x20,0x43,0x41,0x20,0x49,0x30,0x1E,0x17,0x0D,0x30,0x36,0x30,0x33,0x32, -0x32,0x31,0x35,0x35,0x34,0x32,0x38,0x5A,0x17,0x0D,0x32,0x35,0x31,0x32,0x33,0x31, -0x32,0x32,0x35,0x39,0x35,0x39,0x5A,0x30,0x79,0x31,0x0B,0x30,0x09,0x06,0x03,0x55, -0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13, -0x13,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20, -0x47,0x6D,0x62,0x48,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x0B,0x13,0x1B,0x54, -0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x55,0x6E, -0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41,0x31,0x26,0x30,0x24,0x06,0x03, -0x55,0x04,0x03,0x13,0x1D,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E, -0x74,0x65,0x72,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41, -0x20,0x49,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82, -0x01,0x01,0x00,0xA4,0x77,0x23,0x96,0x44,0xAF,0x90,0xF4,0x31,0xA7,0x10,0xF4,0x26, -0x87,0x9C,0xF3,0x38,0xD9,0x0F,0x5E,0xDE,0xCF,0x41,0xE8,0x31,0xAD,0xC6,0x74,0x91, -0x24,0x96,0x78,0x1E,0x09,0xA0,0x9B,0x9A,0x95,0x4A,0x4A,0xF5,0x62,0x7C,0x02,0xA8, -0xCA,0xAC,0xFB,0x5A,0x04,0x76,0x39,0xDE,0x5F,0xF1,0xF9,0xB3,0xBF,0xF3,0x03,0x58, -0x55,0xD2,0xAA,0xB7,0xE3,0x04,0x22,0xD1,0xF8,0x94,0xDA,0x22,0x08,0x00,0x8D,0xD3, -0x7C,0x26,0x5D,0xCC,0x77,0x79,0xE7,0x2C,0x78,0x39,0xA8,0x26,0x73,0x0E,0xA2,0x5D, -0x25,0x69,0x85,0x4F,0x55,0x0E,0x9A,0xEF,0xC6,0xB9,0x44,0xE1,0x57,0x3D,0xDF,0x1F, -0x54,0x22,0xE5,0x6F,0x65,0xAA,0x33,0x84,0x3A,0xF3,0xCE,0x7A,0xBE,0x55,0x97,0xAE, -0x8D,0x12,0x0F,0x14,0x33,0xE2,0x50,0x70,0xC3,0x49,0x87,0x13,0xBC,0x51,0xDE,0xD7, -0x98,0x12,0x5A,0xEF,0x3A,0x83,0x33,0x92,0x06,0x75,0x8B,0x92,0x7C,0x12,0x68,0x7B, -0x70,0x6A,0x0F,0xB5,0x9B,0xB6,0x77,0x5B,0x48,0x59,0x9D,0xE4,0xEF,0x5A,0xAD,0xF3, -0xC1,0x9E,0xD4,0xD7,0x45,0x4E,0xCA,0x56,0x34,0x21,0xBC,0x3E,0x17,0x5B,0x6F,0x77, -0x0C,0x48,0x01,0x43,0x29,0xB0,0xDD,0x3F,0x96,0x6E,0xE6,0x95,0xAA,0x0C,0xC0,0x20, -0xB6,0xFD,0x3E,0x36,0x27,0x9C,0xE3,0x5C,0xCF,0x4E,0x81,0xDC,0x19,0xBB,0x91,0x90, -0x7D,0xEC,0xE6,0x97,0x04,0x1E,0x93,0xCC,0x22,0x49,0xD7,0x97,0x86,0xB6,0x13,0x0A, -0x3C,0x43,0x23,0x77,0x7E,0xF0,0xDC,0xE6,0xCD,0x24,0x1F,0x3B,0x83,0x9B,0x34,0x3A, -0x83,0x34,0xE3,0x02,0x03,0x01,0x00,0x01,0xA3,0x63,0x30,0x61,0x30,0x1F,0x06,0x03, -0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x92,0xA4,0x75,0x2C,0xA4,0x9E,0xBE, -0x81,0x44,0xEB,0x79,0xFC,0x8A,0xC5,0x95,0xA5,0xEB,0x10,0x75,0x73,0x30,0x0F,0x06, -0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E, -0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x1D, -0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x92,0xA4,0x75,0x2C,0xA4,0x9E,0xBE, -0x81,0x44,0xEB,0x79,0xFC,0x8A,0xC5,0x95,0xA5,0xEB,0x10,0x75,0x73,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01, -0x00,0x28,0xD2,0xE0,0x86,0xD5,0xE6,0xF8,0x7B,0xF0,0x97,0xDC,0x22,0x6B,0x3B,0x95, -0x14,0x56,0x0F,0x11,0x30,0xA5,0x9A,0x4F,0x3A,0xB0,0x3A,0xE0,0x06,0xCB,0x65,0xF5, -0xED,0xC6,0x97,0x27,0xFE,0x25,0xF2,0x57,0xE6,0x5E,0x95,0x8C,0x3E,0x64,0x60,0x15, -0x5A,0x7F,0x2F,0x0D,0x01,0xC5,0xB1,0x60,0xFD,0x45,0x35,0xCF,0xF0,0xB2,0xBF,0x06, -0xD9,0xEF,0x5A,0xBE,0xB3,0x62,0x21,0xB4,0xD7,0xAB,0x35,0x7C,0x53,0x3E,0xA6,0x27, -0xF1,0xA1,0x2D,0xDA,0x1A,0x23,0x9D,0xCC,0xDD,0xEC,0x3C,0x2D,0x9E,0x27,0x34,0x5D, -0x0F,0xC2,0x36,0x79,0xBC,0xC9,0x4A,0x62,0x2D,0xED,0x6B,0xD9,0x7D,0x41,0x43,0x7C, -0xB6,0xAA,0xCA,0xED,0x61,0xB1,0x37,0x82,0x15,0x09,0x1A,0x8A,0x16,0x30,0xD8,0xEC, -0xC9,0xD6,0x47,0x72,0x78,0x4B,0x10,0x46,0x14,0x8E,0x5F,0x0E,0xAF,0xEC,0xC7,0x2F, -0xAB,0x10,0xD7,0xB6,0xF1,0x6E,0xEC,0x86,0xB2,0xC2,0xE8,0x0D,0x92,0x73,0xDC,0xA2, -0xF4,0x0F,0x3A,0xBF,0x61,0x23,0x10,0x89,0x9C,0x48,0x40,0x6E,0x70,0x00,0xB3,0xD3, -0xBA,0x37,0x44,0x58,0x11,0x7A,0x02,0x6A,0x88,0xF0,0x37,0x34,0xF0,0x19,0xE9,0xAC, -0xD4,0x65,0x73,0xF6,0x69,0x8C,0x64,0x94,0x3A,0x79,0x85,0x29,0xB0,0x16,0x2B,0x0C, -0x82,0x3F,0x06,0x9C,0xC7,0xFD,0x10,0x2B,0x9E,0x0F,0x2C,0xB6,0x9E,0xE3,0x15,0xBF, -0xD9,0x36,0x1C,0xBA,0x25,0x1A,0x52,0x3D,0x1A,0xEC,0x22,0x0C,0x1C,0xE0,0xA4,0xA2, -0x3D,0xF0,0xE8,0x39,0xCF,0x81,0xC0,0x7B,0xED,0x5D,0x1F,0x6F,0xC5,0xD0,0x0B,0xD7, -0x98, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=Trusted Certificate Services */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=Trusted Certificate Services */ - - -const unsigned char Comodo_Trusted_Services_root_certificate[1095]={ -0x30,0x82,0x04,0x43,0x30,0x82,0x03,0x2B,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x7F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x25,0x30,0x23,0x06,0x03,0x55, -0x04,0x03,0x0C,0x1C,0x54,0x72,0x75,0x73,0x74,0x65,0x64,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73, -0x30,0x1E,0x17,0x0D,0x30,0x34,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30, -0x5A,0x17,0x0D,0x32,0x38,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A, -0x30,0x7F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31, -0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65, -0x72,0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E, -0x06,0x03,0x55,0x04,0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A, -0x30,0x18,0x06,0x03,0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20, -0x43,0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x25,0x30,0x23,0x06,0x03, -0x55,0x04,0x03,0x0C,0x1C,0x54,0x72,0x75,0x73,0x74,0x65,0x64,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65, -0x73,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01, -0x01,0x00,0xDF,0x71,0x6F,0x36,0x58,0x53,0x5A,0xF2,0x36,0x54,0x57,0x80,0xC4,0x74, -0x08,0x20,0xED,0x18,0x7F,0x2A,0x1D,0xE6,0x35,0x9A,0x1E,0x25,0xAC,0x9C,0xE5,0x96, -0x7E,0x72,0x52,0xA0,0x15,0x42,0xDB,0x59,0xDD,0x64,0x7A,0x1A,0xD0,0xB8,0x7B,0xDD, -0x39,0x15,0xBC,0x55,0x48,0xC4,0xED,0x3A,0x00,0xEA,0x31,0x11,0xBA,0xF2,0x71,0x74, -0x1A,0x67,0xB8,0xCF,0x33,0xCC,0xA8,0x31,0xAF,0xA3,0xE3,0xD7,0x7F,0xBF,0x33,0x2D, -0x4C,0x6A,0x3C,0xEC,0x8B,0xC3,0x92,0xD2,0x53,0x77,0x24,0x74,0x9C,0x07,0x6E,0x70, -0xFC,0xBD,0x0B,0x5B,0x76,0xBA,0x5F,0xF2,0xFF,0xD7,0x37,0x4B,0x4A,0x60,0x78,0xF7, -0xF0,0xFA,0xCA,0x70,0xB4,0xEA,0x59,0xAA,0xA3,0xCE,0x48,0x2F,0xA9,0xC3,0xB2,0x0B, -0x7E,0x17,0x72,0x16,0x0C,0xA6,0x07,0x0C,0x1B,0x38,0xCF,0xC9,0x62,0xB7,0x3F,0xA0, -0x93,0xA5,0x87,0x41,0xF2,0xB7,0x70,0x40,0x77,0xD8,0xBE,0x14,0x7C,0xE3,0xA8,0xC0, -0x7A,0x8E,0xE9,0x63,0x6A,0xD1,0x0F,0x9A,0xC6,0xD2,0xF4,0x8B,0x3A,0x14,0x04,0x56, -0xD4,0xED,0xB8,0xCC,0x6E,0xF5,0xFB,0xE2,0x2C,0x58,0xBD,0x7F,0x4F,0x6B,0x2B,0xF7, -0x60,0x24,0x58,0x24,0xCE,0x26,0xEF,0x34,0x91,0x3A,0xD5,0xE3,0x81,0xD0,0xB2,0xF0, -0x04,0x02,0xD7,0x5B,0xB7,0x3E,0x92,0xAC,0x6B,0x12,0x8A,0xF9,0xE4,0x05,0xB0,0x3B, -0x91,0x49,0x5C,0xB2,0xEB,0x53,0xEA,0xF8,0x9F,0x47,0x86,0xEE,0xBF,0x95,0xC0,0xC0, -0x06,0x9F,0xD2,0x5B,0x5E,0x11,0x1B,0xF4,0xC7,0x04,0x35,0x29,0xD2,0x55,0x5C,0xE4, -0xED,0xEB,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xC9,0x30,0x81,0xC6,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xC5,0x7B,0x58,0xBD,0xED,0xDA,0x25,0x69, -0xD2,0xF7,0x59,0x16,0xA8,0xB3,0x32,0xC0,0x7B,0x27,0x5B,0xF4,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03, -0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x81,0x83, -0x06,0x03,0x55,0x1D,0x1F,0x04,0x7C,0x30,0x7A,0x30,0x3C,0xA0,0x3A,0xA0,0x38,0x86, -0x36,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x63,0x6F,0x6D,0x6F, -0x64,0x6F,0x63,0x61,0x2E,0x63,0x6F,0x6D,0x2F,0x54,0x72,0x75,0x73,0x74,0x65,0x64, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x53,0x65,0x72,0x76,0x69, -0x63,0x65,0x73,0x2E,0x63,0x72,0x6C,0x30,0x3A,0xA0,0x38,0xA0,0x36,0x86,0x34,0x68, -0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x63,0x6F,0x6D,0x6F,0x64,0x6F, -0x2E,0x6E,0x65,0x74,0x2F,0x54,0x72,0x75,0x73,0x74,0x65,0x64,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x2E, -0x63,0x72,0x6C,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x03,0x82,0x01,0x01,0x00,0xC8,0x93,0x81,0x3B,0x89,0xB4,0xAF,0xB8,0x84, -0x12,0x4C,0x8D,0xD2,0xF0,0xDB,0x70,0xBA,0x57,0x86,0x15,0x34,0x10,0xB9,0x2F,0x7F, -0x1E,0xB0,0xA8,0x89,0x60,0xA1,0x8A,0xC2,0x77,0x0C,0x50,0x4A,0x9B,0x00,0x8B,0xD8, -0x8B,0xF4,0x41,0xE2,0xD0,0x83,0x8A,0x4A,0x1C,0x14,0x06,0xB0,0xA3,0x68,0x05,0x70, -0x31,0x30,0xA7,0x53,0x9B,0x0E,0xE9,0x4A,0xA0,0x58,0x69,0x67,0x0E,0xAE,0x9D,0xF6, -0xA5,0x2C,0x41,0xBF,0x3C,0x06,0x6B,0xE4,0x59,0xCC,0x6D,0x10,0xF1,0x96,0x6F,0x1F, -0xDF,0xF4,0x04,0x02,0xA4,0x9F,0x45,0x3E,0xC8,0xD8,0xFA,0x36,0x46,0x44,0x50,0x3F, -0x82,0x97,0x91,0x1F,0x28,0xDB,0x18,0x11,0x8C,0x2A,0xE4,0x65,0x83,0x57,0x12,0x12, -0x8C,0x17,0x3F,0x94,0x36,0xFE,0x5D,0xB0,0xC0,0x04,0x77,0x13,0xB8,0xF4,0x15,0xD5, -0x3F,0x38,0xCC,0x94,0x3A,0x55,0xD0,0xAC,0x98,0xF5,0xBA,0x00,0x5F,0xE0,0x86,0x19, -0x81,0x78,0x2F,0x28,0xC0,0x7E,0xD3,0xCC,0x42,0x0A,0xF5,0xAE,0x50,0xA0,0xD1,0x3E, -0xC6,0xA1,0x71,0xEC,0x3F,0xA0,0x20,0x8C,0x66,0x3A,0x89,0xB4,0x8E,0xD4,0xD8,0xB1, -0x4D,0x25,0x47,0xEE,0x2F,0x88,0xC8,0xB5,0xE1,0x05,0x45,0xC0,0xBE,0x14,0x71,0xDE, -0x7A,0xFD,0x8E,0x7B,0x7D,0x4D,0x08,0x96,0xA5,0x12,0x73,0xF0,0x2D,0xCA,0x37,0x27, -0x74,0x12,0x27,0x4C,0xCB,0xB6,0x97,0xE9,0xD9,0xAE,0x08,0x6D,0x5A,0x39,0x40,0xDD, -0x05,0x47,0x75,0x6A,0x5A,0x21,0xB3,0xA3,0x18,0xCF,0x4E,0xF7,0x2E,0x57,0xB7,0x98, -0x70,0x5E,0xC8,0xC4,0x78,0xB0,0x62, -}; - - -/* subject:/C=US/O=Entrust, Inc./OU=www.entrust.net/CPS is incorporated by reference/OU=(c) 2006 Entrust, Inc./CN=Entrust Root Certification Authority */ -/* issuer :/C=US/O=Entrust, Inc./OU=www.entrust.net/CPS is incorporated by reference/OU=(c) 2006 Entrust, Inc./CN=Entrust Root Certification Authority */ - - -const unsigned char Entrust_Root_Certification_Authority_certificate[1173]={ -0x30,0x82,0x04,0x91,0x30,0x82,0x03,0x79,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x45, -0x6B,0x50,0x54,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x30,0x81,0xB0,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02, -0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x45,0x6E,0x74, -0x72,0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x39,0x30,0x37,0x06,0x03, -0x55,0x04,0x0B,0x13,0x30,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74,0x72,0x75,0x73,0x74, -0x2E,0x6E,0x65,0x74,0x2F,0x43,0x50,0x53,0x20,0x69,0x73,0x20,0x69,0x6E,0x63,0x6F, -0x72,0x70,0x6F,0x72,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x72,0x65,0x66,0x65, -0x72,0x65,0x6E,0x63,0x65,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16, -0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x45,0x6E,0x74,0x72,0x75,0x73,0x74, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04,0x03,0x13, -0x24,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65, -0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68, -0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x31,0x32,0x37,0x32, -0x30,0x32,0x33,0x34,0x32,0x5A,0x17,0x0D,0x32,0x36,0x31,0x31,0x32,0x37,0x32,0x30, -0x35,0x33,0x34,0x32,0x5A,0x30,0x81,0xB0,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D, -0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x39,0x30, -0x37,0x06,0x03,0x55,0x04,0x0B,0x13,0x30,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74,0x72, -0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x2F,0x43,0x50,0x53,0x20,0x69,0x73,0x20,0x69, -0x6E,0x63,0x6F,0x72,0x70,0x6F,0x72,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x72, -0x65,0x66,0x65,0x72,0x65,0x6E,0x63,0x65,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04, -0x0B,0x13,0x16,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x45,0x6E,0x74,0x72, -0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55, -0x04,0x03,0x13,0x24,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x20,0x52,0x6F,0x6F,0x74, -0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41, -0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00, -0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xB6,0x95,0xB6,0x43,0x42,0xFA,0xC6, -0x6D,0x2A,0x6F,0x48,0xDF,0x94,0x4C,0x39,0x57,0x05,0xEE,0xC3,0x79,0x11,0x41,0x68, -0x36,0xED,0xEC,0xFE,0x9A,0x01,0x8F,0xA1,0x38,0x28,0xFC,0xF7,0x10,0x46,0x66,0x2E, -0x4D,0x1E,0x1A,0xB1,0x1A,0x4E,0xC6,0xD1,0xC0,0x95,0x88,0xB0,0xC9,0xFF,0x31,0x8B, -0x33,0x03,0xDB,0xB7,0x83,0x7B,0x3E,0x20,0x84,0x5E,0xED,0xB2,0x56,0x28,0xA7,0xF8, -0xE0,0xB9,0x40,0x71,0x37,0xC5,0xCB,0x47,0x0E,0x97,0x2A,0x68,0xC0,0x22,0x95,0x62, -0x15,0xDB,0x47,0xD9,0xF5,0xD0,0x2B,0xFF,0x82,0x4B,0xC9,0xAD,0x3E,0xDE,0x4C,0xDB, -0x90,0x80,0x50,0x3F,0x09,0x8A,0x84,0x00,0xEC,0x30,0x0A,0x3D,0x18,0xCD,0xFB,0xFD, -0x2A,0x59,0x9A,0x23,0x95,0x17,0x2C,0x45,0x9E,0x1F,0x6E,0x43,0x79,0x6D,0x0C,0x5C, -0x98,0xFE,0x48,0xA7,0xC5,0x23,0x47,0x5C,0x5E,0xFD,0x6E,0xE7,0x1E,0xB4,0xF6,0x68, -0x45,0xD1,0x86,0x83,0x5B,0xA2,0x8A,0x8D,0xB1,0xE3,0x29,0x80,0xFE,0x25,0x71,0x88, -0xAD,0xBE,0xBC,0x8F,0xAC,0x52,0x96,0x4B,0xAA,0x51,0x8D,0xE4,0x13,0x31,0x19,0xE8, -0x4E,0x4D,0x9F,0xDB,0xAC,0xB3,0x6A,0xD5,0xBC,0x39,0x54,0x71,0xCA,0x7A,0x7A,0x7F, -0x90,0xDD,0x7D,0x1D,0x80,0xD9,0x81,0xBB,0x59,0x26,0xC2,0x11,0xFE,0xE6,0x93,0xE2, -0xF7,0x80,0xE4,0x65,0xFB,0x34,0x37,0x0E,0x29,0x80,0x70,0x4D,0xAF,0x38,0x86,0x2E, -0x9E,0x7F,0x57,0xAF,0x9E,0x17,0xAE,0xEB,0x1C,0xCB,0x28,0x21,0x5F,0xB6,0x1C,0xD8, -0xE7,0xA2,0x04,0x22,0xF9,0xD3,0xDA,0xD8,0xCB,0x02,0x03,0x01,0x00,0x01,0xA3,0x81, -0xB0,0x30,0x81,0xAD,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x2B,0x06,0x03,0x55,0x1D,0x10,0x04,0x24,0x30,0x22, -0x80,0x0F,0x32,0x30,0x30,0x36,0x31,0x31,0x32,0x37,0x32,0x30,0x32,0x33,0x34,0x32, -0x5A,0x81,0x0F,0x32,0x30,0x32,0x36,0x31,0x31,0x32,0x37,0x32,0x30,0x35,0x33,0x34, -0x32,0x5A,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x68, -0x90,0xE4,0x67,0xA4,0xA6,0x53,0x80,0xC7,0x86,0x66,0xA4,0xF1,0xF7,0x4B,0x43,0xFB, -0x84,0xBD,0x6D,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x68,0x90, -0xE4,0x67,0xA4,0xA6,0x53,0x80,0xC7,0x86,0x66,0xA4,0xF1,0xF7,0x4B,0x43,0xFB,0x84, -0xBD,0x6D,0x30,0x1D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x41,0x00,0x04, -0x10,0x30,0x0E,0x1B,0x08,0x56,0x37,0x2E,0x31,0x3A,0x34,0x2E,0x30,0x03,0x02,0x04, -0x90,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00, -0x03,0x82,0x01,0x01,0x00,0x93,0xD4,0x30,0xB0,0xD7,0x03,0x20,0x2A,0xD0,0xF9,0x63, -0xE8,0x91,0x0C,0x05,0x20,0xA9,0x5F,0x19,0xCA,0x7B,0x72,0x4E,0xD4,0xB1,0xDB,0xD0, -0x96,0xFB,0x54,0x5A,0x19,0x2C,0x0C,0x08,0xF7,0xB2,0xBC,0x85,0xA8,0x9D,0x7F,0x6D, -0x3B,0x52,0xB3,0x2A,0xDB,0xE7,0xD4,0x84,0x8C,0x63,0xF6,0x0F,0xCB,0x26,0x01,0x91, -0x50,0x6C,0xF4,0x5F,0x14,0xE2,0x93,0x74,0xC0,0x13,0x9E,0x30,0x3A,0x50,0xE3,0xB4, -0x60,0xC5,0x1C,0xF0,0x22,0x44,0x8D,0x71,0x47,0xAC,0xC8,0x1A,0xC9,0xE9,0x9B,0x9A, -0x00,0x60,0x13,0xFF,0x70,0x7E,0x5F,0x11,0x4D,0x49,0x1B,0xB3,0x15,0x52,0x7B,0xC9, -0x54,0xDA,0xBF,0x9D,0x95,0xAF,0x6B,0x9A,0xD8,0x9E,0xE9,0xF1,0xE4,0x43,0x8D,0xE2, -0x11,0x44,0x3A,0xBF,0xAF,0xBD,0x83,0x42,0x73,0x52,0x8B,0xAA,0xBB,0xA7,0x29,0xCF, -0xF5,0x64,0x1C,0x0A,0x4D,0xD1,0xBC,0xAA,0xAC,0x9F,0x2A,0xD0,0xFF,0x7F,0x7F,0xDA, -0x7D,0xEA,0xB1,0xED,0x30,0x25,0xC1,0x84,0xDA,0x34,0xD2,0x5B,0x78,0x83,0x56,0xEC, -0x9C,0x36,0xC3,0x26,0xE2,0x11,0xF6,0x67,0x49,0x1D,0x92,0xAB,0x8C,0xFB,0xEB,0xFF, -0x7A,0xEE,0x85,0x4A,0xA7,0x50,0x80,0xF0,0xA7,0x5C,0x4A,0x94,0x2E,0x5F,0x05,0x99, -0x3C,0x52,0x41,0xE0,0xCD,0xB4,0x63,0xCF,0x01,0x43,0xBA,0x9C,0x83,0xDC,0x8F,0x60, -0x3B,0xF3,0x5A,0xB4,0xB4,0x7B,0xAE,0xDA,0x0B,0x90,0x38,0x75,0xEF,0x81,0x1D,0x66, -0xD2,0xF7,0x57,0x70,0x36,0xB3,0xBF,0xFC,0x28,0xAF,0x71,0x25,0x85,0x5B,0x13,0xFE, -0x1E,0x7F,0x5A,0xB4,0x3C, -}; - - -/* subject:/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Class 2 CA/CN=TC TrustCenter Class 2 CA II */ -/* issuer :/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Class 2 CA/CN=TC TrustCenter Class 2 CA II */ - - -const unsigned char TC_TrustCenter_Class_2_CA_II_certificate[1198]={ -0x30,0x82,0x04,0xAA,0x30,0x82,0x03,0x92,0xA0,0x03,0x02,0x01,0x02,0x02,0x0E,0x2E, -0x6A,0x00,0x01,0x00,0x02,0x1F,0xD7,0x52,0x21,0x2C,0x11,0x5C,0x3B,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x76,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06, -0x03,0x55,0x04,0x0A,0x13,0x13,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65, -0x6E,0x74,0x65,0x72,0x20,0x47,0x6D,0x62,0x48,0x31,0x22,0x30,0x20,0x06,0x03,0x55, -0x04,0x0B,0x13,0x19,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74, -0x65,0x72,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x41,0x31,0x25,0x30, -0x23,0x06,0x03,0x55,0x04,0x03,0x13,0x1C,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74, -0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43, -0x41,0x20,0x49,0x49,0x30,0x1E,0x17,0x0D,0x30,0x36,0x30,0x31,0x31,0x32,0x31,0x34, -0x33,0x38,0x34,0x33,0x5A,0x17,0x0D,0x32,0x35,0x31,0x32,0x33,0x31,0x32,0x32,0x35, -0x39,0x35,0x39,0x5A,0x30,0x76,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13,0x13,0x54,0x43, -0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x47,0x6D,0x62, -0x48,0x31,0x22,0x30,0x20,0x06,0x03,0x55,0x04,0x0B,0x13,0x19,0x54,0x43,0x20,0x54, -0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x43,0x6C,0x61,0x73,0x73, -0x20,0x32,0x20,0x43,0x41,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x03,0x13,0x1C, -0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x43, -0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x41,0x20,0x49,0x49,0x30,0x82,0x01,0x22, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03, -0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xAB,0x80,0x87, -0x9B,0x8E,0xF0,0xC3,0x7C,0x87,0xD7,0xE8,0x24,0x82,0x11,0xB3,0x3C,0xDD,0x43,0x62, -0xEE,0xF8,0xC3,0x45,0xDA,0xE8,0xE1,0xA0,0x5F,0xD1,0x2A,0xB2,0xEA,0x93,0x68,0xDF, -0xB4,0xC8,0xD6,0x43,0xE9,0xC4,0x75,0x59,0x7F,0xFC,0xE1,0x1D,0xF8,0x31,0x70,0x23, -0x1B,0x88,0x9E,0x27,0xB9,0x7B,0xFD,0x3A,0xD2,0xC9,0xA9,0xE9,0x14,0x2F,0x90,0xBE, -0x03,0x52,0xC1,0x49,0xCD,0xF6,0xFD,0xE4,0x08,0x66,0x0B,0x57,0x8A,0xA2,0x42,0xA0, -0xB8,0xD5,0x7F,0x69,0x5C,0x90,0x32,0xB2,0x97,0x0D,0xCA,0x4A,0xDC,0x46,0x3E,0x02, -0x55,0x89,0x53,0xE3,0x1A,0x5A,0xCB,0x36,0xC6,0x07,0x56,0xF7,0x8C,0xCF,0x11,0xF4, -0x4C,0xBB,0x30,0x70,0x04,0x95,0xA5,0xF6,0x39,0x8C,0xFD,0x73,0x81,0x08,0x7D,0x89, -0x5E,0x32,0x1E,0x22,0xA9,0x22,0x45,0x4B,0xB0,0x66,0x2E,0x30,0xCC,0x9F,0x65,0xFD, -0xFC,0xCB,0x81,0xA9,0xF1,0xE0,0x3B,0xAF,0xA3,0x86,0xD1,0x89,0xEA,0xC4,0x45,0x79, -0x50,0x5D,0xAE,0xE9,0x21,0x74,0x92,0x4D,0x8B,0x59,0x82,0x8F,0x94,0xE3,0xE9,0x4A, -0xF1,0xE7,0x49,0xB0,0x14,0xE3,0xF5,0x62,0xCB,0xD5,0x72,0xBD,0x1F,0xB9,0xD2,0x9F, -0xA0,0xCD,0xA8,0xFA,0x01,0xC8,0xD9,0x0D,0xDF,0xDA,0xFC,0x47,0x9D,0xB3,0xC8,0x54, -0xDF,0x49,0x4A,0xF1,0x21,0xA9,0xFE,0x18,0x4E,0xEE,0x48,0xD4,0x19,0xBB,0xEF,0x7D, -0xE4,0xE2,0x9D,0xCB,0x5B,0xB6,0x6E,0xFF,0xE3,0xCD,0x5A,0xE7,0x74,0x82,0x05,0xBA, -0x80,0x25,0x38,0xCB,0xE4,0x69,0x9E,0xAF,0x41,0xAA,0x1A,0x84,0xF5,0x02,0x03,0x01, -0x00,0x01,0xA3,0x82,0x01,0x34,0x30,0x82,0x01,0x30,0x30,0x0F,0x06,0x03,0x55,0x1D, -0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55, -0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03,0x55, -0x1D,0x0E,0x04,0x16,0x04,0x14,0xE3,0xAB,0x54,0x4C,0x80,0xA1,0xDB,0x56,0x43,0xB7, -0x91,0x4A,0xCB,0xF3,0x82,0x7A,0x13,0x5C,0x08,0xAB,0x30,0x81,0xED,0x06,0x03,0x55, -0x1D,0x1F,0x04,0x81,0xE5,0x30,0x81,0xE2,0x30,0x81,0xDF,0xA0,0x81,0xDC,0xA0,0x81, -0xD9,0x86,0x35,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x74,0x72, -0x75,0x73,0x74,0x63,0x65,0x6E,0x74,0x65,0x72,0x2E,0x64,0x65,0x2F,0x63,0x72,0x6C, -0x2F,0x76,0x32,0x2F,0x74,0x63,0x5F,0x63,0x6C,0x61,0x73,0x73,0x5F,0x32,0x5F,0x63, -0x61,0x5F,0x49,0x49,0x2E,0x63,0x72,0x6C,0x86,0x81,0x9F,0x6C,0x64,0x61,0x70,0x3A, -0x2F,0x2F,0x77,0x77,0x77,0x2E,0x74,0x72,0x75,0x73,0x74,0x63,0x65,0x6E,0x74,0x65, -0x72,0x2E,0x64,0x65,0x2F,0x43,0x4E,0x3D,0x54,0x43,0x25,0x32,0x30,0x54,0x72,0x75, -0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x25,0x32,0x30,0x43,0x6C,0x61,0x73,0x73, -0x25,0x32,0x30,0x32,0x25,0x32,0x30,0x43,0x41,0x25,0x32,0x30,0x49,0x49,0x2C,0x4F, -0x3D,0x54,0x43,0x25,0x32,0x30,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65, -0x72,0x25,0x32,0x30,0x47,0x6D,0x62,0x48,0x2C,0x4F,0x55,0x3D,0x72,0x6F,0x6F,0x74, -0x63,0x65,0x72,0x74,0x73,0x2C,0x44,0x43,0x3D,0x74,0x72,0x75,0x73,0x74,0x63,0x65, -0x6E,0x74,0x65,0x72,0x2C,0x44,0x43,0x3D,0x64,0x65,0x3F,0x63,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x52,0x65,0x76,0x6F,0x63,0x61,0x74,0x69,0x6F,0x6E, -0x4C,0x69,0x73,0x74,0x3F,0x62,0x61,0x73,0x65,0x3F,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x8C,0xD7, -0xDF,0x7E,0xEE,0x1B,0x80,0x10,0xB3,0x83,0xF5,0xDB,0x11,0xEA,0x6B,0x4B,0xA8,0x92, -0x18,0xD9,0xF7,0x07,0x39,0xF5,0x2C,0xBE,0x06,0x75,0x7A,0x68,0x53,0x15,0x1C,0xEA, -0x4A,0xED,0x5E,0xFC,0x23,0xB2,0x13,0xA0,0xD3,0x09,0xFF,0xF6,0xF6,0x2E,0x6B,0x41, -0x71,0x79,0xCD,0xE2,0x6D,0xFD,0xAE,0x59,0x6B,0x85,0x1D,0xB8,0x4E,0x22,0x9A,0xED, -0x66,0x39,0x6E,0x4B,0x94,0xE6,0x55,0xFC,0x0B,0x1B,0x8B,0x77,0xC1,0x53,0x13,0x66, -0x89,0xD9,0x28,0xD6,0x8B,0xF3,0x45,0x4A,0x63,0xB7,0xFD,0x7B,0x0B,0x61,0x5D,0xB8, -0x6D,0xBE,0xC3,0xDC,0x5B,0x79,0xD2,0xED,0x86,0xE5,0xA2,0x4D,0xBE,0x5E,0x74,0x7C, -0x6A,0xED,0x16,0x38,0x1F,0x7F,0x58,0x81,0x5A,0x1A,0xEB,0x32,0x88,0x2D,0xB2,0xF3, -0x39,0x77,0x80,0xAF,0x5E,0xB6,0x61,0x75,0x29,0xDB,0x23,0x4D,0x88,0xCA,0x50,0x28, -0xCB,0x85,0xD2,0xD3,0x10,0xA2,0x59,0x6E,0xD3,0x93,0x54,0x00,0x7A,0xA2,0x46,0x95, -0x86,0x05,0x9C,0xA9,0x19,0x98,0xE5,0x31,0x72,0x0C,0x00,0xE2,0x67,0xD9,0x40,0xE0, -0x24,0x33,0x7B,0x6F,0x2C,0xB9,0x5C,0xAB,0x65,0x9D,0x2C,0xAC,0x76,0xEA,0x35,0x99, -0xF5,0x97,0xB9,0x0F,0x24,0xEC,0xC7,0x76,0x21,0x28,0x65,0xAE,0x57,0xE8,0x07,0x88, -0x75,0x4A,0x56,0xA0,0xD2,0x05,0x3A,0xA4,0xE6,0x8D,0x92,0x88,0x2C,0xF3,0xF2,0xE1, -0xC1,0xC6,0x61,0xDB,0x41,0xC5,0xC7,0x9B,0xF7,0x0E,0x1A,0x51,0x45,0xC2,0x61,0x6B, -0xDC,0x64,0x27,0x17,0x8C,0x5A,0xB7,0xDA,0x74,0x28,0xCD,0x97,0xE4,0xBD, -}; - - -/* subject:/O=Cybertrust, Inc/CN=Cybertrust Global Root */ -/* issuer :/O=Cybertrust, Inc/CN=Cybertrust Global Root */ - - -const unsigned char Cybertrust_Global_Root_certificate[933]={ -0x30,0x82,0x03,0xA1,0x30,0x82,0x02,0x89,0xA0,0x03,0x02,0x01,0x02,0x02,0x0B,0x04, -0x00,0x00,0x00,0x00,0x01,0x0F,0x85,0xAA,0x2D,0x48,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x3B,0x31,0x18,0x30,0x16,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0F,0x43,0x79,0x62,0x65,0x72,0x74,0x72,0x75,0x73,0x74, -0x2C,0x20,0x49,0x6E,0x63,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x13,0x16, -0x43,0x79,0x62,0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61, -0x6C,0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x32,0x31,0x35, -0x30,0x38,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x31,0x31,0x32,0x31,0x35,0x30, -0x38,0x30,0x30,0x30,0x30,0x5A,0x30,0x3B,0x31,0x18,0x30,0x16,0x06,0x03,0x55,0x04, -0x0A,0x13,0x0F,0x43,0x79,0x62,0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x2C,0x20,0x49, -0x6E,0x63,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x13,0x16,0x43,0x79,0x62, -0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52, -0x6F,0x6F,0x74,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02, -0x82,0x01,0x01,0x00,0xF8,0xC8,0xBC,0xBD,0x14,0x50,0x66,0x13,0xFF,0xF0,0xD3,0x79, -0xEC,0x23,0xF2,0xB7,0x1A,0xC7,0x8E,0x85,0xF1,0x12,0x73,0xA6,0x19,0xAA,0x10,0xDB, -0x9C,0xA2,0x65,0x74,0x5A,0x77,0x3E,0x51,0x7D,0x56,0xF6,0xDC,0x23,0xB6,0xD4,0xED, -0x5F,0x58,0xB1,0x37,0x4D,0xD5,0x49,0x0E,0x6E,0xF5,0x6A,0x87,0xD6,0xD2,0x8C,0xD2, -0x27,0xC6,0xE2,0xFF,0x36,0x9F,0x98,0x65,0xA0,0x13,0x4E,0xC6,0x2A,0x64,0x9B,0xD5, -0x90,0x12,0xCF,0x14,0x06,0xF4,0x3B,0xE3,0xD4,0x28,0xBE,0xE8,0x0E,0xF8,0xAB,0x4E, -0x48,0x94,0x6D,0x8E,0x95,0x31,0x10,0x5C,0xED,0xA2,0x2D,0xBD,0xD5,0x3A,0x6D,0xB2, -0x1C,0xBB,0x60,0xC0,0x46,0x4B,0x01,0xF5,0x49,0xAE,0x7E,0x46,0x8A,0xD0,0x74,0x8D, -0xA1,0x0C,0x02,0xCE,0xEE,0xFC,0xE7,0x8F,0xB8,0x6B,0x66,0xF3,0x7F,0x44,0x00,0xBF, -0x66,0x25,0x14,0x2B,0xDD,0x10,0x30,0x1D,0x07,0x96,0x3F,0x4D,0xF6,0x6B,0xB8,0x8F, -0xB7,0x7B,0x0C,0xA5,0x38,0xEB,0xDE,0x47,0xDB,0xD5,0x5D,0x39,0xFC,0x88,0xA7,0xF3, -0xD7,0x2A,0x74,0xF1,0xE8,0x5A,0xA2,0x3B,0x9F,0x50,0xBA,0xA6,0x8C,0x45,0x35,0xC2, -0x50,0x65,0x95,0xDC,0x63,0x82,0xEF,0xDD,0xBF,0x77,0x4D,0x9C,0x62,0xC9,0x63,0x73, -0x16,0xD0,0x29,0x0F,0x49,0xA9,0x48,0xF0,0xB3,0xAA,0xB7,0x6C,0xC5,0xA7,0x30,0x39, -0x40,0x5D,0xAE,0xC4,0xE2,0x5D,0x26,0x53,0xF0,0xCE,0x1C,0x23,0x08,0x61,0xA8,0x94, -0x19,0xBA,0x04,0x62,0x40,0xEC,0x1F,0x38,0x70,0x77,0x12,0x06,0x71,0xA7,0x30,0x18, -0x5D,0x25,0x27,0xA5,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xA5,0x30,0x81,0xA2,0x30, -0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30, -0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF, -0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xB6,0x08,0x7B,0x0D,0x7A, -0xCC,0xAC,0x20,0x4C,0x86,0x56,0x32,0x5E,0xCF,0xAB,0x6E,0x85,0x2D,0x70,0x57,0x30, -0x3F,0x06,0x03,0x55,0x1D,0x1F,0x04,0x38,0x30,0x36,0x30,0x34,0xA0,0x32,0xA0,0x30, -0x86,0x2E,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x32,0x2E,0x70,0x75, -0x62,0x6C,0x69,0x63,0x2D,0x74,0x72,0x75,0x73,0x74,0x2E,0x63,0x6F,0x6D,0x2F,0x63, -0x72,0x6C,0x2F,0x63,0x74,0x2F,0x63,0x74,0x72,0x6F,0x6F,0x74,0x2E,0x63,0x72,0x6C, -0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0xB6,0x08,0x7B, -0x0D,0x7A,0xCC,0xAC,0x20,0x4C,0x86,0x56,0x32,0x5E,0xCF,0xAB,0x6E,0x85,0x2D,0x70, -0x57,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00, -0x03,0x82,0x01,0x01,0x00,0x56,0xEF,0x0A,0x23,0xA0,0x54,0x4E,0x95,0x97,0xC9,0xF8, -0x89,0xDA,0x45,0xC1,0xD4,0xA3,0x00,0x25,0xF4,0x1F,0x13,0xAB,0xB7,0xA3,0x85,0x58, -0x69,0xC2,0x30,0xAD,0xD8,0x15,0x8A,0x2D,0xE3,0xC9,0xCD,0x81,0x5A,0xF8,0x73,0x23, -0x5A,0xA7,0x7C,0x05,0xF3,0xFD,0x22,0x3B,0x0E,0xD1,0x06,0xC4,0xDB,0x36,0x4C,0x73, -0x04,0x8E,0xE5,0xB0,0x22,0xE4,0xC5,0xF3,0x2E,0xA5,0xD9,0x23,0xE3,0xB8,0x4E,0x4A, -0x20,0xA7,0x6E,0x02,0x24,0x9F,0x22,0x60,0x67,0x7B,0x8B,0x1D,0x72,0x09,0xC5,0x31, -0x5C,0xE9,0x79,0x9F,0x80,0x47,0x3D,0xAD,0xA1,0x0B,0x07,0x14,0x3D,0x47,0xFF,0x03, -0x69,0x1A,0x0C,0x0B,0x44,0xE7,0x63,0x25,0xA7,0x7F,0xB2,0xC9,0xB8,0x76,0x84,0xED, -0x23,0xF6,0x7D,0x07,0xAB,0x45,0x7E,0xD3,0xDF,0xB3,0xBF,0xE9,0x8A,0xB6,0xCD,0xA8, -0xA2,0x67,0x2B,0x52,0xD5,0xB7,0x65,0xF0,0x39,0x4C,0x63,0xA0,0x91,0x79,0x93,0x52, -0x0F,0x54,0xDD,0x83,0xBB,0x9F,0xD1,0x8F,0xA7,0x53,0x73,0xC3,0xCB,0xFF,0x30,0xEC, -0x7C,0x04,0xB8,0xD8,0x44,0x1F,0x93,0x5F,0x71,0x09,0x22,0xB7,0x6E,0x3E,0xEA,0x1C, -0x03,0x4E,0x9D,0x1A,0x20,0x61,0xFB,0x81,0x37,0xEC,0x5E,0xFC,0x0A,0x45,0xAB,0xD7, -0xE7,0x17,0x55,0xD0,0xA0,0xEA,0x60,0x9B,0xA6,0xF6,0xE3,0x8C,0x5B,0x29,0xC2,0x06, -0x60,0x14,0x9D,0x2D,0x97,0x4C,0xA9,0x93,0x15,0x9D,0x61,0xC4,0x01,0x5F,0x48,0xD6, -0x58,0xBD,0x56,0x31,0x12,0x4E,0x11,0xC8,0x21,0xE0,0xB3,0x11,0x91,0x65,0xDB,0xB4, -0xA6,0x88,0x38,0xCE,0x55, -}; - - -/* subject:/C=US/O=Entrust, Inc./OU=See www.entrust.net/legal-terms/OU=(c) 2012 Entrust, Inc. - for authorized use only/CN=Entrust Root Certification Authority - EC1 */ -/* issuer :/C=US/O=Entrust, Inc./OU=See www.entrust.net/legal-terms/OU=(c) 2012 Entrust, Inc. - for authorized use only/CN=Entrust Root Certification Authority - EC1 */ - - -const unsigned char Entrust_Root_Certification_Authority___EC1_certificate[765]={ -0x30,0x82,0x02,0xF9,0x30,0x82,0x02,0x80,0xA0,0x03,0x02,0x01,0x02,0x02,0x0D,0x00, -0xA6,0x8B,0x79,0x29,0x00,0x00,0x00,0x00,0x50,0xD0,0x91,0xF9,0x30,0x0A,0x06,0x08, -0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x81,0xBF,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04, -0x0A,0x13,0x0D,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E, -0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13,0x1F,0x53,0x65,0x65,0x20,0x77, -0x77,0x77,0x2E,0x65,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x2F,0x6C, -0x65,0x67,0x61,0x6C,0x2D,0x74,0x65,0x72,0x6D,0x73,0x31,0x39,0x30,0x37,0x06,0x03, -0x55,0x04,0x0B,0x13,0x30,0x28,0x63,0x29,0x20,0x32,0x30,0x31,0x32,0x20,0x45,0x6E, -0x74,0x72,0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x66,0x6F, -0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65, -0x20,0x6F,0x6E,0x6C,0x79,0x31,0x33,0x30,0x31,0x06,0x03,0x55,0x04,0x03,0x13,0x2A, -0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F, -0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x45,0x43,0x31,0x30,0x1E,0x17,0x0D,0x31,0x32, -0x31,0x32,0x31,0x38,0x31,0x35,0x32,0x35,0x33,0x36,0x5A,0x17,0x0D,0x33,0x37,0x31, -0x32,0x31,0x38,0x31,0x35,0x35,0x35,0x33,0x36,0x5A,0x30,0x81,0xBF,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03, -0x55,0x04,0x0A,0x13,0x0D,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2C,0x20,0x49,0x6E, -0x63,0x2E,0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13,0x1F,0x53,0x65,0x65, -0x20,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74, -0x2F,0x6C,0x65,0x67,0x61,0x6C,0x2D,0x74,0x65,0x72,0x6D,0x73,0x31,0x39,0x30,0x37, -0x06,0x03,0x55,0x04,0x0B,0x13,0x30,0x28,0x63,0x29,0x20,0x32,0x30,0x31,0x32,0x20, -0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20, -0x66,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75, -0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x33,0x30,0x31,0x06,0x03,0x55,0x04,0x03, -0x13,0x2A,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43, -0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x45,0x43,0x31,0x30,0x76,0x30,0x10, -0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05,0x2B,0x81,0x04,0x00,0x22, -0x03,0x62,0x00,0x04,0x84,0x13,0xC9,0xD0,0xBA,0x6D,0x41,0x7B,0xE2,0x6C,0xD0,0xEB, -0x55,0x5F,0x66,0x02,0x1A,0x24,0xF4,0x5B,0x89,0x69,0x47,0xE3,0xB8,0xC2,0x7D,0xF1, -0xF2,0x02,0xC5,0x9F,0xA0,0xF6,0x5B,0xD5,0x8B,0x06,0x19,0x86,0x4F,0x53,0x10,0x6D, -0x07,0x24,0x27,0xA1,0xA0,0xF8,0xD5,0x47,0x19,0x61,0x4C,0x7D,0xCA,0x93,0x27,0xEA, -0x74,0x0C,0xEF,0x6F,0x96,0x09,0xFE,0x63,0xEC,0x70,0x5D,0x36,0xAD,0x67,0x77,0xAE, -0xC9,0x9D,0x7C,0x55,0x44,0x3A,0xA2,0x63,0x51,0x1F,0xF5,0xE3,0x62,0xD4,0xA9,0x47, -0x07,0x3E,0xCC,0x20,0xA3,0x42,0x30,0x40,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01, -0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01, -0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E, -0x04,0x16,0x04,0x14,0xB7,0x63,0xE7,0x1A,0xDD,0x8D,0xE9,0x08,0xA6,0x55,0x83,0xA4, -0xE0,0x6A,0x50,0x41,0x65,0x11,0x42,0x49,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE, -0x3D,0x04,0x03,0x03,0x03,0x67,0x00,0x30,0x64,0x02,0x30,0x61,0x79,0xD8,0xE5,0x42, -0x47,0xDF,0x1C,0xAE,0x53,0x99,0x17,0xB6,0x6F,0x1C,0x7D,0xE1,0xBF,0x11,0x94,0xD1, -0x03,0x88,0x75,0xE4,0x8D,0x89,0xA4,0x8A,0x77,0x46,0xDE,0x6D,0x61,0xEF,0x02,0xF5, -0xFB,0xB5,0xDF,0xCC,0xFE,0x4E,0xFF,0xFE,0xA9,0xE6,0xA7,0x02,0x30,0x5B,0x99,0xD7, -0x85,0x37,0x06,0xB5,0x7B,0x08,0xFD,0xEB,0x27,0x8B,0x4A,0x94,0xF9,0xE1,0xFA,0xA7, -0x8E,0x26,0x08,0xE8,0x7C,0x92,0x68,0x6D,0x73,0xD8,0x6F,0x26,0xAC,0x21,0x02,0xB8, -0x99,0xB7,0x26,0x41,0x5B,0x25,0x60,0xAE,0xD0,0x48,0x1A,0xEE,0x06, -}; - - -/* subject:/C=US/O=GeoTrust Inc./OU=(c) 2007 GeoTrust Inc. - For authorized use only/CN=GeoTrust Primary Certification Authority - G2 */ -/* issuer :/C=US/O=GeoTrust Inc./OU=(c) 2007 GeoTrust Inc. - For authorized use only/CN=GeoTrust Primary Certification Authority - G2 */ - - -const unsigned char GeoTrust_Primary_Certification_Authority___G2_certificate[690]={ -0x30,0x82,0x02,0xAE,0x30,0x82,0x02,0x35,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x3C, -0xB2,0xF4,0x48,0x0A,0x00,0xE2,0xFE,0xEB,0x24,0x3B,0x5E,0x60,0x3E,0xC3,0x6B,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x81,0x98,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49, -0x6E,0x63,0x2E,0x31,0x39,0x30,0x37,0x06,0x03,0x55,0x04,0x0B,0x13,0x30,0x28,0x63, -0x29,0x20,0x32,0x30,0x30,0x37,0x20,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20, -0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F, -0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x36, -0x30,0x34,0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73, -0x74,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66, -0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74, -0x79,0x20,0x2D,0x20,0x47,0x32,0x30,0x1E,0x17,0x0D,0x30,0x37,0x31,0x31,0x30,0x35, -0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x38,0x32, -0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0x98,0x31,0x0B,0x30,0x09,0x06,0x03,0x55, -0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13, -0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x39, -0x30,0x37,0x06,0x03,0x55,0x04,0x0B,0x13,0x30,0x28,0x63,0x29,0x20,0x32,0x30,0x30, -0x37,0x20,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x20, -0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64, -0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x36,0x30,0x34,0x06,0x03,0x55, -0x04,0x03,0x13,0x2D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x50,0x72,0x69, -0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69, -0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47, -0x32,0x30,0x76,0x30,0x10,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05, -0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00,0x04,0x15,0xB1,0xE8,0xFD,0x03,0x15,0x43, -0xE5,0xAC,0xEB,0x87,0x37,0x11,0x62,0xEF,0xD2,0x83,0x36,0x52,0x7D,0x45,0x57,0x0B, -0x4A,0x8D,0x7B,0x54,0x3B,0x3A,0x6E,0x5F,0x15,0x02,0xC0,0x50,0xA6,0xCF,0x25,0x2F, -0x7D,0xCA,0x48,0xB8,0xC7,0x50,0x63,0x1C,0x2A,0x21,0x08,0x7C,0x9A,0x36,0xD8,0x0B, -0xFE,0xD1,0x26,0xC5,0x58,0x31,0x30,0x28,0x25,0xF3,0x5D,0x5D,0xA3,0xB8,0xB6,0xA5, -0xB4,0x92,0xED,0x6C,0x2C,0x9F,0xEB,0xDD,0x43,0x89,0xA2,0x3C,0x4B,0x48,0x91,0x1D, -0x50,0xEC,0x26,0xDF,0xD6,0x60,0x2E,0xBD,0x21,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06, -0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E, -0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D, -0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x15,0x5F,0x35,0x57,0x51,0x55,0xFB, -0x25,0xB2,0xAD,0x03,0x69,0xFC,0x01,0xA3,0xFA,0xBE,0x11,0x55,0xD5,0x30,0x0A,0x06, -0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x03,0x67,0x00,0x30,0x64,0x02,0x30, -0x64,0x96,0x59,0xA6,0xE8,0x09,0xDE,0x8B,0xBA,0xFA,0x5A,0x88,0x88,0xF0,0x1F,0x91, -0xD3,0x46,0xA8,0xF2,0x4A,0x4C,0x02,0x63,0xFB,0x6C,0x5F,0x38,0xDB,0x2E,0x41,0x93, -0xA9,0x0E,0xE6,0x9D,0xDC,0x31,0x1C,0xB2,0xA0,0xA7,0x18,0x1C,0x79,0xE1,0xC7,0x36, -0x02,0x30,0x3A,0x56,0xAF,0x9A,0x74,0x6C,0xF6,0xFB,0x83,0xE0,0x33,0xD3,0x08,0x5F, -0xA1,0x9C,0xC2,0x5B,0x9F,0x46,0xD6,0xB6,0xCB,0x91,0x06,0x63,0xA2,0x06,0xE7,0x33, -0xAC,0x3E,0xA8,0x81,0x12,0xD0,0xCB,0xBA,0xD0,0x92,0x0B,0xB6,0x9E,0x96,0xAA,0x04, -0x0F,0x8A, -}; - - -/* subject:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA 2 */ -/* issuer :/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA 2 */ - - -const unsigned char GeoTrust_Global_CA_2_certificate[874]={ -0x30,0x82,0x03,0x66,0x30,0x82,0x02,0x4E,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x44,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16, -0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73, -0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x03,0x13, -0x14,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C, -0x20,0x43,0x41,0x20,0x32,0x30,0x1E,0x17,0x0D,0x30,0x34,0x30,0x33,0x30,0x34,0x30, -0x35,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x31,0x39,0x30,0x33,0x30,0x34,0x30,0x35, -0x30,0x30,0x30,0x30,0x5A,0x30,0x44,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47, -0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1D,0x30,0x1B, -0x06,0x03,0x55,0x04,0x03,0x13,0x14,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20, -0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x43,0x41,0x20,0x32,0x30,0x82,0x01,0x22,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82, -0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xEF,0x3C,0x4D,0x40, -0x3D,0x10,0xDF,0x3B,0x53,0x00,0xE1,0x67,0xFE,0x94,0x60,0x15,0x3E,0x85,0x88,0xF1, -0x89,0x0D,0x90,0xC8,0x28,0x23,0x99,0x05,0xE8,0x2B,0x20,0x9D,0xC6,0xF3,0x60,0x46, -0xD8,0xC1,0xB2,0xD5,0x8C,0x31,0xD9,0xDC,0x20,0x79,0x24,0x81,0xBF,0x35,0x32,0xFC, -0x63,0x69,0xDB,0xB1,0x2A,0x6B,0xEE,0x21,0x58,0xF2,0x08,0xE9,0x78,0xCB,0x6F,0xCB, -0xFC,0x16,0x52,0xC8,0x91,0xC4,0xFF,0x3D,0x73,0xDE,0xB1,0x3E,0xA7,0xC2,0x7D,0x66, -0xC1,0xF5,0x7E,0x52,0x24,0x1A,0xE2,0xD5,0x67,0x91,0xD0,0x82,0x10,0xD7,0x78,0x4B, -0x4F,0x2B,0x42,0x39,0xBD,0x64,0x2D,0x40,0xA0,0xB0,0x10,0xD3,0x38,0x48,0x46,0x88, -0xA1,0x0C,0xBB,0x3A,0x33,0x2A,0x62,0x98,0xFB,0x00,0x9D,0x13,0x59,0x7F,0x6F,0x3B, -0x72,0xAA,0xEE,0xA6,0x0F,0x86,0xF9,0x05,0x61,0xEA,0x67,0x7F,0x0C,0x37,0x96,0x8B, -0xE6,0x69,0x16,0x47,0x11,0xC2,0x27,0x59,0x03,0xB3,0xA6,0x60,0xC2,0x21,0x40,0x56, -0xFA,0xA0,0xC7,0x7D,0x3A,0x13,0xE3,0xEC,0x57,0xC7,0xB3,0xD6,0xAE,0x9D,0x89,0x80, -0xF7,0x01,0xE7,0x2C,0xF6,0x96,0x2B,0x13,0x0D,0x79,0x2C,0xD9,0xC0,0xE4,0x86,0x7B, -0x4B,0x8C,0x0C,0x72,0x82,0x8A,0xFB,0x17,0xCD,0x00,0x6C,0x3A,0x13,0x3C,0xB0,0x84, -0x87,0x4B,0x16,0x7A,0x29,0xB2,0x4F,0xDB,0x1D,0xD4,0x0B,0xF3,0x66,0x37,0xBD,0xD8, -0xF6,0x57,0xBB,0x5E,0x24,0x7A,0xB8,0x3C,0x8B,0xB9,0xFA,0x92,0x1A,0x1A,0x84,0x9E, -0xD8,0x74,0x8F,0xAA,0x1B,0x7F,0x5E,0xF4,0xFE,0x45,0x22,0x21,0x02,0x03,0x01,0x00, -0x01,0xA3,0x63,0x30,0x61,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0x71,0x38,0x36,0xF2,0x02,0x31,0x53,0x47,0x2B,0x6E,0xBA,0x65,0x46,0xA9,0x10, -0x15,0x58,0x20,0x05,0x09,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16, -0x80,0x14,0x71,0x38,0x36,0xF2,0x02,0x31,0x53,0x47,0x2B,0x6E,0xBA,0x65,0x46,0xA9, -0x10,0x15,0x58,0x20,0x05,0x09,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x03,0xF7,0xB5,0x2B,0xAB,0x5D, -0x10,0xFC,0x7B,0xB2,0xB2,0x5E,0xAC,0x9B,0x0E,0x7E,0x53,0x78,0x59,0x3E,0x42,0x04, -0xFE,0x75,0xA3,0xAD,0xAC,0x81,0x4E,0xD7,0x02,0x8B,0x5E,0xC4,0x2D,0xC8,0x52,0x76, -0xC7,0x2C,0x1F,0xFC,0x81,0x32,0x98,0xD1,0x4B,0xC6,0x92,0x93,0x33,0x35,0x31,0x2F, -0xFC,0xD8,0x1D,0x44,0xDD,0xE0,0x81,0x7F,0x9D,0xE9,0x8B,0xE1,0x64,0x91,0x62,0x0B, -0x39,0x08,0x8C,0xAC,0x74,0x9D,0x59,0xD9,0x7A,0x59,0x52,0x97,0x11,0xB9,0x16,0x7B, -0x6F,0x45,0xD3,0x96,0xD9,0x31,0x7D,0x02,0x36,0x0F,0x9C,0x3B,0x6E,0xCF,0x2C,0x0D, -0x03,0x46,0x45,0xEB,0xA0,0xF4,0x7F,0x48,0x44,0xC6,0x08,0x40,0xCC,0xDE,0x1B,0x70, -0xB5,0x29,0xAD,0xBA,0x8B,0x3B,0x34,0x65,0x75,0x1B,0x71,0x21,0x1D,0x2C,0x14,0x0A, -0xB0,0x96,0x95,0xB8,0xD6,0xEA,0xF2,0x65,0xFB,0x29,0xBA,0x4F,0xEA,0x91,0x93,0x74, -0x69,0xB6,0xF2,0xFF,0xE1,0x1A,0xD0,0x0C,0xD1,0x76,0x85,0xCB,0x8A,0x25,0xBD,0x97, -0x5E,0x2C,0x6F,0x15,0x99,0x26,0xE7,0xB6,0x29,0xFF,0x22,0xEC,0xC9,0x02,0xC7,0x56, -0x00,0xCD,0x49,0xB9,0xB3,0x6C,0x7B,0x53,0x04,0x1A,0xE2,0xA8,0xC9,0xAA,0x12,0x05, -0x23,0xC2,0xCE,0xE7,0xBB,0x04,0x02,0xCC,0xC0,0x47,0xA2,0xE4,0xC4,0x29,0x2F,0x5B, -0x45,0x57,0x89,0x51,0xEE,0x3C,0xEB,0x52,0x08,0xFF,0x07,0x35,0x1E,0x9F,0x35,0x6A, -0x47,0x4A,0x56,0x98,0xD1,0x5A,0x85,0x1F,0x8C,0xF5,0x22,0xBF,0xAB,0xCE,0x83,0xF3, -0xE2,0x22,0x29,0xAE,0x7D,0x83,0x40,0xA8,0xBA,0x6C, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Certification Authority */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Certification Authority */ - - -const unsigned char COMODO_RSA_Certification_Authority_certificate[1500]={ -0x30,0x82,0x05,0xD8,0x30,0x82,0x03,0xC0,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x4C, -0xAA,0xF9,0xCA,0xDB,0x63,0x6F,0xE0,0x1F,0xF7,0x4E,0xD8,0x5B,0x03,0x86,0x9D,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,0x05,0x00,0x30,0x81, -0x85,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x13,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x13,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x13,0x11,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x2B,0x30,0x29,0x06,0x03,0x55, -0x04,0x03,0x13,0x22,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x52,0x53,0x41,0x20,0x43, -0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x31,0x30,0x30,0x31,0x31,0x39, -0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x38,0x32, -0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0x85,0x31,0x0B,0x30,0x09,0x06,0x03,0x55, -0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x13, -0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72,0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73, -0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x07,0x13,0x07,0x53,0x61, -0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30,0x18,0x06,0x03,0x55,0x04,0x0A,0x13,0x11, -0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x43,0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65, -0x64,0x31,0x2B,0x30,0x29,0x06,0x03,0x55,0x04,0x03,0x13,0x22,0x43,0x4F,0x4D,0x4F, -0x44,0x4F,0x20,0x52,0x53,0x41,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82, -0x02,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05, -0x00,0x03,0x82,0x02,0x0F,0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02,0x01,0x00,0x91, -0xE8,0x54,0x92,0xD2,0x0A,0x56,0xB1,0xAC,0x0D,0x24,0xDD,0xC5,0xCF,0x44,0x67,0x74, -0x99,0x2B,0x37,0xA3,0x7D,0x23,0x70,0x00,0x71,0xBC,0x53,0xDF,0xC4,0xFA,0x2A,0x12, -0x8F,0x4B,0x7F,0x10,0x56,0xBD,0x9F,0x70,0x72,0xB7,0x61,0x7F,0xC9,0x4B,0x0F,0x17, -0xA7,0x3D,0xE3,0xB0,0x04,0x61,0xEE,0xFF,0x11,0x97,0xC7,0xF4,0x86,0x3E,0x0A,0xFA, -0x3E,0x5C,0xF9,0x93,0xE6,0x34,0x7A,0xD9,0x14,0x6B,0xE7,0x9C,0xB3,0x85,0xA0,0x82, -0x7A,0x76,0xAF,0x71,0x90,0xD7,0xEC,0xFD,0x0D,0xFA,0x9C,0x6C,0xFA,0xDF,0xB0,0x82, -0xF4,0x14,0x7E,0xF9,0xBE,0xC4,0xA6,0x2F,0x4F,0x7F,0x99,0x7F,0xB5,0xFC,0x67,0x43, -0x72,0xBD,0x0C,0x00,0xD6,0x89,0xEB,0x6B,0x2C,0xD3,0xED,0x8F,0x98,0x1C,0x14,0xAB, -0x7E,0xE5,0xE3,0x6E,0xFC,0xD8,0xA8,0xE4,0x92,0x24,0xDA,0x43,0x6B,0x62,0xB8,0x55, -0xFD,0xEA,0xC1,0xBC,0x6C,0xB6,0x8B,0xF3,0x0E,0x8D,0x9A,0xE4,0x9B,0x6C,0x69,0x99, -0xF8,0x78,0x48,0x30,0x45,0xD5,0xAD,0xE1,0x0D,0x3C,0x45,0x60,0xFC,0x32,0x96,0x51, -0x27,0xBC,0x67,0xC3,0xCA,0x2E,0xB6,0x6B,0xEA,0x46,0xC7,0xC7,0x20,0xA0,0xB1,0x1F, -0x65,0xDE,0x48,0x08,0xBA,0xA4,0x4E,0xA9,0xF2,0x83,0x46,0x37,0x84,0xEB,0xE8,0xCC, -0x81,0x48,0x43,0x67,0x4E,0x72,0x2A,0x9B,0x5C,0xBD,0x4C,0x1B,0x28,0x8A,0x5C,0x22, -0x7B,0xB4,0xAB,0x98,0xD9,0xEE,0xE0,0x51,0x83,0xC3,0x09,0x46,0x4E,0x6D,0x3E,0x99, -0xFA,0x95,0x17,0xDA,0x7C,0x33,0x57,0x41,0x3C,0x8D,0x51,0xED,0x0B,0xB6,0x5C,0xAF, -0x2C,0x63,0x1A,0xDF,0x57,0xC8,0x3F,0xBC,0xE9,0x5D,0xC4,0x9B,0xAF,0x45,0x99,0xE2, -0xA3,0x5A,0x24,0xB4,0xBA,0xA9,0x56,0x3D,0xCF,0x6F,0xAA,0xFF,0x49,0x58,0xBE,0xF0, -0xA8,0xFF,0xF4,0xB8,0xAD,0xE9,0x37,0xFB,0xBA,0xB8,0xF4,0x0B,0x3A,0xF9,0xE8,0x43, -0x42,0x1E,0x89,0xD8,0x84,0xCB,0x13,0xF1,0xD9,0xBB,0xE1,0x89,0x60,0xB8,0x8C,0x28, -0x56,0xAC,0x14,0x1D,0x9C,0x0A,0xE7,0x71,0xEB,0xCF,0x0E,0xDD,0x3D,0xA9,0x96,0xA1, -0x48,0xBD,0x3C,0xF7,0xAF,0xB5,0x0D,0x22,0x4C,0xC0,0x11,0x81,0xEC,0x56,0x3B,0xF6, -0xD3,0xA2,0xE2,0x5B,0xB7,0xB2,0x04,0x22,0x52,0x95,0x80,0x93,0x69,0xE8,0x8E,0x4C, -0x65,0xF1,0x91,0x03,0x2D,0x70,0x74,0x02,0xEA,0x8B,0x67,0x15,0x29,0x69,0x52,0x02, -0xBB,0xD7,0xDF,0x50,0x6A,0x55,0x46,0xBF,0xA0,0xA3,0x28,0x61,0x7F,0x70,0xD0,0xC3, -0xA2,0xAA,0x2C,0x21,0xAA,0x47,0xCE,0x28,0x9C,0x06,0x45,0x76,0xBF,0x82,0x18,0x27, -0xB4,0xD5,0xAE,0xB4,0xCB,0x50,0xE6,0x6B,0xF4,0x4C,0x86,0x71,0x30,0xE9,0xA6,0xDF, -0x16,0x86,0xE0,0xD8,0xFF,0x40,0xDD,0xFB,0xD0,0x42,0x88,0x7F,0xA3,0x33,0x3A,0x2E, -0x5C,0x1E,0x41,0x11,0x81,0x63,0xCE,0x18,0x71,0x6B,0x2B,0xEC,0xA6,0x8A,0xB7,0x31, -0x5C,0x3A,0x6A,0x47,0xE0,0xC3,0x79,0x59,0xD6,0x20,0x1A,0xAF,0xF2,0x6A,0x98,0xAA, -0x72,0xBC,0x57,0x4A,0xD2,0x4B,0x9D,0xBB,0x10,0xFC,0xB0,0x4C,0x41,0xE5,0xED,0x1D, -0x3D,0x5E,0x28,0x9D,0x9C,0xCC,0xBF,0xB3,0x51,0xDA,0xA7,0x47,0xE5,0x84,0x53,0x02, -0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04, -0x16,0x04,0x14,0xBB,0xAF,0x7E,0x02,0x3D,0xFA,0xA6,0xF1,0x3C,0x84,0x8E,0xAD,0xEE, -0x38,0x98,0xEC,0xD9,0x32,0x32,0xD4,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01, -0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01, -0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x0C,0x05,0x00,0x03,0x82,0x02,0x01,0x00,0x0A,0xF1,0xD5,0x46, -0x84,0xB7,0xAE,0x51,0xBB,0x6C,0xB2,0x4D,0x41,0x14,0x00,0x93,0x4C,0x9C,0xCB,0xE5, -0xC0,0x54,0xCF,0xA0,0x25,0x8E,0x02,0xF9,0xFD,0xB0,0xA2,0x0D,0xF5,0x20,0x98,0x3C, -0x13,0x2D,0xAC,0x56,0xA2,0xB0,0xD6,0x7E,0x11,0x92,0xE9,0x2E,0xBA,0x9E,0x2E,0x9A, -0x72,0xB1,0xBD,0x19,0x44,0x6C,0x61,0x35,0xA2,0x9A,0xB4,0x16,0x12,0x69,0x5A,0x8C, -0xE1,0xD7,0x3E,0xA4,0x1A,0xE8,0x2F,0x03,0xF4,0xAE,0x61,0x1D,0x10,0x1B,0x2A,0xA4, -0x8B,0x7A,0xC5,0xFE,0x05,0xA6,0xE1,0xC0,0xD6,0xC8,0xFE,0x9E,0xAE,0x8F,0x2B,0xBA, -0x3D,0x99,0xF8,0xD8,0x73,0x09,0x58,0x46,0x6E,0xA6,0x9C,0xF4,0xD7,0x27,0xD3,0x95, -0xDA,0x37,0x83,0x72,0x1C,0xD3,0x73,0xE0,0xA2,0x47,0x99,0x03,0x38,0x5D,0xD5,0x49, -0x79,0x00,0x29,0x1C,0xC7,0xEC,0x9B,0x20,0x1C,0x07,0x24,0x69,0x57,0x78,0xB2,0x39, -0xFC,0x3A,0x84,0xA0,0xB5,0x9C,0x7C,0x8D,0xBF,0x2E,0x93,0x62,0x27,0xB7,0x39,0xDA, -0x17,0x18,0xAE,0xBD,0x3C,0x09,0x68,0xFF,0x84,0x9B,0x3C,0xD5,0xD6,0x0B,0x03,0xE3, -0x57,0x9E,0x14,0xF7,0xD1,0xEB,0x4F,0xC8,0xBD,0x87,0x23,0xB7,0xB6,0x49,0x43,0x79, -0x85,0x5C,0xBA,0xEB,0x92,0x0B,0xA1,0xC6,0xE8,0x68,0xA8,0x4C,0x16,0xB1,0x1A,0x99, -0x0A,0xE8,0x53,0x2C,0x92,0xBB,0xA1,0x09,0x18,0x75,0x0C,0x65,0xA8,0x7B,0xCB,0x23, -0xB7,0x1A,0xC2,0x28,0x85,0xC3,0x1B,0xFF,0xD0,0x2B,0x62,0xEF,0xA4,0x7B,0x09,0x91, -0x98,0x67,0x8C,0x14,0x01,0xCD,0x68,0x06,0x6A,0x63,0x21,0x75,0x03,0x80,0x88,0x8A, -0x6E,0x81,0xC6,0x85,0xF2,0xA9,0xA4,0x2D,0xE7,0xF4,0xA5,0x24,0x10,0x47,0x83,0xCA, -0xCD,0xF4,0x8D,0x79,0x58,0xB1,0x06,0x9B,0xE7,0x1A,0x2A,0xD9,0x9D,0x01,0xD7,0x94, -0x7D,0xED,0x03,0x4A,0xCA,0xF0,0xDB,0xE8,0xA9,0x01,0x3E,0xF5,0x56,0x99,0xC9,0x1E, -0x8E,0x49,0x3D,0xBB,0xE5,0x09,0xB9,0xE0,0x4F,0x49,0x92,0x3D,0x16,0x82,0x40,0xCC, -0xCC,0x59,0xC6,0xE6,0x3A,0xED,0x12,0x2E,0x69,0x3C,0x6C,0x95,0xB1,0xFD,0xAA,0x1D, -0x7B,0x7F,0x86,0xBE,0x1E,0x0E,0x32,0x46,0xFB,0xFB,0x13,0x8F,0x75,0x7F,0x4C,0x8B, -0x4B,0x46,0x63,0xFE,0x00,0x34,0x40,0x70,0xC1,0xC3,0xB9,0xA1,0xDD,0xA6,0x70,0xE2, -0x04,0xB3,0x41,0xBC,0xE9,0x80,0x91,0xEA,0x64,0x9C,0x7A,0xE1,0x22,0x03,0xA9,0x9C, -0x6E,0x6F,0x0E,0x65,0x4F,0x6C,0x87,0x87,0x5E,0xF3,0x6E,0xA0,0xF9,0x75,0xA5,0x9B, -0x40,0xE8,0x53,0xB2,0x27,0x9D,0x4A,0xB9,0xC0,0x77,0x21,0x8D,0xFF,0x87,0xF2,0xDE, -0xBC,0x8C,0xEF,0x17,0xDF,0xB7,0x49,0x0B,0xD1,0xF2,0x6E,0x30,0x0B,0x1A,0x0E,0x4E, -0x76,0xED,0x11,0xFC,0xF5,0xE9,0x56,0xB2,0x7D,0xBF,0xC7,0x6D,0x0A,0x93,0x8C,0xA5, -0xD0,0xC0,0xB6,0x1D,0xBE,0x3A,0x4E,0x94,0xA2,0xD7,0x6E,0x6C,0x0B,0xC2,0x8A,0x7C, -0xFA,0x20,0xF3,0xC4,0xE4,0xE5,0xCD,0x0D,0xA8,0xCB,0x91,0x92,0xB1,0x7C,0x85,0xEC, -0xB5,0x14,0x69,0x66,0x0E,0x82,0xE7,0xCD,0xCE,0xC8,0x2D,0xA6,0x51,0x7F,0x21,0xC1, -0x35,0x53,0x85,0x06,0x4A,0x5D,0x9F,0xAD,0xBB,0x1B,0x5F,0x74, -}; - - -/* subject:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC */ -/* issuer :/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC */ - - -const unsigned char UTN_DATACorp_SGC_Root_CA_certificate[1122]={ -0x30,0x82,0x04,0x5E,0x30,0x82,0x03,0x46,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x44, -0xBE,0x0C,0x8B,0x50,0x00,0x21,0xB4,0x11,0xD3,0x2A,0x68,0x06,0xA9,0xAD,0x69,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0x93,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x08,0x13,0x02,0x55,0x54,0x31,0x17,0x30,0x15,0x06, -0x03,0x55,0x04,0x07,0x13,0x0E,0x53,0x61,0x6C,0x74,0x20,0x4C,0x61,0x6B,0x65,0x20, -0x43,0x69,0x74,0x79,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55,0x04,0x0A,0x13,0x15,0x54, -0x68,0x65,0x20,0x55,0x53,0x45,0x52,0x54,0x52,0x55,0x53,0x54,0x20,0x4E,0x65,0x74, -0x77,0x6F,0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x0B,0x13,0x18,0x68, -0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x75,0x73,0x65,0x72,0x74,0x72, -0x75,0x73,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x03, -0x13,0x12,0x55,0x54,0x4E,0x20,0x2D,0x20,0x44,0x41,0x54,0x41,0x43,0x6F,0x72,0x70, -0x20,0x53,0x47,0x43,0x30,0x1E,0x17,0x0D,0x39,0x39,0x30,0x36,0x32,0x34,0x31,0x38, -0x35,0x37,0x32,0x31,0x5A,0x17,0x0D,0x31,0x39,0x30,0x36,0x32,0x34,0x31,0x39,0x30, -0x36,0x33,0x30,0x5A,0x30,0x81,0x93,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x55,0x53,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x08,0x13,0x02,0x55, -0x54,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x07,0x13,0x0E,0x53,0x61,0x6C,0x74, -0x20,0x4C,0x61,0x6B,0x65,0x20,0x43,0x69,0x74,0x79,0x31,0x1E,0x30,0x1C,0x06,0x03, -0x55,0x04,0x0A,0x13,0x15,0x54,0x68,0x65,0x20,0x55,0x53,0x45,0x52,0x54,0x52,0x55, -0x53,0x54,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03, -0x55,0x04,0x0B,0x13,0x18,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E, -0x75,0x73,0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x1B,0x30, -0x19,0x06,0x03,0x55,0x04,0x03,0x13,0x12,0x55,0x54,0x4E,0x20,0x2D,0x20,0x44,0x41, -0x54,0x41,0x43,0x6F,0x72,0x70,0x20,0x53,0x47,0x43,0x30,0x82,0x01,0x22,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01, -0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xDF,0xEE,0x58,0x10,0xA2, -0x2B,0x6E,0x55,0xC4,0x8E,0xBF,0x2E,0x46,0x09,0xE7,0xE0,0x08,0x0F,0x2E,0x2B,0x7A, -0x13,0x94,0x1B,0xBD,0xF6,0xB6,0x80,0x8E,0x65,0x05,0x93,0x00,0x1E,0xBC,0xAF,0xE2, -0x0F,0x8E,0x19,0x0D,0x12,0x47,0xEC,0xAC,0xAD,0xA3,0xFA,0x2E,0x70,0xF8,0xDE,0x6E, -0xFB,0x56,0x42,0x15,0x9E,0x2E,0x5C,0xEF,0x23,0xDE,0x21,0xB9,0x05,0x76,0x27,0x19, -0x0F,0x4F,0xD6,0xC3,0x9C,0xB4,0xBE,0x94,0x19,0x63,0xF2,0xA6,0x11,0x0A,0xEB,0x53, -0x48,0x9C,0xBE,0xF2,0x29,0x3B,0x16,0xE8,0x1A,0xA0,0x4C,0xA6,0xC9,0xF4,0x18,0x59, -0x68,0xC0,0x70,0xF2,0x53,0x00,0xC0,0x5E,0x50,0x82,0xA5,0x56,0x6F,0x36,0xF9,0x4A, -0xE0,0x44,0x86,0xA0,0x4D,0x4E,0xD6,0x47,0x6E,0x49,0x4A,0xCB,0x67,0xD7,0xA6,0xC4, -0x05,0xB9,0x8E,0x1E,0xF4,0xFC,0xFF,0xCD,0xE7,0x36,0xE0,0x9C,0x05,0x6C,0xB2,0x33, -0x22,0x15,0xD0,0xB4,0xE0,0xCC,0x17,0xC0,0xB2,0xC0,0xF4,0xFE,0x32,0x3F,0x29,0x2A, -0x95,0x7B,0xD8,0xF2,0xA7,0x4E,0x0F,0x54,0x7C,0xA1,0x0D,0x80,0xB3,0x09,0x03,0xC1, -0xFF,0x5C,0xDD,0x5E,0x9A,0x3E,0xBC,0xAE,0xBC,0x47,0x8A,0x6A,0xAE,0x71,0xCA,0x1F, -0xB1,0x2A,0xB8,0x5F,0x42,0x05,0x0B,0xEC,0x46,0x30,0xD1,0x72,0x0B,0xCA,0xE9,0x56, -0x6D,0xF5,0xEF,0xDF,0x78,0xBE,0x61,0xBA,0xB2,0xA5,0xAE,0x04,0x4C,0xBC,0xA8,0xAC, -0x69,0x15,0x97,0xBD,0xEF,0xEB,0xB4,0x8C,0xBF,0x35,0xF8,0xD4,0xC3,0xD1,0x28,0x0E, -0x5C,0x3A,0x9F,0x70,0x18,0x33,0x20,0x77,0xC4,0xA2,0xAF,0x02,0x03,0x01,0x00,0x01, -0xA3,0x81,0xAB,0x30,0x81,0xA8,0x30,0x0B,0x06,0x03,0x55,0x1D,0x0F,0x04,0x04,0x03, -0x02,0x01,0xC6,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x53, -0x32,0xD1,0xB3,0xCF,0x7F,0xFA,0xE0,0xF1,0xA0,0x5D,0x85,0x4E,0x92,0xD2,0x9E,0x45, -0x1D,0xB4,0x4F,0x30,0x3D,0x06,0x03,0x55,0x1D,0x1F,0x04,0x36,0x30,0x34,0x30,0x32, -0xA0,0x30,0xA0,0x2E,0x86,0x2C,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C, -0x2E,0x75,0x73,0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x2E,0x63,0x6F,0x6D,0x2F,0x55, -0x54,0x4E,0x2D,0x44,0x41,0x54,0x41,0x43,0x6F,0x72,0x70,0x53,0x47,0x43,0x2E,0x63, -0x72,0x6C,0x30,0x2A,0x06,0x03,0x55,0x1D,0x25,0x04,0x23,0x30,0x21,0x06,0x08,0x2B, -0x06,0x01,0x05,0x05,0x07,0x03,0x01,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0x82,0x37, -0x0A,0x03,0x03,0x06,0x09,0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x04,0x01,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01, -0x01,0x00,0x27,0x35,0x97,0x00,0x8A,0x8B,0x28,0xBD,0xC6,0x33,0x30,0x1E,0x29,0xFC, -0xE2,0xF7,0xD5,0x98,0xD4,0x40,0xBB,0x60,0xCA,0xBF,0xAB,0x17,0x2C,0x09,0x36,0x7F, -0x50,0xFA,0x41,0xDC,0xAE,0x96,0x3A,0x0A,0x23,0x3E,0x89,0x59,0xC9,0xA3,0x07,0xED, -0x1B,0x37,0xAD,0xFC,0x7C,0xBE,0x51,0x49,0x5A,0xDE,0x3A,0x0A,0x54,0x08,0x16,0x45, -0xC2,0x99,0xB1,0x87,0xCD,0x8C,0x68,0xE0,0x69,0x03,0xE9,0xC4,0x4E,0x98,0xB2,0x3B, -0x8C,0x16,0xB3,0x0E,0xA0,0x0C,0x98,0x50,0x9B,0x93,0xA9,0x70,0x09,0xC8,0x2C,0xA3, -0x8F,0xDF,0x02,0xE4,0xE0,0x71,0x3A,0xF1,0xB4,0x23,0x72,0xA0,0xAA,0x01,0xDF,0xDF, -0x98,0x3E,0x14,0x50,0xA0,0x31,0x26,0xBD,0x28,0xE9,0x5A,0x30,0x26,0x75,0xF9,0x7B, -0x60,0x1C,0x8D,0xF3,0xCD,0x50,0x26,0x6D,0x04,0x27,0x9A,0xDF,0xD5,0x0D,0x45,0x47, -0x29,0x6B,0x2C,0xE6,0x76,0xD9,0xA9,0x29,0x7D,0x32,0xDD,0xC9,0x36,0x3C,0xBD,0xAE, -0x35,0xF1,0x11,0x9E,0x1D,0xBB,0x90,0x3F,0x12,0x47,0x4E,0x8E,0xD7,0x7E,0x0F,0x62, -0x73,0x1D,0x52,0x26,0x38,0x1C,0x18,0x49,0xFD,0x30,0x74,0x9A,0xC4,0xE5,0x22,0x2F, -0xD8,0xC0,0x8D,0xED,0x91,0x7A,0x4C,0x00,0x8F,0x72,0x7F,0x5D,0xDA,0xDD,0x1B,0x8B, -0x45,0x6B,0xE7,0xDD,0x69,0x97,0xA8,0xC5,0x56,0x4C,0x0F,0x0C,0xF6,0x9F,0x7A,0x91, -0x37,0xF6,0x97,0x82,0xE0,0xDD,0x71,0x69,0xFF,0x76,0x3F,0x60,0x4D,0x3C,0xCF,0xF7, -0x99,0xF9,0xC6,0x57,0xF4,0xC9,0x55,0x39,0x78,0xBA,0x2C,0x79,0xC9,0xA6,0x88,0x2B, -0xF4,0x08, -}; - - -const unsigned char* kSSLCertCertificateList[] = { - GlobalSign_Root_CA_certificate, - USERTrust_RSA_Certification_Authority_certificate, - Starfield_Class_2_CA_certificate, - Verisign_Class_3_Public_Primary_Certification_Authority___G3_certificate, - USERTrust_ECC_Certification_Authority_certificate, - GeoTrust_Global_CA_certificate, - Starfield_Root_Certificate_Authority___G2_certificate, - DigiCert_Global_Root_G3_certificate, - thawte_Primary_Root_CA___G2_certificate, - VeriSign_Universal_Root_Certification_Authority_certificate, - VeriSign_Class_3_Public_Primary_Certification_Authority___G4_certificate, - DigiCert_Global_Root_G2_certificate, - AddTrust_Low_Value_Services_Root_certificate, - AffirmTrust_Premium_ECC_certificate, - Verisign_Class_4_Public_Primary_Certification_Authority___G3_certificate, - thawte_Primary_Root_CA_certificate, - AddTrust_Public_Services_Root_certificate, - AddTrust_Qualified_Certificates_Root_certificate, - GeoTrust_Primary_Certification_Authority___G3_certificate, - GeoTrust_Universal_CA_2_certificate, - Baltimore_CyberTrust_Root_certificate, - GlobalSign_Root_CA___R2_certificate, - GlobalSign_Root_CA___R3_certificate, - AffirmTrust_Networking_certificate, - AddTrust_External_Root_certificate, - thawte_Primary_Root_CA___G3_certificate, - DigiCert_Assured_ID_Root_CA_certificate, - Go_Daddy_Class_2_CA_certificate, - GeoTrust_Primary_Certification_Authority_certificate, - VeriSign_Class_3_Public_Primary_Certification_Authority___G5_certificate, - Equifax_Secure_CA_certificate, - Entrust_net_Premium_2048_Secure_Server_CA_certificate, - DigiCert_Assured_ID_Root_G3_certificate, - COMODO_Certification_Authority_certificate, - DigiCert_Global_Root_CA_certificate, - Comodo_AAA_Services_root_certificate, - DigiCert_High_Assurance_EV_Root_CA_certificate, - GeoTrust_Universal_CA_certificate, - COMODO_ECC_Certification_Authority_certificate, - Entrust_Root_Certification_Authority___G2_certificate, - DigiCert_Assured_ID_Root_G2_certificate, - AffirmTrust_Commercial_certificate, - AffirmTrust_Premium_certificate, - Go_Daddy_Root_Certificate_Authority___G2_certificate, - Comodo_Secure_Services_root_certificate, - DigiCert_Trusted_Root_G4_certificate, - GlobalSign_ECC_Root_CA___R5_certificate, - UTN_USERFirst_Hardware_Root_CA_certificate, - GlobalSign_ECC_Root_CA___R4_certificate, - TC_TrustCenter_Universal_CA_I_certificate, - Comodo_Trusted_Services_root_certificate, - Entrust_Root_Certification_Authority_certificate, - TC_TrustCenter_Class_2_CA_II_certificate, - Cybertrust_Global_Root_certificate, - Entrust_Root_Certification_Authority___EC1_certificate, - GeoTrust_Primary_Certification_Authority___G2_certificate, - GeoTrust_Global_CA_2_certificate, - COMODO_RSA_Certification_Authority_certificate, - UTN_DATACorp_SGC_Root_CA_certificate, -}; - -const size_t kSSLCertCertificateSizeList[] = { - 889, - 1506, - 1043, - 1054, - 659, - 856, - 993, - 579, - 652, - 1213, - 904, - 914, - 1052, - 514, - 1054, - 1060, - 1049, - 1058, - 1026, - 1392, - 891, - 958, - 867, - 848, - 1082, - 1070, - 955, - 1028, - 896, - 1239, - 804, - 1120, - 586, - 1057, - 947, - 1078, - 969, - 1388, - 653, - 1090, - 922, - 848, - 1354, - 969, - 1091, - 1428, - 546, - 1144, - 485, - 993, - 1095, - 1173, - 1198, - 933, - 765, - 690, - 874, - 1500, - 1122, -}; - -#endif // WEBRTC_RTC_BASE_SSLROOTS_H_ diff --git a/webrtc/rtc_base/sslstreamadapter.h b/webrtc/rtc_base/sslstreamadapter.h deleted file mode 100644 index 8d85e9270c..0000000000 --- a/webrtc/rtc_base/sslstreamadapter.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SSLSTREAMADAPTER_H_ -#define WEBRTC_RTC_BASE_SSLSTREAMADAPTER_H_ - -#include -#include -#include - -#include "webrtc/base/stream.h" -#include "webrtc/base/sslidentity.h" - -namespace rtc { - -// Constants for SSL profile. -const int TLS_NULL_WITH_NULL_NULL = 0; - -// Constants for SRTP profiles. -const int SRTP_INVALID_CRYPTO_SUITE = 0; -#ifndef SRTP_AES128_CM_SHA1_80 -const int SRTP_AES128_CM_SHA1_80 = 0x0001; -#endif -#ifndef SRTP_AES128_CM_SHA1_32 -const int SRTP_AES128_CM_SHA1_32 = 0x0002; -#endif -#ifndef SRTP_AEAD_AES_128_GCM -const int SRTP_AEAD_AES_128_GCM = 0x0007; -#endif -#ifndef SRTP_AEAD_AES_256_GCM -const int SRTP_AEAD_AES_256_GCM = 0x0008; -#endif - -// Names of SRTP profiles listed above. -// 128-bit AES with 80-bit SHA-1 HMAC. -extern const char CS_AES_CM_128_HMAC_SHA1_80[]; -// 128-bit AES with 32-bit SHA-1 HMAC. -extern const char CS_AES_CM_128_HMAC_SHA1_32[]; -// 128-bit AES GCM with 16 byte AEAD auth tag. -extern const char CS_AEAD_AES_128_GCM[]; -// 256-bit AES GCM with 16 byte AEAD auth tag. -extern const char CS_AEAD_AES_256_GCM[]; - -// Given the DTLS-SRTP protection profile ID, as defined in -// https://tools.ietf.org/html/rfc4568#section-6.2 , return the SRTP profile -// name, as defined in https://tools.ietf.org/html/rfc5764#section-4.1.2. -std::string SrtpCryptoSuiteToName(int crypto_suite); - -// The reverse of above conversion. -int SrtpCryptoSuiteFromName(const std::string& crypto_suite); - -// Get key length and salt length for given crypto suite. Returns true for -// valid suites, otherwise false. -bool GetSrtpKeyAndSaltLengths(int crypto_suite, int *key_length, - int *salt_length); - -// Returns true if the given crypto suite id uses a GCM cipher. -bool IsGcmCryptoSuite(int crypto_suite); - -// Returns true if the given crypto suite name uses a GCM cipher. -bool IsGcmCryptoSuiteName(const std::string& crypto_suite); - -struct CryptoOptions { - CryptoOptions() {} - - // Helper method to return an instance of the CryptoOptions with GCM crypto - // suites disabled. This method should be used instead of depending on current - // default values set by the constructor. - static CryptoOptions NoGcm(); - - // Enable GCM crypto suites from RFC 7714 for SRTP. GCM will only be used - // if both sides enable it. - bool enable_gcm_crypto_suites = false; -}; - -// Returns supported crypto suites, given |crypto_options|. -// CS_AES_CM_128_HMAC_SHA1_32 will be preferred by default. -std::vector GetSupportedDtlsSrtpCryptoSuites( - const rtc::CryptoOptions& crypto_options); - -// SSLStreamAdapter : A StreamInterfaceAdapter that does SSL/TLS. -// After SSL has been started, the stream will only open on successful -// SSL verification of certificates, and the communication is -// encrypted of course. -// -// This class was written with SSLAdapter as a starting point. It -// offers a similar interface, with two differences: there is no -// support for a restartable SSL connection, and this class has a -// peer-to-peer mode. -// -// The SSL library requires initialization and cleanup. Static method -// for doing this are in SSLAdapter. They should possibly be moved out -// to a neutral class. - - -enum SSLRole { SSL_CLIENT, SSL_SERVER }; -enum SSLMode { SSL_MODE_TLS, SSL_MODE_DTLS }; -enum SSLProtocolVersion { - SSL_PROTOCOL_TLS_10, - SSL_PROTOCOL_TLS_11, - SSL_PROTOCOL_TLS_12, - SSL_PROTOCOL_DTLS_10 = SSL_PROTOCOL_TLS_11, - SSL_PROTOCOL_DTLS_12 = SSL_PROTOCOL_TLS_12, -}; -enum class SSLPeerCertificateDigestError { - NONE, - UNKNOWN_ALGORITHM, - INVALID_LENGTH, - VERIFICATION_FAILED, -}; - -// Errors for Read -- in the high range so no conflict with OpenSSL. -enum { SSE_MSG_TRUNC = 0xff0001 }; - -// Used to send back UMA histogram value. Logged when Dtls handshake fails. -enum class SSLHandshakeError { UNKNOWN, INCOMPATIBLE_CIPHERSUITE, MAX_VALUE }; - -class SSLStreamAdapter : public StreamAdapterInterface { - public: - // Instantiate an SSLStreamAdapter wrapping the given stream, - // (using the selected implementation for the platform). - // Caller is responsible for freeing the returned object. - static SSLStreamAdapter* Create(StreamInterface* stream); - - explicit SSLStreamAdapter(StreamInterface* stream); - ~SSLStreamAdapter() override; - - void set_ignore_bad_cert(bool ignore) { ignore_bad_cert_ = ignore; } - bool ignore_bad_cert() const { return ignore_bad_cert_; } - - void set_client_auth_enabled(bool enabled) { client_auth_enabled_ = enabled; } - bool client_auth_enabled() const { return client_auth_enabled_; } - - // Specify our SSL identity: key and certificate. SSLStream takes ownership - // of the SSLIdentity object and will free it when appropriate. Should be - // called no more than once on a given SSLStream instance. - virtual void SetIdentity(SSLIdentity* identity) = 0; - - // Call this to indicate that we are to play the server role (or client role, - // if the default argument is replaced by SSL_CLIENT). - // The default argument is for backward compatibility. - // TODO(ekr@rtfm.com): rename this SetRole to reflect its new function - virtual void SetServerRole(SSLRole role = SSL_SERVER) = 0; - - // Do DTLS or TLS. - virtual void SetMode(SSLMode mode) = 0; - - // Set maximum supported protocol version. The highest version supported by - // both ends will be used for the connection, i.e. if one party supports - // DTLS 1.0 and the other DTLS 1.2, DTLS 1.0 will be used. - // If requested version is not supported by underlying crypto library, the - // next lower will be used. - virtual void SetMaxProtocolVersion(SSLProtocolVersion version) = 0; - - // Set the initial retransmission timeout for DTLS messages. When the timeout - // expires, the message gets retransmitted and the timeout is exponentially - // increased. - // This should only be called before StartSSL(). - virtual void SetInitialRetransmissionTimeout(int timeout_ms) = 0; - - // StartSSL starts negotiation with a peer, whose certificate is verified - // using the certificate digest. Generally, SetIdentity() and possibly - // SetServerRole() should have been called before this. - // SetPeerCertificateDigest() must also be called. It may be called after - // StartSSLWithPeer() but must be called before the underlying stream opens. - // - // Use of the stream prior to calling StartSSL will pass data in clear text. - // Calling StartSSL causes SSL negotiation to begin as soon as possible: right - // away if the underlying wrapped stream is already opened, or else as soon as - // it opens. - // - // StartSSL returns a negative error code on failure. Returning 0 means - // success so far, but negotiation is probably not complete and will continue - // asynchronously. In that case, the exposed stream will open after - // successful negotiation and verification, or an SE_CLOSE event will be - // raised if negotiation fails. - virtual int StartSSL() = 0; - - // Specify the digest of the certificate that our peer is expected to use. - // Only this certificate will be accepted during SSL verification. The - // certificate is assumed to have been obtained through some other secure - // channel (such as the signaling channel). This must specify the terminal - // certificate, not just a CA. SSLStream makes a copy of the digest value. - // - // Returns true if successful. - // |error| is optional and provides more information about the failure. - virtual bool SetPeerCertificateDigest( - const std::string& digest_alg, - const unsigned char* digest_val, - size_t digest_len, - SSLPeerCertificateDigestError* error = nullptr) = 0; - - // Retrieves the peer's X.509 certificate, if a connection has been - // established. It returns the transmitted over SSL, including the entire - // chain. - virtual std::unique_ptr GetPeerCertificate() const = 0; - - // Retrieves the IANA registration id of the cipher suite used for the - // connection (e.g. 0x2F for "TLS_RSA_WITH_AES_128_CBC_SHA"). - virtual bool GetSslCipherSuite(int* cipher_suite); - - virtual int GetSslVersion() const = 0; - - // Key Exporter interface from RFC 5705 - // Arguments are: - // label -- the exporter label. - // part of the RFC defining each exporter - // usage (IN) - // context/context_len -- a context to bind to for this connection; - // optional, can be null, 0 (IN) - // use_context -- whether to use the context value - // (needed to distinguish no context from - // zero-length ones). - // result -- where to put the computed value - // result_len -- the length of the computed value - virtual bool ExportKeyingMaterial(const std::string& label, - const uint8_t* context, - size_t context_len, - bool use_context, - uint8_t* result, - size_t result_len); - - // DTLS-SRTP interface - virtual bool SetDtlsSrtpCryptoSuites(const std::vector& crypto_suites); - virtual bool GetDtlsSrtpCryptoSuite(int* crypto_suite); - - // Returns true if a TLS connection has been established. - // The only difference between this and "GetState() == SE_OPEN" is that if - // the peer certificate digest hasn't been verified, the state will still be - // SS_OPENING but IsTlsConnected should return true. - virtual bool IsTlsConnected() = 0; - - // Capabilities testing. - // Used to have "DTLS supported", "DTLS-SRTP supported" etc. methods, but now - // that's assumed. - static bool IsBoringSsl(); - - // Returns true iff the supplied cipher is deemed to be strong. - // TODO(torbjorng): Consider removing the KeyType argument. - static bool IsAcceptableCipher(int cipher, KeyType key_type); - static bool IsAcceptableCipher(const std::string& cipher, KeyType key_type); - - // TODO(guoweis): Move this away from a static class method. Currently this is - // introduced such that any caller could depend on sslstreamadapter.h without - // depending on specific SSL implementation. - static std::string SslCipherSuiteToName(int cipher_suite); - - // Use our timeutils.h source of timing in BoringSSL, allowing us to test - // using a fake clock. - static void enable_time_callback_for_testing(); - - sigslot::signal1 SignalSSLHandshakeError; - - private: - // If true, the server certificate need not match the configured - // server_name, and in fact missing certificate authority and other - // verification errors are ignored. - bool ignore_bad_cert_; - - // If true (default), the client is required to provide a certificate during - // handshake. If no certificate is given, handshake fails. This applies to - // server mode only. - bool client_auth_enabled_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_SSLSTREAMADAPTER_H_ diff --git a/webrtc/rtc_base/stream.h b/webrtc/rtc_base/stream.h deleted file mode 100644 index c03867da31..0000000000 --- a/webrtc/rtc_base/stream.h +++ /dev/null @@ -1,715 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_STREAM_H_ -#define WEBRTC_RTC_BASE_STREAM_H_ - -#include - -#include - -#include "webrtc/base/buffer.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/criticalsection.h" -#include "webrtc/base/logging.h" -#include "webrtc/base/messagehandler.h" -#include "webrtc/base/messagequeue.h" -#include "webrtc/base/sigslot.h" - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// -// StreamInterface is a generic asynchronous stream interface, supporting read, -// write, and close operations, and asynchronous signalling of state changes. -// The interface is designed with file, memory, and socket implementations in -// mind. Some implementations offer extended operations, such as seeking. -/////////////////////////////////////////////////////////////////////////////// - -// The following enumerations are declared outside of the StreamInterface -// class for brevity in use. - -// The SS_OPENING state indicates that the stream will signal open or closed -// in the future. -enum StreamState { SS_CLOSED, SS_OPENING, SS_OPEN }; - -// Stream read/write methods return this value to indicate various success -// and failure conditions described below. -enum StreamResult { SR_ERROR, SR_SUCCESS, SR_BLOCK, SR_EOS }; - -// StreamEvents are used to asynchronously signal state transitionss. The flags -// may be combined. -// SE_OPEN: The stream has transitioned to the SS_OPEN state -// SE_CLOSE: The stream has transitioned to the SS_CLOSED state -// SE_READ: Data is available, so Read is likely to not return SR_BLOCK -// SE_WRITE: Data can be written, so Write is likely to not return SR_BLOCK -enum StreamEvent { SE_OPEN = 1, SE_READ = 2, SE_WRITE = 4, SE_CLOSE = 8 }; - -class Thread; - -struct StreamEventData : public MessageData { - int events, error; - StreamEventData(int ev, int er) : events(ev), error(er) { } -}; - -class StreamInterface : public MessageHandler { - public: - enum { - MSG_POST_EVENT = 0xF1F1, MSG_MAX = MSG_POST_EVENT - }; - - ~StreamInterface() override; - - virtual StreamState GetState() const = 0; - - // Read attempts to fill buffer of size buffer_len. Write attempts to send - // data_len bytes stored in data. The variables read and write are set only - // on SR_SUCCESS (see below). Likewise, error is only set on SR_ERROR. - // Read and Write return a value indicating: - // SR_ERROR: an error occurred, which is returned in a non-null error - // argument. Interpretation of the error requires knowledge of the - // stream's concrete type, which limits its usefulness. - // SR_SUCCESS: some number of bytes were successfully written, which is - // returned in a non-null read/write argument. - // SR_BLOCK: the stream is in non-blocking mode, and the operation would - // block, or the stream is in SS_OPENING state. - // SR_EOS: the end-of-stream has been reached, or the stream is in the - // SS_CLOSED state. - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error) = 0; - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error) = 0; - // Attempt to transition to the SS_CLOSED state. SE_CLOSE will not be - // signalled as a result of this call. - virtual void Close() = 0; - - // Streams may signal one or more StreamEvents to indicate state changes. - // The first argument identifies the stream on which the state change occured. - // The second argument is a bit-wise combination of StreamEvents. - // If SE_CLOSE is signalled, then the third argument is the associated error - // code. Otherwise, the value is undefined. - // Note: Not all streams will support asynchronous event signalling. However, - // SS_OPENING and SR_BLOCK returned from stream member functions imply that - // certain events will be raised in the future. - sigslot::signal3 SignalEvent; - - // Like calling SignalEvent, but posts a message to the specified thread, - // which will call SignalEvent. This helps unroll the stack and prevent - // re-entrancy. - void PostEvent(Thread* t, int events, int err); - // Like the aforementioned method, but posts to the current thread. - void PostEvent(int events, int err); - - // - // OPTIONAL OPERATIONS - // - // Not all implementations will support the following operations. In general, - // a stream will only support an operation if it reasonably efficient to do - // so. For example, while a socket could buffer incoming data to support - // seeking, it will not do so. Instead, a buffering stream adapter should - // be used. - // - // Even though several of these operations are related, you should - // always use whichever operation is most relevant. For example, you may - // be tempted to use GetSize() and GetPosition() to deduce the result of - // GetAvailable(). However, a stream which is read-once may support the - // latter operation but not the former. - // - - // The following four methods are used to avoid copying data multiple times. - - // GetReadData returns a pointer to a buffer which is owned by the stream. - // The buffer contains data_len bytes. null is returned if no data is - // available, or if the method fails. If the caller processes the data, it - // must call ConsumeReadData with the number of processed bytes. GetReadData - // does not require a matching call to ConsumeReadData if the data is not - // processed. Read and ConsumeReadData invalidate the buffer returned by - // GetReadData. - virtual const void* GetReadData(size_t* data_len); - virtual void ConsumeReadData(size_t used) {} - - // GetWriteBuffer returns a pointer to a buffer which is owned by the stream. - // The buffer has a capacity of buf_len bytes. null is returned if there is - // no buffer available, or if the method fails. The call may write data to - // the buffer, and then call ConsumeWriteBuffer with the number of bytes - // written. GetWriteBuffer does not require a matching call to - // ConsumeWriteData if no data is written. Write, ForceWrite, and - // ConsumeWriteData invalidate the buffer returned by GetWriteBuffer. - // TODO: Allow the caller to specify a minimum buffer size. If the specified - // amount of buffer is not yet available, return null and Signal SE_WRITE - // when it is available. If the requested amount is too large, return an - // error. - virtual void* GetWriteBuffer(size_t* buf_len); - virtual void ConsumeWriteBuffer(size_t used) {} - - // Write data_len bytes found in data, circumventing any throttling which - // would could cause SR_BLOCK to be returned. Returns true if all the data - // was written. Otherwise, the method is unsupported, or an unrecoverable - // error occurred, and the error value is set. This method should be used - // sparingly to write critical data which should not be throttled. A stream - // which cannot circumvent its blocking constraints should not implement this - // method. - // NOTE: This interface is being considered experimentally at the moment. It - // would be used by JUDP and BandwidthStream as a way to circumvent certain - // soft limits in writing. - //virtual bool ForceWrite(const void* data, size_t data_len, int* error) { - // if (error) *error = -1; - // return false; - //} - - // Seek to a byte offset from the beginning of the stream. Returns false if - // the stream does not support seeking, or cannot seek to the specified - // position. - virtual bool SetPosition(size_t position); - - // Get the byte offset of the current position from the start of the stream. - // Returns false if the position is not known. - virtual bool GetPosition(size_t* position) const; - - // Get the byte length of the entire stream. Returns false if the length - // is not known. - virtual bool GetSize(size_t* size) const; - - // Return the number of Read()-able bytes remaining before end-of-stream. - // Returns false if not known. - virtual bool GetAvailable(size_t* size) const; - - // Return the number of Write()-able bytes remaining before end-of-stream. - // Returns false if not known. - virtual bool GetWriteRemaining(size_t* size) const; - - // Return true if flush is successful. - virtual bool Flush(); - - // Communicates the amount of data which will be written to the stream. The - // stream may choose to preallocate memory to accomodate this data. The - // stream may return false to indicate that there is not enough room (ie, - // Write will return SR_EOS/SR_ERROR at some point). Note that calling this - // function should not affect the existing state of data in the stream. - virtual bool ReserveSize(size_t size); - - // - // CONVENIENCE METHODS - // - // These methods are implemented in terms of other methods, for convenience. - // - - // Seek to the start of the stream. - inline bool Rewind() { return SetPosition(0); } - - // WriteAll is a helper function which repeatedly calls Write until all the - // data is written, or something other than SR_SUCCESS is returned. Note that - // unlike Write, the argument 'written' is always set, and may be non-zero - // on results other than SR_SUCCESS. The remaining arguments have the - // same semantics as Write. - StreamResult WriteAll(const void* data, size_t data_len, - size_t* written, int* error); - - // Similar to ReadAll. Calls Read until buffer_len bytes have been read, or - // until a non-SR_SUCCESS result is returned. 'read' is always set. - StreamResult ReadAll(void* buffer, size_t buffer_len, - size_t* read, int* error); - - // ReadLine is a helper function which repeatedly calls Read until it hits - // the end-of-line character, or something other than SR_SUCCESS. - // TODO: this is too inefficient to keep here. Break this out into a buffered - // readline object or adapter - StreamResult ReadLine(std::string* line); - - protected: - StreamInterface(); - - // MessageHandler Interface - void OnMessage(Message* msg) override; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(StreamInterface); -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamAdapterInterface is a convenient base-class for adapting a stream. -// By default, all operations are pass-through. Override the methods that you -// require adaptation. Streams should really be upgraded to reference-counted. -// In the meantime, use the owned flag to indicate whether the adapter should -// own the adapted stream. -/////////////////////////////////////////////////////////////////////////////// - -class StreamAdapterInterface : public StreamInterface, - public sigslot::has_slots<> { - public: - explicit StreamAdapterInterface(StreamInterface* stream, bool owned = true); - - // Core Stream Interface - StreamState GetState() const override; - StreamResult Read(void* buffer, - size_t buffer_len, - size_t* read, - int* error) override; - StreamResult Write(const void* data, - size_t data_len, - size_t* written, - int* error) override; - void Close() override; - - // Optional Stream Interface - /* Note: Many stream adapters were implemented prior to this Read/Write - interface. Therefore, a simple pass through of data in those cases may - be broken. At a later time, we should do a once-over pass of all - adapters, and make them compliant with these interfaces, after which this - code can be uncommented. - virtual const void* GetReadData(size_t* data_len) { - return stream_->GetReadData(data_len); - } - virtual void ConsumeReadData(size_t used) { - stream_->ConsumeReadData(used); - } - - virtual void* GetWriteBuffer(size_t* buf_len) { - return stream_->GetWriteBuffer(buf_len); - } - virtual void ConsumeWriteBuffer(size_t used) { - stream_->ConsumeWriteBuffer(used); - } - */ - - /* Note: This interface is currently undergoing evaluation. - virtual bool ForceWrite(const void* data, size_t data_len, int* error) { - return stream_->ForceWrite(data, data_len, error); - } - */ - - bool SetPosition(size_t position) override; - bool GetPosition(size_t* position) const override; - bool GetSize(size_t* size) const override; - bool GetAvailable(size_t* size) const override; - bool GetWriteRemaining(size_t* size) const override; - bool ReserveSize(size_t size) override; - bool Flush() override; - - void Attach(StreamInterface* stream, bool owned = true); - StreamInterface* Detach(); - - protected: - ~StreamAdapterInterface() override; - - // Note that the adapter presents itself as the origin of the stream events, - // since users of the adapter may not recognize the adapted object. - virtual void OnEvent(StreamInterface* stream, int events, int err); - StreamInterface* stream() { return stream_; } - - private: - StreamInterface* stream_; - bool owned_; - RTC_DISALLOW_COPY_AND_ASSIGN(StreamAdapterInterface); -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamTap is a non-modifying, pass-through adapter, which copies all data -// in either direction to the tap. Note that errors or blocking on writing to -// the tap will prevent further tap writes from occurring. -/////////////////////////////////////////////////////////////////////////////// - -class StreamTap : public StreamAdapterInterface { - public: - explicit StreamTap(StreamInterface* stream, StreamInterface* tap); - ~StreamTap() override; - - void AttachTap(StreamInterface* tap); - StreamInterface* DetachTap(); - StreamResult GetTapResult(int* error); - - // StreamAdapterInterface Interface - StreamResult Read(void* buffer, - size_t buffer_len, - size_t* read, - int* error) override; - StreamResult Write(const void* data, - size_t data_len, - size_t* written, - int* error) override; - - private: - std::unique_ptr tap_; - StreamResult tap_result_; - int tap_error_; - RTC_DISALLOW_COPY_AND_ASSIGN(StreamTap); -}; - -/////////////////////////////////////////////////////////////////////////////// -// NullStream gives errors on read, and silently discards all written data. -/////////////////////////////////////////////////////////////////////////////// - -class NullStream : public StreamInterface { - public: - NullStream(); - ~NullStream() override; - - // StreamInterface Interface - StreamState GetState() const override; - StreamResult Read(void* buffer, - size_t buffer_len, - size_t* read, - int* error) override; - StreamResult Write(const void* data, - size_t data_len, - size_t* written, - int* error) override; - void Close() override; -}; - -/////////////////////////////////////////////////////////////////////////////// -// FileStream is a simple implementation of a StreamInterface, which does not -// support asynchronous notification. -/////////////////////////////////////////////////////////////////////////////// - -class FileStream : public StreamInterface { - public: - FileStream(); - ~FileStream() override; - - // The semantics of filename and mode are the same as stdio's fopen - virtual bool Open(const std::string& filename, const char* mode, int* error); - virtual bool OpenShare(const std::string& filename, const char* mode, - int shflag, int* error); - - // By default, reads and writes are buffered for efficiency. Disabling - // buffering causes writes to block until the bytes on disk are updated. - virtual bool DisableBuffering(); - - StreamState GetState() const override; - StreamResult Read(void* buffer, - size_t buffer_len, - size_t* read, - int* error) override; - StreamResult Write(const void* data, - size_t data_len, - size_t* written, - int* error) override; - void Close() override; - bool SetPosition(size_t position) override; - bool GetPosition(size_t* position) const override; - bool GetSize(size_t* size) const override; - bool GetAvailable(size_t* size) const override; - bool ReserveSize(size_t size) override; - - bool Flush() override; - -#if defined(WEBRTC_POSIX) && !defined(__native_client__) - // Tries to aquire an exclusive lock on the file. - // Use OpenShare(...) on win32 to get similar functionality. - bool TryLock(); - bool Unlock(); -#endif - - // Note: Deprecated in favor of Filesystem::GetFileSize(). - static bool GetSize(const std::string& filename, size_t* size); - - protected: - virtual void DoClose(); - - FILE* file_; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(FileStream); -}; - -/////////////////////////////////////////////////////////////////////////////// -// MemoryStream is a simple implementation of a StreamInterface over in-memory -// data. Data is read and written at the current seek position. Reads return -// end-of-stream when they reach the end of data. Writes actually extend the -// end of data mark. -/////////////////////////////////////////////////////////////////////////////// - -class MemoryStreamBase : public StreamInterface { - public: - StreamState GetState() const override; - StreamResult Read(void* buffer, - size_t bytes, - size_t* bytes_read, - int* error) override; - StreamResult Write(const void* buffer, - size_t bytes, - size_t* bytes_written, - int* error) override; - void Close() override; - bool SetPosition(size_t position) override; - bool GetPosition(size_t* position) const override; - bool GetSize(size_t* size) const override; - bool GetAvailable(size_t* size) const override; - bool ReserveSize(size_t size) override; - - char* GetBuffer() { return buffer_; } - const char* GetBuffer() const { return buffer_; } - - protected: - MemoryStreamBase(); - - virtual StreamResult DoReserve(size_t size, int* error); - - // Invariant: 0 <= seek_position <= data_length_ <= buffer_length_ - char* buffer_; - size_t buffer_length_; - size_t data_length_; - size_t seek_position_; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(MemoryStreamBase); -}; - -// MemoryStream dynamically resizes to accomodate written data. - -class MemoryStream : public MemoryStreamBase { - public: - MemoryStream(); - explicit MemoryStream(const char* data); // Calls SetData(data, strlen(data)) - MemoryStream(const void* data, size_t length); // Calls SetData(data, length) - ~MemoryStream() override; - - void SetData(const void* data, size_t length); - - protected: - StreamResult DoReserve(size_t size, int* error) override; - // Memory Streams are aligned for efficiency. - static const int kAlignment = 16; - char* buffer_alloc_; -}; - -// ExternalMemoryStream adapts an external memory buffer, so writes which would -// extend past the end of the buffer will return end-of-stream. - -class ExternalMemoryStream : public MemoryStreamBase { - public: - ExternalMemoryStream(); - ExternalMemoryStream(void* data, size_t length); - ~ExternalMemoryStream() override; - - void SetData(void* data, size_t length); -}; - -// FifoBuffer allows for efficient, thread-safe buffering of data between -// writer and reader. As the data can wrap around the end of the buffer, -// MemoryStreamBase can't help us here. - -class FifoBuffer : public StreamInterface { - public: - // Creates a FIFO buffer with the specified capacity. - explicit FifoBuffer(size_t length); - // Creates a FIFO buffer with the specified capacity and owner - FifoBuffer(size_t length, Thread* owner); - ~FifoBuffer() override; - // Gets the amount of data currently readable from the buffer. - bool GetBuffered(size_t* data_len) const; - // Resizes the buffer to the specified capacity. Fails if data_length_ > size - bool SetCapacity(size_t length); - - // Read into |buffer| with an offset from the current read position, offset - // is specified in number of bytes. - // This method doesn't adjust read position nor the number of available - // bytes, user has to call ConsumeReadData() to do this. - StreamResult ReadOffset(void* buffer, size_t bytes, size_t offset, - size_t* bytes_read); - - // Write |buffer| with an offset from the current write position, offset is - // specified in number of bytes. - // This method doesn't adjust the number of buffered bytes, user has to call - // ConsumeWriteBuffer() to do this. - StreamResult WriteOffset(const void* buffer, size_t bytes, size_t offset, - size_t* bytes_written); - - // StreamInterface methods - StreamState GetState() const override; - StreamResult Read(void* buffer, - size_t bytes, - size_t* bytes_read, - int* error) override; - StreamResult Write(const void* buffer, - size_t bytes, - size_t* bytes_written, - int* error) override; - void Close() override; - const void* GetReadData(size_t* data_len) override; - void ConsumeReadData(size_t used) override; - void* GetWriteBuffer(size_t* buf_len) override; - void ConsumeWriteBuffer(size_t used) override; - bool GetWriteRemaining(size_t* size) const override; - - private: - // Helper method that implements ReadOffset. Caller must acquire a lock - // when calling this method. - StreamResult ReadOffsetLocked(void* buffer, size_t bytes, size_t offset, - size_t* bytes_read) - EXCLUSIVE_LOCKS_REQUIRED(crit_); - - // Helper method that implements WriteOffset. Caller must acquire a lock - // when calling this method. - StreamResult WriteOffsetLocked(const void* buffer, size_t bytes, - size_t offset, size_t* bytes_written) - EXCLUSIVE_LOCKS_REQUIRED(crit_); - - // keeps the opened/closed state of the stream - StreamState state_ GUARDED_BY(crit_); - // the allocated buffer - std::unique_ptr buffer_ GUARDED_BY(crit_); - // size of the allocated buffer - size_t buffer_length_ GUARDED_BY(crit_); - // amount of readable data in the buffer - size_t data_length_ GUARDED_BY(crit_); - // offset to the readable data - size_t read_position_ GUARDED_BY(crit_); - // stream callbacks are dispatched on this thread - Thread* owner_; - // object lock - CriticalSection crit_; - RTC_DISALLOW_COPY_AND_ASSIGN(FifoBuffer); -}; - -/////////////////////////////////////////////////////////////////////////////// - -class LoggingAdapter : public StreamAdapterInterface { - public: - LoggingAdapter(StreamInterface* stream, LoggingSeverity level, - const std::string& label, bool hex_mode = false); - - void set_label(const std::string& label); - - StreamResult Read(void* buffer, - size_t buffer_len, - size_t* read, - int* error) override; - StreamResult Write(const void* data, - size_t data_len, - size_t* written, - int* error) override; - void Close() override; - - protected: - void OnEvent(StreamInterface* stream, int events, int err) override; - - private: - LoggingSeverity level_; - std::string label_; - bool hex_mode_; - LogMultilineState lms_; - - RTC_DISALLOW_COPY_AND_ASSIGN(LoggingAdapter); -}; - -/////////////////////////////////////////////////////////////////////////////// -// StringStream - Reads/Writes to an external std::string -/////////////////////////////////////////////////////////////////////////////// - -class StringStream : public StreamInterface { - public: - explicit StringStream(std::string* str); - explicit StringStream(const std::string& str); - - StreamState GetState() const override; - StreamResult Read(void* buffer, - size_t buffer_len, - size_t* read, - int* error) override; - StreamResult Write(const void* data, - size_t data_len, - size_t* written, - int* error) override; - void Close() override; - bool SetPosition(size_t position) override; - bool GetPosition(size_t* position) const override; - bool GetSize(size_t* size) const override; - bool GetAvailable(size_t* size) const override; - bool ReserveSize(size_t size) override; - - private: - std::string& str_; - size_t read_pos_; - bool read_only_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamReference - A reference counting stream adapter -/////////////////////////////////////////////////////////////////////////////// - -// Keep in mind that the streams and adapters defined in this file are -// not thread-safe, so this has limited uses. - -// A StreamRefCount holds the reference count and a pointer to the -// wrapped stream. It deletes the wrapped stream when there are no -// more references. We can then have multiple StreamReference -// instances pointing to one StreamRefCount, all wrapping the same -// stream. - -class StreamReference : public StreamAdapterInterface { - class StreamRefCount; - public: - // Constructor for the first reference to a stream - // Note: get more references through NewReference(). Use this - // constructor only once on a given stream. - explicit StreamReference(StreamInterface* stream); - StreamInterface* GetStream() { return stream(); } - StreamInterface* NewReference(); - ~StreamReference() override; - - private: - class StreamRefCount { - public: - explicit StreamRefCount(StreamInterface* stream) - : stream_(stream), ref_count_(1) { - } - void AddReference() { - CritScope lock(&cs_); - ++ref_count_; - } - void Release() { - int ref_count; - { // Atomic ops would have been a better fit here. - CritScope lock(&cs_); - ref_count = --ref_count_; - } - if (ref_count == 0) { - delete stream_; - delete this; - } - } - private: - StreamInterface* stream_; - int ref_count_; - CriticalSection cs_; - RTC_DISALLOW_COPY_AND_ASSIGN(StreamRefCount); - }; - - // Constructor for adding references - explicit StreamReference(StreamRefCount* stream_ref_count, - StreamInterface* stream); - - StreamRefCount* stream_ref_count_; - RTC_DISALLOW_COPY_AND_ASSIGN(StreamReference); -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Flow attempts to move bytes from source to sink via buffer of size -// buffer_len. The function returns SR_SUCCESS when source reaches -// end-of-stream (returns SR_EOS), and all the data has been written successful -// to sink. Alternately, if source returns SR_BLOCK or SR_ERROR, or if sink -// returns SR_BLOCK, SR_ERROR, or SR_EOS, then the function immediately returns -// with the unexpected StreamResult value. -// data_len is the length of the valid data in buffer. in case of error -// this is the data that read from source but can't move to destination. -// as a pass in parameter, it indicates data in buffer that should move to sink -StreamResult Flow(StreamInterface* source, - char* buffer, - size_t buffer_len, - StreamInterface* sink, - size_t* data_len = nullptr); - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_STREAM_H_ diff --git a/webrtc/rtc_base/string_to_number.h b/webrtc/rtc_base/string_to_number.h deleted file mode 100644 index 4dcddf56fd..0000000000 --- a/webrtc/rtc_base/string_to_number.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2017 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_STRING_TO_NUMBER_H_ -#define WEBRTC_RTC_BASE_STRING_TO_NUMBER_H_ - -#include -#include - -#include "webrtc/base/optional.h" - -namespace rtc { - -// This file declares a family of functions to parse integers from strings. -// The standard C library functions either fail to indicate errors (atoi, etc.) -// or are a hassle to work with (strtol, sscanf, etc.). The standard C++ library -// functions (std::stoi, etc.) indicate errors by throwing exceptions, which -// are disabled in WebRTC. -// -// Integers are parsed using one of the following functions: -// rtc::Optional StringToNumber(const char* str, int base = 10); -// rtc::Optional StringToNumber(const std::string& str, -// int base = 10); -// -// These functions parse a value from the beginning of a string into one of the -// fundamental integer types, or returns an empty Optional if parsing -// failed. Values outside of the range supported by the type will be -// rejected. The strings must begin with a digit or a minus sign. No leading -// space nor trailing contents are allowed. -// By setting base to 0, one of octal, decimal or hexadecimal will be -// detected from the string's prefix (0, nothing or 0x, respectively). -// If non-zero, base can be set to a value between 2 and 36 inclusively. -// -// If desired, this interface could be extended with support for floating-point -// types. - -namespace string_to_number_internal { -// These must be (unsigned) long long, to match the signature of strto(u)ll. -using unsigned_type = unsigned long long; // NOLINT(runtime/int) -using signed_type = long long; // NOLINT(runtime/int) - -rtc::Optional ParseSigned(const char* str, int base); -rtc::Optional ParseUnsigned(const char* str, int base); -} // namespace string_to_number_internal - -template -typename std::enable_if::value && std::is_signed::value, - rtc::Optional>::type -StringToNumber(const char* str, int base = 10) { - using string_to_number_internal::signed_type; - static_assert( - std::numeric_limits::max() <= - std::numeric_limits::max() && - std::numeric_limits::lowest() >= - std::numeric_limits::lowest(), - "StringToNumber only supports signed integers as large as long long int"); - rtc::Optional value = - string_to_number_internal::ParseSigned(str, base); - if (value && *value >= std::numeric_limits::lowest() && - *value <= std::numeric_limits::max()) { - return rtc::Optional(static_cast(*value)); - } - return rtc::Optional(); -} - -template -typename std::enable_if::value && - std::is_unsigned::value, - rtc::Optional>::type -StringToNumber(const char* str, int base = 10) { - using string_to_number_internal::unsigned_type; - static_assert(std::numeric_limits::max() <= - std::numeric_limits::max(), - "StringToNumber only supports unsigned integers as large as " - "unsigned long long int"); - rtc::Optional value = - string_to_number_internal::ParseUnsigned(str, base); - if (value && *value <= std::numeric_limits::max()) { - return rtc::Optional(static_cast(*value)); - } - return rtc::Optional(); -} - -// The std::string overloads only exists if there is a matching const char* -// version. -template -auto StringToNumber(const std::string& str, int base = 10) - -> decltype(StringToNumber(str.c_str(), base)) { - return StringToNumber(str.c_str(), base); -} - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_STRING_TO_NUMBER_H_ diff --git a/webrtc/rtc_base/stringencode.h b/webrtc/rtc_base/stringencode.h deleted file mode 100644 index 668947daff..0000000000 --- a/webrtc/rtc_base/stringencode.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_STRINGENCODE_H_ -#define WEBRTC_RTC_BASE_STRINGENCODE_H_ - -#include -#include -#include - -#include "webrtc/base/checks.h" - -namespace rtc { - -////////////////////////////////////////////////////////////////////// -// String Encoding Utilities -////////////////////////////////////////////////////////////////////// - -// Convert an unsigned value to it's utf8 representation. Returns the length -// of the encoded string, or 0 if the encoding is longer than buflen - 1. -size_t utf8_encode(char* buffer, size_t buflen, unsigned long value); -// Decode the utf8 encoded value pointed to by source. Returns the number of -// bytes used by the encoding, or 0 if the encoding is invalid. -size_t utf8_decode(const char* source, size_t srclen, unsigned long* value); - -// Escaping prefixes illegal characters with the escape character. Compact, but -// illegal characters still appear in the string. -size_t escape(char * buffer, size_t buflen, - const char * source, size_t srclen, - const char * illegal, char escape); -// Note: in-place unescaping (buffer == source) is allowed. -size_t unescape(char * buffer, size_t buflen, - const char * source, size_t srclen, - char escape); - -// Encoding replaces illegal characters with the escape character and 2 hex -// chars, so it's a little less compact than escape, but completely removes -// illegal characters. note that hex digits should not be used as illegal -// characters. -size_t encode(char * buffer, size_t buflen, - const char * source, size_t srclen, - const char * illegal, char escape); -// Note: in-place decoding (buffer == source) is allowed. -size_t decode(char * buffer, size_t buflen, - const char * source, size_t srclen, - char escape); - -// Returns a list of characters that may be unsafe for use in the name of a -// file, suitable for passing to the 'illegal' member of escape or encode. -const char* unsafe_filename_characters(); - -// url_encode is an encode operation with a predefined set of illegal characters -// and escape character (for use in URLs, obviously). -size_t url_encode(char * buffer, size_t buflen, - const char * source, size_t srclen); -// Note: in-place decoding (buffer == source) is allowed. -size_t url_decode(char * buffer, size_t buflen, - const char * source, size_t srclen); - -// html_encode prevents data embedded in html from containing markup. -size_t html_encode(char * buffer, size_t buflen, - const char * source, size_t srclen); -// Note: in-place decoding (buffer == source) is allowed. -size_t html_decode(char * buffer, size_t buflen, - const char * source, size_t srclen); - -// xml_encode makes data suitable for inside xml attributes and values. -size_t xml_encode(char * buffer, size_t buflen, - const char * source, size_t srclen); -// Note: in-place decoding (buffer == source) is allowed. -size_t xml_decode(char * buffer, size_t buflen, - const char * source, size_t srclen); - -// Convert an unsigned value from 0 to 15 to the hex character equivalent... -char hex_encode(unsigned char val); -// ...and vice-versa. -bool hex_decode(char ch, unsigned char* val); - -// hex_encode shows the hex representation of binary data in ascii. -size_t hex_encode(char* buffer, size_t buflen, - const char* source, size_t srclen); - -// hex_encode, but separate each byte representation with a delimiter. -// |delimiter| == 0 means no delimiter -// If the buffer is too short, we return 0 -size_t hex_encode_with_delimiter(char* buffer, size_t buflen, - const char* source, size_t srclen, - char delimiter); - -// Helper functions for hex_encode. -std::string hex_encode(const std::string& str); -std::string hex_encode(const char* source, size_t srclen); -std::string hex_encode_with_delimiter(const char* source, size_t srclen, - char delimiter); - -// hex_decode converts ascii hex to binary. -size_t hex_decode(char* buffer, size_t buflen, - const char* source, size_t srclen); - -// hex_decode, assuming that there is a delimiter between every byte -// pair. -// |delimiter| == 0 means no delimiter -// If the buffer is too short or the data is invalid, we return 0. -size_t hex_decode_with_delimiter(char* buffer, size_t buflen, - const char* source, size_t srclen, - char delimiter); - -// Helper functions for hex_decode. -size_t hex_decode(char* buffer, size_t buflen, const std::string& source); -size_t hex_decode_with_delimiter(char* buffer, size_t buflen, - const std::string& source, char delimiter); - -// Apply any suitable string transform (including the ones above) to an STL -// string. Stack-allocated temporary space is used for the transformation, -// so value and source may refer to the same string. -typedef size_t (*Transform)(char * buffer, size_t buflen, - const char * source, size_t srclen); -size_t transform(std::string& value, size_t maxlen, const std::string& source, - Transform t); - -// Return the result of applying transform t to source. -std::string s_transform(const std::string& source, Transform t); - -// Convenience wrappers. -inline std::string s_url_encode(const std::string& source) { - return s_transform(source, url_encode); -} -inline std::string s_url_decode(const std::string& source) { - return s_transform(source, url_decode); -} - -// Splits the source string into multiple fields separated by delimiter, -// with duplicates of delimiter creating empty fields. -size_t split(const std::string& source, char delimiter, - std::vector* fields); - -// Splits the source string into multiple fields separated by delimiter, -// with duplicates of delimiter ignored. Trailing delimiter ignored. -size_t tokenize(const std::string& source, char delimiter, - std::vector* fields); - -// Tokenize, including the empty tokens. -size_t tokenize_with_empty_tokens(const std::string& source, - char delimiter, - std::vector* fields); - -// Tokenize and append the tokens to fields. Return the new size of fields. -size_t tokenize_append(const std::string& source, char delimiter, - std::vector* fields); - -// Splits the source string into multiple fields separated by delimiter, with -// duplicates of delimiter ignored. Trailing delimiter ignored. A substring in -// between the start_mark and the end_mark is treated as a single field. Return -// the size of fields. For example, if source is "filename -// \"/Library/Application Support/media content.txt\"", delimiter is ' ', and -// the start_mark and end_mark are '"', this method returns two fields: -// "filename" and "/Library/Application Support/media content.txt". -size_t tokenize(const std::string& source, char delimiter, char start_mark, - char end_mark, std::vector* fields); - -// Extract the first token from source as separated by delimiter, with -// duplicates of delimiter ignored. Return false if the delimiter could not be -// found, otherwise return true. -bool tokenize_first(const std::string& source, - const char delimiter, - std::string* token, - std::string* rest); - -// Safe sprintf to std::string -//void sprintf(std::string& value, size_t maxlen, const char * format, ...) -// PRINTF_FORMAT(3); - -// Convert arbitrary values to/from a string. - -template -static bool ToString(const T &t, std::string* s) { - RTC_DCHECK(s); - std::ostringstream oss; - oss << std::boolalpha << t; - *s = oss.str(); - return !oss.fail(); -} - -template -static bool FromString(const std::string& s, T* t) { - RTC_DCHECK(t); - std::istringstream iss(s); - iss >> std::boolalpha >> *t; - return !iss.fail(); -} - -// Inline versions of the string conversion routines. - -template -static inline std::string ToString(const T& val) { - std::string str; ToString(val, &str); return str; -} - -template -static inline T FromString(const std::string& str) { - T val; FromString(str, &val); return val; -} - -template -static inline T FromString(const T& defaultValue, const std::string& str) { - T val(defaultValue); FromString(str, &val); return val; -} - -// simple function to strip out characters which shouldn't be -// used in filenames -char make_char_safe_for_filename(char c); - -////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_STRINGENCODE_H__ diff --git a/webrtc/rtc_base/stringize_macros.h b/webrtc/rtc_base/stringize_macros.h deleted file mode 100644 index 992d35c2c0..0000000000 --- a/webrtc/rtc_base/stringize_macros.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Modified from the Chromium original: -// src/base/strings/stringize_macros.h - -// This file defines preprocessor macros for stringizing preprocessor -// symbols (or their output) and manipulating preprocessor symbols -// that define strings. - -#ifndef WEBRTC_RTC_BASE_STRINGIZE_MACROS_H_ -#define WEBRTC_RTC_BASE_STRINGIZE_MACROS_H_ - -// This is not very useful as it does not expand defined symbols if -// called directly. Use its counterpart without the _NO_EXPANSION -// suffix, below. -#define STRINGIZE_NO_EXPANSION(x) #x - -// Use this to quote the provided parameter, first expanding it if it -// is a preprocessor symbol. -// -// For example, if: -// #define A FOO -// #define B(x) myobj->FunctionCall(x) -// -// Then: -// STRINGIZE(A) produces "FOO" -// STRINGIZE(B(y)) produces "myobj->FunctionCall(y)" -#define STRINGIZE(x) STRINGIZE_NO_EXPANSION(x) - -#endif // WEBRTC_RTC_BASE_STRINGIZE_MACROS_H_ diff --git a/webrtc/rtc_base/stringutils.h b/webrtc/rtc_base/stringutils.h deleted file mode 100644 index 1a6392f34a..0000000000 --- a/webrtc/rtc_base/stringutils.h +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_STRINGUTILS_H_ -#define WEBRTC_RTC_BASE_STRINGUTILS_H_ - -#include -#include -#include -#include - -#if defined(WEBRTC_WIN) -#include -#include -#define alloca _alloca -#endif // WEBRTC_WIN - -#if defined(WEBRTC_POSIX) -#ifdef BSD -#include -#else // BSD -#include -#endif // !BSD -#endif // WEBRTC_POSIX - -#include - -/////////////////////////////////////////////////////////////////////////////// -// Generic string/memory utilities -/////////////////////////////////////////////////////////////////////////////// - -#define STACK_ARRAY(TYPE, LEN) static_cast(::alloca((LEN)*sizeof(TYPE))) - -namespace rtc { - -// Complement to memset. Verifies memory consists of count bytes of value c. -bool memory_check(const void* memory, int c, size_t count); - -// Determines whether the simple wildcard pattern matches target. -// Alpha characters in pattern match case-insensitively. -// Asterisks in pattern match 0 or more characters. -// Ex: string_match("www.TEST.GOOGLE.COM", "www.*.com") -> true -bool string_match(const char* target, const char* pattern); - -} // namespace rtc - -/////////////////////////////////////////////////////////////////////////////// -// Rename a bunch of common string functions so they are consistent across -// platforms and between char and wchar_t variants. -// Here is the full list of functions that are unified: -// strlen, strcmp, stricmp, strncmp, strnicmp -// strchr, vsnprintf, strtoul, tolowercase -// tolowercase is like tolower, but not compatible with end-of-file value -// -// It's not clear if we will ever use wchar_t strings on unix. In theory, -// all strings should be Utf8 all the time, except when interfacing with Win32 -// APIs that require Utf16. -/////////////////////////////////////////////////////////////////////////////// - -inline char tolowercase(char c) { - return static_cast(tolower(c)); -} - -#if defined(WEBRTC_WIN) - -inline size_t strlen(const wchar_t* s) { - return wcslen(s); -} -inline int strcmp(const wchar_t* s1, const wchar_t* s2) { - return wcscmp(s1, s2); -} -inline int stricmp(const wchar_t* s1, const wchar_t* s2) { - return _wcsicmp(s1, s2); -} -inline int strncmp(const wchar_t* s1, const wchar_t* s2, size_t n) { - return wcsncmp(s1, s2, n); -} -inline int strnicmp(const wchar_t* s1, const wchar_t* s2, size_t n) { - return _wcsnicmp(s1, s2, n); -} -inline const wchar_t* strchr(const wchar_t* s, wchar_t c) { - return wcschr(s, c); -} -inline const wchar_t* strstr(const wchar_t* haystack, const wchar_t* needle) { - return wcsstr(haystack, needle); -} -#ifndef vsnprintf -inline int vsnprintf(wchar_t* buf, size_t n, const wchar_t* fmt, va_list args) { - return _vsnwprintf(buf, n, fmt, args); -} -#endif // !vsnprintf -inline unsigned long strtoul(const wchar_t* snum, wchar_t** end, int base) { - return wcstoul(snum, end, base); -} -inline wchar_t tolowercase(wchar_t c) { - return static_cast(towlower(c)); -} - -#endif // WEBRTC_WIN - -#if defined(WEBRTC_POSIX) - -inline int _stricmp(const char* s1, const char* s2) { - return strcasecmp(s1, s2); -} -inline int _strnicmp(const char* s1, const char* s2, size_t n) { - return strncasecmp(s1, s2, n); -} - -#endif // WEBRTC_POSIX - -/////////////////////////////////////////////////////////////////////////////// -// Traits simplifies porting string functions to be CTYPE-agnostic -/////////////////////////////////////////////////////////////////////////////// - -namespace rtc { - -const size_t SIZE_UNKNOWN = static_cast(-1); - -template -struct Traits { - // STL string type - //typedef XXX string; - // Null-terminated string - //inline static const CTYPE* empty_str(); -}; - -/////////////////////////////////////////////////////////////////////////////// -// String utilities which work with char or wchar_t -/////////////////////////////////////////////////////////////////////////////// - -template -inline const CTYPE* nonnull(const CTYPE* str, const CTYPE* def_str = nullptr) { - return str ? str : (def_str ? def_str : Traits::empty_str()); -} - -template -const CTYPE* strchr(const CTYPE* str, const CTYPE* chs) { - for (size_t i=0; str[i]; ++i) { - for (size_t j=0; chs[j]; ++j) { - if (str[i] == chs[j]) { - return str + i; - } - } - } - return 0; -} - -template -const CTYPE* strchrn(const CTYPE* str, size_t slen, CTYPE ch) { - for (size_t i=0; i -size_t strlenn(const CTYPE* buffer, size_t buflen) { - size_t bufpos = 0; - while (buffer[bufpos] && (bufpos < buflen)) { - ++bufpos; - } - return bufpos; -} - -// Safe versions of strncpy, strncat, snprintf and vsnprintf that always -// null-terminate. - -template -size_t strcpyn(CTYPE* buffer, size_t buflen, - const CTYPE* source, size_t srclen = SIZE_UNKNOWN) { - if (buflen <= 0) - return 0; - - if (srclen == SIZE_UNKNOWN) { - srclen = strlenn(source, buflen - 1); - } else if (srclen >= buflen) { - srclen = buflen - 1; - } - memcpy(buffer, source, srclen * sizeof(CTYPE)); - buffer[srclen] = 0; - return srclen; -} - -template -size_t strcatn(CTYPE* buffer, size_t buflen, - const CTYPE* source, size_t srclen = SIZE_UNKNOWN) { - if (buflen <= 0) - return 0; - - size_t bufpos = strlenn(buffer, buflen - 1); - return bufpos + strcpyn(buffer + bufpos, buflen - bufpos, source, srclen); -} - -// Some compilers (clang specifically) require vsprintfn be defined before -// sprintfn. -template -size_t vsprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, - va_list args) { - int len = vsnprintf(buffer, buflen, format, args); - if ((len < 0) || (static_cast(len) >= buflen)) { - len = static_cast(buflen - 1); - buffer[len] = 0; - } - return len; -} - -template -size_t sprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, ...); -template -size_t sprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, ...) { - va_list args; - va_start(args, format); - size_t len = vsprintfn(buffer, buflen, format, args); - va_end(args); - return len; -} - -/////////////////////////////////////////////////////////////////////////////// -// Allow safe comparing and copying ascii (not UTF-8) with both wide and -// non-wide character strings. -/////////////////////////////////////////////////////////////////////////////// - -inline int asccmp(const char* s1, const char* s2) { - return strcmp(s1, s2); -} -inline int ascicmp(const char* s1, const char* s2) { - return _stricmp(s1, s2); -} -inline int ascncmp(const char* s1, const char* s2, size_t n) { - return strncmp(s1, s2, n); -} -inline int ascnicmp(const char* s1, const char* s2, size_t n) { - return _strnicmp(s1, s2, n); -} -inline size_t asccpyn(char* buffer, size_t buflen, - const char* source, size_t srclen = SIZE_UNKNOWN) { - return strcpyn(buffer, buflen, source, srclen); -} - -#if defined(WEBRTC_WIN) - -typedef wchar_t(*CharacterTransformation)(wchar_t); -inline wchar_t identity(wchar_t c) { return c; } -int ascii_string_compare(const wchar_t* s1, const char* s2, size_t n, - CharacterTransformation transformation); - -inline int asccmp(const wchar_t* s1, const char* s2) { - return ascii_string_compare(s1, s2, static_cast(-1), identity); -} -inline int ascicmp(const wchar_t* s1, const char* s2) { - return ascii_string_compare(s1, s2, static_cast(-1), tolowercase); -} -inline int ascncmp(const wchar_t* s1, const char* s2, size_t n) { - return ascii_string_compare(s1, s2, n, identity); -} -inline int ascnicmp(const wchar_t* s1, const char* s2, size_t n) { - return ascii_string_compare(s1, s2, n, tolowercase); -} -size_t asccpyn(wchar_t* buffer, size_t buflen, - const char* source, size_t srclen = SIZE_UNKNOWN); - -#endif // WEBRTC_WIN - -/////////////////////////////////////////////////////////////////////////////// -// Traits specializations -/////////////////////////////////////////////////////////////////////////////// - -template<> -struct Traits { - typedef std::string string; - inline static const char* empty_str() { return ""; } -}; - -/////////////////////////////////////////////////////////////////////////////// -// Traits specializations (Windows only, currently) -/////////////////////////////////////////////////////////////////////////////// - -#if defined(WEBRTC_WIN) - -template<> -struct Traits { - typedef std::wstring string; - inline static const wchar_t* empty_str() { return L""; } -}; - -#endif // WEBRTC_WIN - -// Replaces all occurrences of "search" with "replace". -void replace_substrs(const char *search, - size_t search_len, - const char *replace, - size_t replace_len, - std::string *s); - -// True iff s1 starts with s2. -bool starts_with(const char *s1, const char *s2); - -// True iff s1 ends with s2. -bool ends_with(const char *s1, const char *s2); - -// Remove leading and trailing whitespaces. -std::string string_trim(const std::string& s); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_STRINGUTILS_H_ diff --git a/webrtc/rtc_base/swap_queue.h b/webrtc/rtc_base/swap_queue.h deleted file mode 100644 index 8c6527894c..0000000000 --- a/webrtc/rtc_base/swap_queue.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_SWAP_QUEUE_H_ -#define WEBRTC_RTC_BASE_SWAP_QUEUE_H_ - -#include -#include -#include - -#include "webrtc/base/checks.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/criticalsection.h" - -namespace webrtc { - -namespace internal { - -// (Internal; please don't use outside this file.) -template -bool NoopSwapQueueItemVerifierFunction(const T&) { - return true; -} - -} // namespace internal - -// Functor to use when supplying a verifier function for the queue. -template -class SwapQueueItemVerifier { - public: - bool operator()(const T& t) const { return QueueItemVerifierFunction(t); } -}; - -// This class is a fixed-size queue. A producer calls Insert() to insert -// an element of type T at the back of the queue, and a consumer calls -// Remove() to remove an element from the front of the queue. It's safe -// for the producer(s) and the consumer(s) to access the queue -// concurrently, from different threads. -// -// To avoid the construction, copying, and destruction of Ts that a naive -// queue implementation would require, for each "full" T passed from -// producer to consumer, SwapQueue passes an "empty" T in the other -// direction (an "empty" T is one that contains nothing of value for the -// consumer). This bidirectional movement is implemented with swap(). -// -// // Create queue: -// Bottle proto(568); // Prepare an empty Bottle. Heap allocates space for -// // 568 ml. -// SwapQueue q(N, proto); // Init queue with N copies of proto. -// // Each copy allocates on the heap. -// // Producer pseudo-code: -// Bottle b(568); // Prepare an empty Bottle. Heap allocates space for 568 ml. -// loop { -// b.Fill(amount); // Where amount <= 568 ml. -// q.Insert(&b); // Swap our full Bottle for an empty one from q. -// } -// -// // Consumer pseudo-code: -// Bottle b(568); // Prepare an empty Bottle. Heap allocates space for 568 ml. -// loop { -// q.Remove(&b); // Swap our empty Bottle for the next-in-line full Bottle. -// Drink(&b); -// } -// -// For a well-behaved Bottle class, there are no allocations in the -// producer, since it just fills an empty Bottle that's already large -// enough; no deallocations in the consumer, since it returns each empty -// Bottle to the queue after having drunk it; and no copies along the -// way, since the queue uses swap() everywhere to move full Bottles in -// one direction and empty ones in the other. -template > -class SwapQueue { - public: - // Creates a queue of size size and fills it with default constructed Ts. - explicit SwapQueue(size_t size) : queue_(size) { - RTC_DCHECK(VerifyQueueSlots()); - } - - // Same as above and accepts an item verification functor. - SwapQueue(size_t size, const QueueItemVerifier& queue_item_verifier) - : queue_item_verifier_(queue_item_verifier), queue_(size) { - RTC_DCHECK(VerifyQueueSlots()); - } - - // Creates a queue of size size and fills it with copies of prototype. - SwapQueue(size_t size, const T& prototype) : queue_(size, prototype) { - RTC_DCHECK(VerifyQueueSlots()); - } - - // Same as above and accepts an item verification functor. - SwapQueue(size_t size, - const T& prototype, - const QueueItemVerifier& queue_item_verifier) - : queue_item_verifier_(queue_item_verifier), queue_(size, prototype) { - RTC_DCHECK(VerifyQueueSlots()); - } - - // Resets the queue to have zero content wile maintaining the queue size. - void Clear() { - rtc::CritScope cs(&crit_queue_); - next_write_index_ = 0; - next_read_index_ = 0; - num_elements_ = 0; - } - - // Inserts a "full" T at the back of the queue by swapping *input with an - // "empty" T from the queue. - // Returns true if the item was inserted or false if not (the queue was full). - // When specified, the T given in *input must pass the ItemVerifier() test. - // The contents of *input after the call are then also guaranteed to pass the - // ItemVerifier() test. - bool Insert(T* input) RTC_WARN_UNUSED_RESULT { - RTC_DCHECK(input); - - rtc::CritScope cs(&crit_queue_); - - RTC_DCHECK(queue_item_verifier_(*input)); - - if (num_elements_ == queue_.size()) { - return false; - } - - using std::swap; - swap(*input, queue_[next_write_index_]); - - ++next_write_index_; - if (next_write_index_ == queue_.size()) { - next_write_index_ = 0; - } - - ++num_elements_; - - RTC_DCHECK_LT(next_write_index_, queue_.size()); - RTC_DCHECK_LE(num_elements_, queue_.size()); - - return true; - } - - // Removes the frontmost "full" T from the queue by swapping it with - // the "empty" T in *output. - // Returns true if an item could be removed or false if not (the queue was - // empty). When specified, The T given in *output must pass the ItemVerifier() - // test and the contents of *output after the call are then also guaranteed to - // pass the ItemVerifier() test. - bool Remove(T* output) RTC_WARN_UNUSED_RESULT { - RTC_DCHECK(output); - - rtc::CritScope cs(&crit_queue_); - - RTC_DCHECK(queue_item_verifier_(*output)); - - if (num_elements_ == 0) { - return false; - } - - using std::swap; - swap(*output, queue_[next_read_index_]); - - ++next_read_index_; - if (next_read_index_ == queue_.size()) { - next_read_index_ = 0; - } - - --num_elements_; - - RTC_DCHECK_LT(next_read_index_, queue_.size()); - RTC_DCHECK_LE(num_elements_, queue_.size()); - - return true; - } - - private: - // Verify that the queue slots complies with the ItemVerifier test. - bool VerifyQueueSlots() { - rtc::CritScope cs(&crit_queue_); - for (const auto& v : queue_) { - RTC_DCHECK(queue_item_verifier_(v)); - } - return true; - } - - rtc::CriticalSection crit_queue_; - - // TODO(peah): Change this to use std::function() once we can use C++11 std - // lib. - QueueItemVerifier queue_item_verifier_ GUARDED_BY(crit_queue_); - - // (next_read_index_ + num_elements_) % queue_.size() = - // next_write_index_ - size_t next_write_index_ GUARDED_BY(crit_queue_) = 0; - size_t next_read_index_ GUARDED_BY(crit_queue_) = 0; - size_t num_elements_ GUARDED_BY(crit_queue_) = 0; - - // queue_.size() is constant. - std::vector queue_ GUARDED_BY(crit_queue_); - - RTC_DISALLOW_COPY_AND_ASSIGN(SwapQueue); -}; - -} // namespace webrtc - -#endif // WEBRTC_RTC_BASE_SWAP_QUEUE_H_ diff --git a/webrtc/rtc_base/task_queue.h b/webrtc/rtc_base/task_queue.h deleted file mode 100644 index 4c43b23164..0000000000 --- a/webrtc/rtc_base/task_queue.h +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TASK_QUEUE_H_ -#define WEBRTC_RTC_BASE_TASK_QUEUE_H_ - -#include -#include -#include - -#if defined(WEBRTC_MAC) && !defined(WEBRTC_BUILD_LIBEVENT) -#include -#endif - -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/criticalsection.h" - -#if defined(WEBRTC_WIN) || defined(WEBRTC_BUILD_LIBEVENT) -#include "webrtc/base/platform_thread.h" -#endif - -#if defined(WEBRTC_BUILD_LIBEVENT) -#include "webrtc/base/refcountedobject.h" -#include "webrtc/base/scoped_ref_ptr.h" - -struct event_base; -struct event; -#endif - -namespace rtc { - -// Base interface for asynchronously executed tasks. -// The interface basically consists of a single function, Run(), that executes -// on the target queue. For more details see the Run() method and TaskQueue. -class QueuedTask { - public: - QueuedTask() {} - virtual ~QueuedTask() {} - - // Main routine that will run when the task is executed on the desired queue. - // The task should return |true| to indicate that it should be deleted or - // |false| to indicate that the queue should consider ownership of the task - // having been transferred. Returning |false| can be useful if a task has - // re-posted itself to a different queue or is otherwise being re-used. - virtual bool Run() = 0; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(QueuedTask); -}; - -// Simple implementation of QueuedTask for use with rtc::Bind and lambdas. -template -class ClosureTask : public QueuedTask { - public: - explicit ClosureTask(const Closure& closure) : closure_(closure) {} - - private: - bool Run() override { - closure_(); - return true; - } - - Closure closure_; -}; - -// Extends ClosureTask to also allow specifying cleanup code. -// This is useful when using lambdas if guaranteeing cleanup, even if a task -// was dropped (queue is too full), is required. -template -class ClosureTaskWithCleanup : public ClosureTask { - public: - ClosureTaskWithCleanup(const Closure& closure, Cleanup cleanup) - : ClosureTask(closure), cleanup_(cleanup) {} - ~ClosureTaskWithCleanup() { cleanup_(); } - - private: - Cleanup cleanup_; -}; - -// Convenience function to construct closures that can be passed directly -// to methods that support std::unique_ptr but not template -// based parameters. -template -static std::unique_ptr NewClosure(const Closure& closure) { - return std::unique_ptr(new ClosureTask(closure)); -} - -template -static std::unique_ptr NewClosure(const Closure& closure, - const Cleanup& cleanup) { - return std::unique_ptr( - new ClosureTaskWithCleanup(closure, cleanup)); -} - -// Implements a task queue that asynchronously executes tasks in a way that -// guarantees that they're executed in FIFO order and that tasks never overlap. -// Tasks may always execute on the same worker thread and they may not. -// To DCHECK that tasks are executing on a known task queue, use IsCurrent(). -// -// Here are some usage examples: -// -// 1) Asynchronously running a lambda: -// -// class MyClass { -// ... -// TaskQueue queue_("MyQueue"); -// }; -// -// void MyClass::StartWork() { -// queue_.PostTask([]() { Work(); }); -// ... -// -// 2) Doing work asynchronously on a worker queue and providing a notification -// callback on the current queue, when the work has been done: -// -// void MyClass::StartWorkAndLetMeKnowWhenDone( -// std::unique_ptr callback) { -// DCHECK(TaskQueue::Current()) << "Need to be running on a queue"; -// queue_.PostTaskAndReply([]() { Work(); }, std::move(callback)); -// } -// ... -// my_class->StartWorkAndLetMeKnowWhenDone( -// NewClosure([]() { LOG(INFO) << "The work is done!";})); -// -// 3) Posting a custom task on a timer. The task posts itself again after -// every running: -// -// class TimerTask : public QueuedTask { -// public: -// TimerTask() {} -// private: -// bool Run() override { -// ++count_; -// TaskQueue::Current()->PostDelayedTask( -// std::unique_ptr(this), 1000); -// // Ownership has been transferred to the next occurance, -// // so return false to prevent from being deleted now. -// return false; -// } -// int count_ = 0; -// }; -// ... -// queue_.PostDelayedTask( -// std::unique_ptr(new TimerTask()), 1000); -// -// For more examples, see task_queue_unittests.cc. -// -// A note on destruction: -// -// When a TaskQueue is deleted, pending tasks will not be executed but they will -// be deleted. The deletion of tasks may happen asynchronously after the -// TaskQueue itself has been deleted or it may happen synchronously while the -// TaskQueue instance is being deleted. This may vary from one OS to the next -// so assumptions about lifetimes of pending tasks should not be made. -class LOCKABLE TaskQueue { - public: - // TaskQueue priority levels. On some platforms these will map to thread - // priorities, on others such as Mac and iOS, GCD queue priorities. - enum class Priority { - NORMAL = 0, - HIGH, - LOW, - }; - - explicit TaskQueue(const char* queue_name, - Priority priority = Priority::NORMAL); - ~TaskQueue(); - - static TaskQueue* Current(); - - // Used for DCHECKing the current queue. - static bool IsCurrent(const char* queue_name); - bool IsCurrent() const; - - // TODO(tommi): For better debuggability, implement RTC_FROM_HERE. - - // Ownership of the task is passed to PostTask. - void PostTask(std::unique_ptr task); - void PostTaskAndReply(std::unique_ptr task, - std::unique_ptr reply, - TaskQueue* reply_queue); - void PostTaskAndReply(std::unique_ptr task, - std::unique_ptr reply); - - // Schedules a task to execute a specified number of milliseconds from when - // the call is made. The precision should be considered as "best effort" - // and in some cases, such as on Windows when all high precision timers have - // been used up, can be off by as much as 15 millseconds (although 8 would be - // more likely). This can be mitigated by limiting the use of delayed tasks. - void PostDelayedTask(std::unique_ptr task, uint32_t milliseconds); - - template - void PostTask(const Closure& closure) { - PostTask(std::unique_ptr(new ClosureTask(closure))); - } - - // See documentation above for performance expectations. - template - void PostDelayedTask(const Closure& closure, uint32_t milliseconds) { - PostDelayedTask( - std::unique_ptr(new ClosureTask(closure)), - milliseconds); - } - - template - void PostTaskAndReply(const Closure1& task, - const Closure2& reply, - TaskQueue* reply_queue) { - PostTaskAndReply( - std::unique_ptr(new ClosureTask(task)), - std::unique_ptr(new ClosureTask(reply)), - reply_queue); - } - - template - void PostTaskAndReply(std::unique_ptr task, - const Closure& reply) { - PostTaskAndReply(std::move(task), std::unique_ptr( - new ClosureTask(reply))); - } - - template - void PostTaskAndReply(const Closure& task, - std::unique_ptr reply) { - PostTaskAndReply( - std::unique_ptr(new ClosureTask(task)), - std::move(reply)); - } - - template - void PostTaskAndReply(const Closure1& task, const Closure2& reply) { - PostTaskAndReply( - std::unique_ptr(new ClosureTask(task)), - std::unique_ptr(new ClosureTask(reply))); - } - - private: -#if defined(WEBRTC_BUILD_LIBEVENT) - static void ThreadMain(void* context); - static void OnWakeup(int socket, short flags, void* context); // NOLINT - static void RunTask(int fd, short flags, void* context); // NOLINT - static void RunTimer(int fd, short flags, void* context); // NOLINT - - class ReplyTaskOwner; - class PostAndReplyTask; - class SetTimerTask; - - typedef RefCountedObject ReplyTaskOwnerRef; - - void PrepareReplyTask(scoped_refptr reply_task); - - struct QueueContext; - - int wakeup_pipe_in_ = -1; - int wakeup_pipe_out_ = -1; - event_base* event_base_; - std::unique_ptr wakeup_event_; - PlatformThread thread_; - rtc::CriticalSection pending_lock_; - std::list> pending_ GUARDED_BY(pending_lock_); - std::list> pending_replies_ - GUARDED_BY(pending_lock_); -#elif defined(WEBRTC_MAC) - struct QueueContext; - struct TaskContext; - struct PostTaskAndReplyContext; - dispatch_queue_t queue_; - QueueContext* const context_; -#elif defined(WEBRTC_WIN) - class ThreadState; - void RunPendingTasks(); - static void ThreadMain(void* context); - - class WorkerThread : public PlatformThread { - public: - WorkerThread(ThreadRunFunction func, - void* obj, - const char* thread_name, - ThreadPriority priority) - : PlatformThread(func, obj, thread_name, priority) {} - - bool QueueAPC(PAPCFUNC apc_function, ULONG_PTR data) { - return PlatformThread::QueueAPC(apc_function, data); - } - }; - WorkerThread thread_; - rtc::CriticalSection pending_lock_; - std::queue> pending_ GUARDED_BY(pending_lock_); - HANDLE in_queue_; -#else -#error not supported. -#endif - - RTC_DISALLOW_COPY_AND_ASSIGN(TaskQueue); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_TASK_QUEUE_H_ diff --git a/webrtc/rtc_base/task_queue_posix.h b/webrtc/rtc_base/task_queue_posix.h deleted file mode 100644 index cab2009a22..0000000000 --- a/webrtc/rtc_base/task_queue_posix.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TASK_QUEUE_POSIX_H_ -#define WEBRTC_RTC_BASE_TASK_QUEUE_POSIX_H_ - -#include - -namespace rtc { - -class TaskQueue; - -namespace internal { - -class AutoSetCurrentQueuePtr { - public: - explicit AutoSetCurrentQueuePtr(TaskQueue* q); - ~AutoSetCurrentQueuePtr(); - - private: - TaskQueue* const prev_; -}; - -pthread_key_t GetQueuePtrTls(); - -} // namespace internal -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_TASK_QUEUE_POSIX_H_ diff --git a/webrtc/rtc_base/template_util.h b/webrtc/rtc_base/template_util.h deleted file mode 100644 index acadc9d29a..0000000000 --- a/webrtc/rtc_base/template_util.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/template_util.h. - -#ifndef WEBRTC_RTC_BASE_TEMPLATE_UTIL_H_ -#define WEBRTC_RTC_BASE_TEMPLATE_UTIL_H_ - -#include // For size_t. - -namespace rtc { - -// Template definitions from tr1. - -template -struct integral_constant { - static const T value = v; - typedef T value_type; - typedef integral_constant type; -}; - -template const T integral_constant::value; - -typedef integral_constant true_type; -typedef integral_constant false_type; - -template struct is_pointer : false_type {}; -template struct is_pointer : true_type {}; - -template struct is_same : public false_type {}; -template struct is_same : true_type {}; - -template struct is_array : public false_type {}; -template struct is_array : public true_type {}; -template struct is_array : public true_type {}; - -template struct is_non_const_reference : false_type {}; -template struct is_non_const_reference : true_type {}; -template struct is_non_const_reference : false_type {}; - -template struct is_void : false_type {}; -template <> struct is_void : true_type {}; - -// Helper useful for converting a tuple to variadic template function -// arguments. -// -// sequence_generator<3>::type will be sequence<0, 1, 2>. -template -struct sequence {}; -template -struct sequence_generator : sequence_generator {}; -template -struct sequence_generator<0, S...> { - typedef sequence type; -}; - -namespace internal { - -// Types YesType and NoType are guaranteed such that sizeof(YesType) < -// sizeof(NoType). -typedef char YesType; - -struct NoType { - YesType dummy[2]; -}; - -// This class is an implementation detail for is_convertible, and you -// don't need to know how it works to use is_convertible. For those -// who care: we declare two different functions, one whose argument is -// of type To and one with a variadic argument list. We give them -// return types of different size, so we can use sizeof to trick the -// compiler into telling us which function it would have chosen if we -// had called it with an argument of type From. See Alexandrescu's -// _Modern C++ Design_ for more details on this sort of trick. - -struct ConvertHelper { - template - static YesType Test(To); - - template - static NoType Test(...); - - template - static From& Create(); -}; - -// Used to determine if a type is a struct/union/class. Inspired by Boost's -// is_class type_trait implementation. -struct IsClassHelper { - template - static YesType Test(void(C::*)(void)); - - template - static NoType Test(...); -}; - -} // namespace internal - -// Inherits from true_type if From is convertible to To, false_type otherwise. -// -// Note that if the type is convertible, this will be a true_type REGARDLESS -// of whether or not the conversion would emit a warning. -template -struct is_convertible - : integral_constant( - internal::ConvertHelper::Create())) == - sizeof(internal::YesType)> { -}; - -template -struct is_class - : integral_constant(0)) == - sizeof(internal::YesType)> { -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_TEMPLATE_UTIL_H_ diff --git a/webrtc/rtc_base/testbase64.h b/webrtc/rtc_base/testbase64.h deleted file mode 100644 index f8e7ac139b..0000000000 --- a/webrtc/rtc_base/testbase64.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TESTBASE64_H_ -#define WEBRTC_RTC_BASE_TESTBASE64_H_ - -/* This file was generated by googleclient/talk/binary2header.sh */ - -static unsigned char testbase64[] = { -0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xe1, 0x0d, 0x07, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x4d, 0x4d, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x01, 0x0e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x9e, 0x01, 0x0f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xbe, 0x01, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0xc3, 0x01, 0x12, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xcc, 0x01, 0x1b, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x28, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x01, 0x31, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x32, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x3c, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x04, 0x02, 0x13, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x87, 0x69, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x14, 0x00, 0x00, 0x02, 0xc4, 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, 0x20, 0x00, 0x53, 0x4f, 0x4e, 0x59, 0x00, 0x44, 0x53, 0x43, 0x2d, 0x50, 0x32, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x20, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x20, 0x37, 0x2e, 0x30, 0x00, 0x32, 0x30, 0x30, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x33, 0x30, 0x20, 0x32, 0x33, 0x3a, 0x31, 0x30, 0x3a, 0x30, 0x34, 0x00, 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58, 0x20, 0x31, 0x30, 0x2e, 0x34, 0x2e, 0x38, 0x00, 0x00, 0x1c, 0x82, 0x9a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x6a, 0x82, 0x9d, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x72, 0x88, 0x22, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x88, 0x27, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x64, 0x00, 0x00, 0x90, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x30, 0x32, 0x32, 0x30, 0x90, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02, 0x7a, 0x90, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02, 0x8e, 0x91, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x01, 0x02, 0x03, 0x00, 0x91, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xa2, 0x92, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xaa, 0x92, 0x05, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xb2, 0x92, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x92, 0x08, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x92, 0x09, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x92, 0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xba, 0xa0, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x30, 0x31, 0x30, 0x30, 0xa0, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0xa0, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0xa3, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x06, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x08, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x09, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x30, 0x30, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x32, 0x30, 0x20, 0x32, 0x33, 0x3a, 0x30, 0x35, 0x3a, 0x35, 0x32, 0x00, 0x32, 0x30, 0x30, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x32, 0x30, 0x20, 0x32, 0x33, 0x3a, 0x30, 0x35, 0x3a, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x12, 0x01, 0x1b, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x1a, 0x01, 0x28, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x02, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x22, 0x02, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x09, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xed, 0x00, 0x0c, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x5f, 0x43, 0x4d, 0x00, 0x02, 0xff, 0xee, 0x00, 0x0e, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x00, 0x64, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0c, 0x08, 0x08, 0x08, 0x09, 0x08, 0x0c, 0x09, 0x09, 0x0c, 0x11, 0x0b, 0x0a, 0x0b, 0x11, 0x15, 0x0f, 0x0c, 0x0c, 0x0f, 0x15, 0x18, 0x13, 0x13, 0x15, 0x13, 0x13, 0x18, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x01, 0x0d, 0x0b, 0x0b, 0x0d, 0x0e, 0x0d, 0x10, 0x0e, 0x0e, 0x10, 0x14, 0x0e, 0x0e, 0x0e, 0x14, 0x14, 0x0e, 0x0e, 0x0e, 0x0e, 0x14, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x64, 0x00, 0x64, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xdd, 0x00, 0x04, 0x00, 0x07, 0xff, 0xc4, 0x01, 0x3f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x01, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x01, 0x04, 0x01, 0x03, 0x02, 0x04, 0x02, 0x05, 0x07, 0x06, 0x08, 0x05, 0x03, 0x0c, 0x33, 0x01, 0x00, 0x02, 0x11, 0x03, 0x04, 0x21, 0x12, 0x31, 0x05, 0x41, 0x51, 0x61, 0x13, 0x22, 0x71, 0x81, 0x32, 0x06, 0x14, 0x91, 0xa1, 0xb1, 0x42, 0x23, 0x24, 0x15, 0x52, 0xc1, 0x62, 0x33, 0x34, 0x72, 0x82, 0xd1, 0x43, 0x07, 0x25, 0x92, 0x53, 0xf0, 0xe1, 0xf1, 0x63, 0x73, 0x35, 0x16, 0xa2, 0xb2, 0x83, 0x26, 0x44, 0x93, 0x54, 0x64, 0x45, 0xc2, 0xa3, 0x74, 0x36, 0x17, 0xd2, 0x55, 0xe2, 0x65, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x27, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x11, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x06, 0x05, 0x35, 0x01, 0x00, 0x02, 0x11, 0x03, 0x21, 0x31, 0x12, 0x04, 0x41, 0x51, 0x61, 0x71, 0x22, 0x13, 0x05, 0x32, 0x81, 0x91, 0x14, 0xa1, 0xb1, 0x42, 0x23, 0xc1, 0x52, 0xd1, 0xf0, 0x33, 0x24, 0x62, 0xe1, 0x72, 0x82, 0x92, 0x43, 0x53, 0x15, 0x63, 0x73, 0x34, 0xf1, 0x25, 0x06, 0x16, 0xa2, 0xb2, 0x83, 0x07, 0x26, 0x35, 0xc2, 0xd2, 0x44, 0x93, 0x54, 0xa3, 0x17, 0x64, 0x45, 0x55, 0x36, 0x74, 0x65, 0xe2, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xf2, 0xed, 0xb2, 0x8d, 0x4d, 0x45, 0xcd, 0x2f, 0x3f, 0x44, 0x68, 0x93, 0xc3, 0x58, 0xc8, 0xf1, 0x1f, 0x8a, 0x33, 0x86, 0xda, 0x58, 0xc1, 0xa0, 0x02, 0x4f, 0xc4, 0xa1, 0x69, 0xa5, 0x9b, 0x5b, 0x4b, 0x84, 0x73, 0xdf, 0xc9, 0x15, 0xf8, 0xe3, 0xd1, 0x0e, 0x07, 0x93, 0xf3, 0xd1, 0x0f, 0x1c, 0x17, 0xef, 0x2e, 0x3b, 0x5b, 0xdc, 0xff, 0x00, 0xdf, 0x42, 0xbf, 0x8f, 0x8e, 0xdc, 0x82, 0xca, 0xd8, 0x37, 0x11, 0xa9, 0x3d, 0x82, 0x69, 0x2b, 0xc4, 0x6d, 0xc9, 0x75, 0x25, 0xbc, 0xf7, 0xec, 0xa1, 0xb5, 0x74, 0x19, 0x5d, 0x2e, 0x8a, 0x9a, 0x4b, 0x89, 0x7d, 0xc4, 0x68, 0xc6, 0xf6, 0xfe, 0xb2, 0xa0, 0x30, 0x1d, 0x60, 0x86, 0x88, 0x8d, 0x49, 0x3e, 0x01, 0x11, 0x20, 0xa3, 0x8c, 0xb9, 0xb1, 0xaa, 0x62, 0xad, 0xbf, 0x18, 0x97, 0x43, 0x47, 0x1d, 0xd2, 0xaf, 0x04, 0xd9, 0xb8, 0xc8, 0x0d, 0x68, 0xe4, 0xf7, 0x3e, 0x48, 0xf1, 0x05, 0xbc, 0x25, 0xaa, 0x07, 0x71, 0xd9, 0x14, 0x78, 0xf6, 0x49, 0xb5, 0x90, 0xfd, 0xa7, 0xc6, 0x14, 0xfd, 0x1b, 0x1c, 0xff, 0x00, 0x4d, 0x8d, 0x2e, 0x73, 0x8c, 0x35, 0xa3, 0x52, 0x4f, 0x92, 0x48, 0xa6, 0x1a, 0x24, 0xb6, 0x2a, 0xfa, 0xa5, 0x9e, 0x60, 0x64, 0x39, 0x94, 0x13, 0xcb, 0x27, 0x73, 0x80, 0xf3, 0x0c, 0xf6, 0xff, 0x00, 0xd2, 0x5a, 0x78, 0xbf, 0x53, 0x71, 0xf6, 0x01, 0x75, 0xb6, 0x97, 0x6a, 0x25, 0xa1, 0xad, 0x1f, 0xf4, 0xb7, 0x23, 0x48, 0xb7, 0x94, 0x84, 0x97, 0x5b, 0xff, 0x00, 0x32, 0xa9, 0xdd, 0xfc, 0xed, 0x9b, 0x7e, 0x0d, 0x9e, 0x52, 0x4a, 0x95, 0x61, 0xff, 0xd0, 0xf3, 0x3b, 0xa7, 0x70, 0xee, 0x01, 0x8f, 0xb9, 0x59, 0xfa, 0x7e, 0xdf, 0xe4, 0xc8, 0xf9, 0x2a, 0xc2, 0x5c, 0x63, 0xc3, 0x54, 0x67, 0x87, 0x6e, 0x10, 0x35, 0x68, 0xd4, 0x79, 0x1e, 0x53, 0x4a, 0xe0, 0xdc, 0xe9, 0xb8, 0x1f, 0x6a, 0xda, 0x6c, 0x25, 0x94, 0x37, 0xb0, 0xd0, 0xb8, 0xad, 0x67, 0xe4, 0x55, 0x8a, 0x5b, 0x8b, 0x82, 0xc0, 0x6f, 0x76, 0x80, 0x34, 0x49, 0x05, 0x2e, 0x9e, 0xc6, 0x1c, 0x66, 0x31, 0xba, 0x10, 0x23, 0xe0, 0xaf, 0xe1, 0x61, 0x53, 0x43, 0x8d, 0x81, 0xb3, 0x67, 0xef, 0x9e, 0x49, 0x2a, 0x12, 0x6c, 0xb6, 0x63, 0x1a, 0x0c, 0x31, 0xba, 0x55, 0xcd, 0xac, 0xfa, 0x8e, 0xdf, 0x91, 0x6e, 0x91, 0xd9, 0xb3, 0xc9, 0x73, 0x90, 0x7a, 0xab, 0x6a, 0xc2, 0xa4, 0x60, 0xe2, 0x8f, 0xd2, 0x38, 0x03, 0x7d, 0x9e, 0x0d, 0xff, 0x00, 0xcc, 0xd6, 0xd3, 0x6b, 0x71, 0x67, 0xd2, 0x3e, 0x64, 0x72, 0xab, 0xdb, 0x8d, 0x54, 0x39, 0xc5, 0x83, 0x6b, 0x3d, 0xee, 0x2e, 0xd4, 0x92, 0x3c, 0x4a, 0x56, 0xba, 0xb4, 0x79, 0x5c, 0xf7, 0xb2, 0x96, 0x6c, 0x8d, 0xaf, 0x80, 0x48, 0x3c, 0xf0, 0xb2, 0x1f, 0x63, 0x9c, 0xe9, 0x3f, 0x24, 0x5c, 0xdb, 0xdd, 0x76, 0x43, 0xde, 0xfd, 0x5c, 0xe3, 0x24, 0xfc, 0x50, 0x00, 0x93, 0x0a, 0x78, 0x8a, 0x0d, 0x49, 0xca, 0xcf, 0x93, 0x63, 0x1b, 0x7d, 0xd7, 0x57, 0x50, 0xd5, 0xef, 0x70, 0x6b, 0x4f, 0xc7, 0x45, 0xdb, 0x74, 0x9e, 0x8d, 0x5e, 0x33, 0x83, 0xd8, 0x37, 0xdd, 0xc3, 0xac, 0x3d, 0xbf, 0x92, 0xc5, 0x5b, 0xea, 0xbf, 0xd5, 0x62, 0xc0, 0xdc, 0xbc, 0xbd, 0x2d, 0x22, 0x5a, 0xcf, 0xdd, 0x69, 0xff, 0x00, 0xd1, 0x8e, 0x5d, 0xa5, 0x38, 0xb5, 0xb0, 0x00, 0xc6, 0xc4, 0x24, 0x4a, 0xd6, 0x8d, 0x18, 0x04, 0x49, 0x88, 0x9e, 0x55, 0xd6, 0x61, 0xb0, 0xc1, 0x70, 0x32, 0xdd, 0x3c, 0x95, 0xda, 0xf1, 0xfe, 0xf5, 0x62, 0xbc, 0x76, 0x8e, 0x75, 0x28, 0x02, 0xa2, 0xe7, 0x7d, 0x92, 0xb9, 0x84, 0x96, 0x96, 0xda, 0xf7, 0x70, 0x12, 0x4e, 0x5a, 0xff, 0x00, 0xff, 0xd1, 0xf3, 0x7a, 0x21, 0xaf, 0xde, 0xef, 0xa2, 0x22, 0x55, 0xfc, 0x5a, 0xbd, 0x42, 0xfb, 0x08, 0xfa, 0x67, 0x4f, 0x82, 0xcd, 0x6d, 0x85, 0xc0, 0x56, 0x3b, 0x90, 0xb7, 0xf0, 0x2a, 0x0e, 0x63, 0x58, 0x3b, 0xf2, 0xa3, 0x9e, 0x8c, 0xb8, 0x86, 0xbe, 0x49, 0xf1, 0x2c, 0x0c, 0x86, 0xb4, 0x4c, 0x69, 0xe4, 0xaf, 0x6e, 0xcc, 0x6b, 0x7d, 0x46, 0xb3, 0x70, 0xec, 0x38, 0x51, 0x7d, 0x02, 0x8a, 0xc7, 0xa6, 0xd9, 0x20, 0x68, 0x0f, 0x8f, 0x8a, 0xcf, 0xc9, 0xc2, 0xea, 0x59, 0x5b, 0x48, 0xb0, 0x91, 0xae, 0xe6, 0xc9, 0x03, 0xc9, 0x30, 0x51, 0x66, 0xd4, 0x0d, 0xad, 0xbd, 0x5f, 0x53, 0xcc, 0x6b, 0xb6, 0x90, 0x5a, 0x3b, 0x83, 0x0b, 0x43, 0x17, 0x31, 0xd6, 0xc3, 0x6e, 0x12, 0x3b, 0x79, 0xac, 0xc1, 0x89, 0x47, 0xd9, 0xe8, 0x63, 0x98, 0x45, 0xed, 0x6c, 0x5a, 0xf1, 0xa0, 0x27, 0xc5, 0x5b, 0xc3, 0x6f, 0xa6, 0xe0, 0x1c, 0x7d, 0xb3, 0xa2, 0x69, 0x34, 0x7b, 0xae, 0x1a, 0x8d, 0x45, 0x17, 0x9d, 0xeb, 0xfd, 0x21, 0xd8, 0xb9, 0xae, 0xb5, 0x80, 0xbb, 0x1e, 0xd2, 0x5c, 0xd7, 0x78, 0x13, 0xf9, 0xae, 0x4b, 0xea, 0xc7, 0x4a, 0x39, 0xbd, 0x55, 0xb3, 0xed, 0x66, 0x38, 0xf5, 0x09, 0x22, 0x41, 0x23, 0xe8, 0x37, 0xfb, 0x4b, 0xa1, 0xeb, 0xd6, 0xfe, 0x88, 0x31, 0xbf, 0x41, 0xc0, 0xee, 0xd2, 0x74, 0x02, 0x78, 0x53, 0xfa, 0x97, 0x43, 0x19, 0x85, 0x65, 0xff, 0x00, 0x9d, 0x71, 0x33, 0xe4, 0x1a, 0x7d, 0x8d, 0x53, 0x42, 0x56, 0x35, 0x6b, 0xe5, 0x80, 0x06, 0xc7, 0x57, 0xa7, 0xc4, 0xa9, 0xdb, 0xb6, 0x81, 0x1f, 0xeb, 0xd9, 0x69, 0x56, 0xc2, 0xd0, 0x00, 0xe5, 0x55, 0xc0, 0x12, 0xc2, 0xd7, 0x4e, 0xa2, 0x5a, 0x7c, 0x0a, 0xd0, 0x63, 0x9a, 0xd1, 0xaf, 0xd2, 0xe2, 0x3c, 0x12, 0x62, 0x66, 0xc6, 0x42, 0x23, 0x5a, 0x49, 0x8f, 0x10, 0xa2, 0xd2, 0x3e, 0x28, 0x9d, 0xc4, 0x88, 0x09, 0x29, 0x16, 0xc3, 0x3c, 0x24, 0x8d, 0xe6, 0x92, 0x72, 0x1f, 0xff, 0xd2, 0xf3, 0xbb, 0xb0, 0xfe, 0xcb, 0x99, 0xe9, 0xce, 0xf6, 0x88, 0x2d, 0x77, 0x91, 0x5b, 0x3d, 0x3d, 0xd0, 0xe6, 0x90, 0xa9, 0x65, 0x57, 0x38, 0x95, 0xdd, 0xcb, 0x9a, 0x7d, 0xce, 0xf2, 0x3f, 0x44, 0x23, 0x60, 0x58, 0x76, 0xe9, 0xca, 0x8c, 0xea, 0x1b, 0x31, 0x02, 0x32, 0x23, 0xea, 0xee, 0xb1, 0xcd, 0xb0, 0xc7, 0x87, 0x74, 0x7a, 0xeb, 0x70, 0x1a, 0x71, 0xe1, 0xfe, 0xe4, 0x1c, 0x1d, 0xae, 0xe5, 0x69, 0xd8, 0xfa, 0x99, 0x50, 0x0d, 0x1a, 0xf7, 0x2a, 0x3a, 0x0c, 0xf4, 0x1a, 0x8e, 0xc7, 0x27, 0x5d, 0xbf, 0x18, 0x41, 0xdc, 0xc2, 0xf0, 0x7f, 0x74, 0xf6, 0x3a, 0x22, 0x66, 0xdb, 0x68, 0xc6, 0x80, 0x48, 0x6b, 0x88, 0x06, 0x39, 0x0d, 0xee, 0xaa, 0x1f, 0xb3, 0xd5, 0x1b, 0x83, 0xd8, 0x3b, 0x38, 0x8f, 0x69, 0xfe, 0xdf, 0xd1, 0x4d, 0x29, 0xa1, 0x4c, 0x7a, 0xf4, 0xbf, 0xa7, 0x92, 0xcf, 0xa5, 0x20, 0x08, 0xf3, 0xf6, 0xff, 0x00, 0x15, 0xbb, 0xd1, 0x31, 0xd9, 0x5e, 0x3d, 0x75, 0x56, 0x36, 0x88, 0x00, 0x81, 0xe0, 0x16, 0x5e, 0x55, 0x74, 0x3f, 0x00, 0x9d, 0xe0, 0xcc, 0x69, 0xe7, 0x3a, 0x2d, 0xbe, 0x90, 0x00, 0xa9, 0xae, 0xef, 0x1f, 0x95, 0x4b, 0x0d, 0x9a, 0xdc, 0xc7, 0x45, 0xfe, 0xb1, 0x7d, 0x60, 0xa7, 0xa1, 0xe0, 0x1f, 0x4e, 0x1d, 0x99, 0x69, 0x02, 0x9a, 0xcf, 0x1f, 0xca, 0x7b, 0xbf, 0x90, 0xc5, 0xc2, 0xb3, 0xeb, 0x57, 0xd6, 0x03, 0x6b, 0xae, 0x39, 0xb6, 0x82, 0xe3, 0x31, 0xa1, 0x68, 0xf2, 0x6b, 0x5c, 0x12, 0xfa, 0xe1, 0x91, 0x66, 0x47, 0x5d, 0xb8, 0x3b, 0x4f, 0x44, 0x36, 0xb6, 0x8f, 0x28, 0xdd, 0xff, 0x00, 0x7e, 0x46, 0xab, 0x12, 0x2b, 0x65, 0x55, 0x32, 0xa7, 0x62, 0xb6, 0xbd, 0xf7, 0x64, 0x10, 0xdb, 0x03, 0x9f, 0x1b, 0x9e, 0xc7, 0xd9, 0xb8, 0x3b, 0x1f, 0x67, 0xf3, 0x6c, 0x52, 0x80, 0xd7, 0x7d, 0x0f, 0xea, 0x7f, 0x5d, 0x1d, 0x67, 0xa6, 0x0b, 0x1e, 0x47, 0xda, 0x69, 0x3b, 0x2e, 0x03, 0xc7, 0xf3, 0x5f, 0x1f, 0xf0, 0x8b, 0xa1, 0x02, 0x46, 0xba, 0x79, 0xaf, 0x32, 0xff, 0x00, 0x16, 0xad, 0xca, 0x1d, 0x57, 0x2a, 0xdc, 0x79, 0x18, 0x41, 0xb0, 0xf6, 0x9e, 0xe4, 0x9f, 0xd0, 0x8f, 0xeb, 0x31, 0xab, 0xd2, 0x83, 0xa4, 0xcb, 0x8c, 0xb8, 0xa0, 0x42, 0x12, 0x7b, 0x67, 0x9f, 0x2f, 0xf5, 0x09, 0x26, 0x96, 0xc4, 0xce, 0xa9, 0x20, 0xa7, 0xff, 0xd3, 0xf3, 0x2f, 0xb4, 0x5d, 0xe9, 0x0a, 0xb7, 0x9f, 0x4c, 0x19, 0xdb, 0x3a, 0x2d, 0x5e, 0x94, 0xfd, 0xc4, 0xb7, 0xc5, 0x62, 0xf9, 0x2b, 0xfd, 0x2e, 0xe3, 0x5d, 0xe0, 0x7c, 0x13, 0x48, 0xd1, 0x92, 0x12, 0xa9, 0x0b, 0x7a, 0xbc, 0x2d, 0xc2, 0x7f, 0x92, 0x60, 0xab, 0x4e, 0x79, 0x2e, 0x00, 0xf0, 0xaa, 0xe1, 0xda, 0x3d, 0x43, 0xfc, 0xad, 0x55, 0xbb, 0x80, 0x79, 0x81, 0xa0, 0xe6, 0x54, 0x32, 0x6d, 0x02, 0xbe, 0xf3, 0x61, 0x81, 0xa8, 0x44, 0x14, 0x03, 0x59, 0x0e, 0x1c, 0xf6, 0x1f, 0xdc, 0xb2, 0xec, 0xa3, 0x23, 0x77, 0xe8, 0x6e, 0x70, 0xf2, 0x25, 0x1f, 0x1f, 0x17, 0xa9, 0x6d, 0x71, 0x36, 0x97, 0x47, 0x00, 0xa4, 0x02, 0xe0, 0x2c, 0x7c, 0xc1, 0xab, 0xd5, 0x31, 0x85, 0x35, 0xd4, 0xe6, 0x13, 0x02, 0xd6, 0x4b, 0x67, 0x48, 0x2b, 0xa9, 0xe9, 0x2e, 0x02, 0xb6, 0x4f, 0x82, 0xe5, 0x7a, 0x95, 0x19, 0xc6, 0x87, 0x3d, 0xfb, 0xa2, 0xb8, 0x79, 0x1e, 0x4d, 0x3b, 0x96, 0xcf, 0x4f, 0xbd, 0xcd, 0xa2, 0xa2, 0x1f, 0xa0, 0x82, 0xd3, 0xfc, 0x97, 0x05, 0x24, 0x36, 0x6b, 0xf3, 0x31, 0xa2, 0x35, 0x79, 0xef, 0xad, 0xf8, 0xae, 0xaf, 0xaf, 0xd8, 0xf2, 0xd8, 0x6d, 0xed, 0x6b, 0xda, 0x7b, 0x18, 0x1b, 0x5d, 0xff, 0x00, 0x52, 0xb1, 0x6d, 0xf0, 0x81, 0x31, 0xca, 0xf4, 0x6e, 0xb1, 0x80, 0xce, 0xb1, 0x84, 0xc0, 0x21, 0xb7, 0xd6, 0x77, 0x31, 0xd1, 0x27, 0xc1, 0xcd, 0xfe, 0xd2, 0xe3, 0xec, 0xe8, 0x1d, 0x45, 0x96, 0xb0, 0x9a, 0xb7, 0x87, 0x3f, 0x68, 0x2d, 0xf7, 0x01, 0x1f, 0xbe, 0xd1, 0xf4, 0x7f, 0xb4, 0xa4, 0x0d, 0x77, 0xbb, 0xfa, 0x8f, 0x80, 0x3a, 0x7f, 0x43, 0xaa, 0xe2, 0xdf, 0xd2, 0x65, 0x7e, 0x95, 0xe4, 0x0f, 0x1f, 0xa1, 0xfe, 0x6b, 0x16, 0x9f, 0x52, 0xfa, 0xc1, 0xd3, 0xba, 0x6d, 0x26, 0xdc, 0xac, 0x86, 0xd4, 0xd9, 0x0d, 0x31, 0x2e, 0x74, 0x9e, 0xdb, 0x59, 0x2e, 0x55, 0xe8, 0xc9, 0xb2, 0x96, 0xd5, 0x4b, 0x9f, 0xb8, 0x6d, 0xda, 0x1c, 0x04, 0x09, 0x03, 0xfe, 0x8a, 0xc6, 0xfa, 0xd3, 0xf5, 0x6a, 0xbe, 0xbb, 0x5b, 0x2e, 0xc6, 0xb5, 0x94, 0xe6, 0xd5, 0x20, 0x97, 0x7d, 0x1b, 0x1b, 0xf9, 0xad, 0x7c, 0x7d, 0x17, 0xb7, 0xf3, 0x1e, 0x92, 0x1b, 0x7f, 0xf8, 0xe0, 0x7d, 0x59, 0xdd, 0xfd, 0x32, 0xd8, 0x8f, 0xa5, 0xe8, 0x3a, 0x12, 0x5c, 0x3f, 0xfc, 0xc4, 0xfa, 0xc3, 0xb3, 0x77, 0xa7, 0x56, 0xed, 0xdb, 0x76, 0x7a, 0x8d, 0xdd, 0x1f, 0xbf, 0xfd, 0x44, 0x92, 0x56, 0x8f, 0xff, 0xd4, 0xf2, 0xe8, 0x86, 0x17, 0x1e, 0xfa, 0x04, 0x56, 0x4b, 0x43, 0x6c, 0x6f, 0x2d, 0xe5, 0x46, 0x01, 0x64, 0x2b, 0x14, 0x32, 0x5b, 0xb4, 0xa0, 0x52, 0x1d, 0xde, 0x9b, 0x94, 0xdb, 0xab, 0x6b, 0x81, 0xf7, 0x05, 0xb0, 0xd7, 0x07, 0xb2, 0x27, 0x55, 0xc6, 0x57, 0x65, 0xd8, 0x76, 0x6e, 0x64, 0xed, 0xee, 0x16, 0xce, 0x27, 0x57, 0x63, 0xda, 0x0c, 0xc2, 0x8e, 0x51, 0x67, 0x84, 0xfa, 0x1d, 0xdd, 0x62, 0xc7, 0x07, 0xe9, 0xf7, 0xa3, 0xd6, 0x6c, 0x02, 0x41, 0x55, 0x31, 0xf3, 0x2b, 0xb3, 0xba, 0x2b, 0x2e, 0x68, 0x24, 0x1d, 0x47, 0x64, 0xca, 0xa6, 0x50, 0x41, 0x65, 0x90, 0x6c, 0xb1, 0xa5, 0xae, 0x33, 0x23, 0x51, 0xe4, 0xab, 0x7d, 0x5d, 0xcb, 0xb6, 0xcc, 0x37, 0xd0, 0x40, 0x73, 0x71, 0xde, 0x58, 0x09, 0xe7, 0x6f, 0x2c, 0x44, 0xc9, 0xc9, 0xae, 0xba, 0x9d, 0x63, 0x88, 0x01, 0xa0, 0x95, 0x9d, 0xf5, 0x3f, 0x2a, 0xe6, 0x67, 0xdb, 0x50, 0x83, 0x55, 0xad, 0x36, 0x3e, 0x78, 0x10, 0x74, 0x77, 0xfd, 0x2d, 0xaa, 0x4c, 0x7d, 0x58, 0x73, 0x91, 0xa0, 0x0f, 0x51, 0x45, 0xb7, 0x33, 0xdd, 0x58, 0x69, 0x1d, 0xd8, 0x0c, 0x9f, 0x96, 0x88, 0x19, 0x99, 0x19, 0xac, 0xcf, 0xa3, 0xd2, 0xad, 0xb5, 0xdb, 0x76, 0x8f, 0xad, 0xc4, 0xea, 0xcf, 0xdf, 0x7e, 0xdf, 0xdd, 0xfc, 0xd5, 0xa3, 0x5e, 0x43, 0x2b, 0x6b, 0xb2, 0xad, 0x3b, 0x6a, 0xa4, 0x13, 0xa7, 0x04, 0xac, 0x7a, 0x6f, 0xb3, 0x23, 0x26, 0xcc, 0xfb, 0xb4, 0x75, 0x8e, 0x01, 0x83, 0xf7, 0x58, 0x3e, 0x8b, 0x53, 0xa7, 0x2a, 0x1a, 0x31, 0x42, 0x36, 0x5d, 0x4c, 0x9a, 0xf2, 0xdc, 0xc6, 0xfe, 0x98, 0xb4, 0x34, 0xcb, 0x48, 0x0a, 0x8f, 0xdb, 0xb2, 0xeb, 0x76, 0xd6, 0x07, 0x5c, 0x59, 0xc9, 0x64, 0x8f, 0x93, 0xa7, 0x73, 0x16, 0x83, 0xaf, 0x0e, 0xa4, 0x33, 0xef, 0x50, 0xc5, 0x0c, 0xda, 0x59, 0x10, 0x06, 0x8a, 0x2e, 0x29, 0x0e, 0xac, 0xc2, 0x31, 0x3d, 0x36, 0x69, 0x7e, 0xd6, 0xcc, 0xf5, 0x3d, 0x6f, 0xb3, 0xeb, 0x1b, 0x76, 0xef, 0x3b, 0xa3, 0xfa, 0xc9, 0x2b, 0x5f, 0x66, 0x6f, 0xa9, 0x1e, 0x73, 0xf2, 0x49, 0x2e, 0x39, 0xf7, 0x4f, 0xb7, 0x8d, 0xff, 0xd5, 0xf3, 0x26, 0xfe, 0x0a, 0xc5, 0x1b, 0xa7, 0xcb, 0xb2, 0xcf, 0x49, 0x03, 0xb2, 0x46, 0xee, 0xd9, 0xd9, 0xb3, 0xf4, 0x9f, 0x25, 0x4a, 0xdf, 0x4b, 0x77, 0xe8, 0x27, 0xd4, 0xef, 0x1c, 0x2a, 0x29, 0x26, 0xc5, 0x7c, 0x9d, 0x6c, 0x7f, 0xb7, 0x6e, 0x1b, 0x26, 0x7f, 0x05, 0xa3, 0xfe, 0x53, 0x8d, 0x62, 0x57, 0x30, 0x92, 0x12, 0xfa, 0x2f, 0x86, 0xdf, 0xa4, 0xec, 0x67, 0xfe, 0xd0, 0xf4, 0xff, 0x00, 0x4d, 0xfc, 0xdf, 0x78, 0xe1, 0x68, 0x7d, 0x54, 0x99, 0xbf, 0x6f, 0xf3, 0xbe, 0xdf, 0x8e, 0xdd, 0x7f, 0xef, 0xeb, 0x97, 0x49, 0x3e, 0x3b, 0x7f, 0x06, 0x2c, 0x9f, 0x37, 0x5f, 0xf0, 0x9f, 0x4c, 0xeb, 0x7b, 0xbf, 0x67, 0x55, 0xe8, 0xff, 0x00, 0x31, 0xbc, 0x7a, 0x9e, 0x31, 0xdb, 0xfe, 0x92, 0xae, 0x37, 0x7a, 0x4d, 0xdb, 0xe2, 0x17, 0x9d, 0xa4, 0xa3, 0xc9, 0xba, 0xfc, 0x7b, 0x7d, 0x5f, 0x52, 0xa7, 0x7e, 0xd1, 0x28, 0xf8, 0xf3, 0xb0, 0xc7, 0x32, 0xbc, 0x99, 0x24, 0xc5, 0xe3, 0xab, 0xeb, 0x1f, 0xa4, 0xf5, 0xfc, 0xe1, 0x25, 0xe4, 0xe9, 0x24, 0x97, 0xff, 0xd9, 0xff, 0xed, 0x2e, 0x1c, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x20, 0x33, 0x2e, 0x30, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x1c, 0x02, 0x00, 0x00, 0x02, 0x00, 0x02, 0x1c, 0x02, 0x78, 0x00, 0x1f, 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, 0x20, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xfb, 0x09, 0xa6, 0xbd, 0x07, 0x4c, 0x2a, 0x36, 0x9d, 0x8f, 0xe2, 0xcc, 0x57, 0xa9, 0xac, 0x85, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xea, 0x00, 0x00, 0x00, 0x00, 0x1d, 0xb0, 0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x22, 0x55, 0x54, 0x46, 0x2d, 0x38, 0x22, 0x3f, 0x3e, 0x0a, 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x22, 0x2d, 0x2f, 0x2f, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x2f, 0x44, 0x54, 0x44, 0x20, 0x50, 0x4c, 0x49, 0x53, 0x54, 0x20, 0x31, 0x2e, 0x30, 0x2f, 0x2f, 0x45, 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x54, 0x44, 0x73, 0x2f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x2d, 0x31, 0x2e, 0x30, 0x2e, 0x64, 0x74, 0x64, 0x22, 0x3e, 0x0a, 0x3c, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x3e, 0x0a, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x48, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x48, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x32, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x31, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x31, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x32, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x31, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x73, 0x75, 0x62, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x61, 0x70, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x33, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x37, 0x36, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x37, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x39, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x6e, 0x61, 0x2d, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x33, 0x2d, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x54, 0x31, 0x37, 0x3a, 0x34, 0x39, 0x3a, 0x33, 0x36, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x31, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x33, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x37, 0x36, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x37, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x39, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x70, 0x64, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x70, 0x64, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x55, 0x53, 0x20, 0x4c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x33, 0x2d, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x54, 0x31, 0x37, 0x3a, 0x34, 0x39, 0x3a, 0x33, 0x36, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x31, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x41, 0x50, 0x49, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x30, 0x30, 0x2e, 0x32, 0x30, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x63, 0x6b, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2f, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x41, 0x50, 0x49, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x30, 0x30, 0x2e, 0x32, 0x30, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x63, 0x6b, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2f, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x3c, 0x2f, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x3e, 0x0a, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x02, 0xde, 0x02, 0x40, 0xff, 0xee, 0xff, 0xee, 0x03, 0x06, 0x02, 0x52, 0x03, 0x67, 0x05, 0x28, 0x03, 0xfc, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x02, 0xd8, 0x02, 0x28, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x01, 0x7f, 0xff, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x08, 0x00, 0x19, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xed, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1e, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1e, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x2f, 0x66, 0x66, 0x00, 0x01, 0x00, 0x6c, 0x66, 0x66, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x2f, 0x66, 0x66, 0x00, 0x01, 0x00, 0xa1, 0x99, 0x9a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x35, 0x00, 0x00, 0x00, 0x01, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x03, 0x45, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x08, 0x00, 0x44, 0x00, 0x53, 0x00, 0x43, 0x00, 0x30, 0x00, 0x32, 0x00, 0x33, 0x00, 0x32, 0x00, 0x35, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x75, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x4f, 0x62, 0x6a, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x63, 0x74, 0x31, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x54, 0x6f, 0x70, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x65, 0x66, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x74, 0x6f, 0x6d, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x52, 0x67, 0x68, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x06, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x73, 0x56, 0x6c, 0x4c, 0x73, 0x00, 0x00, 0x00, 0x01, 0x4f, 0x62, 0x6a, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x07, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x49, 0x44, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x0d, 0x61, 0x75, 0x74, 0x6f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, 0x54, 0x79, 0x70, 0x65, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0a, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00, 0x00, 0x49, 0x6d, 0x67, 0x20, 0x00, 0x00, 0x00, 0x06, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x4f, 0x62, 0x6a, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x63, 0x74, 0x31, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x54, 0x6f, 0x70, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x65, 0x66, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x74, 0x6f, 0x6d, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x52, 0x67, 0x68, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x03, 0x75, 0x72, 0x6c, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x75, 0x6c, 0x6c, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x73, 0x67, 0x65, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x61, 0x6c, 0x74, 0x54, 0x61, 0x67, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x63, 0x65, 0x6c, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x49, 0x73, 0x48, 0x54, 0x4d, 0x4c, 0x62, 0x6f, 0x6f, 0x6c, 0x01, 0x00, 0x00, 0x00, 0x08, 0x63, 0x65, 0x6c, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x68, 0x6f, 0x72, 0x7a, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0f, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x48, 0x6f, 0x72, 0x7a, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x00, 0x00, 0x00, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x00, 0x00, 0x09, 0x76, 0x65, 0x72, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0f, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x00, 0x00, 0x00, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x00, 0x00, 0x0b, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x11, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x42, 0x47, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x09, 0x74, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x6c, 0x65, 0x66, 0x74, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x72, 0x69, 0x67, 0x68, 0x74, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x09, 0xf9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0x09, 0xdd, 0x00, 0x18, 0x00, 0x01, 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xed, 0x00, 0x0c, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x5f, 0x43, 0x4d, 0x00, 0x02, 0xff, 0xee, 0x00, 0x0e, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x00, 0x64, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0c, 0x08, 0x08, 0x08, 0x09, 0x08, 0x0c, 0x09, 0x09, 0x0c, 0x11, 0x0b, 0x0a, 0x0b, 0x11, 0x15, 0x0f, 0x0c, 0x0c, 0x0f, 0x15, 0x18, 0x13, 0x13, 0x15, 0x13, 0x13, 0x18, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x01, 0x0d, 0x0b, 0x0b, 0x0d, 0x0e, 0x0d, 0x10, 0x0e, 0x0e, 0x10, 0x14, 0x0e, 0x0e, 0x0e, 0x14, 0x14, 0x0e, 0x0e, 0x0e, 0x0e, 0x14, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x64, 0x00, 0x64, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xdd, 0x00, 0x04, 0x00, 0x07, 0xff, 0xc4, 0x01, 0x3f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x01, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x01, 0x04, 0x01, 0x03, 0x02, 0x04, 0x02, 0x05, 0x07, 0x06, 0x08, 0x05, 0x03, 0x0c, 0x33, 0x01, 0x00, 0x02, 0x11, 0x03, 0x04, 0x21, 0x12, 0x31, 0x05, 0x41, 0x51, 0x61, 0x13, 0x22, 0x71, 0x81, 0x32, 0x06, 0x14, 0x91, 0xa1, 0xb1, 0x42, 0x23, 0x24, 0x15, 0x52, 0xc1, 0x62, 0x33, 0x34, 0x72, 0x82, 0xd1, 0x43, 0x07, 0x25, 0x92, 0x53, 0xf0, 0xe1, 0xf1, 0x63, 0x73, 0x35, 0x16, 0xa2, 0xb2, 0x83, 0x26, 0x44, 0x93, 0x54, 0x64, 0x45, 0xc2, 0xa3, 0x74, 0x36, 0x17, 0xd2, 0x55, 0xe2, 0x65, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x27, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x11, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x06, 0x05, 0x35, 0x01, 0x00, 0x02, 0x11, 0x03, 0x21, 0x31, 0x12, 0x04, 0x41, 0x51, 0x61, 0x71, 0x22, 0x13, 0x05, 0x32, 0x81, 0x91, 0x14, 0xa1, 0xb1, 0x42, 0x23, 0xc1, 0x52, 0xd1, 0xf0, 0x33, 0x24, 0x62, 0xe1, 0x72, 0x82, 0x92, 0x43, 0x53, 0x15, 0x63, 0x73, 0x34, 0xf1, 0x25, 0x06, 0x16, 0xa2, 0xb2, 0x83, 0x07, 0x26, 0x35, 0xc2, 0xd2, 0x44, 0x93, 0x54, 0xa3, 0x17, 0x64, 0x45, 0x55, 0x36, 0x74, 0x65, 0xe2, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xf2, 0xed, 0xb2, 0x8d, 0x4d, 0x45, 0xcd, 0x2f, 0x3f, 0x44, 0x68, 0x93, 0xc3, 0x58, 0xc8, 0xf1, 0x1f, 0x8a, 0x33, 0x86, 0xda, 0x58, 0xc1, 0xa0, 0x02, 0x4f, 0xc4, 0xa1, 0x69, 0xa5, 0x9b, 0x5b, 0x4b, 0x84, 0x73, 0xdf, 0xc9, 0x15, 0xf8, 0xe3, 0xd1, 0x0e, 0x07, 0x93, 0xf3, 0xd1, 0x0f, 0x1c, 0x17, 0xef, 0x2e, 0x3b, 0x5b, 0xdc, 0xff, 0x00, 0xdf, 0x42, 0xbf, 0x8f, 0x8e, 0xdc, 0x82, 0xca, 0xd8, 0x37, 0x11, 0xa9, 0x3d, 0x82, 0x69, 0x2b, 0xc4, 0x6d, 0xc9, 0x75, 0x25, 0xbc, 0xf7, 0xec, 0xa1, 0xb5, 0x74, 0x19, 0x5d, 0x2e, 0x8a, 0x9a, 0x4b, 0x89, 0x7d, 0xc4, 0x68, 0xc6, 0xf6, 0xfe, 0xb2, 0xa0, 0x30, 0x1d, 0x60, 0x86, 0x88, 0x8d, 0x49, 0x3e, 0x01, 0x11, 0x20, 0xa3, 0x8c, 0xb9, 0xb1, 0xaa, 0x62, 0xad, 0xbf, 0x18, 0x97, 0x43, 0x47, 0x1d, 0xd2, 0xaf, 0x04, 0xd9, 0xb8, 0xc8, 0x0d, 0x68, 0xe4, 0xf7, 0x3e, 0x48, 0xf1, 0x05, 0xbc, 0x25, 0xaa, 0x07, 0x71, 0xd9, 0x14, 0x78, 0xf6, 0x49, 0xb5, 0x90, 0xfd, 0xa7, 0xc6, 0x14, 0xfd, 0x1b, 0x1c, 0xff, 0x00, 0x4d, 0x8d, 0x2e, 0x73, 0x8c, 0x35, 0xa3, 0x52, 0x4f, 0x92, 0x48, 0xa6, 0x1a, 0x24, 0xb6, 0x2a, 0xfa, 0xa5, 0x9e, 0x60, 0x64, 0x39, 0x94, 0x13, 0xcb, 0x27, 0x73, 0x80, 0xf3, 0x0c, 0xf6, 0xff, 0x00, 0xd2, 0x5a, 0x78, 0xbf, 0x53, 0x71, 0xf6, 0x01, 0x75, 0xb6, 0x97, 0x6a, 0x25, 0xa1, 0xad, 0x1f, 0xf4, 0xb7, 0x23, 0x48, 0xb7, 0x94, 0x84, 0x97, 0x5b, 0xff, 0x00, 0x32, 0xa9, 0xdd, 0xfc, 0xed, 0x9b, 0x7e, 0x0d, 0x9e, 0x52, 0x4a, 0x95, 0x61, 0xff, 0xd0, 0xf3, 0x3b, 0xa7, 0x70, 0xee, 0x01, 0x8f, 0xb9, 0x59, 0xfa, 0x7e, 0xdf, 0xe4, 0xc8, 0xf9, 0x2a, 0xc2, 0x5c, 0x63, 0xc3, 0x54, 0x67, 0x87, 0x6e, 0x10, 0x35, 0x68, 0xd4, 0x79, 0x1e, 0x53, 0x4a, 0xe0, 0xdc, 0xe9, 0xb8, 0x1f, 0x6a, 0xda, 0x6c, 0x25, 0x94, 0x37, 0xb0, 0xd0, 0xb8, 0xad, 0x67, 0xe4, 0x55, 0x8a, 0x5b, 0x8b, 0x82, 0xc0, 0x6f, 0x76, 0x80, 0x34, 0x49, 0x05, 0x2e, 0x9e, 0xc6, 0x1c, 0x66, 0x31, 0xba, 0x10, 0x23, 0xe0, 0xaf, 0xe1, 0x61, 0x53, 0x43, 0x8d, 0x81, 0xb3, 0x67, 0xef, 0x9e, 0x49, 0x2a, 0x12, 0x6c, 0xb6, 0x63, 0x1a, 0x0c, 0x31, 0xba, 0x55, 0xcd, 0xac, 0xfa, 0x8e, 0xdf, 0x91, 0x6e, 0x91, 0xd9, 0xb3, 0xc9, 0x73, 0x90, 0x7a, 0xab, 0x6a, 0xc2, 0xa4, 0x60, 0xe2, 0x8f, 0xd2, 0x38, 0x03, 0x7d, 0x9e, 0x0d, 0xff, 0x00, 0xcc, 0xd6, 0xd3, 0x6b, 0x71, 0x67, 0xd2, 0x3e, 0x64, 0x72, 0xab, 0xdb, 0x8d, 0x54, 0x39, 0xc5, 0x83, 0x6b, 0x3d, 0xee, 0x2e, 0xd4, 0x92, 0x3c, 0x4a, 0x56, 0xba, 0xb4, 0x79, 0x5c, 0xf7, 0xb2, 0x96, 0x6c, 0x8d, 0xaf, 0x80, 0x48, 0x3c, 0xf0, 0xb2, 0x1f, 0x63, 0x9c, 0xe9, 0x3f, 0x24, 0x5c, 0xdb, 0xdd, 0x76, 0x43, 0xde, 0xfd, 0x5c, 0xe3, 0x24, 0xfc, 0x50, 0x00, 0x93, 0x0a, 0x78, 0x8a, 0x0d, 0x49, 0xca, 0xcf, 0x93, 0x63, 0x1b, 0x7d, 0xd7, 0x57, 0x50, 0xd5, 0xef, 0x70, 0x6b, 0x4f, 0xc7, 0x45, 0xdb, 0x74, 0x9e, 0x8d, 0x5e, 0x33, 0x83, 0xd8, 0x37, 0xdd, 0xc3, 0xac, 0x3d, 0xbf, 0x92, 0xc5, 0x5b, 0xea, 0xbf, 0xd5, 0x62, 0xc0, 0xdc, 0xbc, 0xbd, 0x2d, 0x22, 0x5a, 0xcf, 0xdd, 0x69, 0xff, 0x00, 0xd1, 0x8e, 0x5d, 0xa5, 0x38, 0xb5, 0xb0, 0x00, 0xc6, 0xc4, 0x24, 0x4a, 0xd6, 0x8d, 0x18, 0x04, 0x49, 0x88, 0x9e, 0x55, 0xd6, 0x61, 0xb0, 0xc1, 0x70, 0x32, 0xdd, 0x3c, 0x95, 0xda, 0xf1, 0xfe, 0xf5, 0x62, 0xbc, 0x76, 0x8e, 0x75, 0x28, 0x02, 0xa2, 0xe7, 0x7d, 0x92, 0xb9, 0x84, 0x96, 0x96, 0xda, 0xf7, 0x70, 0x12, 0x4e, 0x5a, 0xff, 0x00, 0xff, 0xd1, 0xf3, 0x7a, 0x21, 0xaf, 0xde, 0xef, 0xa2, 0x22, 0x55, 0xfc, 0x5a, 0xbd, 0x42, 0xfb, 0x08, 0xfa, 0x67, 0x4f, 0x82, 0xcd, 0x6d, 0x85, 0xc0, 0x56, 0x3b, 0x90, 0xb7, 0xf0, 0x2a, 0x0e, 0x63, 0x58, 0x3b, 0xf2, 0xa3, 0x9e, 0x8c, 0xb8, 0x86, 0xbe, 0x49, 0xf1, 0x2c, 0x0c, 0x86, 0xb4, 0x4c, 0x69, 0xe4, 0xaf, 0x6e, 0xcc, 0x6b, 0x7d, 0x46, 0xb3, 0x70, 0xec, 0x38, 0x51, 0x7d, 0x02, 0x8a, 0xc7, 0xa6, 0xd9, 0x20, 0x68, 0x0f, 0x8f, 0x8a, 0xcf, 0xc9, 0xc2, 0xea, 0x59, 0x5b, 0x48, 0xb0, 0x91, 0xae, 0xe6, 0xc9, 0x03, 0xc9, 0x30, 0x51, 0x66, 0xd4, 0x0d, 0xad, 0xbd, 0x5f, 0x53, 0xcc, 0x6b, 0xb6, 0x90, 0x5a, 0x3b, 0x83, 0x0b, 0x43, 0x17, 0x31, 0xd6, 0xc3, 0x6e, 0x12, 0x3b, 0x79, 0xac, 0xc1, 0x89, 0x47, 0xd9, 0xe8, 0x63, 0x98, 0x45, 0xed, 0x6c, 0x5a, 0xf1, 0xa0, 0x27, 0xc5, 0x5b, 0xc3, 0x6f, 0xa6, 0xe0, 0x1c, 0x7d, 0xb3, 0xa2, 0x69, 0x34, 0x7b, 0xae, 0x1a, 0x8d, 0x45, 0x17, 0x9d, 0xeb, 0xfd, 0x21, 0xd8, 0xb9, 0xae, 0xb5, 0x80, 0xbb, 0x1e, 0xd2, 0x5c, 0xd7, 0x78, 0x13, 0xf9, 0xae, 0x4b, 0xea, 0xc7, 0x4a, 0x39, 0xbd, 0x55, 0xb3, 0xed, 0x66, 0x38, 0xf5, 0x09, 0x22, 0x41, 0x23, 0xe8, 0x37, 0xfb, 0x4b, 0xa1, 0xeb, 0xd6, 0xfe, 0x88, 0x31, 0xbf, 0x41, 0xc0, 0xee, 0xd2, 0x74, 0x02, 0x78, 0x53, 0xfa, 0x97, 0x43, 0x19, 0x85, 0x65, 0xff, 0x00, 0x9d, 0x71, 0x33, 0xe4, 0x1a, 0x7d, 0x8d, 0x53, 0x42, 0x56, 0x35, 0x6b, 0xe5, 0x80, 0x06, 0xc7, 0x57, 0xa7, 0xc4, 0xa9, 0xdb, 0xb6, 0x81, 0x1f, 0xeb, 0xd9, 0x69, 0x56, 0xc2, 0xd0, 0x00, 0xe5, 0x55, 0xc0, 0x12, 0xc2, 0xd7, 0x4e, 0xa2, 0x5a, 0x7c, 0x0a, 0xd0, 0x63, 0x9a, 0xd1, 0xaf, 0xd2, 0xe2, 0x3c, 0x12, 0x62, 0x66, 0xc6, 0x42, 0x23, 0x5a, 0x49, 0x8f, 0x10, 0xa2, 0xd2, 0x3e, 0x28, 0x9d, 0xc4, 0x88, 0x09, 0x29, 0x16, 0xc3, 0x3c, 0x24, 0x8d, 0xe6, 0x92, 0x72, 0x1f, 0xff, 0xd2, 0xf3, 0xbb, 0xb0, 0xfe, 0xcb, 0x99, 0xe9, 0xce, 0xf6, 0x88, 0x2d, 0x77, 0x91, 0x5b, 0x3d, 0x3d, 0xd0, 0xe6, 0x90, 0xa9, 0x65, 0x57, 0x38, 0x95, 0xdd, 0xcb, 0x9a, 0x7d, 0xce, 0xf2, 0x3f, 0x44, 0x23, 0x60, 0x58, 0x76, 0xe9, 0xca, 0x8c, 0xea, 0x1b, 0x31, 0x02, 0x32, 0x23, 0xea, 0xee, 0xb1, 0xcd, 0xb0, 0xc7, 0x87, 0x74, 0x7a, 0xeb, 0x70, 0x1a, 0x71, 0xe1, 0xfe, 0xe4, 0x1c, 0x1d, 0xae, 0xe5, 0x69, 0xd8, 0xfa, 0x99, 0x50, 0x0d, 0x1a, 0xf7, 0x2a, 0x3a, 0x0c, 0xf4, 0x1a, 0x8e, 0xc7, 0x27, 0x5d, 0xbf, 0x18, 0x41, 0xdc, 0xc2, 0xf0, 0x7f, 0x74, 0xf6, 0x3a, 0x22, 0x66, 0xdb, 0x68, 0xc6, 0x80, 0x48, 0x6b, 0x88, 0x06, 0x39, 0x0d, 0xee, 0xaa, 0x1f, 0xb3, 0xd5, 0x1b, 0x83, 0xd8, 0x3b, 0x38, 0x8f, 0x69, 0xfe, 0xdf, 0xd1, 0x4d, 0x29, 0xa1, 0x4c, 0x7a, 0xf4, 0xbf, 0xa7, 0x92, 0xcf, 0xa5, 0x20, 0x08, 0xf3, 0xf6, 0xff, 0x00, 0x15, 0xbb, 0xd1, 0x31, 0xd9, 0x5e, 0x3d, 0x75, 0x56, 0x36, 0x88, 0x00, 0x81, 0xe0, 0x16, 0x5e, 0x55, 0x74, 0x3f, 0x00, 0x9d, 0xe0, 0xcc, 0x69, 0xe7, 0x3a, 0x2d, 0xbe, 0x90, 0x00, 0xa9, 0xae, 0xef, 0x1f, 0x95, 0x4b, 0x0d, 0x9a, 0xdc, 0xc7, 0x45, 0xfe, 0xb1, 0x7d, 0x60, 0xa7, 0xa1, 0xe0, 0x1f, 0x4e, 0x1d, 0x99, 0x69, 0x02, 0x9a, 0xcf, 0x1f, 0xca, 0x7b, 0xbf, 0x90, 0xc5, 0xc2, 0xb3, 0xeb, 0x57, 0xd6, 0x03, 0x6b, 0xae, 0x39, 0xb6, 0x82, 0xe3, 0x31, 0xa1, 0x68, 0xf2, 0x6b, 0x5c, 0x12, 0xfa, 0xe1, 0x91, 0x66, 0x47, 0x5d, 0xb8, 0x3b, 0x4f, 0x44, 0x36, 0xb6, 0x8f, 0x28, 0xdd, 0xff, 0x00, 0x7e, 0x46, 0xab, 0x12, 0x2b, 0x65, 0x55, 0x32, 0xa7, 0x62, 0xb6, 0xbd, 0xf7, 0x64, 0x10, 0xdb, 0x03, 0x9f, 0x1b, 0x9e, 0xc7, 0xd9, 0xb8, 0x3b, 0x1f, 0x67, 0xf3, 0x6c, 0x52, 0x80, 0xd7, 0x7d, 0x0f, 0xea, 0x7f, 0x5d, 0x1d, 0x67, 0xa6, 0x0b, 0x1e, 0x47, 0xda, 0x69, 0x3b, 0x2e, 0x03, 0xc7, 0xf3, 0x5f, 0x1f, 0xf0, 0x8b, 0xa1, 0x02, 0x46, 0xba, 0x79, 0xaf, 0x32, 0xff, 0x00, 0x16, 0xad, 0xca, 0x1d, 0x57, 0x2a, 0xdc, 0x79, 0x18, 0x41, 0xb0, 0xf6, 0x9e, 0xe4, 0x9f, 0xd0, 0x8f, 0xeb, 0x31, 0xab, 0xd2, 0x83, 0xa4, 0xcb, 0x8c, 0xb8, 0xa0, 0x42, 0x12, 0x7b, 0x67, 0x9f, 0x2f, 0xf5, 0x09, 0x26, 0x96, 0xc4, 0xce, 0xa9, 0x20, 0xa7, 0xff, 0xd3, 0xf3, 0x2f, 0xb4, 0x5d, 0xe9, 0x0a, 0xb7, 0x9f, 0x4c, 0x19, 0xdb, 0x3a, 0x2d, 0x5e, 0x94, 0xfd, 0xc4, 0xb7, 0xc5, 0x62, 0xf9, 0x2b, 0xfd, 0x2e, 0xe3, 0x5d, 0xe0, 0x7c, 0x13, 0x48, 0xd1, 0x92, 0x12, 0xa9, 0x0b, 0x7a, 0xbc, 0x2d, 0xc2, 0x7f, 0x92, 0x60, 0xab, 0x4e, 0x79, 0x2e, 0x00, 0xf0, 0xaa, 0xe1, 0xda, 0x3d, 0x43, 0xfc, 0xad, 0x55, 0xbb, 0x80, 0x79, 0x81, 0xa0, 0xe6, 0x54, 0x32, 0x6d, 0x02, 0xbe, 0xf3, 0x61, 0x81, 0xa8, 0x44, 0x14, 0x03, 0x59, 0x0e, 0x1c, 0xf6, 0x1f, 0xdc, 0xb2, 0xec, 0xa3, 0x23, 0x77, 0xe8, 0x6e, 0x70, 0xf2, 0x25, 0x1f, 0x1f, 0x17, 0xa9, 0x6d, 0x71, 0x36, 0x97, 0x47, 0x00, 0xa4, 0x02, 0xe0, 0x2c, 0x7c, 0xc1, 0xab, 0xd5, 0x31, 0x85, 0x35, 0xd4, 0xe6, 0x13, 0x02, 0xd6, 0x4b, 0x67, 0x48, 0x2b, 0xa9, 0xe9, 0x2e, 0x02, 0xb6, 0x4f, 0x82, 0xe5, 0x7a, 0x95, 0x19, 0xc6, 0x87, 0x3d, 0xfb, 0xa2, 0xb8, 0x79, 0x1e, 0x4d, 0x3b, 0x96, 0xcf, 0x4f, 0xbd, 0xcd, 0xa2, 0xa2, 0x1f, 0xa0, 0x82, 0xd3, 0xfc, 0x97, 0x05, 0x24, 0x36, 0x6b, 0xf3, 0x31, 0xa2, 0x35, 0x79, 0xef, 0xad, 0xf8, 0xae, 0xaf, 0xaf, 0xd8, 0xf2, 0xd8, 0x6d, 0xed, 0x6b, 0xda, 0x7b, 0x18, 0x1b, 0x5d, 0xff, 0x00, 0x52, 0xb1, 0x6d, 0xf0, 0x81, 0x31, 0xca, 0xf4, 0x6e, 0xb1, 0x80, 0xce, 0xb1, 0x84, 0xc0, 0x21, 0xb7, 0xd6, 0x77, 0x31, 0xd1, 0x27, 0xc1, 0xcd, 0xfe, 0xd2, 0xe3, 0xec, 0xe8, 0x1d, 0x45, 0x96, 0xb0, 0x9a, 0xb7, 0x87, 0x3f, 0x68, 0x2d, 0xf7, 0x01, 0x1f, 0xbe, 0xd1, 0xf4, 0x7f, 0xb4, 0xa4, 0x0d, 0x77, 0xbb, 0xfa, 0x8f, 0x80, 0x3a, 0x7f, 0x43, 0xaa, 0xe2, 0xdf, 0xd2, 0x65, 0x7e, 0x95, 0xe4, 0x0f, 0x1f, 0xa1, 0xfe, 0x6b, 0x16, 0x9f, 0x52, 0xfa, 0xc1, 0xd3, 0xba, 0x6d, 0x26, 0xdc, 0xac, 0x86, 0xd4, 0xd9, 0x0d, 0x31, 0x2e, 0x74, 0x9e, 0xdb, 0x59, 0x2e, 0x55, 0xe8, 0xc9, 0xb2, 0x96, 0xd5, 0x4b, 0x9f, 0xb8, 0x6d, 0xda, 0x1c, 0x04, 0x09, 0x03, 0xfe, 0x8a, 0xc6, 0xfa, 0xd3, 0xf5, 0x6a, 0xbe, 0xbb, 0x5b, 0x2e, 0xc6, 0xb5, 0x94, 0xe6, 0xd5, 0x20, 0x97, 0x7d, 0x1b, 0x1b, 0xf9, 0xad, 0x7c, 0x7d, 0x17, 0xb7, 0xf3, 0x1e, 0x92, 0x1b, 0x7f, 0xf8, 0xe0, 0x7d, 0x59, 0xdd, 0xfd, 0x32, 0xd8, 0x8f, 0xa5, 0xe8, 0x3a, 0x12, 0x5c, 0x3f, 0xfc, 0xc4, 0xfa, 0xc3, 0xb3, 0x77, 0xa7, 0x56, 0xed, 0xdb, 0x76, 0x7a, 0x8d, 0xdd, 0x1f, 0xbf, 0xfd, 0x44, 0x92, 0x56, 0x8f, 0xff, 0xd4, 0xf2, 0xe8, 0x86, 0x17, 0x1e, 0xfa, 0x04, 0x56, 0x4b, 0x43, 0x6c, 0x6f, 0x2d, 0xe5, 0x46, 0x01, 0x64, 0x2b, 0x14, 0x32, 0x5b, 0xb4, 0xa0, 0x52, 0x1d, 0xde, 0x9b, 0x94, 0xdb, 0xab, 0x6b, 0x81, 0xf7, 0x05, 0xb0, 0xd7, 0x07, 0xb2, 0x27, 0x55, 0xc6, 0x57, 0x65, 0xd8, 0x76, 0x6e, 0x64, 0xed, 0xee, 0x16, 0xce, 0x27, 0x57, 0x63, 0xda, 0x0c, 0xc2, 0x8e, 0x51, 0x67, 0x84, 0xfa, 0x1d, 0xdd, 0x62, 0xc7, 0x07, 0xe9, 0xf7, 0xa3, 0xd6, 0x6c, 0x02, 0x41, 0x55, 0x31, 0xf3, 0x2b, 0xb3, 0xba, 0x2b, 0x2e, 0x68, 0x24, 0x1d, 0x47, 0x64, 0xca, 0xa6, 0x50, 0x41, 0x65, 0x90, 0x6c, 0xb1, 0xa5, 0xae, 0x33, 0x23, 0x51, 0xe4, 0xab, 0x7d, 0x5d, 0xcb, 0xb6, 0xcc, 0x37, 0xd0, 0x40, 0x73, 0x71, 0xde, 0x58, 0x09, 0xe7, 0x6f, 0x2c, 0x44, 0xc9, 0xc9, 0xae, 0xba, 0x9d, 0x63, 0x88, 0x01, 0xa0, 0x95, 0x9d, 0xf5, 0x3f, 0x2a, 0xe6, 0x67, 0xdb, 0x50, 0x83, 0x55, 0xad, 0x36, 0x3e, 0x78, 0x10, 0x74, 0x77, 0xfd, 0x2d, 0xaa, 0x4c, 0x7d, 0x58, 0x73, 0x91, 0xa0, 0x0f, 0x51, 0x45, 0xb7, 0x33, 0xdd, 0x58, 0x69, 0x1d, 0xd8, 0x0c, 0x9f, 0x96, 0x88, 0x19, 0x99, 0x19, 0xac, 0xcf, 0xa3, 0xd2, 0xad, 0xb5, 0xdb, 0x76, 0x8f, 0xad, 0xc4, 0xea, 0xcf, 0xdf, 0x7e, 0xdf, 0xdd, 0xfc, 0xd5, 0xa3, 0x5e, 0x43, 0x2b, 0x6b, 0xb2, 0xad, 0x3b, 0x6a, 0xa4, 0x13, 0xa7, 0x04, 0xac, 0x7a, 0x6f, 0xb3, 0x23, 0x26, 0xcc, 0xfb, 0xb4, 0x75, 0x8e, 0x01, 0x83, 0xf7, 0x58, 0x3e, 0x8b, 0x53, 0xa7, 0x2a, 0x1a, 0x31, 0x42, 0x36, 0x5d, 0x4c, 0x9a, 0xf2, 0xdc, 0xc6, 0xfe, 0x98, 0xb4, 0x34, 0xcb, 0x48, 0x0a, 0x8f, 0xdb, 0xb2, 0xeb, 0x76, 0xd6, 0x07, 0x5c, 0x59, 0xc9, 0x64, 0x8f, 0x93, 0xa7, 0x73, 0x16, 0x83, 0xaf, 0x0e, 0xa4, 0x33, 0xef, 0x50, 0xc5, 0x0c, 0xda, 0x59, 0x10, 0x06, 0x8a, 0x2e, 0x29, 0x0e, 0xac, 0xc2, 0x31, 0x3d, 0x36, 0x69, 0x7e, 0xd6, 0xcc, 0xf5, 0x3d, 0x6f, 0xb3, 0xeb, 0x1b, 0x76, 0xef, 0x3b, 0xa3, 0xfa, 0xc9, 0x2b, 0x5f, 0x66, 0x6f, 0xa9, 0x1e, 0x73, 0xf2, 0x49, 0x2e, 0x39, 0xf7, 0x4f, 0xb7, 0x8d, 0xff, 0xd5, 0xf3, 0x26, 0xfe, 0x0a, 0xc5, 0x1b, 0xa7, 0xcb, 0xb2, 0xcf, 0x49, 0x03, 0xb2, 0x46, 0xee, 0xd9, 0xd9, 0xb3, 0xf4, 0x9f, 0x25, 0x4a, 0xdf, 0x4b, 0x77, 0xe8, 0x27, 0xd4, 0xef, 0x1c, 0x2a, 0x29, 0x26, 0xc5, 0x7c, 0x9d, 0x6c, 0x7f, 0xb7, 0x6e, 0x1b, 0x26, 0x7f, 0x05, 0xa3, 0xfe, 0x53, 0x8d, 0x62, 0x57, 0x30, 0x92, 0x12, 0xfa, 0x2f, 0x86, 0xdf, 0xa4, 0xec, 0x67, 0xfe, 0xd0, 0xf4, 0xff, 0x00, 0x4d, 0xfc, 0xdf, 0x78, 0xe1, 0x68, 0x7d, 0x54, 0x99, 0xbf, 0x6f, 0xf3, 0xbe, 0xdf, 0x8e, 0xdd, 0x7f, 0xef, 0xeb, 0x97, 0x49, 0x3e, 0x3b, 0x7f, 0x06, 0x2c, 0x9f, 0x37, 0x5f, 0xf0, 0x9f, 0x4c, 0xeb, 0x7b, 0xbf, 0x67, 0x55, 0xe8, 0xff, 0x00, 0x31, 0xbc, 0x7a, 0x9e, 0x31, 0xdb, 0xfe, 0x92, 0xae, 0x37, 0x7a, 0x4d, 0xdb, 0xe2, 0x17, 0x9d, 0xa4, 0xa3, 0xc9, 0xba, 0xfc, 0x7b, 0x7d, 0x5f, 0x52, 0xa7, 0x7e, 0xd1, 0x28, 0xf8, 0xf3, 0xb0, 0xc7, 0x32, 0xbc, 0x99, 0x24, 0xc5, 0xe3, 0xab, 0xeb, 0x1f, 0xa4, 0xf5, 0xfc, 0xe1, 0x25, 0xe4, 0xe9, 0x24, 0x97, 0xff, 0xd9, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x41, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x62, 0x00, 0x65, 0x00, 0x20, 0x00, 0x50, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x00, 0x00, 0x13, 0x00, 0x41, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x62, 0x00, 0x65, 0x00, 0x20, 0x00, 0x50, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x20, 0x00, 0x37, 0x00, 0x2e, 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xff, 0xe1, 0x15, 0x67, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x61, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x00, 0x3c, 0x3f, 0x78, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x3d, 0x27, 0xef, 0xbb, 0xbf, 0x27, 0x20, 0x69, 0x64, 0x3d, 0x27, 0x57, 0x35, 0x4d, 0x30, 0x4d, 0x70, 0x43, 0x65, 0x68, 0x69, 0x48, 0x7a, 0x72, 0x65, 0x53, 0x7a, 0x4e, 0x54, 0x63, 0x7a, 0x6b, 0x63, 0x39, 0x64, 0x27, 0x3f, 0x3e, 0x0a, 0x3c, 0x3f, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2d, 0x78, 0x61, 0x70, 0x2d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x20, 0x65, 0x73, 0x63, 0x3d, 0x22, 0x43, 0x52, 0x22, 0x3f, 0x3e, 0x0a, 0x3c, 0x78, 0x3a, 0x78, 0x61, 0x70, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x78, 0x3d, 0x27, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x3a, 0x6e, 0x73, 0x3a, 0x6d, 0x65, 0x74, 0x61, 0x2f, 0x27, 0x20, 0x78, 0x3a, 0x78, 0x61, 0x70, 0x74, 0x6b, 0x3d, 0x27, 0x58, 0x4d, 0x50, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x6b, 0x69, 0x74, 0x20, 0x32, 0x2e, 0x38, 0x2e, 0x32, 0x2d, 0x33, 0x33, 0x2c, 0x20, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x31, 0x2e, 0x35, 0x27, 0x3e, 0x0a, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x52, 0x44, 0x46, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x72, 0x64, 0x66, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x77, 0x33, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x31, 0x39, 0x39, 0x39, 0x2f, 0x30, 0x32, 0x2f, 0x32, 0x32, 0x2d, 0x72, 0x64, 0x66, 0x2d, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2d, 0x6e, 0x73, 0x23, 0x27, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x69, 0x58, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x58, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x27, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x70, 0x64, 0x66, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x64, 0x66, 0x2f, 0x31, 0x2e, 0x33, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x70, 0x64, 0x66, 0x3a, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x3a, 0x43, 0x61, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x78, 0x61, 0x70, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x61, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x78, 0x61, 0x70, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x78, 0x61, 0x70, 0x4d, 0x4d, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x61, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x6d, 0x6d, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x78, 0x61, 0x70, 0x4d, 0x4d, 0x3a, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x3e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x3a, 0x64, 0x6f, 0x63, 0x69, 0x64, 0x3a, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x36, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x3c, 0x2f, 0x78, 0x61, 0x70, 0x4d, 0x4d, 0x3a, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x64, 0x63, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x70, 0x75, 0x72, 0x6c, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x64, 0x63, 0x2f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x31, 0x2e, 0x31, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x64, 0x63, 0x3a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x41, 0x6c, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x6c, 0x69, 0x20, 0x78, 0x6d, 0x6c, 0x3a, 0x6c, 0x61, 0x6e, 0x67, 0x3d, 0x27, 0x78, 0x2d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x27, 0x3e, 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, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x6c, 0x69, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x41, 0x6c, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x2f, 0x64, 0x63, 0x3a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x52, 0x44, 0x46, 0x3e, 0x0a, 0x3c, 0x2f, 0x78, 0x3a, 0x78, 0x61, 0x70, 0x6d, 0x65, 0x74, 0x61, 0x3e, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x3c, 0x3f, 0x78, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x65, 0x6e, 0x64, 0x3d, 0x27, 0x77, 0x27, 0x3f, 0x3e, 0xff, 0xee, 0x00, 0x0e, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x00, 0x64, 0x40, 0x00, 0x00, 0x00, 0x01, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x04, 0x06, 0x04, 0x03, 0x04, 0x06, 0x07, 0x05, 0x04, 0x04, 0x05, 0x07, 0x08, 0x06, 0x06, 0x07, 0x06, 0x06, 0x08, 0x0a, 0x08, 0x09, 0x09, 0x09, 0x09, 0x08, 0x0a, 0x0a, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0a, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x01, 0x04, 0x05, 0x05, 0x08, 0x07, 0x08, 0x0f, 0x0a, 0x0a, 0x0f, 0x14, 0x0e, 0x0e, 0x0e, 0x14, 0x14, 0x0e, 0x0e, 0x0e, 0x0e, 0x14, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x64, 0x00, 0x64, 0x03, 0x01, 0x11, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xdd, 0x00, 0x04, 0x00, 0x0d, 0xff, 0xc4, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x03, 0x02, 0x06, 0x01, 0x00, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x01, 0x00, 0x02, 0x02, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x02, 0x06, 0x07, 0x03, 0x04, 0x02, 0x06, 0x02, 0x73, 0x01, 0x02, 0x03, 0x11, 0x04, 0x00, 0x05, 0x21, 0x12, 0x31, 0x41, 0x51, 0x06, 0x13, 0x61, 0x22, 0x71, 0x81, 0x14, 0x32, 0x91, 0xa1, 0x07, 0x15, 0xb1, 0x42, 0x23, 0xc1, 0x52, 0xd1, 0xe1, 0x33, 0x16, 0x62, 0xf0, 0x24, 0x72, 0x82, 0xf1, 0x25, 0x43, 0x34, 0x53, 0x92, 0xa2, 0xb2, 0x63, 0x73, 0xc2, 0x35, 0x44, 0x27, 0x93, 0xa3, 0xb3, 0x36, 0x17, 0x54, 0x64, 0x74, 0xc3, 0xd2, 0xe2, 0x08, 0x26, 0x83, 0x09, 0x0a, 0x18, 0x19, 0x84, 0x94, 0x45, 0x46, 0xa4, 0xb4, 0x56, 0xd3, 0x55, 0x28, 0x1a, 0xf2, 0xe3, 0xf3, 0xc4, 0xd4, 0xe4, 0xf4, 0x65, 0x75, 0x85, 0x95, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x38, 0x48, 0x58, 0x68, 0x78, 0x88, 0x98, 0xa8, 0xb8, 0xc8, 0xd8, 0xe8, 0xf8, 0x29, 0x39, 0x49, 0x59, 0x69, 0x79, 0x89, 0x99, 0xa9, 0xb9, 0xc9, 0xd9, 0xe9, 0xf9, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa, 0x11, 0x00, 0x02, 0x02, 0x01, 0x02, 0x03, 0x05, 0x05, 0x04, 0x05, 0x06, 0x04, 0x08, 0x03, 0x03, 0x6d, 0x01, 0x00, 0x02, 0x11, 0x03, 0x04, 0x21, 0x12, 0x31, 0x41, 0x05, 0x51, 0x13, 0x61, 0x22, 0x06, 0x71, 0x81, 0x91, 0x32, 0xa1, 0xb1, 0xf0, 0x14, 0xc1, 0xd1, 0xe1, 0x23, 0x42, 0x15, 0x52, 0x62, 0x72, 0xf1, 0x33, 0x24, 0x34, 0x43, 0x82, 0x16, 0x92, 0x53, 0x25, 0xa2, 0x63, 0xb2, 0xc2, 0x07, 0x73, 0xd2, 0x35, 0xe2, 0x44, 0x83, 0x17, 0x54, 0x93, 0x08, 0x09, 0x0a, 0x18, 0x19, 0x26, 0x36, 0x45, 0x1a, 0x27, 0x64, 0x74, 0x55, 0x37, 0xf2, 0xa3, 0xb3, 0xc3, 0x28, 0x29, 0xd3, 0xe3, 0xf3, 0x84, 0x94, 0xa4, 0xb4, 0xc4, 0xd4, 0xe4, 0xf4, 0x65, 0x75, 0x85, 0x95, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x46, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x38, 0x48, 0x58, 0x68, 0x78, 0x88, 0x98, 0xa8, 0xb8, 0xc8, 0xd8, 0xe8, 0xf8, 0x39, 0x49, 0x59, 0x69, 0x79, 0x89, 0x99, 0xa9, 0xb9, 0xc9, 0xd9, 0xe9, 0xf9, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xf0, 0x67, 0xa6, 0x5c, 0x0f, 0x01, 0xd4, 0x7e, 0x18, 0x12, 0x98, 0xe9, 0xd6, 0x2d, 0x34, 0x6d, 0x70, 0xdf, 0xdc, 0xa1, 0xe3, 0xec, 0x5b, 0xfb, 0x32, 0x24, 0xb2, 0x01, 0x1f, 0x15, 0xa4, 0x52, 0x4a, 0x82, 0x31, 0xf1, 0xfe, 0xd1, 0x3d, 0x14, 0x64, 0x49, 0x64, 0x22, 0x98, 0xcf, 0xa5, 0x46, 0x6c, 0x16, 0x55, 0x71, 0x56, 0x62, 0x28, 0x07, 0xc5, 0x45, 0x15, 0xa0, 0xc8, 0x89, 0x33, 0xe1, 0x63, 0xd2, 0xd8, 0x34, 0x44, 0x17, 0xa0, 0x2c, 0x4d, 0x16, 0xbb, 0xed, 0xdc, 0xf8, 0x64, 0xc1, 0x6b, 0x31, 0x42, 0x18, 0x8e, 0xc7, 0xb5, 0x2a, 0x7d, 0xb2, 0x56, 0xc5, 0x61, 0x8c, 0xf2, 0xa0, 0x1b, 0x1e, 0x83, 0x0d, 0xa1, 0x63, 0x50, 0x1f, 0x97, 0x7c, 0x2a, 0xa9, 0x1a, 0x9a, 0x86, 0x4f, 0xb4, 0xb4, 0x38, 0x0a, 0xa6, 0x0b, 0xb8, 0x0c, 0x05, 0x14, 0xf8, 0x76, 0x3e, 0x19, 0x14, 0xb6, 0x78, 0xf8, 0x8c, 0x2a, 0xd5, 0x01, 0xdc, 0x6f, 0x8a, 0x1a, 0xe3, 0x8d, 0xab, 0xff, 0xd0, 0xf0, 0xec, 0xe9, 0x15, 0xb5, 0xb9, 0x5a, 0x7c, 0x4c, 0xa2, 0x9e, 0x24, 0xf5, 0xca, 0xc6, 0xe5, 0x99, 0xd9, 0x34, 0x99, 0x04, 0x3a, 0x7d, 0xb5, 0xba, 0xd5, 0x51, 0x63, 0x0e, 0xc7, 0xc5, 0x9b, 0x73, 0xf8, 0xe4, 0x6f, 0x76, 0xca, 0xd9, 0xda, 0x54, 0x6d, 0x72, 0x2e, 0x1a, 0x57, 0x11, 0x44, 0x40, 0x0d, 0x27, 0x7a, 0x0f, 0xd9, 0x5f, 0x12, 0x69, 0x4c, 0x84, 0xcd, 0x36, 0xe3, 0x85, 0xb2, 0xcd, 0x2f, 0x4a, 0x8b, 0x58, 0x36, 0xf6, 0x76, 0xa8, 0x64, 0x64, 0x3c, 0xa4, 0x93, 0xaa, 0x25, 0x3c, 0x49, 0xda, 0xa4, 0xe5, 0x26, 0x54, 0xe4, 0x8c, 0x7c, 0x5c, 0x93, 0x4d, 0x67, 0xc9, 0x3a, 0x6e, 0x9f, 0x13, 0xb4, 0xce, 0xf7, 0x3a, 0x9b, 0xad, 0x52, 0xd6, 0x2a, 0xd1, 0x49, 0xee, 0xc7, 0xf8, 0x64, 0x46, 0x42, 0x4e, 0xcd, 0x92, 0xc2, 0x00, 0xdd, 0x8a, 0x47, 0xe5, 0x69, 0x6e, 0xd4, 0xa4, 0x08, 0x16, 0x83, 0x9c, 0x8c, 0xdd, 0x95, 0x6b, 0xb9, 0xf6, 0xef, 0x97, 0x78, 0x94, 0xe3, 0x78, 0x04, 0xa4, 0xf3, 0xe8, 0xee, 0x64, 0xe1, 0x12, 0x10, 0x05, 0x6a, 0xc7, 0xc0, 0x6f, 0x53, 0xf3, 0xc9, 0x89, 0xb4, 0x9c, 0x4e, 0xb4, 0xf2, 0xd3, 0xde, 0x7a, 0xd2, 0x19, 0x16, 0x38, 0x61, 0x5d, 0xd9, 0x88, 0x05, 0x9c, 0xf4, 0x0a, 0x0f, 0x5f, 0x73, 0x84, 0xe4, 0xa4, 0xc7, 0x0d, 0xa5, 0xf1, 0x59, 0xba, 0x5c, 0x08, 0x98, 0x6f, 0xc8, 0x20, 0xfa, 0x4e, 0x4e, 0xf6, 0x69, 0xe1, 0xa2, 0x89, 0xfd, 0x1f, 0x77, 0x2c, 0xe6, 0xce, 0xd6, 0x17, 0x9a, 0x69, 0xdb, 0xd3, 0x86, 0x18, 0xc1, 0x67, 0x77, 0x26, 0x80, 0x28, 0x1b, 0x93, 0x88, 0x41, 0x0f, 0x40, 0xb0, 0xfc, 0x87, 0xf3, 0x43, 0x98, 0xd7, 0x58, 0x96, 0xdb, 0x4d, 0x91, 0x88, 0xe5, 0x6c, 0x58, 0xdc, 0x5c, 0x2a, 0xf7, 0x2c, 0xb1, 0xfc, 0x20, 0x8f, 0x02, 0xd9, 0x65, 0x06, 0xbe, 0x26, 0x6f, 0xa2, 0x7f, 0xce, 0x3d, 0x69, 0x26, 0xdd, 0x13, 0x52, 0xbf, 0xbd, 0x92, 0x62, 0x59, 0x4c, 0x90, 0xac, 0x50, 0x45, 0x5e, 0xbb, 0x09, 0x03, 0x12, 0x29, 0x84, 0x00, 0xc4, 0xc9, 0x11, 0xff, 0x00, 0x42, 0xe7, 0xa7, 0x7a, 0xd4, 0xfd, 0x21, 0x79, 0xe9, 0x78, 0x71, 0x8b, 0x95, 0x39, 0x75, 0xaf, 0x4e, 0x98, 0x78, 0x42, 0x38, 0xdf, 0xff, 0xd1, 0xf0, 0xe6, 0xa0, 0x58, 0xc8, 0x84, 0x9a, 0xaa, 0x30, 0x55, 0xf9, 0x0a, 0x6f, 0x90, 0x0c, 0xca, 0x72, 0x48, 0xb8, 0x1e, 0x89, 0xa7, 0x23, 0x17, 0x24, 0xff, 0x00, 0x61, 0xb6, 0x54, 0x76, 0x6e, 0x1b, 0xa7, 0xbe, 0x50, 0xf2, 0xc1, 0xd7, 0x4c, 0x52, 0x5e, 0x33, 0x5b, 0xe9, 0x10, 0xf4, 0x54, 0x3c, 0x5e, 0x77, 0xee, 0x49, 0xec, 0x2b, 0xb6, 0x63, 0xe4, 0xc9, 0xc3, 0xef, 0x73, 0xf0, 0xe1, 0x32, 0x1b, 0xf2, 0x7a, 0x05, 0xce, 0xad, 0x65, 0xa1, 0x98, 0xb4, 0x0f, 0x2a, 0x5b, 0x23, 0xeb, 0x12, 0x00, 0x88, 0xb0, 0xa8, 0x66, 0x46, 0x3d, 0xea, 0x7b, 0xfb, 0x9e, 0x99, 0x89, 0xbc, 0x8d, 0x97, 0x3a, 0x34, 0x05, 0x32, 0x5d, 0x1f, 0xc9, 0x1a, 0x8c, 0x36, 0x8c, 0x6f, 0x66, 0xfa, 0xc6, 0xb7, 0x7d, 0xf0, 0x94, 0x04, 0xf0, 0x88, 0xc9, 0xd5, 0x9d, 0x8d, 0x4b, 0x11, 0xd4, 0x9f, 0xbb, 0x25, 0xc5, 0xdc, 0xa2, 0x03, 0x99, 0x4b, 0xbc, 0xf3, 0x0d, 0x97, 0x96, 0x74, 0xe5, 0xf2, 0xb6, 0x80, 0x95, 0xbd, 0x99, 0x15, 0xf5, 0x4b, 0xd2, 0x37, 0x58, 0x46, 0xd4, 0x27, 0xc5, 0xce, 0xc1, 0x7c, 0x30, 0x8e, 0x68, 0x94, 0x7b, 0x9e, 0x6d, 0xe6, 0x7b, 0x9b, 0x5d, 0x3a, 0xd8, 0xdb, 0x32, 0xfa, 0x77, 0x65, 0x15, 0xe4, 0x57, 0xa7, 0x21, 0x55, 0x04, 0x57, 0xef, 0xd8, 0x66, 0x56, 0x38, 0x19, 0x1b, 0xe8, 0xe0, 0x67, 0x98, 0xc7, 0x1a, 0x1c, 0xde, 0x71, 0x71, 0x79, 0x2c, 0xf2, 0xfa, 0x8c, 0x48, 0xec, 0xb5, 0x24, 0x9a, 0x0c, 0xce, 0x75, 0x29, 0xae, 0x8c, 0x67, 0xd4, 0xb5, 0x0b, 0x4b, 0x04, 0x05, 0xef, 0x2e, 0x66, 0x8e, 0x18, 0x08, 0x15, 0xdd, 0x8f, 0x11, 0xb0, 0xeb, 0x4c, 0x04, 0x5b, 0x21, 0x2a, 0x7d, 0x41, 0xe4, 0x4f, 0xcb, 0xcb, 0x5d, 0x12, 0x45, 0xb8, 0xb7, 0x53, 0x71, 0xaa, 0x9f, 0x86, 0x5b, 0xd6, 0x50, 0x4a, 0xed, 0xba, 0x46, 0x77, 0x00, 0x13, 0xd4, 0x8c, 0x85, 0xd3, 0x12, 0x6d, 0xeb, 0x1a, 0x67, 0x95, 0xd9, 0x39, 0x39, 0x50, 0xac, 0xff, 0x00, 0x6f, 0xc4, 0xff, 0x00, 0x1c, 0x81, 0x92, 0xb2, 0x6b, 0x6d, 0x02, 0xdd, 0xbd, 0x36, 0x92, 0x36, 0x2d, 0x1f, 0xc0, 0x2a, 0x0b, 0x28, 0x1b, 0x91, 0x41, 0xf4, 0x9c, 0xb6, 0x25, 0x81, 0x46, 0xfe, 0x81, 0xb5, 0xad, 0x3d, 0xba, 0x57, 0xb7, 0xf9, 0xf6, 0xc9, 0xb0, 0x7f, 0xff, 0xd2, 0xf0, 0xe2, 0x86, 0x95, 0xc4, 0x67, 0x7e, 0x3f, 0x11, 0xf7, 0xa8, 0x19, 0x06, 0x69, 0x8d, 0xca, 0xca, 0x24, 0x8f, 0xd3, 0x52, 0x24, 0x89, 0x47, 0x25, 0x1f, 0xcb, 0x20, 0xf8, 0xb2, 0xb2, 0x76, 0x6e, 0x88, 0x36, 0xf6, 0x6f, 0x2a, 0xc1, 0x6e, 0xfa, 0x45, 0xad, 0xbc, 0x3f, 0x0b, 0x46, 0x81, 0x4d, 0x46, 0xea, 0x7a, 0x9a, 0x83, 0x9a, 0xa9, 0xdd, 0xbb, 0xec, 0x7b, 0x06, 0x5b, 0xe5, 0xcf, 0x2e, 0x69, 0xfa, 0x5c, 0xcd, 0x7b, 0x14, 0x5e, 0xa5, 0xee, 0xf5, 0xb8, 0x7d, 0xdd, 0x99, 0xba, 0xef, 0x91, 0x16, 0x5b, 0x36, 0xb6, 0x65, 0x0d, 0xac, 0xb2, 0x5b, 0xed, 0x34, 0x81, 0x7a, 0xbb, 0x46, 0x40, 0x6a, 0x9e, 0xb4, 0x39, 0x31, 0x13, 0x49, 0xda, 0xd2, 0x9b, 0xed, 0x1e, 0xc4, 0x24, 0xb3, 0x35, 0xb2, 0x88, 0x60, 0x06, 0xe6, 0x56, 0x98, 0x96, 0x79, 0x1e, 0x31, 0x51, 0xc9, 0x8f, 0xcb, 0x00, 0xe6, 0xb3, 0xe4, 0xf9, 0x2b, 0xcc, 0x7a, 0x94, 0xda, 0x96, 0xa9, 0x71, 0x77, 0x70, 0x79, 0xcd, 0x33, 0x97, 0x76, 0x3f, 0xcc, 0xc6, 0xa6, 0x9f, 0x2e, 0x99, 0xb9, 0xc6, 0x2a, 0x21, 0xe6, 0x73, 0xca, 0xe6, 0x4a, 0x51, 0x1a, 0x99, 0x1c, 0x28, 0x04, 0x93, 0xd0, 0x0e, 0xa4, 0xe4, 0xda, 0x5f, 0x50, 0xfe, 0x4a, 0xfe, 0x48, 0xb5, 0xb2, 0xc1, 0xe6, 0x1f, 0x31, 0x7e, 0xef, 0x52, 0x91, 0x43, 0xc3, 0x6e, 0x77, 0xf4, 0x22, 0x6d, 0xbf, 0xe4, 0x63, 0x0e, 0xbf, 0xca, 0x36, 0xeb, 0x5c, 0x84, 0xa5, 0x48, 0x7d, 0x3b, 0x61, 0xa1, 0xdb, 0x5b, 0x2c, 0x71, 0xda, 0x45, 0xc4, 0x28, 0x00, 0x81, 0xdb, 0x31, 0xc9, 0xb4, 0xb2, 0x3b, 0x5d, 0x27, 0xa5, 0x05, 0x1b, 0xc7, 0xdb, 0x10, 0xa9, 0xbd, 0xa6, 0x93, 0x0c, 0x75, 0xe4, 0x39, 0x35, 0x41, 0x3d, 0xc5, 0x06, 0xdb, 0x8e, 0xfd, 0x46, 0x5b, 0x1d, 0x98, 0x95, 0x4f, 0x46, 0xdb, 0xd5, 0xfb, 0x29, 0x5e, 0x9d, 0x0d, 0x32, 0xeb, 0x61, 0x4f, 0xff, 0xd3, 0xf1, 0x46, 0x9a, 0x16, 0x1b, 0x91, 0x71, 0x28, 0xac, 0x4a, 0x14, 0x30, 0x3e, 0x19, 0x54, 0xb9, 0x36, 0xc7, 0x9b, 0x2d, 0xd1, 0x6c, 0x45, 0xe3, 0xdc, 0xde, 0xc8, 0x95, 0x5b, 0x87, 0xf8, 0x41, 0x1d, 0x10, 0x54, 0x01, 0x98, 0x79, 0x25, 0xd1, 0xda, 0xe9, 0xe1, 0xb5, 0x9e, 0xac, 0xeb, 0x42, 0xba, 0x8e, 0xdf, 0x8c, 0x31, 0x21, 0x70, 0xb4, 0x5d, 0xbe, 0xc5, 0x7c, 0x2b, 0xed, 0xe1, 0x94, 0x18, 0xb9, 0x51, 0x3d, 0x03, 0x2c, 0x13, 0x6b, 0xf1, 0x42, 0x6e, 0xe2, 0xb7, 0x12, 0xa0, 0xdd, 0x50, 0x9f, 0x4f, 0x6f, 0xa7, 0x6f, 0xc7, 0x03, 0x61, 0xa0, 0x83, 0xb5, 0xf3, 0x97, 0x98, 0x20, 0x9c, 0x44, 0xea, 0xd0, 0xad, 0x48, 0x64, 0x90, 0x21, 0xd8, 0x9f, 0xa7, 0xa6, 0x44, 0xca, 0x99, 0xc6, 0x36, 0xcb, 0x74, 0x5d, 0x7e, 0x5b, 0xfe, 0x31, 0x6a, 0x31, 0xf3, 0x8c, 0xd0, 0xad, 0x40, 0xa3, 0x1f, 0x7c, 0x44, 0xd6, 0x51, 0xd9, 0xe0, 0x5f, 0x9a, 0x7e, 0x41, 0x9f, 0x40, 0xf3, 0x14, 0xba, 0x85, 0xba, 0x34, 0xba, 0x2d, 0xfb, 0x34, 0xd0, 0xcf, 0x4f, 0xb0, 0xce, 0x6a, 0x51, 0xe9, 0xb0, 0x20, 0xf4, 0xf1, 0x19, 0xb2, 0xc3, 0x90, 0x11, 0x4e, 0x97, 0x55, 0x80, 0x83, 0xc4, 0x17, 0x7e, 0x4c, 0x79, 0x19, 0xfc, 0xd1, 0xe7, 0x78, 0x4b, 0x91, 0x1d, 0xae, 0x92, 0xa6, 0xf6, 0x46, 0x75, 0xe4, 0xad, 0x22, 0x1f, 0xdd, 0xa1, 0x07, 0xb3, 0x1e, 0xfe, 0xd9, 0x92, 0xeb, 0x4b, 0xed, 0xfd, 0x0a, 0xc2, 0x63, 0x27, 0xa4, 0x88, 0x17, 0x60, 0x49, 0x35, 0xdc, 0x8e, 0xa5, 0x7d, 0xab, 0xd3, 0x28, 0x90, 0x50, 0xcd, 0xed, 0x2d, 0xda, 0x15, 0x55, 0x51, 0xf1, 0x1a, 0x0a, 0xf7, 0x39, 0x5d, 0xaa, 0x77, 0x6f, 0x01, 0x8e, 0xa7, 0x7d, 0xfa, 0xff, 0x00, 0x66, 0x10, 0xa8, 0xb8, 0x63, 0x76, 0x90, 0xa8, 0x20, 0x06, 0x56, 0xdb, 0x61, 0xda, 0xbd, 0x4f, 0xcb, 0x24, 0x15, 0x0f, 0xf5, 0x66, 0xe5, 0x5f, 0x4c, 0x53, 0xc3, 0xb7, 0xce, 0x99, 0x6b, 0x17, 0xff, 0xd4, 0xf0, 0xec, 0x57, 0x6f, 0x32, 0xa5, 0xa4, 0x43, 0x76, 0x75, 0xa9, 0xf1, 0x03, 0xfa, 0x64, 0x08, 0x6c, 0x8e, 0xfb, 0x3d, 0x7f, 0xcb, 0x16, 0x2b, 0x3d, 0xbc, 0x16, 0xa3, 0x66, 0x6d, 0x98, 0xfb, 0x1e, 0xb9, 0xac, 0xc8, 0x77, 0xb7, 0x7d, 0x01, 0xb3, 0x37, 0xb8, 0xd3, 0x46, 0x95, 0x68, 0x86, 0xd2, 0x2e, 0x4e, 0xab, 0xf0, 0x23, 0x11, 0x4e, 0x5f, 0xcd, 0x98, 0xe7, 0x25, 0x96, 0x71, 0x83, 0x0f, 0xd6, 0x3c, 0xb9, 0xe7, 0x0d, 0x7c, 0x41, 0x22, 0x5e, 0xb3, 0x20, 0x0c, 0x65, 0x80, 0xc8, 0x63, 0x8e, 0xbb, 0x95, 0xa5, 0x07, 0xeb, 0xcc, 0xac, 0x73, 0x83, 0x4e, 0x5c, 0x59, 0x09, 0xd8, 0xec, 0xc8, 0x57, 0x41, 0xd3, 0x4e, 0x95, 0xa5, 0x5b, 0x4b, 0x6a, 0xcb, 0xab, 0x43, 0x10, 0x4b, 0xeb, 0x85, 0xa2, 0x2c, 0x8e, 0x3f, 0x68, 0x54, 0xf5, 0x00, 0xd3, 0x97, 0x7a, 0x65, 0x79, 0xa6, 0x24, 0x76, 0x6f, 0xd3, 0x62, 0x96, 0x30, 0x78, 0xcb, 0x21, 0xf2, 0xf4, 0x22, 0xce, 0x54, 0x8e, 0x46, 0x26, 0x10, 0x7e, 0x0a, 0xf5, 0xd8, 0xf5, 0x1f, 0x31, 0x98, 0x83, 0x73, 0xb3, 0x91, 0xcd, 0x67, 0xe6, 0x7d, 0xe8, 0x16, 0x69, 0x6f, 0x10, 0x1f, 0x54, 0x9a, 0x37, 0xf5, 0x41, 0x5e, 0x7f, 0x0a, 0x29, 0x62, 0x02, 0xf8, 0x9c, 0xc8, 0x8c, 0x77, 0x6a, 0x99, 0xa0, 0x89, 0xff, 0x00, 0x9c, 0x74, 0xd2, 0xed, 0xed, 0xfc, 0xbb, 0x7b, 0xaa, 0x9a, 0x7d, 0x62, 0xfe, 0x46, 0x2d, 0xfe, 0x4c, 0x51, 0x31, 0x11, 0xa9, 0xf6, 0xef, 0x9b, 0x30, 0x5e, 0x7b, 0x38, 0xdd, 0xf4, 0x7f, 0x95, 0x94, 0xbc, 0x12, 0x43, 0x30, 0x6a, 0xb2, 0xf3, 0x86, 0x40, 0x3e, 0xcb, 0xd7, 0x6a, 0xd7, 0xb1, 0xe9, 0x8f, 0x37, 0x19, 0x97, 0x41, 0x2c, 0x71, 0x20, 0xf5, 0x36, 0x9c, 0x55, 0x78, 0x1d, 0x8a, 0x91, 0xd7, 0x11, 0x14, 0x5a, 0x3e, 0x19, 0x03, 0x10, 0x6b, 0xca, 0xbd, 0x86, 0xf8, 0x9d, 0x95, 0x18, 0x36, 0x65, 0x2e, 0xbc, 0x54, 0x1f, 0xa2, 0x99, 0x00, 0x59, 0x2a, 0x6f, 0x5e, 0x55, 0x15, 0xe9, 0x5f, 0xc3, 0x2f, 0xb6, 0x14, 0xff, 0x00, 0xff, 0xd5, 0xf1, 0x95, 0xfe, 0x80, 0x74, 0x0d, 0x7c, 0xd9, 0x89, 0x3d, 0x78, 0x57, 0x8b, 0xc5, 0x28, 0xe8, 0x55, 0xf7, 0x1f, 0x48, 0xca, 0x38, 0xb8, 0x83, 0x9f, 0x93, 0x07, 0x85, 0x3a, 0x7a, 0x6f, 0x95, 0x66, 0x2b, 0x2c, 0x4c, 0x0d, 0x14, 0x00, 0x3e, 0x9c, 0xc3, 0x98, 0x76, 0xb8, 0x45, 0xbd, 0x02, 0xde, 0x48, 0xee, 0xdc, 0xa0, 0x15, 0xe2, 0x2b, 0xc8, 0x8a, 0x8a, 0xfd, 0x3b, 0x66, 0x3f, 0x00, 0x73, 0x84, 0x2d, 0x36, 0xb5, 0xb5, 0x9e, 0x35, 0x1c, 0x29, 0xc4, 0xfe, 0xc8, 0x04, 0x7f, 0xc4, 0x69, 0x91, 0xe1, 0x67, 0x2c, 0x4a, 0xd2, 0xe9, 0x4e, 0xe3, 0xd4, 0xf4, 0x81, 0x5a, 0x12, 0xc5, 0x41, 0x3f, 0x79, 0x38, 0x9b, 0x60, 0x20, 0x07, 0x34, 0xb0, 0xc9, 0x03, 0x5c, 0x23, 0x03, 0x53, 0x13, 0x56, 0x88, 0xdf, 0x09, 0xda, 0x9b, 0xd3, 0xb6, 0x52, 0x0e, 0xec, 0xe4, 0x29, 0x24, 0xfc, 0xd0, 0xe7, 0x75, 0xe5, 0x57, 0x6b, 0x61, 0xfb, 0xf0, 0xca, 0xaa, 0x57, 0xa8, 0xe6, 0x78, 0x1a, 0x7d, 0xf9, 0x95, 0x8a, 0x5e, 0xa0, 0xe3, 0x67, 0x8f, 0xa0, 0xbd, 0x5b, 0xf2, 0xdf, 0x4a, 0x82, 0xcb, 0x4a, 0xb3, 0xb0, 0xb4, 0x41, 0x0a, 0x70, 0x48, 0xd9, 0x57, 0x60, 0x51, 0x3a, 0x8f, 0xbc, 0xe6, 0x7b, 0xcb, 0xe4, 0x3b, 0xa7, 0x3f, 0x9b, 0x9f, 0x9a, 0xba, 0x77, 0xe5, 0x5f, 0x95, 0x9c, 0x59, 0x94, 0x9f, 0xcd, 0x37, 0x8c, 0xa9, 0xa6, 0xd9, 0x39, 0xaa, 0xd0, 0x7d, 0xa9, 0x1c, 0x03, 0x5e, 0x09, 0xff, 0x00, 0x0c, 0x76, 0xcb, 0x62, 0x2d, 0xa5, 0xf2, 0x85, 0xbf, 0xe7, 0x87, 0xe6, 0xa3, 0x5e, 0x4d, 0xa8, 0xc9, 0xe6, 0x8b, 0xd5, 0x69, 0x5c, 0xb0, 0x4a, 0xab, 0xc4, 0xb5, 0x35, 0x0a, 0xaa, 0xea, 0x40, 0x03, 0xa0, 0xf6, 0xcb, 0x40, 0x4d, 0x3e, 0xdb, 0xff, 0x00, 0x9c, 0x7f, 0xfc, 0xce, 0x4f, 0xcc, 0xbf, 0x26, 0x25, 0xe5, 0xd3, 0x2f, 0xe9, 0xdd, 0x3d, 0xfe, 0xab, 0xa9, 0xaa, 0xd2, 0xa6, 0x40, 0x2a, 0xb2, 0x71, 0x00, 0x01, 0xea, 0x0d, 0xe8, 0x3a, 0x64, 0x25, 0x16, 0x1c, 0x8b, 0xd9, 0x51, 0x39, 0x28, 0x12, 0x51, 0x41, 0xfd, 0xa3, 0xd2, 0xb9, 0x4f, 0x0d, 0x33, 0xb5, 0xf4, 0x87, 0x9d, 0x79, 0x0e, 0xb4, 0xaf, 0x6a, 0xf8, 0xf1, 0xf0, 0xc9, 0xda, 0xbf, 0xff, 0xd6, 0xf2, 0xc6, 0xb5, 0x68, 0x64, 0xd0, 0x6d, 0x35, 0x20, 0x39, 0xcd, 0x13, 0x0f, 0x5e, 0x61, 0xfc, 0x8f, 0x40, 0x8b, 0x5e, 0xe0, 0x66, 0x1c, 0x4f, 0xaa, 0x9d, 0xe6, 0xa6, 0x1e, 0x91, 0x2e, 0xa9, 0x87, 0x95, 0xee, 0x9c, 0xc5, 0x55, 0x34, 0x60, 0x40, 0xae, 0x57, 0x30, 0xd9, 0xa7, 0x95, 0xbd, 0x6f, 0xcb, 0x26, 0x39, 0x40, 0x0d, 0x4e, 0xc0, 0x9f, 0x9e, 0x50, 0x5d, 0xac, 0x79, 0x33, 0x8b, 0xbb, 0x9b, 0x3b, 0x6b, 0x35, 0x48, 0x54, 0x09, 0x29, 0x56, 0x7f, 0xe1, 0x86, 0x72, 0x00, 0x2c, 0x6e, 0xf7, 0x63, 0x3e, 0x63, 0xbd, 0xbd, 0x5d, 0x20, 0x2a, 0xb3, 0xa4, 0x33, 0x48, 0xab, 0x21, 0x43, 0xf1, 0x2c, 0x47, 0xed, 0x1d, 0xbc, 0x73, 0x18, 0x9b, 0x64, 0x28, 0x96, 0x3a, 0xc7, 0x49, 0xb0, 0xf4, 0xcc, 0xe9, 0x73, 0x6c, 0xb4, 0xf8, 0x67, 0x92, 0x32, 0x21, 0x70, 0x7b, 0x89, 0x05, 0x57, 0xef, 0x38, 0x28, 0x94, 0x4a, 0x7d, 0x13, 0x7d, 0x6a, 0xd3, 0x4c, 0xb8, 0xf2, 0xc3, 0xc8, 0x2e, 0x03, 0xf3, 0xe2, 0x7d, 0x33, 0xb7, 0xc5, 0xcc, 0x71, 0x03, 0xc6, 0xb9, 0x64, 0x06, 0xe2, 0x9a, 0xf2, 0x4f, 0xd2, 0x6d, 0xe9, 0xfe, 0x41, 0x45, 0x5b, 0x18, 0x66, 0xa5, 0x64, 0x09, 0xf4, 0xd5, 0xb7, 0xcd, 0x93, 0xc7, 0xcf, 0x9b, 0xe5, 0x6f, 0xf9, 0xc8, 0x0d, 0x56, 0xeb, 0x59, 0xfc, 0xce, 0xd5, 0x12, 0x61, 0xc4, 0x69, 0xe9, 0x0d, 0xa4, 0x4b, 0xfe, 0x48, 0x40, 0xd5, 0x3e, 0xe4, 0xb6, 0x64, 0x8e, 0x4c, 0x02, 0x61, 0x65, 0xa0, 0x14, 0xb4, 0xb6, 0xb0, 0xb1, 0xb6, 0xb2, 0x97, 0xcb, 0xf1, 0x5a, 0x2d, 0xc6, 0xa5, 0xac, 0xb4, 0x70, 0x5d, 0xc7, 0x3d, 0xc1, 0x51, 0x24, 0x91, 0xc9, 0x31, 0x75, 0x6b, 0x70, 0x9f, 0x14, 0x68, 0x01, 0x46, 0xe4, 0xb5, 0xa3, 0x17, 0xcb, 0x40, 0x61, 0x6f, 0x47, 0xff, 0x00, 0x9c, 0x3a, 0x8f, 0x5b, 0x4f, 0x3c, 0x6b, 0xb7, 0xfa, 0x30, 0x91, 0x3c, 0xa4, 0xb1, 0x95, 0xb9, 0x82, 0x42, 0x0a, 0xbc, 0x8e, 0xe4, 0xdb, 0xa9, 0xef, 0xc9, 0x17, 0x91, 0x24, 0x7c, 0xb2, 0x05, 0x64, 0xfb, 0x75, 0x64, 0x32, 0x39, 0x69, 0x5b, 0x9c, 0xad, 0xb9, 0xdb, 0xa7, 0xb5, 0x3b, 0x53, 0x2a, 0x21, 0x41, 0x44, 0xf3, 0x8b, 0x8f, 0x2e, 0x43, 0x9d, 0x2b, 0xd4, 0x57, 0x23, 0x41, 0x36, 0xff, 0x00, 0xff, 0xd7, 0xf0, 0xc0, 0xd5, 0xb5, 0x11, 0x64, 0xb6, 0x3f, 0x59, 0x90, 0xd9, 0xab, 0x06, 0xf4, 0x79, 0x7c, 0x3b, 0x74, 0xc8, 0x08, 0x8b, 0xb6, 0xe3, 0x96, 0x55, 0x57, 0xb3, 0x3e, 0xf2, 0x35, 0xc7, 0xd6, 0x0b, 0x45, 0x5d, 0xdc, 0x8a, 0x7d, 0xd9, 0x8d, 0x94, 0x3b, 0x3d, 0x1c, 0x9e, 0xc3, 0xe5, 0xc3, 0x2c, 0x7c, 0xc5, 0x0f, 0xee, 0xdb, 0x8b, 0x0c, 0xc4, 0x26, 0x9d, 0xa0, 0x9a, 0x7d, 0x2c, 0xe5, 0xe4, 0x55, 0x7f, 0xee, 0xc1, 0x15, 0x04, 0xd0, 0x12, 0x3c, 0x72, 0x89, 0x1b, 0x2c, 0xcc, 0xa8, 0x2a, 0x8b, 0x87, 0xbb, 0x63, 0x1a, 0x28, 0x65, 0xf0, 0xed, 0xf2, 0xc3, 0xc2, 0x0a, 0x06, 0x4a, 0x46, 0xc7, 0xa5, 0xa3, 0x59, 0xc8, 0xb2, 0xc7, 0x45, 0x22, 0x9c, 0x14, 0x54, 0x10, 0x46, 0xf5, 0x1d, 0x32, 0x5c, 0x14, 0x14, 0xe4, 0x32, 0x2f, 0x3a, 0xf3, 0xb6, 0x90, 0x9a, 0x6d, 0xae, 0x9f, 0x3d, 0xab, 0xb8, 0x8a, 0x3b, 0xf8, 0x39, 0x44, 0x58, 0xf0, 0x08, 0xd5, 0x14, 0xa5, 0x7b, 0x65, 0x98, 0x8e, 0xfb, 0xb5, 0x67, 0x87, 0xa5, 0xef, 0x5e, 0x44, 0x96, 0x35, 0xb5, 0xb6, 0x59, 0x36, 0xfd, 0xd8, 0xa0, 0xf1, 0x20, 0x53, 0x33, 0xc0, 0x79, 0x59, 0x73, 0x7c, 0xd7, 0xf9, 0xfb, 0xa2, 0xcd, 0x67, 0xf9, 0xa7, 0x7b, 0x72, 0xf1, 0x71, 0x83, 0x53, 0x86, 0x0b, 0x98, 0x24, 0x22, 0x8a, 0xcc, 0x88, 0x23, 0x7f, 0xb8, 0xae, 0xf9, 0x7c, 0x50, 0x1e, 0x5f, 0x7c, 0x48, 0x21, 0x44, 0x6b, 0xce, 0x9b, 0xb0, 0x1b, 0x9e, 0xf5, 0xaf, 0x8e, 0x4d, 0x5f, 0x7a, 0x7f, 0xce, 0x34, 0xf9, 0x5d, 0x3c, 0xa3, 0xf9, 0x69, 0x63, 0xa9, 0x3c, 0x27, 0xeb, 0xda, 0xe1, 0x37, 0xd7, 0x2e, 0xaa, 0xdb, 0x06, 0xda, 0x30, 0x49, 0xfe, 0x54, 0x03, 0x03, 0x49, 0xdc, 0xb3, 0xaf, 0x38, 0xfe, 0x6a, 0xf9, 0x47, 0xc9, 0x3a, 0x74, 0x97, 0xfa, 0xf6, 0xaf, 0x15, 0x85, 0xb8, 0x75, 0x89, 0xb8, 0x87, 0x9a, 0x72, 0xee, 0x2a, 0x14, 0x24, 0x60, 0xb1, 0xa8, 0xdf, 0x07, 0x0b, 0x2d, 0xcb, 0xcf, 0x7f, 0xe8, 0x6a, 0xff, 0x00, 0x26, 0xbd, 0x6a, 0x7f, 0x89, 0x2f, 0xf8, 0x52, 0x9e, 0xb7, 0xe8, 0xb9, 0xb8, 0x57, 0xc2, 0x95, 0xe9, 0x8f, 0x08, 0x5a, 0x2f, 0xff, 0xd0, 0xf0, 0x4d, 0x40, 0xaa, 0xd7, 0x00, 0x64, 0xcb, 0x3c, 0x97, 0xa8, 0xb5, 0x9e, 0xa3, 0x1a, 0xd6, 0x84, 0x95, 0x3f, 0x45, 0x72, 0x9c, 0xa2, 0xc3, 0x99, 0xa5, 0x9d, 0x49, 0xf4, 0x17, 0x97, 0xaf, 0x63, 0x17, 0x52, 0x6f, 0xf0, 0xc8, 0x43, 0x6f, 0x9a, 0xe9, 0x07, 0x70, 0x0e, 0xec, 0x83, 0x51, 0x44, 0xb8, 0x61, 0x1a, 0x9e, 0x11, 0xd3, 0x91, 0x60, 0x68, 0x6b, 0xd3, 0x31, 0x4f, 0x36, 0xd3, 0x4c, 0x52, 0xef, 0x4c, 0xd5, 0x0c, 0xc4, 0x69, 0xda, 0x94, 0xc8, 0x3a, 0xf0, 0x66, 0x07, 0x73, 0xe0, 0x40, 0xfd, 0x79, 0x93, 0x12, 0x1c, 0x9c, 0x32, 0xc7, 0xfc, 0x41, 0x33, 0xd2, 0xb4, 0x6f, 0x38, 0x98, 0x65, 0x76, 0xbf, 0x69, 0x42, 0xd0, 0xaa, 0xc9, 0xde, 0x95, 0xad, 0x28, 0x46, 0x4e, 0xac, 0x39, 0x77, 0x80, 0x11, 0xbf, 0xd8, 0xc7, 0x7c, 0xe1, 0xa5, 0xf9, 0x92, 0x4d, 0x32, 0x5b, 0x8b, 0x93, 0x27, 0xa7, 0x68, 0x56, 0xe2, 0x45, 0xda, 0x85, 0x61, 0x6e, 0x67, 0xad, 0x6b, 0xb0, 0x38, 0xc2, 0x81, 0xe4, 0xc7, 0x52, 0x31, 0x1c, 0x67, 0x86, 0x5b, 0xbd, 0x37, 0xca, 0x7a, 0x94, 0xb1, 0x69, 0xb6, 0x2e, 0xb7, 0x15, 0x48, 0xc2, 0xb4, 0x52, 0x53, 0xac, 0x32, 0xaf, 0xb1, 0xed, 0x9b, 0x10, 0x36, 0x78, 0x5c, 0x9f, 0x51, 0x64, 0x1f, 0x98, 0x3e, 0x58, 0xb6, 0xfc, 0xc8, 0xf2, 0xe5, 0xbc, 0x68, 0x52, 0x2d, 0x5a, 0xd1, 0x84, 0xb6, 0xf3, 0x95, 0x0e, 0xc0, 0x85, 0xe2, 0xcb, 0xd8, 0xd1, 0xbb, 0xe4, 0xc1, 0xa6, 0x97, 0xce, 0x17, 0x5f, 0x95, 0xde, 0x6d, 0xb6, 0xbe, 0xb7, 0x69, 0x34, 0xf3, 0x3c, 0x72, 0xcf, 0xe8, 0xa3, 0x45, 0x49, 0x95, 0x4a, 0x90, 0x3e, 0x35, 0x5a, 0x95, 0x1d, 0xfe, 0x21, 0x93, 0x4d, 0xbe, 0xd2, 0xd2, 0xf5, 0x8b, 0xbd, 0x32, 0x2d, 0x3f, 0x4c, 0x9a, 0xe4, 0xca, 0x9e, 0x90, 0x85, 0x65, 0x55, 0x08, 0x85, 0x91, 0x01, 0x3b, 0x0a, 0x05, 0xe9, 0xb0, 0xc0, 0x5a, 0xc3, 0xcd, 0x3f, 0x3b, 0x7f, 0x26, 0xec, 0xff, 0x00, 0x35, 0x6d, 0x6d, 0xb5, 0x3d, 0x16, 0xfe, 0x0d, 0x3b, 0xcd, 0x96, 0x01, 0x92, 0x46, 0x9e, 0xa2, 0x0b, 0xc8, 0xb7, 0x28, 0x92, 0x71, 0xfb, 0x2e, 0xa7, 0xec, 0x3d, 0x0f, 0xc2, 0x68, 0x71, 0x05, 0x95, 0xd3, 0xe7, 0x9f, 0xfa, 0x16, 0x2f, 0xcd, 0x7f, 0x43, 0xd6, 0xfa, 0xa5, 0x97, 0xab, 0xeb, 0x7a, 0x5f, 0x55, 0xfa, 0xec, 0x5e, 0xaf, 0x0f, 0xf7, 0xed, 0x2b, 0x4e, 0x15, 0xff, 0x00, 0x65, 0xdf, 0x8e, 0x14, 0xf1, 0xbf, 0xff, 0xd1, 0xf0, 0x5a, 0xa7, 0x18, 0x5e, 0x56, 0x1f, 0x68, 0x71, 0x5f, 0xa7, 0xbe, 0x2a, 0x98, 0xdb, 0xfa, 0x90, 0x24, 0x37, 0xb0, 0xfd, 0xb8, 0xa8, 0x58, 0x78, 0xae, 0x43, 0xc9, 0xb4, 0x6d, 0xbb, 0xda, 0x3c, 0xa1, 0xad, 0x43, 0xa8, 0xda, 0xc5, 0x2a, 0x3d, 0x26, 0x5a, 0x02, 0x2b, 0xbe, 0x60, 0x64, 0x8d, 0x17, 0x6f, 0x8b, 0x20, 0x90, 0x7a, 0x3c, 0x32, 0x8b, 0xa8, 0x02, 0xf3, 0xfd, 0xe0, 0x1b, 0x11, 0x98, 0x66, 0x3b, 0xb9, 0x62, 0x54, 0x83, 0x36, 0xf2, 0xa4, 0xe4, 0x29, 0x34, 0xeb, 0xc8, 0x74, 0xae, 0x0d, 0xc3, 0x65, 0x82, 0x13, 0x6b, 0x57, 0xba, 0x54, 0xe4, 0x8c, 0x41, 0x1b, 0x75, 0xa7, 0xe0, 0x72, 0x5c, 0x4c, 0x84, 0x50, 0x5a, 0xb3, 0xdd, 0xdd, 0xc3, 0x24, 0x33, 0xb1, 0x60, 0xe0, 0x86, 0x52, 0x45, 0x38, 0xd2, 0x87, 0x24, 0x26, 0x6d, 0x8c, 0xe1, 0x41, 0x25, 0xfc, 0xa3, 0xd7, 0x2f, 0x6f, 0x3c, 0xbf, 0x73, 0xa5, 0xb2, 0x2c, 0xd1, 0x69, 0x17, 0x2f, 0x6b, 0x14, 0x8c, 0x0f, 0x21, 0x0d, 0x79, 0x46, 0x09, 0x15, 0xed, 0xb7, 0x4e, 0xd9, 0xb9, 0x8b, 0xcb, 0xe4, 0xa2, 0x5e, 0xa3, 0xa6, 0xdf, 0x6a, 0x36, 0xe4, 0xcd, 0x69, 0x1c, 0x4e, 0x84, 0x7c, 0x76, 0xab, 0x21, 0x67, 0xa8, 0xa7, 0xd9, 0xf8, 0x4d, 0x2b, 0xf3, 0xc3, 0x4d, 0x49, 0x57, 0x98, 0x75, 0x6f, 0x31, 0xda, 0xf9, 0xa3, 0x4b, 0xfd, 0x1f, 0x69, 0x1d, 0xae, 0xa1, 0xa9, 0x7e, 0xee, 0xe6, 0xd2, 0x79, 0x18, 0xf3, 0xb5, 0x1f, 0xee, 0xd9, 0x0a, 0x01, 0x4e, 0x3f, 0xb3, 0x4d, 0xf2, 0x9c, 0xb9, 0x04, 0x05, 0xb7, 0xe2, 0x87, 0x1e, 0xdd, 0x19, 0x3e, 0xaf, 0x6b, 0xae, 0xcb, 0x6d, 0x13, 0x0d, 0x45, 0xa2, 0x8e, 0x06, 0xe5, 0x13, 0x2a, 0x02, 0x01, 0x5e, 0x82, 0xb5, 0x04, 0xe6, 0x11, 0xd4, 0xcd, 0xda, 0x43, 0x49, 0x8e, 0xb7, 0xdc, 0xb1, 0x51, 0xe6, 0x4d, 0x76, 0xd2, 0x61, 0x15, 0xaa, 0x4b, 0xa8, 0xc9, 0x6e, 0x49, 0x79, 0x20, 0xe6, 0x8c, 0x49, 0xad, 0x43, 0x16, 0xe4, 0xa7, 0xaf, 0x43, 0xd3, 0x26, 0x35, 0x75, 0xcd, 0xa8, 0xe8, 0x87, 0x46, 0xbf, 0xc7, 0x9a, 0xff, 0x00, 0xd6, 0xbf, 0x48, 0xfe, 0x88, 0xfd, 0xe7, 0x0f, 0xab, 0xfa, 0x3f, 0x58, 0x7f, 0x5f, 0x8d, 0x3f, 0x9f, 0xa7, 0x5e, 0xd4, 0xc3, 0xf9, 0xd1, 0x7c, 0xb6, 0x47, 0xe4, 0x3a, 0x5b, 0xff, 0xd2, 0xf0, 0xb7, 0xa6, 0x1e, 0xdf, 0xd3, 0xf6, 0xa5, 0x71, 0x54, 0xdb, 0x4b, 0x80, 0x3c, 0x42, 0x26, 0xee, 0x29, 0xbe, 0x51, 0x23, 0x4e, 0x44, 0x05, 0x84, 0x45, 0xa5, 0xd5, 0xf7, 0x97, 0x2e, 0xfd, 0x6b, 0x6a, 0x98, 0x09, 0xab, 0xc7, 0xfc, 0x46, 0x3b, 0x4c, 0x26, 0x32, 0x30, 0x3e, 0x4f, 0x49, 0xd0, 0xfc, 0xfb, 0x05, 0xd4, 0x4a, 0x7d, 0x40, 0xac, 0x3a, 0x8e, 0x84, 0x1c, 0xc5, 0x96, 0x2a, 0x73, 0xe1, 0x9c, 0x16, 0x6d, 0xa5, 0x79, 0x86, 0xd6, 0xec, 0x80, 0x5a, 0xa0, 0xf5, 0xca, 0xcc, 0x5c, 0xa1, 0x2b, 0x1b, 0x26, 0x30, 0x6a, 0x31, 0x46, 0xcf, 0x1c, 0x87, 0x94, 0x64, 0x9e, 0x3d, 0xb6, 0xf0, 0xca, 0xa8, 0x39, 0x51, 0x99, 0x42, 0x6b, 0x1a, 0xc5, 0xa5, 0xa5, 0x94, 0xf7, 0x92, 0xc8, 0xaa, 0xb1, 0x23, 0x30, 0x04, 0xf8, 0x0e, 0x9f, 0x4e, 0x4a, 0x11, 0xb2, 0xd5, 0x9b, 0x25, 0x06, 0x1b, 0xff, 0x00, 0x38, 0xfd, 0xad, 0xdf, 0xda, 0xf9, 0xa2, 0xfe, 0xc5, 0x42, 0xbe, 0x9b, 0x7f, 0x0b, 0xdd, 0xdd, 0x07, 0xaf, 0x14, 0x68, 0xd8, 0x71, 0x6d, 0xbb, 0x90, 0xfc, 0x73, 0x6e, 0xf2, 0xf2, 0xdd, 0xf4, 0xad, 0xa6, 0xab, 0x6d, 0x69, 0x14, 0xfa, 0xee, 0xa0, 0xe2, 0x0b, 0x0d, 0x39, 0x19, 0xfe, 0x11, 0xc5, 0x1a, 0x4a, 0x1d, 0x8f, 0x73, 0x4f, 0xf8, 0x96, 0x0b, 0x40, 0x8d, 0xec, 0xf3, 0x6d, 0x3f, 0x52, 0xba, 0xd6, 0x35, 0x8b, 0xbf, 0x36, 0x6a, 0x5f, 0x0d, 0xc5, 0xdc, 0xa8, 0xb6, 0xa8, 0x7a, 0xc5, 0x6c, 0x9b, 0x22, 0x0f, 0xa3, 0x73, 0x9a, 0xbc, 0xb3, 0xe2, 0x36, 0xed, 0xb1, 0x43, 0x80, 0x53, 0xd0, 0xa7, 0xd4, 0x44, 0xfa, 0x7a, 0xda, 0x83, 0xbd, 0x3e, 0x2f, 0xa7, 0x2b, 0xad, 0x9b, 0xb8, 0x8d, 0xa8, 0xe8, 0x91, 0xdb, 0xfa, 0x2d, 0x6f, 0xc3, 0x8a, 0x2d, 0x56, 0xa3, 0xad, 0x4f, 0x5c, 0xa4, 0x0d, 0xdc, 0xa3, 0xca, 0xd0, 0xbf, 0xa1, 0xe3, 0xfa, 0xe7, 0x0f, 0xf2, 0xb9, 0x57, 0xbf, 0x1a, 0xe4, 0xb8, 0x57, 0xc5, 0xdd, 0xff, 0xd3, 0xf0, 0xcc, 0x5d, 0x7b, 0x70, 0xc5, 0x53, 0x6d, 0x2f, 0xd5, 0xe4, 0x69, 0xfd, 0xdf, 0xec, 0xd7, 0xad, 0x7d, 0xb2, 0x8c, 0x8d, 0xd8, 0xed, 0x91, 0x9f, 0x43, 0xea, 0xe7, 0xeb, 0x94, 0xad, 0x3e, 0x1e, 0x95, 0xfc, 0x72, 0x81, 0x7d, 0x1c, 0x9d, 0xba, 0xb1, 0x7b, 0xdf, 0xa9, 0x7a, 0xdf, 0xee, 0x2f, 0xd4, 0xfa, 0xe7, 0xed, 0x7a, 0x7f, 0xdd, 0xff, 0x00, 0xb2, 0xae, 0x64, 0x0b, 0xea, 0xe3, 0x9a, 0xbf, 0x4a, 0x6f, 0xa4, 0xff, 0x00, 0x89, 0xbd, 0x45, 0xfa, 0xb5, 0x79, 0xf7, 0xeb, 0xc7, 0xe9, 0xae, 0x57, 0x2e, 0x17, 0x23, 0x1f, 0x89, 0xd1, 0x99, 0x8f, 0xf1, 0xa7, 0x11, 0xcf, 0xd3, 0xf5, 0x29, 0xb5, 0x6b, 0xd3, 0xe8, 0xcc, 0x7f, 0x45, 0xb9, 0xa3, 0xc5, 0x62, 0xbe, 0x68, 0xff, 0x00, 0x15, 0xfd, 0x4c, 0xfe, 0x90, 0xaf, 0xd4, 0xab, 0xf1, 0x7a, 0x7f, 0x62, 0x9d, 0xab, 0xdf, 0x32, 0xb1, 0x70, 0x5e, 0xdc, 0xdc, 0x2d, 0x47, 0x8b, 0x5e, 0xae, 0x4c, 0xbf, 0xf2, 0x37, 0x9f, 0x3d, 0x5b, 0xd2, 0xff, 0x00, 0x8e, 0x87, 0xee, 0x29, 0x5a, 0xf2, 0xf4, 0xaa, 0xd4, 0xa5, 0x36, 0xa7, 0x3a, 0x57, 0xfd, 0x8e, 0x64, 0x3a, 0xf2, 0xf6, 0xbf, 0xcc, 0x7f, 0x5b, 0xfc, 0x23, 0xa7, 0xfe, 0x8e, 0xff, 0x00, 0x8e, 0x37, 0xd6, 0x63, 0xfa, 0xe5, 0x2b, 0xcb, 0x87, 0xec, 0xd6, 0xbd, 0xb9, 0x7d, 0xac, 0xc7, 0xcd, 0x7c, 0x2d, 0xf8, 0x2b, 0x89, 0x26, 0x8f, 0xd4, 0xfa, 0x94, 0x3e, 0x85, 0x29, 0xc9, 0x69, 0xfc, 0x33, 0x58, 0x5d, 0x9c, 0x79, 0xb2, 0xbb, 0x0f, 0xac, 0x7a, 0x2b, 0xea, 0x75, 0xef, 0x92, 0x0c, 0x53, 0x3d, 0x2f, 0xd4, 0xfa, 0xbb, 0xfa, 0x74, 0xf5, 0x39, 0x9a, 0xd7, 0xe7, 0x80, 0x53, 0x79, 0xba, 0x5b, 0xfe, 0x97, 0xfa, 0x4b, 0xfc, 0xba, 0x7f, 0xb1, 0xc7, 0xab, 0x1e, 0x8f, 0xff, 0xd9 -}; - -#endif // WEBRTC_RTC_BASE_TESTBASE64_H_ diff --git a/webrtc/rtc_base/testclient.h b/webrtc/rtc_base/testclient.h deleted file mode 100644 index b15657b5de..0000000000 --- a/webrtc/rtc_base/testclient.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TESTCLIENT_H_ -#define WEBRTC_RTC_BASE_TESTCLIENT_H_ - -#include -#include -#include "webrtc/base/asyncudpsocket.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/criticalsection.h" -#include "webrtc/base/fakeclock.h" - -namespace rtc { - -// A simple client that can send TCP or UDP data and check that it receives -// what it expects to receive. Useful for testing server functionality. -class TestClient : public sigslot::has_slots<> { - public: - // Records the contents of a packet that was received. - struct Packet { - Packet(const SocketAddress& a, - const char* b, - size_t s, - const PacketTime& packet_time); - Packet(const Packet& p); - virtual ~Packet(); - - SocketAddress addr; - char* buf; - size_t size; - PacketTime packet_time; - }; - - // Default timeout for NextPacket reads. - static const int kTimeoutMs = 5000; - - // Creates a client that will send and receive with the given socket and - // will post itself messages with the given thread. - explicit TestClient(std::unique_ptr socket); - // Create a test client that will use a fake clock. NextPacket needs to wait - // for a packet to be received, and thus it needs to advance the fake clock - // if the test is using one, rather than just sleeping. - TestClient(std::unique_ptr socket, FakeClock* fake_clock); - ~TestClient() override; - - SocketAddress address() const { return socket_->GetLocalAddress(); } - SocketAddress remote_address() const { return socket_->GetRemoteAddress(); } - - // Checks that the socket moves to the specified connect state. - bool CheckConnState(AsyncPacketSocket::State state); - - // Checks that the socket is connected to the remote side. - bool CheckConnected() { - return CheckConnState(AsyncPacketSocket::STATE_CONNECTED); - } - - // Sends using the clients socket. - int Send(const char* buf, size_t size); - - // Sends using the clients socket to the given destination. - int SendTo(const char* buf, size_t size, const SocketAddress& dest); - - // Returns the next packet received by the client or null if none is received - // within the specified timeout. - std::unique_ptr NextPacket(int timeout_ms); - - // Checks that the next packet has the given contents. Returns the remote - // address that the packet was sent from. - bool CheckNextPacket(const char* buf, size_t len, SocketAddress* addr); - - // Checks that no packets have arrived or will arrive in the next second. - bool CheckNoPacket(); - - int GetError(); - int SetOption(Socket::Option opt, int value); - - bool ready_to_send() const { return ready_to_send_count() > 0; } - - // How many times SignalReadyToSend has been fired. - int ready_to_send_count() const { return ready_to_send_count_; } - - private: - // Timeout for reads when no packet is expected. - static const int kNoPacketTimeoutMs = 1000; - // Workaround for the fact that AsyncPacketSocket::GetConnState doesn't exist. - Socket::ConnState GetState(); - // Slot for packets read on the socket. - void OnPacket(AsyncPacketSocket* socket, const char* buf, size_t len, - const SocketAddress& remote_addr, - const PacketTime& packet_time); - void OnReadyToSend(AsyncPacketSocket* socket); - bool CheckTimestamp(int64_t packet_timestamp); - void AdvanceTime(int ms); - - FakeClock* fake_clock_ = nullptr; - CriticalSection crit_; - std::unique_ptr socket_; - std::vector> packets_; - int ready_to_send_count_ = 0; - int64_t prev_packet_timestamp_; - RTC_DISALLOW_COPY_AND_ASSIGN(TestClient); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_TESTCLIENT_H_ diff --git a/webrtc/rtc_base/testechoserver.h b/webrtc/rtc_base/testechoserver.h deleted file mode 100644 index 2ec46aa003..0000000000 --- a/webrtc/rtc_base/testechoserver.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TESTECHOSERVER_H_ -#define WEBRTC_RTC_BASE_TESTECHOSERVER_H_ - -#include -#include -#include "webrtc/base/asynctcpsocket.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/socketaddress.h" -#include "webrtc/base/sigslot.h" -#include "webrtc/base/thread.h" - -namespace rtc { - -// A test echo server, echoes back any packets sent to it. -// Useful for unit tests. -class TestEchoServer : public sigslot::has_slots<> { - public: - TestEchoServer(Thread* thread, const SocketAddress& addr) - : server_socket_(thread->socketserver()->CreateAsyncSocket(addr.family(), - SOCK_STREAM)) { - server_socket_->Bind(addr); - server_socket_->Listen(5); - server_socket_->SignalReadEvent.connect(this, &TestEchoServer::OnAccept); - } - ~TestEchoServer() { - for (ClientList::iterator it = client_sockets_.begin(); - it != client_sockets_.end(); ++it) { - delete *it; - } - } - - SocketAddress address() const { return server_socket_->GetLocalAddress(); } - - private: - void OnAccept(AsyncSocket* socket) { - AsyncSocket* raw_socket = socket->Accept(nullptr); - if (raw_socket) { - AsyncTCPSocket* packet_socket = new AsyncTCPSocket(raw_socket, false); - packet_socket->SignalReadPacket.connect(this, &TestEchoServer::OnPacket); - packet_socket->SignalClose.connect(this, &TestEchoServer::OnClose); - client_sockets_.push_back(packet_socket); - } - } - void OnPacket(AsyncPacketSocket* socket, const char* buf, size_t size, - const SocketAddress& remote_addr, - const PacketTime& packet_time) { - rtc::PacketOptions options; - socket->Send(buf, size, options); - } - void OnClose(AsyncPacketSocket* socket, int err) { - ClientList::iterator it = - std::find(client_sockets_.begin(), client_sockets_.end(), socket); - client_sockets_.erase(it); - Thread::Current()->Dispose(socket); - } - - typedef std::list ClientList; - std::unique_ptr server_socket_; - ClientList client_sockets_; - RTC_DISALLOW_COPY_AND_ASSIGN(TestEchoServer); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_TESTECHOSERVER_H_ diff --git a/webrtc/rtc_base/testutils.h b/webrtc/rtc_base/testutils.h deleted file mode 100644 index e66c072e01..0000000000 --- a/webrtc/rtc_base/testutils.h +++ /dev/null @@ -1,566 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TESTUTILS_H_ -#define WEBRTC_RTC_BASE_TESTUTILS_H_ - -// Utilities for testing rtc infrastructure in unittests - -#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) -#include -#include - -// X defines a few macros that stomp on types that gunit.h uses. -#undef None -#undef Bool -#endif - -#include -#include -#include -#include -#include "webrtc/base/arraysize.h" -#include "webrtc/base/asyncsocket.h" -#include "webrtc/base/checks.h" -#include "webrtc/base/gunit.h" -#include "webrtc/base/nethelpers.h" -#include "webrtc/base/pathutils.h" -#include "webrtc/base/stream.h" -#include "webrtc/base/stringencode.h" -#include "webrtc/base/stringutils.h" -#include "webrtc/base/thread.h" - -namespace webrtc { -namespace testing { - -using namespace rtc; - -/////////////////////////////////////////////////////////////////////////////// -// StreamSink - Monitor asynchronously signalled events from StreamInterface -// or AsyncSocket (which should probably be a StreamInterface. -/////////////////////////////////////////////////////////////////////////////// - -// Note: Any event that is an error is treaded as SSE_ERROR instead of that -// event. - -enum StreamSinkEvent { - SSE_OPEN = SE_OPEN, - SSE_READ = SE_READ, - SSE_WRITE = SE_WRITE, - SSE_CLOSE = SE_CLOSE, - SSE_ERROR = 16 -}; - -class StreamSink : public sigslot::has_slots<> { - public: - void Monitor(StreamInterface* stream) { - stream->SignalEvent.connect(this, &StreamSink::OnEvent); - events_.erase(stream); - } - void Unmonitor(StreamInterface* stream) { - stream->SignalEvent.disconnect(this); - // In case you forgot to unmonitor a previous object with this address - events_.erase(stream); - } - bool Check(StreamInterface* stream, StreamSinkEvent event, bool reset = true) { - return DoCheck(stream, event, reset); - } - int Events(StreamInterface* stream, bool reset = true) { - return DoEvents(stream, reset); - } - - void Monitor(AsyncSocket* socket) { - socket->SignalConnectEvent.connect(this, &StreamSink::OnConnectEvent); - socket->SignalReadEvent.connect(this, &StreamSink::OnReadEvent); - socket->SignalWriteEvent.connect(this, &StreamSink::OnWriteEvent); - socket->SignalCloseEvent.connect(this, &StreamSink::OnCloseEvent); - // In case you forgot to unmonitor a previous object with this address - events_.erase(socket); - } - void Unmonitor(AsyncSocket* socket) { - socket->SignalConnectEvent.disconnect(this); - socket->SignalReadEvent.disconnect(this); - socket->SignalWriteEvent.disconnect(this); - socket->SignalCloseEvent.disconnect(this); - events_.erase(socket); - } - bool Check(AsyncSocket* socket, StreamSinkEvent event, bool reset = true) { - return DoCheck(socket, event, reset); - } - int Events(AsyncSocket* socket, bool reset = true) { - return DoEvents(socket, reset); - } - - private: - typedef std::map EventMap; - - void OnEvent(StreamInterface* stream, int events, int error) { - if (error) { - events = SSE_ERROR; - } - AddEvents(stream, events); - } - void OnConnectEvent(AsyncSocket* socket) { - AddEvents(socket, SSE_OPEN); - } - void OnReadEvent(AsyncSocket* socket) { - AddEvents(socket, SSE_READ); - } - void OnWriteEvent(AsyncSocket* socket) { - AddEvents(socket, SSE_WRITE); - } - void OnCloseEvent(AsyncSocket* socket, int error) { - AddEvents(socket, (0 == error) ? SSE_CLOSE : SSE_ERROR); - } - - void AddEvents(void* obj, int events) { - EventMap::iterator it = events_.find(obj); - if (events_.end() == it) { - events_.insert(EventMap::value_type(obj, events)); - } else { - it->second |= events; - } - } - bool DoCheck(void* obj, StreamSinkEvent event, bool reset) { - EventMap::iterator it = events_.find(obj); - if ((events_.end() == it) || (0 == (it->second & event))) { - return false; - } - if (reset) { - it->second &= ~event; - } - return true; - } - int DoEvents(void* obj, bool reset) { - EventMap::iterator it = events_.find(obj); - if (events_.end() == it) - return 0; - int events = it->second; - if (reset) { - it->second = 0; - } - return events; - } - - EventMap events_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamSource - Implements stream interface and simulates asynchronous -// events on the stream, without a network. Also buffers written data. -/////////////////////////////////////////////////////////////////////////////// - -class StreamSource : public StreamInterface { -public: - StreamSource() { - Clear(); - } - - void Clear() { - readable_data_.clear(); - written_data_.clear(); - state_ = SS_CLOSED; - read_block_ = 0; - write_block_ = SIZE_UNKNOWN; - } - void QueueString(const char* data) { - QueueData(data, strlen(data)); - } - void QueueStringF(const char* format, ...) { - va_list args; - va_start(args, format); - char buffer[1024]; - size_t len = vsprintfn(buffer, sizeof(buffer), format, args); - RTC_CHECK(len < sizeof(buffer) - 1); - va_end(args); - QueueData(buffer, len); - } - void QueueData(const char* data, size_t len) { - readable_data_.insert(readable_data_.end(), data, data + len); - if ((SS_OPEN == state_) && (readable_data_.size() == len)) { - SignalEvent(this, SE_READ, 0); - } - } - std::string ReadData() { - std::string data; - // avoid accessing written_data_[0] if it is undefined - if (written_data_.size() > 0) { - data.insert(0, &written_data_[0], written_data_.size()); - } - written_data_.clear(); - return data; - } - void SetState(StreamState state) { - int events = 0; - if ((SS_OPENING == state_) && (SS_OPEN == state)) { - events |= SE_OPEN; - if (!readable_data_.empty()) { - events |= SE_READ; - } - } else if ((SS_CLOSED != state_) && (SS_CLOSED == state)) { - events |= SE_CLOSE; - } - state_ = state; - if (events) { - SignalEvent(this, events, 0); - } - } - // Will cause Read to block when there are pos bytes in the read queue. - void SetReadBlock(size_t pos) { read_block_ = pos; } - // Will cause Write to block when there are pos bytes in the write queue. - void SetWriteBlock(size_t pos) { write_block_ = pos; } - - virtual StreamState GetState() const { return state_; } - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error) { - if (SS_CLOSED == state_) { - if (error) *error = -1; - return SR_ERROR; - } - if ((SS_OPENING == state_) || (readable_data_.size() <= read_block_)) { - return SR_BLOCK; - } - size_t count = std::min(buffer_len, readable_data_.size() - read_block_); - memcpy(buffer, &readable_data_[0], count); - size_t new_size = readable_data_.size() - count; - // Avoid undefined access beyond the last element of the vector. - // This only happens when new_size is 0. - if (count < readable_data_.size()) { - memmove(&readable_data_[0], &readable_data_[count], new_size); - } - readable_data_.resize(new_size); - if (read) *read = count; - return SR_SUCCESS; - } - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error) { - if (SS_CLOSED == state_) { - if (error) *error = -1; - return SR_ERROR; - } - if (SS_OPENING == state_) { - return SR_BLOCK; - } - if (SIZE_UNKNOWN != write_block_) { - if (written_data_.size() >= write_block_) { - return SR_BLOCK; - } - if (data_len > (write_block_ - written_data_.size())) { - data_len = write_block_ - written_data_.size(); - } - } - if (written) *written = data_len; - const char* cdata = static_cast(data); - written_data_.insert(written_data_.end(), cdata, cdata + data_len); - return SR_SUCCESS; - } - virtual void Close() { state_ = SS_CLOSED; } - -private: - typedef std::vector Buffer; - Buffer readable_data_, written_data_; - StreamState state_; - size_t read_block_, write_block_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// SocketTestClient -// Creates a simulated client for testing. Works on real and virtual networks. -/////////////////////////////////////////////////////////////////////////////// - -class SocketTestClient : public sigslot::has_slots<> { -public: - SocketTestClient() { Init(nullptr, AF_INET); } - SocketTestClient(AsyncSocket* socket) { - Init(socket, socket->GetLocalAddress().family()); - } - SocketTestClient(const SocketAddress& address) { - Init(nullptr, address.family()); - socket_->Connect(address); - } - - AsyncSocket* socket() { return socket_.get(); } - - void QueueString(const char* data) { - QueueData(data, strlen(data)); - } - void QueueStringF(const char* format, ...) { - va_list args; - va_start(args, format); - char buffer[1024]; - size_t len = vsprintfn(buffer, sizeof(buffer), format, args); - RTC_CHECK(len < sizeof(buffer) - 1); - va_end(args); - QueueData(buffer, len); - } - void QueueData(const char* data, size_t len) { - send_buffer_.insert(send_buffer_.end(), data, data + len); - if (Socket::CS_CONNECTED == socket_->GetState()) { - Flush(); - } - } - std::string ReadData() { - std::string data(&recv_buffer_[0], recv_buffer_.size()); - recv_buffer_.clear(); - return data; - } - - bool IsConnected() const { - return (Socket::CS_CONNECTED == socket_->GetState()); - } - bool IsClosed() const { - return (Socket::CS_CLOSED == socket_->GetState()); - } - -private: - typedef std::vector Buffer; - - void Init(AsyncSocket* socket, int family) { - if (!socket) { - socket = Thread::Current()->socketserver() - ->CreateAsyncSocket(family, SOCK_STREAM); - } - socket_.reset(socket); - socket_->SignalConnectEvent.connect(this, - &SocketTestClient::OnConnectEvent); - socket_->SignalReadEvent.connect(this, &SocketTestClient::OnReadEvent); - socket_->SignalWriteEvent.connect(this, &SocketTestClient::OnWriteEvent); - socket_->SignalCloseEvent.connect(this, &SocketTestClient::OnCloseEvent); - } - - void Flush() { - size_t sent = 0; - while (sent < send_buffer_.size()) { - int result = socket_->Send(&send_buffer_[sent], - send_buffer_.size() - sent); - if (result > 0) { - sent += result; - } else { - break; - } - } - size_t new_size = send_buffer_.size() - sent; - memmove(&send_buffer_[0], &send_buffer_[sent], new_size); - send_buffer_.resize(new_size); - } - - void OnConnectEvent(AsyncSocket* socket) { - if (!send_buffer_.empty()) { - Flush(); - } - } - void OnReadEvent(AsyncSocket* socket) { - char data[64 * 1024]; - int result = socket_->Recv(data, arraysize(data), nullptr); - if (result > 0) { - recv_buffer_.insert(recv_buffer_.end(), data, data + result); - } - } - void OnWriteEvent(AsyncSocket* socket) { - if (!send_buffer_.empty()) { - Flush(); - } - } - void OnCloseEvent(AsyncSocket* socket, int error) { - } - - std::unique_ptr socket_; - Buffer send_buffer_, recv_buffer_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// SocketTestServer -// Creates a simulated server for testing. Works on real and virtual networks. -/////////////////////////////////////////////////////////////////////////////// - -class SocketTestServer : public sigslot::has_slots<> { - public: - SocketTestServer(const SocketAddress& address) - : socket_(Thread::Current()->socketserver() - ->CreateAsyncSocket(address.family(), SOCK_STREAM)) - { - socket_->SignalReadEvent.connect(this, &SocketTestServer::OnReadEvent); - socket_->Bind(address); - socket_->Listen(5); - } - virtual ~SocketTestServer() { - clear(); - } - - size_t size() const { return clients_.size(); } - SocketTestClient* client(size_t index) const { return clients_[index]; } - SocketTestClient* operator[](size_t index) const { return client(index); } - - void clear() { - for (size_t i=0; i(socket_->Accept(nullptr)); - if (!accepted) - return; - clients_.push_back(new SocketTestClient(accepted)); - } - - std::unique_ptr socket_; - std::vector clients_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// Unittest predicates which are similar to STREQ, but for raw memory -/////////////////////////////////////////////////////////////////////////////// - -inline ::testing::AssertionResult CmpHelperMemEq( - const char* expected_expression, - const char* expected_length_expression, - const char* actual_expression, - const char* actual_length_expression, - const void* expected, - size_t expected_length, - const void* actual, - size_t actual_length) { - if ((expected_length == actual_length) - && (0 == memcmp(expected, actual, expected_length))) { - return ::testing::AssertionSuccess(); - } - - ::testing::Message msg; - msg << "Value of: " << actual_expression - << " [" << actual_length_expression << "]"; - if (true) { //!actual_value.Equals(actual_expression)) { - size_t buffer_size = actual_length * 2 + 1; - char* buffer = STACK_ARRAY(char, buffer_size); - hex_encode(buffer, buffer_size, - reinterpret_cast(actual), actual_length); - msg << "\n Actual: " << buffer << " [" << actual_length << "]"; - } - - msg << "\nExpected: " << expected_expression - << " [" << expected_length_expression << "]"; - if (true) { //!expected_value.Equals(expected_expression)) { - size_t buffer_size = expected_length * 2 + 1; - char* buffer = STACK_ARRAY(char, buffer_size); - hex_encode(buffer, buffer_size, - reinterpret_cast(expected), expected_length); - msg << "\nWhich is: " << buffer << " [" << expected_length << "]"; - } - - return AssertionFailure(msg); -} - -#define EXPECT_MEMEQ(expected, expected_length, actual, actual_length) \ - EXPECT_PRED_FORMAT4(::testing::CmpHelperMemEq, expected, expected_length, \ - actual, actual_length) - -#define ASSERT_MEMEQ(expected, expected_length, actual, actual_length) \ - ASSERT_PRED_FORMAT4(::testing::CmpHelperMemEq, expected, expected_length, \ - actual, actual_length) - -/////////////////////////////////////////////////////////////////////////////// -// Helpers for initializing constant memory with integers in a particular byte -// order -/////////////////////////////////////////////////////////////////////////////// - -#define BYTE_CAST(x) static_cast((x)&0xFF) - -// Declare a N-bit integer as a little-endian sequence of bytes -#define LE16(x) BYTE_CAST(((uint16_t)x) >> 0), BYTE_CAST(((uint16_t)x) >> 8) - -#define LE32(x) \ - BYTE_CAST(((uint32_t)x) >> 0), BYTE_CAST(((uint32_t)x) >> 8), \ - BYTE_CAST(((uint32_t)x) >> 16), BYTE_CAST(((uint32_t)x) >> 24) - -#define LE64(x) \ - BYTE_CAST(((uint64_t)x) >> 0), BYTE_CAST(((uint64_t)x) >> 8), \ - BYTE_CAST(((uint64_t)x) >> 16), BYTE_CAST(((uint64_t)x) >> 24), \ - BYTE_CAST(((uint64_t)x) >> 32), BYTE_CAST(((uint64_t)x) >> 40), \ - BYTE_CAST(((uint64_t)x) >> 48), BYTE_CAST(((uint64_t)x) >> 56) - -// Declare a N-bit integer as a big-endian (Internet) sequence of bytes -#define BE16(x) BYTE_CAST(((uint16_t)x) >> 8), BYTE_CAST(((uint16_t)x) >> 0) - -#define BE32(x) \ - BYTE_CAST(((uint32_t)x) >> 24), BYTE_CAST(((uint32_t)x) >> 16), \ - BYTE_CAST(((uint32_t)x) >> 8), BYTE_CAST(((uint32_t)x) >> 0) - -#define BE64(x) \ - BYTE_CAST(((uint64_t)x) >> 56), BYTE_CAST(((uint64_t)x) >> 48), \ - BYTE_CAST(((uint64_t)x) >> 40), BYTE_CAST(((uint64_t)x) >> 32), \ - BYTE_CAST(((uint64_t)x) >> 24), BYTE_CAST(((uint64_t)x) >> 16), \ - BYTE_CAST(((uint64_t)x) >> 8), BYTE_CAST(((uint64_t)x) >> 0) - -// Declare a N-bit integer as a this-endian (local machine) sequence of bytes -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 1 -#endif // BIG_ENDIAN - -#if BIG_ENDIAN -#define TE16 BE16 -#define TE32 BE32 -#define TE64 BE64 -#else // !BIG_ENDIAN -#define TE16 LE16 -#define TE32 LE32 -#define TE64 LE64 -#endif // !BIG_ENDIAN - -/////////////////////////////////////////////////////////////////////////////// - -// Helpers for determining if X/screencasting is available (on linux). - -#define MAYBE_SKIP_SCREENCAST_TEST() \ - if (!testing::IsScreencastingAvailable()) { \ - LOG(LS_WARNING) << "Skipping test, since it doesn't have the requisite " \ - << "X environment for screen capture."; \ - return; \ - } \ - -#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) -struct XDisplay { - XDisplay() : display_(XOpenDisplay(nullptr)) {} - ~XDisplay() { if (display_) XCloseDisplay(display_); } - bool IsValid() const { return display_ != nullptr; } - operator Display*() { return display_; } - private: - Display* display_; -}; -#endif - -// Returns true if screencasting is available. When false, anything that uses -// screencasting features may fail. -inline bool IsScreencastingAvailable() { -#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) - XDisplay display; - if (!display.IsValid()) { - LOG(LS_WARNING) << "No X Display available."; - return false; - } - int ignored_int, major_version, minor_version; - if (!XRRQueryExtension(display, &ignored_int, &ignored_int) || - !XRRQueryVersion(display, &major_version, &minor_version) || - major_version < 1 || - (major_version < 2 && minor_version < 3)) { - LOG(LS_WARNING) << "XRandr version: " << major_version << "." - << minor_version; - LOG(LS_WARNING) << "XRandr is not supported or is too old (pre 1.3)."; - return false; - } -#endif - return true; -} - -} // namespace testing -} // namespace webrtc - -#endif // WEBRTC_RTC_BASE_TESTUTILS_H_ diff --git a/webrtc/rtc_base/thread.h b/webrtc/rtc_base/thread.h deleted file mode 100644 index b6e98faa16..0000000000 --- a/webrtc/rtc_base/thread.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_THREAD_H_ -#define WEBRTC_RTC_BASE_THREAD_H_ - -#include -#include -#include -#include -#include - -#if defined(WEBRTC_POSIX) -#include -#endif -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/event.h" -#include "webrtc/base/messagequeue.h" -#include "webrtc/base/platform_thread_types.h" - -#if defined(WEBRTC_WIN) -#include "webrtc/base/win32.h" -#endif - -namespace rtc { - -class Thread; - -class ThreadManager { - public: - static const int kForever = -1; - - // Singleton, constructor and destructor are private. - static ThreadManager* Instance(); - - Thread* CurrentThread(); - void SetCurrentThread(Thread* thread); - - // Returns a thread object with its thread_ ivar set - // to whatever the OS uses to represent the thread. - // If there already *is* a Thread object corresponding to this thread, - // this method will return that. Otherwise it creates a new Thread - // object whose wrapped() method will return true, and whose - // handle will, on Win32, be opened with only synchronization privileges - - // if you need more privilegs, rather than changing this method, please - // write additional code to adjust the privileges, or call a different - // factory method of your own devising, because this one gets used in - // unexpected contexts (like inside browser plugins) and it would be a - // shame to break it. It is also conceivable on Win32 that we won't even - // be able to get synchronization privileges, in which case the result - // will have a null handle. - Thread *WrapCurrentThread(); - void UnwrapCurrentThread(); - - bool IsMainThread(); - - private: - ThreadManager(); - ~ThreadManager(); - -#if defined(WEBRTC_POSIX) - pthread_key_t key_; -#endif - -#if defined(WEBRTC_WIN) - DWORD key_; -#endif - - // The thread to potentially autowrap. - PlatformThreadRef main_thread_ref_; - - RTC_DISALLOW_COPY_AND_ASSIGN(ThreadManager); -}; - -struct _SendMessage { - _SendMessage() {} - Thread *thread; - Message msg; - bool *ready; -}; - -class Runnable { - public: - virtual ~Runnable() {} - virtual void Run(Thread* thread) = 0; - - protected: - Runnable() {} - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(Runnable); -}; - -// WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). - -class LOCKABLE Thread : public MessageQueue { - public: - // Create a new Thread and optionally assign it to the passed SocketServer. - Thread(); - explicit Thread(SocketServer* ss); - explicit Thread(std::unique_ptr ss); - - // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or - // guarantee Stop() is explicitly called before the subclass is destroyed). - // This is required to avoid a data race between the destructor modifying the - // vtable, and the Thread::PreRun calling the virtual method Run(). - ~Thread() override; - - static std::unique_ptr CreateWithSocketServer(); - static std::unique_ptr Create(); - static Thread* Current(); - - // Used to catch performance regressions. Use this to disallow blocking calls - // (Invoke) for a given scope. If a synchronous call is made while this is in - // effect, an assert will be triggered. - // Note that this is a single threaded class. - class ScopedDisallowBlockingCalls { - public: - ScopedDisallowBlockingCalls(); - ~ScopedDisallowBlockingCalls(); - private: - Thread* const thread_; - const bool previous_state_; - }; - - bool IsCurrent() const; - - // Sleeps the calling thread for the specified number of milliseconds, during - // which time no processing is performed. Returns false if sleeping was - // interrupted by a signal (POSIX only). - static bool SleepMs(int millis); - - // Sets the thread's name, for debugging. Must be called before Start(). - // If |obj| is non-null, its value is appended to |name|. - const std::string& name() const { return name_; } - bool SetName(const std::string& name, const void* obj); - - // Starts the execution of the thread. - bool Start(Runnable* runnable = nullptr); - - // Tells the thread to stop and waits until it is joined. - // Never call Stop on the current thread. Instead use the inherited Quit - // function which will exit the base MessageQueue without terminating the - // underlying OS thread. - virtual void Stop(); - - // By default, Thread::Run() calls ProcessMessages(kForever). To do other - // work, override Run(). To receive and dispatch messages, call - // ProcessMessages occasionally. - virtual void Run(); - - virtual void Send(const Location& posted_from, - MessageHandler* phandler, - uint32_t id = 0, - MessageData* pdata = nullptr); - - // Convenience method to invoke a functor on another thread. Caller must - // provide the |ReturnT| template argument, which cannot (easily) be deduced. - // Uses Send() internally, which blocks the current thread until execution - // is complete. - // Ex: bool result = thread.Invoke(RTC_FROM_HERE, - // &MyFunctionReturningBool); - // NOTE: This function can only be called when synchronous calls are allowed. - // See ScopedDisallowBlockingCalls for details. - template - ReturnT Invoke(const Location& posted_from, const FunctorT& functor) { - FunctorMessageHandler handler(functor); - InvokeInternal(posted_from, &handler); - return handler.MoveResult(); - } - - // From MessageQueue - void Clear(MessageHandler* phandler, - uint32_t id = MQID_ANY, - MessageList* removed = nullptr) override; - void ReceiveSends() override; - - // ProcessMessages will process I/O and dispatch messages until: - // 1) cms milliseconds have elapsed (returns true) - // 2) Stop() is called (returns false) - bool ProcessMessages(int cms); - - // Returns true if this is a thread that we created using the standard - // constructor, false if it was created by a call to - // ThreadManager::WrapCurrentThread(). The main thread of an application - // is generally not owned, since the OS representation of the thread - // obviously exists before we can get to it. - // You cannot call Start on non-owned threads. - bool IsOwned(); - -#if defined(WEBRTC_WIN) - HANDLE GetHandle() const { - return thread_; - } - DWORD GetId() const { - return thread_id_; - } -#elif defined(WEBRTC_POSIX) - pthread_t GetPThread() { - return thread_; - } -#endif - - // Expose private method running() for tests. - // - // DANGER: this is a terrible public API. Most callers that might want to - // call this likely do not have enough control/knowledge of the Thread in - // question to guarantee that the returned value remains true for the duration - // of whatever code is conditionally executing because of the return value! - bool RunningForTest() { return running(); } - - // Sets the per-thread allow-blocking-calls flag and returns the previous - // value. Must be called on this thread. - bool SetAllowBlockingCalls(bool allow); - - // These functions are public to avoid injecting test hooks. Don't call them - // outside of tests. - // This method should be called when thread is created using non standard - // method, like derived implementation of rtc::Thread and it can not be - // started by calling Start(). This will set started flag to true and - // owned to false. This must be called from the current thread. - bool WrapCurrent(); - void UnwrapCurrent(); - - protected: - // Same as WrapCurrent except that it never fails as it does not try to - // acquire the synchronization access of the thread. The caller should never - // call Stop() or Join() on this thread. - void SafeWrapCurrent(); - - // Blocks the calling thread until this thread has terminated. - void Join(); - - static void AssertBlockingIsAllowedOnCurrentThread(); - - friend class ScopedDisallowBlockingCalls; - - private: - struct ThreadInit { - Thread* thread; - Runnable* runnable; - }; - -#if defined(WEBRTC_WIN) - static DWORD WINAPI PreRun(LPVOID context); -#else - static void *PreRun(void *pv); -#endif - - // ThreadManager calls this instead WrapCurrent() because - // ThreadManager::Instance() cannot be used while ThreadManager is - // being created. - // The method tries to get synchronization rights of the thread on Windows if - // |need_synchronize_access| is true. - bool WrapCurrentWithThreadManager(ThreadManager* thread_manager, - bool need_synchronize_access); - - // Return true if the thread was started and hasn't yet stopped. - bool running() { return running_.Wait(0); } - - // Processes received "Send" requests. If |source| is not null, only requests - // from |source| are processed, otherwise, all requests are processed. - void ReceiveSendsFromThread(const Thread* source); - - // If |source| is not null, pops the first "Send" message from |source| in - // |sendlist_|, otherwise, pops the first "Send" message of |sendlist_|. - // The caller must lock |crit_| before calling. - // Returns true if there is such a message. - bool PopSendMessageFromThread(const Thread* source, _SendMessage* msg); - - void InvokeInternal(const Location& posted_from, MessageHandler* handler); - - std::list<_SendMessage> sendlist_; - std::string name_; - Event running_; // Signalled means running. - -#if defined(WEBRTC_POSIX) - pthread_t thread_; -#endif - -#if defined(WEBRTC_WIN) - HANDLE thread_; - DWORD thread_id_; -#endif - - bool owned_; - bool blocking_calls_allowed_; // By default set to |true|. - - friend class ThreadManager; - - RTC_DISALLOW_COPY_AND_ASSIGN(Thread); -}; - -// AutoThread automatically installs itself at construction -// uninstalls at destruction, if a Thread object is -// _not already_ associated with the current OS thread. - -class AutoThread : public Thread { - public: - AutoThread(); - ~AutoThread() override; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(AutoThread); -}; - -// AutoSocketServerThread automatically installs itself at -// construction and uninstalls at destruction. If a Thread object is -// already associated with the current OS thread, it is temporarily -// disassociated and restored by the destructor. - -class AutoSocketServerThread : public Thread { - public: - explicit AutoSocketServerThread(SocketServer* ss); - ~AutoSocketServerThread() override; - - private: - rtc::Thread* old_thread_; - - RTC_DISALLOW_COPY_AND_ASSIGN(AutoSocketServerThread); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_THREAD_H_ diff --git a/webrtc/rtc_base/thread_annotations.h b/webrtc/rtc_base/thread_annotations.h deleted file mode 100644 index 09afb9353f..0000000000 --- a/webrtc/rtc_base/thread_annotations.h +++ /dev/null @@ -1,100 +0,0 @@ -// -// Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style license -// that can be found in the LICENSE file in the root of the source -// tree. An additional intellectual property rights grant can be found -// in the file PATENTS. All contributing project authors may -// be found in the AUTHORS file in the root of the source tree. -// -// Borrowed from -// https://code.google.com/p/gperftools/source/browse/src/base/thread_annotations.h -// but adapted for clang attributes instead of the gcc. -// -// This header file contains the macro definitions for thread safety -// annotations that allow the developers to document the locking policies -// of their multi-threaded code. The annotations can also help program -// analysis tools to identify potential thread safety issues. - -#ifndef WEBRTC_RTC_BASE_THREAD_ANNOTATIONS_H_ -#define WEBRTC_RTC_BASE_THREAD_ANNOTATIONS_H_ - -#if defined(__clang__) && (!defined(SWIG)) -#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x)) -#else -#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op -#endif - -// Document if a shared variable/field needs to be protected by a lock. -// GUARDED_BY allows the user to specify a particular lock that should be -// held when accessing the annotated variable, while GUARDED_VAR only -// indicates a shared variable should be guarded (by any lock). GUARDED_VAR -// is primarily used when the client cannot express the name of the lock. -#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) -#define GUARDED_VAR THREAD_ANNOTATION_ATTRIBUTE__(guarded_var) - -// Document if the memory location pointed to by a pointer should be guarded -// by a lock when dereferencing the pointer. Similar to GUARDED_VAR, -// PT_GUARDED_VAR is primarily used when the client cannot express the name -// of the lock. Note that a pointer variable to a shared memory location -// could itself be a shared variable. For example, if a shared global pointer -// q, which is guarded by mu1, points to a shared memory location that is -// guarded by mu2, q should be annotated as follows: -// int *q GUARDED_BY(mu1) PT_GUARDED_BY(mu2); -#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x)) -#define PT_GUARDED_VAR THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_var) - -// Document the acquisition order between locks that can be held -// simultaneously by a thread. For any two locks that need to be annotated -// to establish an acquisition order, only one of them needs the annotation. -// (i.e. You don't have to annotate both locks with both ACQUIRED_AFTER -// and ACQUIRED_BEFORE.) -#define ACQUIRED_AFTER(x) THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(x)) -#define ACQUIRED_BEFORE(x) THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(x)) - -// The following three annotations document the lock requirements for -// functions/methods. - -// Document if a function expects certain locks to be held before it is called -#define EXCLUSIVE_LOCKS_REQUIRED(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__)) - -#define SHARED_LOCKS_REQUIRED(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__)) - -// Document the locks acquired in the body of the function. These locks -// cannot be held when calling this function (as google3's Mutex locks are -// non-reentrant). -#define LOCKS_EXCLUDED(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__)) - -// Document the lock the annotated function returns without acquiring it. -#define LOCK_RETURNED(x) THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x)) - -// Document if a class/type is a lockable type (such as the Mutex class). -#define LOCKABLE THREAD_ANNOTATION_ATTRIBUTE__(lockable) - -// Document if a class is a scoped lockable type (such as the MutexLock class). -#define SCOPED_LOCKABLE THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable) - -// The following annotations specify lock and unlock primitives. -#define EXCLUSIVE_LOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(exclusive_lock_function(__VA_ARGS__)) - -#define SHARED_LOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(shared_lock_function(__VA_ARGS__)) - -#define EXCLUSIVE_TRYLOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__)) - -#define SHARED_TRYLOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(shared_trylock_function(__VA_ARGS__)) - -#define UNLOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__)) - -// An escape hatch for thread safety analysis to ignore the annotated function. -#define NO_THREAD_SAFETY_ANALYSIS \ - THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis) - -#endif // WEBRTC_RTC_BASE_THREAD_ANNOTATIONS_H_ diff --git a/webrtc/rtc_base/thread_checker.h b/webrtc/rtc_base/thread_checker.h deleted file mode 100644 index 4ab538f44b..0000000000 --- a/webrtc/rtc_base/thread_checker.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/threading/thread_checker.h. - -#ifndef WEBRTC_RTC_BASE_THREAD_CHECKER_H_ -#define WEBRTC_RTC_BASE_THREAD_CHECKER_H_ - -// Apart from debug builds, we also enable the thread checker in -// builds with RTC_DCHECK_IS_ON so that trybots and waterfall bots -// with this define will get the same level of thread checking as -// debug bots. -#define ENABLE_THREAD_CHECKER RTC_DCHECK_IS_ON - -#include "webrtc/base/checks.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/thread_annotations.h" -#include "webrtc/base/thread_checker_impl.h" - -namespace rtc { - -// Do nothing implementation, for use in release mode. -// -// Note: You should almost always use the ThreadChecker class to get the -// right version for your build configuration. -class ThreadCheckerDoNothing { - public: - bool CalledOnValidThread() const { - return true; - } - - void DetachFromThread() {} -}; - -// ThreadChecker is a helper class used to help verify that some methods of a -// class are called from the same thread. It provides identical functionality to -// base::NonThreadSafe, but it is meant to be held as a member variable, rather -// than inherited from base::NonThreadSafe. -// -// While inheriting from base::NonThreadSafe may give a clear indication about -// the thread-safety of a class, it may also lead to violations of the style -// guide with regard to multiple inheritance. The choice between having a -// ThreadChecker member and inheriting from base::NonThreadSafe should be based -// on whether: -// - Derived classes need to know the thread they belong to, as opposed to -// having that functionality fully encapsulated in the base class. -// - Derived classes should be able to reassign the base class to another -// thread, via DetachFromThread. -// -// If neither of these are true, then having a ThreadChecker member and calling -// CalledOnValidThread is the preferable solution. -// -// Example: -// class MyClass { -// public: -// void Foo() { -// RTC_DCHECK(thread_checker_.CalledOnValidThread()); -// ... (do stuff) ... -// } -// -// private: -// ThreadChecker thread_checker_; -// } -// -// In Release mode, CalledOnValidThread will always return true. -#if ENABLE_THREAD_CHECKER -class LOCKABLE ThreadChecker : public ThreadCheckerImpl { -}; -#else -class LOCKABLE ThreadChecker : public ThreadCheckerDoNothing { -}; -#endif // ENABLE_THREAD_CHECKER - -#undef ENABLE_THREAD_CHECKER - -namespace internal { -class SCOPED_LOCKABLE AnnounceOnThread { - public: - template - explicit AnnounceOnThread(const ThreadLikeObject* thread_like_object) - EXCLUSIVE_LOCK_FUNCTION(thread_like_object) {} - ~AnnounceOnThread() UNLOCK_FUNCTION() {} - - template - static bool IsCurrent(const ThreadLikeObject* thread_like_object) { - return thread_like_object->IsCurrent(); - } - static bool IsCurrent(const rtc::ThreadChecker* checker) { - return checker->CalledOnValidThread(); - } - - private: - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AnnounceOnThread); -}; - -} // namespace internal -} // namespace rtc - -// RUN_ON/ACCESS_ON/RTC_DCHECK_RUN_ON macros allows to annotate variables are -// accessed from same thread/task queue. -// Using tools designed to check mutexes, it checks at compile time everywhere -// variable is access, there is a run-time dcheck thread/task queue is correct. -// -// class ExampleThread { -// public: -// void NeedVar1() { -// RTC_DCHECK_RUN_ON(network_thread_); -// transport_->Send(); -// } -// -// private: -// rtc::Thread* network_thread_; -// int transport_ ACCESS_ON(network_thread_); -// }; -// -// class ExampleThreadChecker { -// public: -// int CalledFromPacer() RUN_ON(pacer_thread_checker_) { -// return var2_; -// } -// -// void CallMeFromPacer() { -// RTC_DCHECK_RUN_ON(&pacer_thread_checker_) -// << "Should be called from pacer"; -// CalledFromPacer(); -// } -// -// private: -// int pacer_var_ ACCESS_ON(pacer_thread_checker_); -// rtc::ThreadChecker pacer_thread_checker_; -// }; -// -// class TaskQueueExample { -// public: -// class Encoder { -// public: -// rtc::TaskQueue* Queue() { return encoder_queue_; } -// void Encode() { -// RTC_DCHECK_RUN_ON(encoder_queue_); -// DoSomething(var_); -// } -// -// private: -// rtc::TaskQueue* const encoder_queue_; -// Frame var_ ACCESS_ON(encoder_queue_); -// }; -// -// void Encode() { -// // Will fail at runtime when DCHECK is enabled: -// // encoder_->Encode(); -// // Will work: -// rtc::scoped_ref_ptr encoder = encoder_; -// encoder_->Queue()->PostTask([encoder] { encoder->Encode(); }); -// } -// -// private: -// rtc::scoped_ref_ptr encoder_; -// } - -// Document if a variable/field is not shared and should be accessed from -// same thread/task queue. -#define ACCESS_ON(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) - -// Document if a function expected to be called from same thread/task queue. -#define RUN_ON(x) THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(x)) - -#define RTC_DCHECK_RUN_ON(thread_like_object) \ - rtc::internal::AnnounceOnThread thread_announcer(thread_like_object); \ - RTC_DCHECK(rtc::internal::AnnounceOnThread::IsCurrent(thread_like_object)) - -#endif // WEBRTC_RTC_BASE_THREAD_CHECKER_H_ diff --git a/webrtc/rtc_base/thread_checker_impl.h b/webrtc/rtc_base/thread_checker_impl.h deleted file mode 100644 index 05b1b6251d..0000000000 --- a/webrtc/rtc_base/thread_checker_impl.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/threading/thread_checker_impl.h. - -#ifndef WEBRTC_RTC_BASE_THREAD_CHECKER_IMPL_H_ -#define WEBRTC_RTC_BASE_THREAD_CHECKER_IMPL_H_ - -#include "webrtc/base/criticalsection.h" -#include "webrtc/base/platform_thread_types.h" - -namespace rtc { - -// Real implementation of ThreadChecker, for use in debug mode, or -// for temporary use in release mode (e.g. to RTC_CHECK on a threading issue -// seen only in the wild). -// -// Note: You should almost always use the ThreadChecker class to get the -// right version for your build configuration. -class ThreadCheckerImpl { - public: - ThreadCheckerImpl(); - ~ThreadCheckerImpl(); - - bool CalledOnValidThread() const; - - // Changes the thread that is checked for in CalledOnValidThread. This may - // be useful when an object may be created on one thread and then used - // exclusively on another thread. - void DetachFromThread(); - - private: - CriticalSection lock_; - // This is mutable so that CalledOnValidThread can set it. - // It's guarded by |lock_|. - mutable PlatformThreadRef valid_thread_; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_THREAD_CHECKER_IMPL_H_ diff --git a/webrtc/rtc_base/timedelta.h b/webrtc/rtc_base/timedelta.h deleted file mode 100644 index 49008ba925..0000000000 --- a/webrtc/rtc_base/timedelta.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TIMEDELTA_H_ -#define WEBRTC_RTC_BASE_TIMEDELTA_H_ - -#include - -#include "webrtc/base/timeutils.h" - -// Convenience class to convert between different units of relative time. -// Stores time to precision of nanoseconds, as int64_t internally. -// Doesn't check for overflow/underflow. -// -// Based on TimeDelta in: -// https://code.google.com/p/chromium/codesearch#chromium/src/base/time/time.h -namespace rtc { - -class TimeDelta { - public: - TimeDelta() : delta_(0) {} - - // Converts units of time to TimeDeltas. - static constexpr TimeDelta FromSeconds(int64_t secs) { - return TimeDelta(secs * kNumNanosecsPerSec); - } - static constexpr TimeDelta FromMilliseconds(int64_t ms) { - return TimeDelta(ms * kNumNanosecsPerMillisec); - } - static constexpr TimeDelta FromMicroseconds(int64_t us) { - return TimeDelta(us * kNumNanosecsPerMicrosec); - } - static constexpr TimeDelta FromNanoseconds(int64_t ns) { - return TimeDelta(ns); - } - - // Returns true if the time delta is zero. - bool is_zero() const { return delta_ == 0; } - - // Converts TimeDelta to units of time. - int64_t ToSeconds() const { return delta_ / kNumNanosecsPerSec; } - int64_t ToMilliseconds() const { return delta_ / kNumNanosecsPerMillisec; } - int64_t ToMicroseconds() const { return delta_ / kNumNanosecsPerMicrosec; } - int64_t ToNanoseconds() const { return delta_; } - - TimeDelta& operator=(TimeDelta other) { - delta_ = other.delta_; - return *this; - } - - // Computations with other deltas. - TimeDelta operator+(TimeDelta other) const { - return TimeDelta(delta_ + other.delta_); - } - TimeDelta operator-(TimeDelta other) const { - return TimeDelta(delta_ + other.delta_); - } - - TimeDelta& operator+=(TimeDelta other) { return *this = (*this + other); } - TimeDelta& operator-=(TimeDelta other) { return *this = (*this - other); } - TimeDelta operator-() const { return TimeDelta(-delta_); } - - // Computations with numeric types. - template - TimeDelta operator*(T a) const { - return TimeDelta(delta_ * a); - } - template - TimeDelta operator/(T a) const { - return TimeDelta(delta_ / a); - } - template - TimeDelta& operator*=(T a) { - return *this = (*this * a); - } - template - TimeDelta& operator/=(T a) { - return *this = (*this / a); - } - - TimeDelta operator%(TimeDelta a) const { - return TimeDelta(delta_ % a.delta_); - } - - // Comparison operators. - constexpr bool operator==(TimeDelta other) const { - return delta_ == other.delta_; - } - constexpr bool operator!=(TimeDelta other) const { - return delta_ != other.delta_; - } - constexpr bool operator<(TimeDelta other) const { - return delta_ < other.delta_; - } - constexpr bool operator<=(TimeDelta other) const { - return delta_ <= other.delta_; - } - constexpr bool operator>(TimeDelta other) const { - return delta_ > other.delta_; - } - constexpr bool operator>=(TimeDelta other) const { - return delta_ >= other.delta_; - } - - private: - // Constructs a delta given the duration in nanoseconds. This is private - // to avoid confusion by callers with an integer constructor. Use - // FromSeconds, FromMilliseconds, etc. instead. - constexpr explicit TimeDelta(int64_t delta_ns) : delta_(delta_ns) {} - - // Delta in nanoseconds. - int64_t delta_; -}; - -template -inline TimeDelta operator*(T a, TimeDelta td) { - return td * a; -} - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_TIMEDELTA_H_ diff --git a/webrtc/rtc_base/timestampaligner.h b/webrtc/rtc_base/timestampaligner.h deleted file mode 100644 index 90db4b9962..0000000000 --- a/webrtc/rtc_base/timestampaligner.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TIMESTAMPALIGNER_H_ -#define WEBRTC_RTC_BASE_TIMESTAMPALIGNER_H_ - -#include - -#include "webrtc/base/constructormagic.h" - -namespace rtc { - -// The TimestampAligner class helps translating camera timestamps into -// the same timescale as is used by rtc::TimeMicros(). Some cameras -// have built in timestamping which is more accurate than reading the -// system clock, but using a different epoch and unknown clock drift. -// Frame timestamps in webrtc should use rtc::TimeMicros (system monotonic -// time), and this class provides a filter which lets us use the -// rtc::TimeMicros timescale, and at the same time take advantage of -// higher accuracy of the camera clock. - -// This class is not thread safe, so all calls to it must be synchronized -// externally. -class TimestampAligner { - public: - TimestampAligner(); - ~TimestampAligner(); - - public: - // Translates camera timestamps to the same timescale as is used by - // rtc::TimeMicros(). |camera_time_us| is assumed to be accurate, but - // with an unknown epoch and clock drift. |system_time_us| is - // time according to rtc::TimeMicros(), preferably read as soon as - // possible when the frame is captured. It may have poor accuracy - // due to poor resolution or scheduling delays. Returns the - // translated timestamp. - int64_t TranslateTimestamp(int64_t camera_time_us, int64_t system_time_us); - - protected: - // Update the estimated offset between camera time and system monotonic time. - int64_t UpdateOffset(int64_t camera_time_us, int64_t system_time_us); - - // Clip timestamp, return value is always - // <= |system_time_us|, and - // >= min(|prev_translated_time_us_| + |kMinFrameIntervalUs|, - // |system_time_us|). - int64_t ClipTimestamp(int64_t filtered_time_us, int64_t system_time_us); - - private: - // State for the timestamp translation. - int frames_seen_; - // Estimated offset between camera time and system monotonic time. - int64_t offset_us_; - - // State for the ClipTimestamp method, applied after the filter. - // A large negative camera clock drift tends to push translated - // timestamps into the future. |clip_bias_us_| is subtracted from the - // translated timestamps, to get them back from the future. - int64_t clip_bias_us_; - // Used to ensure that translated timestamps are monotonous. - int64_t prev_translated_time_us_; - RTC_DISALLOW_COPY_AND_ASSIGN(TimestampAligner); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_TIMESTAMPALIGNER_H_ diff --git a/webrtc/rtc_base/timeutils.h b/webrtc/rtc_base/timeutils.h deleted file mode 100644 index ea7b17d744..0000000000 --- a/webrtc/rtc_base/timeutils.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2005 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TIMEUTILS_H_ -#define WEBRTC_RTC_BASE_TIMEUTILS_H_ - -#include -#include - -#include - -namespace rtc { - -static const int64_t kNumMillisecsPerSec = INT64_C(1000); -static const int64_t kNumMicrosecsPerSec = INT64_C(1000000); -static const int64_t kNumNanosecsPerSec = INT64_C(1000000000); - -static const int64_t kNumMicrosecsPerMillisec = - kNumMicrosecsPerSec / kNumMillisecsPerSec; -static const int64_t kNumNanosecsPerMillisec = - kNumNanosecsPerSec / kNumMillisecsPerSec; -static const int64_t kNumNanosecsPerMicrosec = - kNumNanosecsPerSec / kNumMicrosecsPerSec; - -// TODO(honghaiz): Define a type for the time value specifically. - -class ClockInterface { - public: - virtual ~ClockInterface() {} - virtual int64_t TimeNanos() const = 0; -}; - -// Sets the global source of time. This is useful mainly for unit tests. -// -// Returns the previously set ClockInterface, or nullptr if none is set. -// -// Does not transfer ownership of the clock. SetClockForTesting(nullptr) -// should be called before the ClockInterface is deleted. -// -// This method is not thread-safe; it should only be used when no other thread -// is running (for example, at the start/end of a unit test, or start/end of -// main()). -// -// TODO(deadbeef): Instead of having functions that access this global -// ClockInterface, we may want to pass the ClockInterface into everything -// that uses it, eliminating the need for a global variable and this function. -ClockInterface* SetClockForTesting(ClockInterface* clock); - -// Returns previously set clock, or nullptr if no custom clock is being used. -ClockInterface* GetClockForTesting(); - -// Returns the actual system time, even if a clock is set for testing. -// Useful for timeouts while using a test clock, or for logging. -int64_t SystemTimeNanos(); -int64_t SystemTimeMillis(); - -// Returns the current time in milliseconds in 32 bits. -uint32_t Time32(); - -// Returns the current time in milliseconds in 64 bits. -int64_t TimeMillis(); -// Deprecated. Do not use this in any new code. -inline int64_t Time() { - return TimeMillis(); -} - -// Returns the current time in microseconds. -int64_t TimeMicros(); - -// Returns the current time in nanoseconds. -int64_t TimeNanos(); - - -// Returns a future timestamp, 'elapsed' milliseconds from now. -int64_t TimeAfter(int64_t elapsed); - -// Number of milliseconds that would elapse between 'earlier' and 'later' -// timestamps. The value is negative if 'later' occurs before 'earlier'. -int64_t TimeDiff(int64_t later, int64_t earlier); -int32_t TimeDiff32(uint32_t later, uint32_t earlier); - -// The number of milliseconds that have elapsed since 'earlier'. -inline int64_t TimeSince(int64_t earlier) { - return TimeMillis() - earlier; -} - -// The number of milliseconds that will elapse between now and 'later'. -inline int64_t TimeUntil(int64_t later) { - return later - TimeMillis(); -} - -class TimestampWrapAroundHandler { - public: - TimestampWrapAroundHandler(); - - int64_t Unwrap(uint32_t ts); - - private: - uint32_t last_ts_; - int64_t num_wrap_; -}; - -// Convert from std::tm, which is relative to 1900-01-01 00:00 to number of -// seconds from 1970-01-01 00:00 ("epoch"). Don't return time_t since that -// is still 32 bits on many systems. -int64_t TmToSeconds(const std::tm& tm); - -// Return the number of microseconds since January 1, 1970, UTC. -// Useful mainly when producing logs to be correlated with other -// devices, and when the devices in question all have properly -// synchronized clocks. -// -// Note that this function obeys the system's idea about what the time -// is. It is not guaranteed to be monotonic; it will jump in case the -// system time is changed, e.g., by some other process calling -// settimeofday. Always use rtc::TimeMicros(), not this function, for -// measuring time intervals and timeouts. -int64_t TimeUTCMicros(); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_TIMEUTILS_H_ diff --git a/webrtc/rtc_base/trace_event.h b/webrtc/rtc_base/trace_event.h deleted file mode 100644 index fd48eae974..0000000000 --- a/webrtc/rtc_base/trace_event.h +++ /dev/null @@ -1,910 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file under third_party_mods/chromium or at: -// http://src.chromium.org/svn/trunk/src/LICENSE - -#ifndef WEBRTC_RTC_BASE_TRACE_EVENT_H_ -#define WEBRTC_RTC_BASE_TRACE_EVENT_H_ - -#include - -#include "webrtc/base/event_tracer.h" - -#if defined(TRACE_EVENT0) -#error "Another copy of trace_event.h has already been included." -#endif - -// Extracted from Chromium's src/base/debug/trace_event.h. - -// This header is designed to give you trace_event macros without specifying -// how the events actually get collected and stored. If you need to expose trace -// event to some other universe, you can copy-and-paste this file, -// implement the TRACE_EVENT_API macros, and do any other necessary fixup for -// the target platform. The end result is that multiple libraries can funnel -// events through to a shared trace event collector. - -// Trace events are for tracking application performance and resource usage. -// Macros are provided to track: -// Begin and end of function calls -// Counters -// -// Events are issued against categories. Whereas LOG's -// categories are statically defined, TRACE categories are created -// implicitly with a string. For example: -// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent") -// -// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope: -// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly") -// doSomethingCostly() -// TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly") -// Note: our tools can't always determine the correct BEGIN/END pairs unless -// these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you -// need them to be in separate scopes. -// -// A common use case is to trace entire function scopes. This -// issues a trace BEGIN and END automatically: -// void doSomethingCostly() { -// TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly"); -// ... -// } -// -// Additional parameters can be associated with an event: -// void doSomethingCostly2(int howMuch) { -// TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly", -// "howMuch", howMuch); -// ... -// } -// -// The trace system will automatically add to this information the -// current process id, thread id, and a timestamp in microseconds. -// -// To trace an asynchronous procedure such as an IPC send/receive, use -// ASYNC_BEGIN and ASYNC_END: -// [single threaded sender code] -// static int send_count = 0; -// ++send_count; -// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count); -// Send(new MyMessage(send_count)); -// [receive code] -// void OnMyMessage(send_count) { -// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count); -// } -// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs. -// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process. -// Pointers can be used for the ID parameter, and they will be mangled -// internally so that the same pointer on two different processes will not -// match. For example: -// class MyTracedClass { -// public: -// MyTracedClass() { -// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this); -// } -// ~MyTracedClass() { -// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this); -// } -// } -// -// Trace event also supports counters, which is a way to track a quantity -// as it varies over time. Counters are created with the following macro: -// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue); -// -// Counters are process-specific. The macro itself can be issued from any -// thread, however. -// -// Sometimes, you want to track two counters at once. You can do this with two -// counter macros: -// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]); -// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]); -// Or you can do it with a combined macro: -// TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter", -// "bytesPinned", g_myCounterValue[0], -// "bytesAllocated", g_myCounterValue[1]); -// This indicates to the tracing UI that these counters should be displayed -// in a single graph, as a summed area chart. -// -// Since counters are in a global namespace, you may want to disembiguate with a -// unique ID, by using the TRACE_COUNTER_ID* variations. -// -// By default, trace collection is compiled in, but turned off at runtime. -// Collecting trace data is the responsibility of the embedding -// application. In Chrome's case, navigating to about:tracing will turn on -// tracing and display data collected across all active processes. -// -// -// Memory scoping note: -// Tracing copies the pointers, not the string content, of the strings passed -// in for category, name, and arg_names. Thus, the following code will -// cause problems: -// char* str = strdup("impprtantName"); -// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD! -// free(str); // Trace system now has dangling pointer -// -// To avoid this issue with the |name| and |arg_name| parameters, use the -// TRACE_EVENT_COPY_XXX overloads of the macros at additional runtime overhead. -// Notes: The category must always be in a long-lived char* (i.e. static const). -// The |arg_values|, when used, are always deep copied with the _COPY -// macros. -// -// When are string argument values copied: -// const char* arg_values are only referenced by default: -// TRACE_EVENT1("category", "name", -// "arg1", "literal string is only referenced"); -// Use TRACE_STR_COPY to force copying of a const char*: -// TRACE_EVENT1("category", "name", -// "arg1", TRACE_STR_COPY("string will be copied")); -// std::string arg_values are always copied: -// TRACE_EVENT1("category", "name", -// "arg1", std::string("string will be copied")); -// -// -// Thread Safety: -// Thread safety is provided by methods defined in event_tracer.h. See the file -// for details. - - -// By default, const char* argument values are assumed to have long-lived scope -// and will not be copied. Use this macro to force a const char* to be copied. -#define TRACE_STR_COPY(str) \ - webrtc::trace_event_internal::TraceStringWithCopy(str) - -// This will mark the trace event as disabled by default. The user will need -// to explicitly enable the event. -#define TRACE_DISABLED_BY_DEFAULT(name) "disabled-by-default-" name - -// By default, uint64 ID argument values are not mangled with the Process ID in -// TRACE_EVENT_ASYNC macros. Use this macro to force Process ID mangling. -#define TRACE_ID_MANGLE(id) \ - webrtc::trace_event_internal::TraceID::ForceMangle(id) - -// Records a pair of begin and end events called "name" for the current -// scope, with 0, 1 or 2 associated arguments. If the category is not -// enabled, then this does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_EVENT0(category, name) \ - INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name) -#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, arg1_name, arg1_val) -#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) - -// Same as TRACE_EVENT except that they are not included in official builds. -#ifdef OFFICIAL_BUILD -#define UNSHIPPED_TRACE_EVENT0(category, name) (void)0 -#define UNSHIPPED_TRACE_EVENT1(category, name, arg1_name, arg1_val) (void)0 -#define UNSHIPPED_TRACE_EVENT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) (void)0 -#define UNSHIPPED_TRACE_EVENT_INSTANT0(category, name) (void)0 -#define UNSHIPPED_TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ - (void)0 -#define UNSHIPPED_TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) (void)0 -#else -#define UNSHIPPED_TRACE_EVENT0(category, name) \ - TRACE_EVENT0(category, name) -#define UNSHIPPED_TRACE_EVENT1(category, name, arg1_name, arg1_val) \ - TRACE_EVENT1(category, name, arg1_name, arg1_val) -#define UNSHIPPED_TRACE_EVENT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) -#define UNSHIPPED_TRACE_EVENT_INSTANT0(category, name) \ - TRACE_EVENT_INSTANT0(category, name) -#define UNSHIPPED_TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ - TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) -#define UNSHIPPED_TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#endif - -// Records a single event called "name" immediately, with 0, 1 or 2 -// associated arguments. If the category is not enabled, then this -// does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_EVENT_INSTANT0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#define TRACE_EVENT_COPY_INSTANT0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_INSTANT1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ - arg2_name, arg2_val) - -// Records a single BEGIN event called "name" immediately, with 0, 1 or 2 -// associated arguments. If the category is not enabled, then this -// does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_EVENT_BEGIN0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#define TRACE_EVENT_COPY_BEGIN0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ - arg2_name, arg2_val) - -// Records a single END event for "name" immediately. If the category -// is not enabled, then this does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_EVENT_END0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#define TRACE_EVENT_COPY_END0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ - arg2_name, arg2_val) - -// Records the value of a counter called "name" immediately. Value -// must be representable as a 32 bit integer. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_COUNTER1(category, name, value) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ - category, name, TRACE_EVENT_FLAG_NONE, \ - "value", static_cast(value)) -#define TRACE_COPY_COUNTER1(category, name, value) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ - category, name, TRACE_EVENT_FLAG_COPY, \ - "value", static_cast(value)) - -// Records the values of a multi-parted counter called "name" immediately. -// The UI will treat value1 and value2 as parts of a whole, displaying their -// values as a stacked-bar chart. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_COUNTER2(category, name, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ - category, name, TRACE_EVENT_FLAG_NONE, \ - value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) -#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ - category, name, TRACE_EVENT_FLAG_COPY, \ - value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) - -// Records the value of a counter called "name" immediately. Value -// must be representable as a 32 bit integer. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -// - |id| is used to disambiguate counters with the same name. It must either -// be a pointer or an integer value up to 64 bits. If it's a pointer, the bits -// will be xored with a hash of the process ID so that the same pointer on -// two different processes will not collide. -#define TRACE_COUNTER_ID1(category, name, id, value) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - "value", static_cast(value)) -#define TRACE_COPY_COUNTER_ID1(category, name, id, value) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - "value", static_cast(value)) - -// Records the values of a multi-parted counter called "name" immediately. -// The UI will treat value1 and value2 as parts of a whole, displaying their -// values as a stacked-bar chart. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -// - |id| is used to disambiguate counters with the same name. It must either -// be a pointer or an integer value up to 64 bits. If it's a pointer, the bits -// will be xored with a hash of the process ID so that the same pointer on -// two different processes will not collide. -#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) -#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) - - -// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2 -// associated arguments. If the category is not enabled, then this -// does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event. ASYNC -// events are considered to match if their category, name and id values all -// match. |id| must either be a pointer or an integer value up to 64 bits. If -// it's a pointer, the bits will be xored with a hash of the process ID so -// that the same pointer on two different processes will not collide. -// An asynchronous operation can consist of multiple phases. The first phase is -// defined by the ASYNC_BEGIN calls. Additional phases can be defined using the -// ASYNC_STEP macros. When the operation completes, call ASYNC_END. -// An ASYNC trace typically occur on a single thread (if not, they will only be -// drawn on the thread defined in the ASYNC_BEGIN event), but all events in that -// operation must use the same |name| and |id|. Each event can have its own -// args. -#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val, arg2_name, arg2_val) - -// Records a single ASYNC_STEP event for |step| immediately. If the category -// is not enabled, then this does nothing. The |name| and |id| must match the -// ASYNC_BEGIN event above. The |step| param identifies this step within the -// async event. This should be called at the beginning of the next phase of an -// asynchronous operation. -#define TRACE_EVENT_ASYNC_STEP0(category, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ - category, name, id, TRACE_EVENT_FLAG_NONE, "step", step) -#define TRACE_EVENT_ASYNC_STEP1(category, name, id, step, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ - category, name, id, TRACE_EVENT_FLAG_NONE, "step", step, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_ASYNC_STEP0(category, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step) -#define TRACE_EVENT_COPY_ASYNC_STEP1(category, name, id, step, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, \ - arg1_name, arg1_val) - -// Records a single ASYNC_END event for "name" immediately. If the category -// is not enabled, then this does nothing. -#define TRACE_EVENT_ASYNC_END0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val, arg2_name, arg2_val) - - -// Records a single FLOW_BEGIN event called "name" immediately, with 0, 1 or 2 -// associated arguments. If the category is not enabled, then this -// does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -// - |id| is used to match the FLOW_BEGIN event with the FLOW_END event. FLOW -// events are considered to match if their category, name and id values all -// match. |id| must either be a pointer or an integer value up to 64 bits. If -// it's a pointer, the bits will be xored with a hash of the process ID so -// that the same pointer on two different processes will not collide. -// FLOW events are different from ASYNC events in how they are drawn by the -// tracing UI. A FLOW defines asynchronous data flow, such as posting a task -// (FLOW_BEGIN) and later executing that task (FLOW_END). Expect FLOWs to be -// drawn as lines or arrows from FLOW_BEGIN scopes to FLOW_END scopes. Similar -// to ASYNC, a FLOW can consist of multiple phases. The first phase is defined -// by the FLOW_BEGIN calls. Additional phases can be defined using the FLOW_STEP -// macros. When the operation completes, call FLOW_END. An async operation can -// span threads and processes, but all events in that operation must use the -// same |name| and |id|. Each event can have its own args. -#define TRACE_EVENT_FLOW_BEGIN0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_FLOW_BEGIN1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_FLOW_BEGIN2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_FLOW_BEGIN0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_FLOW_BEGIN1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_FLOW_BEGIN2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val, arg2_name, arg2_val) - -// Records a single FLOW_STEP event for |step| immediately. If the category -// is not enabled, then this does nothing. The |name| and |id| must match the -// FLOW_BEGIN event above. The |step| param identifies this step within the -// async event. This should be called at the beginning of the next phase of an -// asynchronous operation. -#define TRACE_EVENT_FLOW_STEP0(category, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ - category, name, id, TRACE_EVENT_FLAG_NONE, "step", step) -#define TRACE_EVENT_FLOW_STEP1(category, name, id, step, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ - category, name, id, TRACE_EVENT_FLAG_NONE, "step", step, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_FLOW_STEP0(category, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step) -#define TRACE_EVENT_COPY_FLOW_STEP1(category, name, id, step, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, \ - arg1_name, arg1_val) - -// Records a single FLOW_END event for "name" immediately. If the category -// is not enabled, then this does nothing. -#define TRACE_EVENT_FLOW_END0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_FLOW_END1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_FLOW_END2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_FLOW_END0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_FLOW_END1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_FLOW_END2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val, arg2_name, arg2_val) - - -//////////////////////////////////////////////////////////////////////////////// -// Implementation specific tracing API definitions. - -// Get a pointer to the enabled state of the given trace category. Only -// long-lived literal strings should be given as the category name. The returned -// pointer can be held permanently in a local static for example. If the -// unsigned char is non-zero, tracing is enabled. If tracing is enabled, -// TRACE_EVENT_API_ADD_TRACE_EVENT can be called. It's OK if tracing is disabled -// between the load of the tracing state and the call to -// TRACE_EVENT_API_ADD_TRACE_EVENT, because this flag only provides an early out -// for best performance when tracing is disabled. -// const unsigned char* -// TRACE_EVENT_API_GET_CATEGORY_ENABLED(const char* category_name) -#define TRACE_EVENT_API_GET_CATEGORY_ENABLED \ - webrtc::EventTracer::GetCategoryEnabled - -// Add a trace event to the platform tracing system. -// void TRACE_EVENT_API_ADD_TRACE_EVENT( -// char phase, -// const unsigned char* category_enabled, -// const char* name, -// unsigned long long id, -// int num_args, -// const char** arg_names, -// const unsigned char* arg_types, -// const unsigned long long* arg_values, -// unsigned char flags) -#define TRACE_EVENT_API_ADD_TRACE_EVENT webrtc::EventTracer::AddTraceEvent - -//////////////////////////////////////////////////////////////////////////////// - -// Implementation detail: trace event macros create temporary variables -// to keep instrumentation overhead low. These macros give each temporary -// variable a unique name based on the line number to prevent name collissions. -#define INTERNAL_TRACE_EVENT_UID3(a,b) \ - trace_event_unique_##a##b -#define INTERNAL_TRACE_EVENT_UID2(a,b) \ - INTERNAL_TRACE_EVENT_UID3(a,b) -#define INTERNAL_TRACE_EVENT_UID(name_prefix) \ - INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__) - -// Implementation detail: internal macro to create static category. -#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category) \ - static const unsigned char* INTERNAL_TRACE_EVENT_UID(catstatic) = \ - TRACE_EVENT_API_GET_CATEGORY_ENABLED(category); - -// Implementation detail: internal macro to create static category and add -// event if the category is enabled. -#define INTERNAL_TRACE_EVENT_ADD(phase, category, name, flags, ...) \ - do { \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ - if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ - webrtc::trace_event_internal::AddTraceEvent( \ - phase, INTERNAL_TRACE_EVENT_UID(catstatic), name, \ - webrtc::trace_event_internal::kNoEventId, flags, ##__VA_ARGS__); \ - } \ - } while (0) - -// Implementation detail: internal macro to create static category and add begin -// event if the category is enabled. Also adds the end event when the scope -// ends. -#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, ...) \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ - webrtc::trace_event_internal::TraceEndOnScopeClose \ - INTERNAL_TRACE_EVENT_UID(profileScope); \ - if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ - webrtc::trace_event_internal::AddTraceEvent( \ - TRACE_EVENT_PHASE_BEGIN, \ - INTERNAL_TRACE_EVENT_UID(catstatic), \ - name, webrtc::trace_event_internal::kNoEventId, \ - TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__); \ - INTERNAL_TRACE_EVENT_UID(profileScope).Initialize( \ - INTERNAL_TRACE_EVENT_UID(catstatic), name); \ - } - -// Implementation detail: internal macro to create static category and add -// event if the category is enabled. -#define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category, name, id, flags, \ - ...) \ - do { \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ - if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ - unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ - webrtc::trace_event_internal::TraceID trace_event_trace_id( \ - id, &trace_event_flags); \ - webrtc::trace_event_internal::AddTraceEvent( \ - phase, INTERNAL_TRACE_EVENT_UID(catstatic), \ - name, trace_event_trace_id.data(), trace_event_flags, \ - ##__VA_ARGS__); \ - } \ - } while (0) - -// Notes regarding the following definitions: -// New values can be added and propagated to third party libraries, but existing -// definitions must never be changed, because third party libraries may use old -// definitions. - -// Phase indicates the nature of an event entry. E.g. part of a begin/end pair. -#define TRACE_EVENT_PHASE_BEGIN ('B') -#define TRACE_EVENT_PHASE_END ('E') -#define TRACE_EVENT_PHASE_INSTANT ('I') -#define TRACE_EVENT_PHASE_ASYNC_BEGIN ('S') -#define TRACE_EVENT_PHASE_ASYNC_STEP ('T') -#define TRACE_EVENT_PHASE_ASYNC_END ('F') -#define TRACE_EVENT_PHASE_FLOW_BEGIN ('s') -#define TRACE_EVENT_PHASE_FLOW_STEP ('t') -#define TRACE_EVENT_PHASE_FLOW_END ('f') -#define TRACE_EVENT_PHASE_METADATA ('M') -#define TRACE_EVENT_PHASE_COUNTER ('C') - -// Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. -#define TRACE_EVENT_FLAG_NONE (static_cast(0)) -#define TRACE_EVENT_FLAG_COPY (static_cast(1 << 0)) -#define TRACE_EVENT_FLAG_HAS_ID (static_cast(1 << 1)) -#define TRACE_EVENT_FLAG_MANGLE_ID (static_cast(1 << 2)) - -// Type values for identifying types in the TraceValue union. -#define TRACE_VALUE_TYPE_BOOL (static_cast(1)) -#define TRACE_VALUE_TYPE_UINT (static_cast(2)) -#define TRACE_VALUE_TYPE_INT (static_cast(3)) -#define TRACE_VALUE_TYPE_DOUBLE (static_cast(4)) -#define TRACE_VALUE_TYPE_POINTER (static_cast(5)) -#define TRACE_VALUE_TYPE_STRING (static_cast(6)) -#define TRACE_VALUE_TYPE_COPY_STRING (static_cast(7)) - -namespace webrtc { -namespace trace_event_internal { - -// Specify these values when the corresponding argument of AddTraceEvent is not -// used. -const int kZeroNumArgs = 0; -const unsigned long long kNoEventId = 0; - -// TraceID encapsulates an ID that can either be an integer or pointer. Pointers -// are mangled with the Process ID so that they are unlikely to collide when the -// same pointer is used on different processes. -class TraceID { - public: - class ForceMangle { - public: - explicit ForceMangle(unsigned long long id) : data_(id) {} - explicit ForceMangle(unsigned long id) : data_(id) {} - explicit ForceMangle(unsigned int id) : data_(id) {} - explicit ForceMangle(unsigned short id) : data_(id) {} - explicit ForceMangle(unsigned char id) : data_(id) {} - explicit ForceMangle(long long id) - : data_(static_cast(id)) {} - explicit ForceMangle(long id) - : data_(static_cast(id)) {} - explicit ForceMangle(int id) - : data_(static_cast(id)) {} - explicit ForceMangle(short id) - : data_(static_cast(id)) {} - explicit ForceMangle(signed char id) - : data_(static_cast(id)) {} - - unsigned long long data() const { return data_; } - - private: - unsigned long long data_; - }; - - explicit TraceID(const void* id, unsigned char* flags) - : data_(static_cast( - reinterpret_cast(id))) { - *flags |= TRACE_EVENT_FLAG_MANGLE_ID; - } - explicit TraceID(ForceMangle id, unsigned char* flags) : data_(id.data()) { - *flags |= TRACE_EVENT_FLAG_MANGLE_ID; - } - explicit TraceID(unsigned long long id, unsigned char* flags) - : data_(id) { (void)flags; } - explicit TraceID(unsigned long id, unsigned char* flags) - : data_(id) { (void)flags; } - explicit TraceID(unsigned int id, unsigned char* flags) - : data_(id) { (void)flags; } - explicit TraceID(unsigned short id, unsigned char* flags) - : data_(id) { (void)flags; } - explicit TraceID(unsigned char id, unsigned char* flags) - : data_(id) { (void)flags; } - explicit TraceID(long long id, unsigned char* flags) - : data_(static_cast(id)) { (void)flags; } - explicit TraceID(long id, unsigned char* flags) - : data_(static_cast(id)) { (void)flags; } - explicit TraceID(int id, unsigned char* flags) - : data_(static_cast(id)) { (void)flags; } - explicit TraceID(short id, unsigned char* flags) - : data_(static_cast(id)) { (void)flags; } - explicit TraceID(signed char id, unsigned char* flags) - : data_(static_cast(id)) { (void)flags; } - - unsigned long long data() const { return data_; } - - private: - unsigned long long data_; -}; - -// Simple union to store various types as unsigned long long. -union TraceValueUnion { - bool as_bool; - unsigned long long as_uint; - long long as_int; - double as_double; - const void* as_pointer; - const char* as_string; -}; - -// Simple container for const char* that should be copied instead of retained. -class TraceStringWithCopy { - public: - explicit TraceStringWithCopy(const char* str) : str_(str) {} - operator const char* () const { return str_; } - private: - const char* str_; -}; - -// Define SetTraceValue for each allowed type. It stores the type and -// value in the return arguments. This allows this API to avoid declaring any -// structures so that it is portable to third_party libraries. -#define INTERNAL_DECLARE_SET_TRACE_VALUE(actual_type, \ - union_member, \ - value_type_id) \ - static inline void SetTraceValue(actual_type arg, \ - unsigned char* type, \ - unsigned long long* value) { \ - TraceValueUnion type_value; \ - type_value.union_member = arg; \ - *type = value_type_id; \ - *value = type_value.as_uint; \ - } -// Simpler form for int types that can be safely casted. -#define INTERNAL_DECLARE_SET_TRACE_VALUE_INT(actual_type, \ - value_type_id) \ - static inline void SetTraceValue(actual_type arg, \ - unsigned char* type, \ - unsigned long long* value) { \ - *type = value_type_id; \ - *value = static_cast(arg); \ - } - -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned long long, TRACE_VALUE_TYPE_UINT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned long, TRACE_VALUE_TYPE_UINT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned int, TRACE_VALUE_TYPE_UINT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned short, TRACE_VALUE_TYPE_UINT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned char, TRACE_VALUE_TYPE_UINT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(long long, TRACE_VALUE_TYPE_INT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(long, TRACE_VALUE_TYPE_INT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(int, TRACE_VALUE_TYPE_INT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(short, TRACE_VALUE_TYPE_INT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(signed char, TRACE_VALUE_TYPE_INT) -INTERNAL_DECLARE_SET_TRACE_VALUE(bool, as_bool, TRACE_VALUE_TYPE_BOOL) -INTERNAL_DECLARE_SET_TRACE_VALUE(double, as_double, TRACE_VALUE_TYPE_DOUBLE) -INTERNAL_DECLARE_SET_TRACE_VALUE(const void*, as_pointer, - TRACE_VALUE_TYPE_POINTER) -INTERNAL_DECLARE_SET_TRACE_VALUE(const char*, as_string, - TRACE_VALUE_TYPE_STRING) -INTERNAL_DECLARE_SET_TRACE_VALUE(const TraceStringWithCopy&, as_string, - TRACE_VALUE_TYPE_COPY_STRING) - -#undef INTERNAL_DECLARE_SET_TRACE_VALUE -#undef INTERNAL_DECLARE_SET_TRACE_VALUE_INT - -// std::string version of SetTraceValue so that trace arguments can be strings. -static inline void SetTraceValue(const std::string& arg, - unsigned char* type, - unsigned long long* value) { - TraceValueUnion type_value; - type_value.as_string = arg.c_str(); - *type = TRACE_VALUE_TYPE_COPY_STRING; - *value = type_value.as_uint; -} - -// These AddTraceEvent template functions are defined here instead of in the -// macro, because the arg_values could be temporary objects, such as -// std::string. In order to store pointers to the internal c_str and pass -// through to the tracing API, the arg_values must live throughout -// these procedures. - -static inline void AddTraceEvent(char phase, - const unsigned char* category_enabled, - const char* name, - unsigned long long id, - unsigned char flags) { - TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_enabled, name, id, - kZeroNumArgs, nullptr, nullptr, nullptr, - flags); -} - -template -static inline void AddTraceEvent(char phase, - const unsigned char* category_enabled, - const char* name, - unsigned long long id, - unsigned char flags, - const char* arg1_name, - const ARG1_TYPE& arg1_val) { - const int num_args = 1; - unsigned char arg_types[1]; - unsigned long long arg_values[1]; - SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); - TRACE_EVENT_API_ADD_TRACE_EVENT( - phase, category_enabled, name, id, - num_args, &arg1_name, arg_types, arg_values, - flags); -} - -template -static inline void AddTraceEvent(char phase, - const unsigned char* category_enabled, - const char* name, - unsigned long long id, - unsigned char flags, - const char* arg1_name, - const ARG1_TYPE& arg1_val, - const char* arg2_name, - const ARG2_TYPE& arg2_val) { - const int num_args = 2; - const char* arg_names[2] = { arg1_name, arg2_name }; - unsigned char arg_types[2]; - unsigned long long arg_values[2]; - SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); - SetTraceValue(arg2_val, &arg_types[1], &arg_values[1]); - TRACE_EVENT_API_ADD_TRACE_EVENT( - phase, category_enabled, name, id, - num_args, arg_names, arg_types, arg_values, - flags); -} - -// Used by TRACE_EVENTx macro. Do not use directly. -class TraceEndOnScopeClose { - public: - // Note: members of data_ intentionally left uninitialized. See Initialize. - TraceEndOnScopeClose() : p_data_(nullptr) {} - ~TraceEndOnScopeClose() { - if (p_data_) - AddEventIfEnabled(); - } - - void Initialize(const unsigned char* category_enabled, - const char* name) { - data_.category_enabled = category_enabled; - data_.name = name; - p_data_ = &data_; - } - - private: - // Add the end event if the category is still enabled. - void AddEventIfEnabled() { - // Only called when p_data_ is non-null. - if (*p_data_->category_enabled) { - TRACE_EVENT_API_ADD_TRACE_EVENT(TRACE_EVENT_PHASE_END, - p_data_->category_enabled, p_data_->name, - kNoEventId, kZeroNumArgs, nullptr, - nullptr, nullptr, TRACE_EVENT_FLAG_NONE); - } - } - - // This Data struct workaround is to avoid initializing all the members - // in Data during construction of this object, since this object is always - // constructed, even when tracing is disabled. If the members of Data were - // members of this class instead, compiler warnings occur about potential - // uninitialized accesses. - struct Data { - const unsigned char* category_enabled; - const char* name; - }; - Data* p_data_; - Data data_; -}; - -} // namespace trace_event_internal -} // namespace webrtc - -#endif // WEBRTC_RTC_BASE_TRACE_EVENT_H_ diff --git a/webrtc/rtc_base/transformadapter.h b/webrtc/rtc_base/transformadapter.h deleted file mode 100644 index 081889901b..0000000000 --- a/webrtc/rtc_base/transformadapter.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TRANSFORMADAPTER_H_ -#define WEBRTC_RTC_BASE_TRANSFORMADAPTER_H_ - -#include "webrtc/base/stream.h" - -namespace rtc { -/////////////////////////////////////////////////////////////////////////////// - -class TransformInterface { -public: - virtual ~TransformInterface() { } - - // Transform should convert the in_len bytes of input into the out_len-sized - // output buffer. If flush is true, there will be no more data following - // input. - // After the transformation, in_len contains the number of bytes consumed, and - // out_len contains the number of bytes ready in output. - // Note: Transform should not return SR_BLOCK, as there is no asynchronous - // notification available. - virtual StreamResult Transform(const void * input, size_t * in_len, - void * output, size_t * out_len, - bool flush) = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// - -// TransformAdapter causes all data passed through to be transformed by the -// supplied TransformInterface object, which may apply compression, encryption, -// etc. - -class TransformAdapter : public StreamAdapterInterface { -public: - // Note that the transformation is unidirectional, in the direction specified - // by the constructor. Operations in the opposite direction result in SR_EOS. - TransformAdapter(StreamInterface * stream, - TransformInterface * transform, - bool direction_read); - ~TransformAdapter() override; - - StreamResult Read(void* buffer, - size_t buffer_len, - size_t* read, - int* error) override; - StreamResult Write(const void* data, - size_t data_len, - size_t* written, - int* error) override; - void Close() override; - - // Apriori, we can't tell what the transformation does to the stream length. - bool GetAvailable(size_t* size) const override; - bool ReserveSize(size_t size) override; - - // Transformations might not be restartable - virtual bool Rewind(); - -private: - enum State { ST_PROCESSING, ST_FLUSHING, ST_COMPLETE, ST_ERROR }; - enum { BUFFER_SIZE = 1024 }; - - TransformInterface * transform_; - bool direction_read_; - State state_; - int error_; - - char buffer_[BUFFER_SIZE]; - size_t len_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_TRANSFORMADAPTER_H_ diff --git a/webrtc/rtc_base/type_traits.h b/webrtc/rtc_base/type_traits.h deleted file mode 100644 index 5ecbc07590..0000000000 --- a/webrtc/rtc_base/type_traits.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_TYPE_TRAITS_H_ -#define WEBRTC_RTC_BASE_TYPE_TRAITS_H_ - -#include -#include - -namespace rtc { - -// Determines if the given class has zero-argument .data() and .size() methods -// whose return values are convertible to T* and size_t, respectively. -template -class HasDataAndSize { - private: - template < - typename C, - typename std::enable_if< - std::is_convertible().data()), T*>::value && - std::is_convertible().size()), - std::size_t>::value>::type* = nullptr> - static int Test(int); - - template - static char Test(...); - - public: - static constexpr bool value = std::is_same(0)), int>::value; -}; - -namespace test_has_data_and_size { - -template -struct Test1 { - DR data(); - SR size(); -}; -static_assert(HasDataAndSize, int>::value, ""); -static_assert(HasDataAndSize, const int>::value, ""); -static_assert(HasDataAndSize, const int>::value, ""); -static_assert(!HasDataAndSize, int>::value, - "implicit cast of const int* to int*"); -static_assert(!HasDataAndSize, int>::value, - "implicit cast of char* to int*"); - -struct Test2 { - int* data; - size_t size; -}; -static_assert(!HasDataAndSize::value, - ".data and .size aren't functions"); - -struct Test3 { - int* data(); -}; -static_assert(!HasDataAndSize::value, ".size() is missing"); - -class Test4 { - int* data(); - size_t size(); -}; -static_assert(!HasDataAndSize::value, - ".data() and .size() are private"); - -} // namespace test_has_data_and_size - -namespace type_traits_impl { - -// Determines if the given type is an enum that converts implicitly to -// an integral type. -template -struct IsIntEnum { - private: - // This overload is used if the type is an enum, and unary plus - // compiles and turns it into an integral type. - template ::value && - std::is_integral())>::value>::type* = - nullptr> - static int Test(int); - - // Otherwise, this overload is used. - template - static char Test(...); - - public: - static constexpr bool value = - std::is_same::type>(0)), - int>::value; -}; - -} // namespace type_traits_impl - -// Determines if the given type is integral, or an enum that -// converts implicitly to an integral type. -template -struct IsIntlike { - private: - using X = typename std::remove_reference::type; - - public: - static constexpr bool value = - std::is_integral::value || type_traits_impl::IsIntEnum::value; -}; - -namespace test_enum_intlike { - -enum E1 { e1 }; -enum { e2 }; -enum class E3 { e3 }; -struct S {}; - -static_assert(type_traits_impl::IsIntEnum::value, ""); -static_assert(type_traits_impl::IsIntEnum::value, ""); -static_assert(!type_traits_impl::IsIntEnum::value, ""); -static_assert(!type_traits_impl::IsIntEnum::value, ""); -static_assert(!type_traits_impl::IsIntEnum::value, ""); -static_assert(!type_traits_impl::IsIntEnum::value, ""); - -static_assert(IsIntlike::value, ""); -static_assert(IsIntlike::value, ""); -static_assert(!IsIntlike::value, ""); -static_assert(IsIntlike::value, ""); -static_assert(!IsIntlike::value, ""); -static_assert(!IsIntlike::value, ""); - -} // test_enum_intlike - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_TYPE_TRAITS_H_ diff --git a/webrtc/rtc_base/unixfilesystem.h b/webrtc/rtc_base/unixfilesystem.h deleted file mode 100644 index eb58a4df3a..0000000000 --- a/webrtc/rtc_base/unixfilesystem.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_UNIXFILESYSTEM_H_ -#define WEBRTC_RTC_BASE_UNIXFILESYSTEM_H_ - -#include - -#include "webrtc/base/fileutils.h" - -namespace rtc { - -class UnixFilesystem : public FilesystemInterface { - public: - UnixFilesystem(); - ~UnixFilesystem() override; - -#if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC) - // Android does not have a native code API to fetch the app data or temp - // folders. That needs to be passed into this class from Java. Similarly, iOS - // only supports an Objective-C API for fetching the folder locations, so that - // needs to be passed in here from Objective-C. Or at least that used to be - // the case; now the ctor will do the work if necessary and possible. - // TODO(fischman): add an Android version that uses JNI and drop the - // SetApp*Folder() APIs once external users stop using them. - static void SetAppDataFolder(const std::string& folder); - static void SetAppTempFolder(const std::string& folder); -#endif - - // This will attempt to delete the file located at filename. - // It will fail with VERIY if you pass it a non-existant file, or a directory. - bool DeleteFile(const Pathname& filename) override; - - // Creates a directory. This will call itself recursively to create /foo/bar - // even if /foo does not exist. All created directories are created with the - // given mode. - // Returns TRUE if function succeeds - virtual bool CreateFolder(const Pathname &pathname, mode_t mode); - - // As above, with mode = 0755. - bool CreateFolder(const Pathname& pathname) override; - - // This moves a file from old_path to new_path, where "file" can be a plain - // file or directory, which will be moved recursively. - // Returns true if function succeeds. - bool MoveFile(const Pathname& old_path, const Pathname& new_path) override; - - // Returns true if a pathname is a directory - bool IsFolder(const Pathname& pathname) override; - - // Returns true of pathname represents an existing file - bool IsFile(const Pathname& pathname) override; - - // Returns true if pathname refers to no filesystem object, every parent - // directory either exists, or is also absent. - bool IsAbsent(const Pathname& pathname) override; - - std::string TempFilename(const Pathname& dir, - const std::string& prefix) override; - - // A folder appropriate for storing temporary files (Contents are - // automatically deleted when the program exists) - bool GetTemporaryFolder(Pathname& path, - bool create, - const std::string* append) override; - - bool GetFileSize(const Pathname& path, size_t* size) override; - - private: -#if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC) - static char* provided_app_data_folder_; - static char* provided_app_temp_folder_; -#else - static char* app_temp_path_; -#endif - - static char* CopyString(const std::string& str); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_UNIXFILESYSTEM_H_ diff --git a/webrtc/rtc_base/virtualsocketserver.h b/webrtc/rtc_base/virtualsocketserver.h deleted file mode 100644 index 4de12c7de2..0000000000 --- a/webrtc/rtc_base/virtualsocketserver.h +++ /dev/null @@ -1,400 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_VIRTUALSOCKETSERVER_H_ -#define WEBRTC_RTC_BASE_VIRTUALSOCKETSERVER_H_ - -#include -#include - -#include "webrtc/base/checks.h" -#include "webrtc/base/constructormagic.h" -#include "webrtc/base/event.h" -#include "webrtc/base/fakeclock.h" -#include "webrtc/base/messagequeue.h" -#include "webrtc/base/socketserver.h" - -namespace rtc { - -class Packet; -class VirtualSocket; -class SocketAddressPair; - -// Simulates a network in the same manner as a loopback interface. The -// interface can create as many addresses as you want. All of the sockets -// created by this network will be able to communicate with one another, unless -// they are bound to addresses from incompatible families. -class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> { - public: - VirtualSocketServer(); - // This constructor needs to be used if the test uses a fake clock and - // ProcessMessagesUntilIdle, since ProcessMessagesUntilIdle needs a way of - // advancing time. - explicit VirtualSocketServer(FakeClock* fake_clock); - ~VirtualSocketServer() override; - - // The default route indicates which local address to use when a socket is - // bound to the 'any' address, e.g. 0.0.0.0. - IPAddress GetDefaultRoute(int family); - void SetDefaultRoute(const IPAddress& from_addr); - - // Limits the network bandwidth (maximum bytes per second). Zero means that - // all sends occur instantly. Defaults to 0. - uint32_t bandwidth() const { return bandwidth_; } - void set_bandwidth(uint32_t bandwidth) { bandwidth_ = bandwidth; } - - // Limits the amount of data which can be in flight on the network without - // packet loss (on a per sender basis). Defaults to 64 KB. - uint32_t network_capacity() const { return network_capacity_; } - void set_network_capacity(uint32_t capacity) { network_capacity_ = capacity; } - - // The amount of data which can be buffered by tcp on the sender's side - uint32_t send_buffer_capacity() const { return send_buffer_capacity_; } - void set_send_buffer_capacity(uint32_t capacity) { - send_buffer_capacity_ = capacity; - } - - // The amount of data which can be buffered by tcp on the receiver's side - uint32_t recv_buffer_capacity() const { return recv_buffer_capacity_; } - void set_recv_buffer_capacity(uint32_t capacity) { - recv_buffer_capacity_ = capacity; - } - - // Controls the (transit) delay for packets sent in the network. This does - // not inclue the time required to sit in the send queue. Both of these - // values are measured in milliseconds. Defaults to no delay. - uint32_t delay_mean() const { return delay_mean_; } - uint32_t delay_stddev() const { return delay_stddev_; } - uint32_t delay_samples() const { return delay_samples_; } - void set_delay_mean(uint32_t delay_mean) { delay_mean_ = delay_mean; } - void set_delay_stddev(uint32_t delay_stddev) { delay_stddev_ = delay_stddev; } - void set_delay_samples(uint32_t delay_samples) { - delay_samples_ = delay_samples; - } - - // If the (transit) delay parameters are modified, this method should be - // called to recompute the new distribution. - void UpdateDelayDistribution(); - - // Controls the (uniform) probability that any sent packet is dropped. This - // is separate from calculations to drop based on queue size. - double drop_probability() { return drop_prob_; } - void set_drop_probability(double drop_prob) { - RTC_DCHECK_GE(drop_prob, 0.0); - RTC_DCHECK_LE(drop_prob, 1.0); - drop_prob_ = drop_prob; - } - - // If |blocked| is true, subsequent attempts to send will result in -1 being - // returned, with the socket error set to EWOULDBLOCK. - // - // If this method is later called with |blocked| set to false, any sockets - // that previously failed to send with EWOULDBLOCK will emit SignalWriteEvent. - // - // This can be used to simulate the send buffer on a network interface being - // full, and test functionality related to EWOULDBLOCK/SignalWriteEvent. - void SetSendingBlocked(bool blocked); - - // SocketFactory: - Socket* CreateSocket(int type) override; - Socket* CreateSocket(int family, int type) override; - - AsyncSocket* CreateAsyncSocket(int type) override; - AsyncSocket* CreateAsyncSocket(int family, int type) override; - - // SocketServer: - void SetMessageQueue(MessageQueue* queue) override; - bool Wait(int cms, bool process_io) override; - void WakeUp() override; - - void SetDelayOnAddress(const rtc::SocketAddress& address, int delay_ms) { - delay_by_ip_[address.ipaddr()] = delay_ms; - } - - typedef std::pair Point; - typedef std::vector Function; - - static Function* CreateDistribution(uint32_t mean, - uint32_t stddev, - uint32_t samples); - - // Similar to Thread::ProcessMessages, but it only processes messages until - // there are no immediate messages or pending network traffic. Returns false - // if Thread::Stop() was called. - bool ProcessMessagesUntilIdle(); - - // Sets the next port number to use for testing. - void SetNextPortForTesting(uint16_t port); - - // Close a pair of Tcp connections by addresses. Both connections will have - // its own OnClose invoked. - bool CloseTcpConnections(const SocketAddress& addr_local, - const SocketAddress& addr_remote); - - // For testing purpose only. Fired when a client socket is created. - sigslot::signal1 SignalSocketCreated; - - protected: - // Returns a new IP not used before in this network. - IPAddress GetNextIP(int family); - uint16_t GetNextPort(); - - VirtualSocket* CreateSocketInternal(int family, int type); - - // Binds the given socket to addr, assigning and IP and Port if necessary - int Bind(VirtualSocket* socket, SocketAddress* addr); - - // Binds the given socket to the given (fully-defined) address. - int Bind(VirtualSocket* socket, const SocketAddress& addr); - - // Find the socket bound to the given address - VirtualSocket* LookupBinding(const SocketAddress& addr); - - int Unbind(const SocketAddress& addr, VirtualSocket* socket); - - // Adds a mapping between this socket pair and the socket. - void AddConnection(const SocketAddress& client, - const SocketAddress& server, - VirtualSocket* socket); - - // Find the socket pair corresponding to this server address. - VirtualSocket* LookupConnection(const SocketAddress& client, - const SocketAddress& server); - - void RemoveConnection(const SocketAddress& client, - const SocketAddress& server); - - // Connects the given socket to the socket at the given address - int Connect(VirtualSocket* socket, const SocketAddress& remote_addr, - bool use_delay); - - // Sends a disconnect message to the socket at the given address - bool Disconnect(VirtualSocket* socket); - - // Sends the given packet to the socket at the given address (if one exists). - int SendUdp(VirtualSocket* socket, const char* data, size_t data_size, - const SocketAddress& remote_addr); - - // Moves as much data as possible from the sender's buffer to the network - void SendTcp(VirtualSocket* socket); - - // Places a packet on the network. - void AddPacketToNetwork(VirtualSocket* socket, - VirtualSocket* recipient, - int64_t cur_time, - const char* data, - size_t data_size, - size_t header_size, - bool ordered); - - // Removes stale packets from the network - void PurgeNetworkPackets(VirtualSocket* socket, int64_t cur_time); - - // Computes the number of milliseconds required to send a packet of this size. - uint32_t SendDelay(uint32_t size); - - // If the delay has been set for the address of the socket, returns the set - // delay. Otherwise, returns a random transit delay chosen from the - // appropriate distribution. - uint32_t GetTransitDelay(Socket* socket); - - // Basic operations on functions. Those that return a function also take - // ownership of the function given (and hence, may modify or delete it). - static Function* Accumulate(Function* f); - static Function* Invert(Function* f); - static Function* Resample(Function* f, - double x1, - double x2, - uint32_t samples); - static double Evaluate(Function* f, double x); - - // Null out our message queue if it goes away. Necessary in the case where - // our lifetime is greater than that of the thread we are using, since we - // try to send Close messages for all connected sockets when we shutdown. - void OnMessageQueueDestroyed() { msg_queue_ = nullptr; } - - // Determine if two sockets should be able to communicate. - // We don't (currently) specify an address family for sockets; instead, - // the currently bound address is used to infer the address family. - // Any socket that is not explicitly bound to an IPv4 address is assumed to be - // dual-stack capable. - // This function tests if two addresses can communicate, as well as the - // sockets to which they may be bound (the addresses may or may not yet be - // bound to the sockets). - // First the addresses are tested (after normalization): - // If both have the same family, then communication is OK. - // If only one is IPv4 then false, unless the other is bound to ::. - // This applies even if the IPv4 address is 0.0.0.0. - // The socket arguments are optional; the sockets are checked to see if they - // were explicitly bound to IPv6-any ('::'), and if so communication is - // permitted. - // NB: This scheme doesn't permit non-dualstack IPv6 sockets. - static bool CanInteractWith(VirtualSocket* local, VirtualSocket* remote); - - private: - friend class VirtualSocket; - - // Sending was previously blocked, but now isn't. - sigslot::signal0<> SignalReadyToSend; - - typedef std::map AddressMap; - typedef std::map ConnectionMap; - - // May be null if the test doesn't use a fake clock, or it does but doesn't - // use ProcessMessagesUntilIdle. - FakeClock* fake_clock_ = nullptr; - - // Used to implement Wait/WakeUp. - Event wakeup_; - MessageQueue* msg_queue_; - bool stop_on_idle_; - in_addr next_ipv4_; - in6_addr next_ipv6_; - uint16_t next_port_; - AddressMap* bindings_; - ConnectionMap* connections_; - - IPAddress default_route_v4_; - IPAddress default_route_v6_; - - uint32_t bandwidth_; - uint32_t network_capacity_; - uint32_t send_buffer_capacity_; - uint32_t recv_buffer_capacity_; - uint32_t delay_mean_; - uint32_t delay_stddev_; - uint32_t delay_samples_; - - std::map delay_by_ip_; - std::unique_ptr delay_dist_; - - CriticalSection delay_crit_; - - double drop_prob_; - bool sending_blocked_ = false; - RTC_DISALLOW_COPY_AND_ASSIGN(VirtualSocketServer); -}; - -// Implements the socket interface using the virtual network. Packets are -// passed as messages using the message queue of the socket server. -class VirtualSocket : public AsyncSocket, - public MessageHandler, - public sigslot::has_slots<> { - public: - VirtualSocket(VirtualSocketServer* server, int family, int type, bool async); - ~VirtualSocket() override; - - SocketAddress GetLocalAddress() const override; - SocketAddress GetRemoteAddress() const override; - - // Used by TurnPortTest to mimic a case where proxy returns local host address - // instead of the original one TurnPort was bound against. Please see WebRTC - // issue 3927 for more detail. - void SetAlternativeLocalAddress(const SocketAddress& addr); - - int Bind(const SocketAddress& addr) override; - int Connect(const SocketAddress& addr) override; - int Close() override; - int Send(const void* pv, size_t cb) override; - int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; - int Recv(void* pv, size_t cb, int64_t* timestamp) override; - int RecvFrom(void* pv, - size_t cb, - SocketAddress* paddr, - int64_t* timestamp) override; - int Listen(int backlog) override; - VirtualSocket* Accept(SocketAddress* paddr) override; - - int GetError() const override; - void SetError(int error) override; - ConnState GetState() const override; - int GetOption(Option opt, int* value) override; - int SetOption(Option opt, int value) override; - void OnMessage(Message* pmsg) override; - - bool was_any() { return was_any_; } - void set_was_any(bool was_any) { was_any_ = was_any; } - - // For testing purpose only. Fired when client socket is bound to an address. - sigslot::signal2 SignalAddressReady; - - private: - struct NetworkEntry { - size_t size; - int64_t done_time; - }; - - typedef std::deque ListenQueue; - typedef std::deque NetworkQueue; - typedef std::vector SendBuffer; - typedef std::list RecvBuffer; - typedef std::map OptionsMap; - - int InitiateConnect(const SocketAddress& addr, bool use_delay); - void CompleteConnect(const SocketAddress& addr, bool notify); - int SendUdp(const void* pv, size_t cb, const SocketAddress& addr); - int SendTcp(const void* pv, size_t cb); - - // Used by server sockets to set the local address without binding. - void SetLocalAddress(const SocketAddress& addr); - - void OnSocketServerReadyToSend(); - - VirtualSocketServer* server_; - int type_; - bool async_; - ConnState state_; - int error_; - SocketAddress local_addr_; - SocketAddress alternative_local_addr_; - SocketAddress remote_addr_; - - // Pending sockets which can be Accepted - ListenQueue* listen_queue_; - - // Data which tcp has buffered for sending - SendBuffer send_buffer_; - // Set to false if the last attempt to send resulted in EWOULDBLOCK. - // Set back to true when the socket can send again. - bool ready_to_send_ = true; - - // Critical section to protect the recv_buffer and queue_ - CriticalSection crit_; - - // Network model that enforces bandwidth and capacity constraints - NetworkQueue network_; - size_t network_size_; - // The scheduled delivery time of the last packet sent on this socket. - // It is used to ensure ordered delivery of packets sent on this socket. - int64_t last_delivery_time_ = 0; - - // Data which has been received from the network - RecvBuffer recv_buffer_; - // The amount of data which is in flight or in recv_buffer_ - size_t recv_buffer_size_; - - // Is this socket bound? - bool bound_; - - // When we bind a socket to Any, VSS's Bind gives it another address. For - // dual-stack sockets, we want to distinguish between sockets that were - // explicitly given a particular address and sockets that had one picked - // for them by VSS. - bool was_any_; - - // Store the options that are set - OptionsMap options_map_; - - friend class VirtualSocketServer; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_VIRTUALSOCKETSERVER_H_ diff --git a/webrtc/rtc_base/weak_ptr.h b/webrtc/rtc_base/weak_ptr.h deleted file mode 100644 index 62c97d96ba..0000000000 --- a/webrtc/rtc_base/weak_ptr.h +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_WEAK_PTR_H_ -#define WEBRTC_RTC_BASE_WEAK_PTR_H_ - -#include - -#include - -#include "webrtc/base/refcount.h" -#include "webrtc/base/scoped_ref_ptr.h" -#include "webrtc/base/sequenced_task_checker.h" - -// The implementation is borrowed from chromium except that it does not -// implement SupportsWeakPtr. - -// Weak pointers are pointers to an object that do not affect its lifetime, -// and which may be invalidated (i.e. reset to nullptr) by the object, or its -// owner, at any time, most commonly when the object is about to be deleted. - -// Weak pointers are useful when an object needs to be accessed safely by one -// or more objects other than its owner, and those callers can cope with the -// object vanishing and e.g. tasks posted to it being silently dropped. -// Reference-counting such an object would complicate the ownership graph and -// make it harder to reason about the object's lifetime. - -// EXAMPLE: -// -// class Controller { -// public: -// Controller() : weak_factory_(this) {} -// void SpawnWorker() { Worker::StartNew(weak_factory_.GetWeakPtr()); } -// void WorkComplete(const Result& result) { ... } -// private: -// // Member variables should appear before the WeakPtrFactory, to ensure -// // that any WeakPtrs to Controller are invalidated before its members -// // variable's destructors are executed, rendering them invalid. -// WeakPtrFactory weak_factory_; -// }; -// -// class Worker { -// public: -// static void StartNew(const WeakPtr& controller) { -// Worker* worker = new Worker(controller); -// // Kick off asynchronous processing... -// } -// private: -// Worker(const WeakPtr& controller) -// : controller_(controller) {} -// void DidCompleteAsynchronousProcessing(const Result& result) { -// if (controller_) -// controller_->WorkComplete(result); -// } -// WeakPtr controller_; -// }; -// -// With this implementation a caller may use SpawnWorker() to dispatch multiple -// Workers and subsequently delete the Controller, without waiting for all -// Workers to have completed. - -// ------------------------- IMPORTANT: Thread-safety ------------------------- - -// Weak pointers may be passed safely between threads, but must always be -// dereferenced and invalidated on the same TaskQueue or thread, otherwise -// checking the pointer would be racey. -// -// To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory -// is dereferenced, the factory and its WeakPtrs become bound to the calling -// TaskQueue/thread, and cannot be dereferenced or -// invalidated on any other TaskQueue/thread. Bound WeakPtrs can still be handed -// off to other TaskQueues, e.g. to use to post tasks back to object on the -// bound sequence. -// -// Thus, at least one WeakPtr object must exist and have been dereferenced on -// the correct thread to enforce that other WeakPtr objects will enforce they -// are used on the desired thread. - -namespace rtc { - -namespace internal { - -class WeakReference { - public: - // Although Flag is bound to a specific sequence, it may be - // deleted from another via base::WeakPtr::~WeakPtr(). - class Flag : public RefCountInterface { - public: - Flag(); - - void Invalidate(); - bool IsValid() const; - - private: - friend class RefCountedObject; - - ~Flag() override; - - SequencedTaskChecker checker_; - bool is_valid_; - }; - - WeakReference(); - explicit WeakReference(const Flag* flag); - ~WeakReference(); - - WeakReference(WeakReference&& other); - WeakReference(const WeakReference& other); - WeakReference& operator=(WeakReference&& other) = default; - WeakReference& operator=(const WeakReference& other) = default; - - bool is_valid() const; - - private: - scoped_refptr flag_; -}; - -class WeakReferenceOwner { - public: - WeakReferenceOwner(); - ~WeakReferenceOwner(); - - WeakReference GetRef() const; - - bool HasRefs() const { return flag_.get() && !flag_->HasOneRef(); } - - void Invalidate(); - - private: - SequencedTaskChecker checker_; - mutable scoped_refptr> flag_; -}; - -// This class simplifies the implementation of WeakPtr's type conversion -// constructor by avoiding the need for a public accessor for ref_. A -// WeakPtr cannot access the private members of WeakPtr, so this -// base class gives us a way to access ref_ in a protected fashion. -class WeakPtrBase { - public: - WeakPtrBase(); - ~WeakPtrBase(); - - WeakPtrBase(const WeakPtrBase& other) = default; - WeakPtrBase(WeakPtrBase&& other) = default; - WeakPtrBase& operator=(const WeakPtrBase& other) = default; - WeakPtrBase& operator=(WeakPtrBase&& other) = default; - - protected: - explicit WeakPtrBase(const WeakReference& ref); - - WeakReference ref_; -}; - -} // namespace internal - -template -class WeakPtrFactory; - -template -class WeakPtr : public internal::WeakPtrBase { - public: - WeakPtr() : ptr_(nullptr) {} - - // Allow conversion from U to T provided U "is a" T. Note that this - // is separate from the (implicit) copy and move constructors. - template - WeakPtr(const WeakPtr& other) - : internal::WeakPtrBase(other), ptr_(other.ptr_) {} - template - WeakPtr(WeakPtr&& other) - : internal::WeakPtrBase(std::move(other)), ptr_(other.ptr_) {} - - T* get() const { return ref_.is_valid() ? ptr_ : nullptr; } - - T& operator*() const { - RTC_DCHECK(get() != nullptr); - return *get(); - } - T* operator->() const { - RTC_DCHECK(get() != nullptr); - return get(); - } - - void reset() { - ref_ = internal::WeakReference(); - ptr_ = nullptr; - } - - // Allow conditionals to test validity, e.g. if (weak_ptr) {...}; - explicit operator bool() const { return get() != nullptr; } - - private: - template - friend class WeakPtr; - friend class WeakPtrFactory; - - WeakPtr(const internal::WeakReference& ref, T* ptr) - : internal::WeakPtrBase(ref), ptr_(ptr) {} - - // This pointer is only valid when ref_.is_valid() is true. Otherwise, its - // value is undefined (as opposed to nullptr). - T* ptr_; -}; - -// Allow callers to compare WeakPtrs against nullptr to test validity. -template -bool operator!=(const WeakPtr& weak_ptr, std::nullptr_t) { - return !(weak_ptr == nullptr); -} -template -bool operator!=(std::nullptr_t, const WeakPtr& weak_ptr) { - return weak_ptr != nullptr; -} -template -bool operator==(const WeakPtr& weak_ptr, std::nullptr_t) { - return weak_ptr.get() == nullptr; -} -template -bool operator==(std::nullptr_t, const WeakPtr& weak_ptr) { - return weak_ptr == nullptr; -} - -// A class may be composed of a WeakPtrFactory and thereby -// control how it exposes weak pointers to itself. This is helpful if you only -// need weak pointers within the implementation of a class. This class is also -// useful when working with primitive types. For example, you could have a -// WeakPtrFactory that is used to pass around a weak reference to a bool. - -// Note that GetWeakPtr must be called on one and only one TaskQueue or thread -// and the WeakPtr must only be dereferenced and invalidated on that same -// TaskQueue/thread. A WeakPtr instance can be copied and posted to other -// sequences though as long as it is not dereferenced (WeakPtr::get()). -template -class WeakPtrFactory { - public: - explicit WeakPtrFactory(T* ptr) : ptr_(ptr) {} - - ~WeakPtrFactory() { ptr_ = nullptr; } - - WeakPtr GetWeakPtr() { - RTC_DCHECK(ptr_); - return WeakPtr(weak_reference_owner_.GetRef(), ptr_); - } - - // Call this method to invalidate all existing weak pointers. - void InvalidateWeakPtrs() { - RTC_DCHECK(ptr_); - weak_reference_owner_.Invalidate(); - } - - // Call this method to determine if any weak pointers exist. - bool HasWeakPtrs() const { - RTC_DCHECK(ptr_); - return weak_reference_owner_.HasRefs(); - } - - private: - internal::WeakReferenceOwner weak_reference_owner_; - T* ptr_; - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WeakPtrFactory); -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_WEAK_PTR_H_ diff --git a/webrtc/rtc_base/win32.h b/webrtc/rtc_base/win32.h deleted file mode 100644 index b4c7646f0f..0000000000 --- a/webrtc/rtc_base/win32.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_WIN32_H_ -#define WEBRTC_RTC_BASE_WIN32_H_ - -#if defined(WEBRTC_WIN) - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -// Make sure we don't get min/max macros -#ifndef NOMINMAX -#define NOMINMAX -#endif - -#include -#include - -#ifndef SECURITY_MANDATORY_LABEL_AUTHORITY -// Add defines that we use if we are compiling against older sdks -#define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L) -#define TokenIntegrityLevel static_cast(0x19) -typedef struct _TOKEN_MANDATORY_LABEL { - SID_AND_ATTRIBUTES Label; -} TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL; -#endif // SECURITY_MANDATORY_LABEL_AUTHORITY - -#undef SetPort - -#include - -#include "webrtc/base/stringutils.h" -#include "webrtc/base/basictypes.h" - -namespace rtc { - -const char* win32_inet_ntop(int af, const void *src, char* dst, socklen_t size); -int win32_inet_pton(int af, const char* src, void *dst); - -inline std::wstring ToUtf16(const char* utf8, size_t len) { - int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast(len), - nullptr, 0); - wchar_t* ws = STACK_ARRAY(wchar_t, len16); - ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast(len), ws, len16); - return std::wstring(ws, len16); -} - -inline std::wstring ToUtf16(const std::string& str) { - return ToUtf16(str.data(), str.length()); -} - -inline std::string ToUtf8(const wchar_t* wide, size_t len) { - int len8 = ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast(len), - nullptr, 0, nullptr, nullptr); - char* ns = STACK_ARRAY(char, len8); - ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast(len), ns, len8, - nullptr, nullptr); - return std::string(ns, len8); -} - -inline std::string ToUtf8(const wchar_t* wide) { - return ToUtf8(wide, wcslen(wide)); -} - -inline std::string ToUtf8(const std::wstring& wstr) { - return ToUtf8(wstr.data(), wstr.length()); -} - -// Convert FILETIME to time_t -void FileTimeToUnixTime(const FILETIME& ft, time_t* ut); - -// Convert time_t to FILETIME -void UnixTimeToFileTime(const time_t& ut, FILETIME * ft); - -// Convert a Utf8 path representation to a non-length-limited Unicode pathname. -bool Utf8ToWindowsFilename(const std::string& utf8, std::wstring* filename); - -// Convert a FILETIME to a UInt64 -inline uint64_t ToUInt64(const FILETIME& ft) { - ULARGE_INTEGER r = {{ft.dwLowDateTime, ft.dwHighDateTime}}; - return r.QuadPart; -} - -enum WindowsMajorVersions { - kWindows2000 = 5, - kWindowsVista = 6, -}; -bool GetOsVersion(int* major, int* minor, int* build); - -inline bool IsWindowsVistaOrLater() { - int major; - return (GetOsVersion(&major, nullptr, nullptr) && major >= kWindowsVista); -} - -inline bool IsWindowsXpOrLater() { - int major, minor; - return (GetOsVersion(&major, &minor, nullptr) && - (major >= kWindowsVista || (major == kWindows2000 && minor >= 1))); -} - -inline bool IsWindows8OrLater() { - int major, minor; - return (GetOsVersion(&major, &minor, nullptr) && - (major > kWindowsVista || (major == kWindowsVista && minor >= 2))); -} - -// Determine the current integrity level of the process. -bool GetCurrentProcessIntegrityLevel(int* level); - -inline bool IsCurrentProcessLowIntegrity() { - int level; - return (GetCurrentProcessIntegrityLevel(&level) && - level < SECURITY_MANDATORY_MEDIUM_RID); -} - -} // namespace rtc - -#endif // WEBRTC_WIN -#endif // WEBRTC_RTC_BASE_WIN32_H_ diff --git a/webrtc/rtc_base/win32filesystem.h b/webrtc/rtc_base/win32filesystem.h deleted file mode 100644 index f7a6ab4c84..0000000000 --- a/webrtc/rtc_base/win32filesystem.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_WIN32FILESYSTEM_H_ -#define WEBRTC_RTC_BASE_WIN32FILESYSTEM_H_ - -#include "fileutils.h" - -namespace rtc { - -class Win32Filesystem : public FilesystemInterface { - public: - // This will attempt to delete the path located at filename. - // If the path points to a folder, it will fail with VERIFY - bool DeleteFile(const Pathname& filename) override; - - // Creates a directory. This will call itself recursively to create /foo/bar even if - // /foo does not exist. - // Returns TRUE if function succeeds - bool CreateFolder(const Pathname& pathname) override; - - // This moves a file from old_path to new_path. If the new path is on a - // different volume than the old, it will attempt to copy and then delete - // the folder - // Returns true if the file is successfully moved - bool MoveFile(const Pathname& old_path, const Pathname& new_path) override; - - // Returns true if a pathname is a directory - bool IsFolder(const Pathname& pathname) override; - - // Returns true if a file exists at path - bool IsFile(const Pathname& path) override; - - // Returns true if pathname refers to no filesystem object, every parent - // directory either exists, or is also absent. - bool IsAbsent(const Pathname& pathname) override; - - // All of the following functions set pathname and return true if successful. - // Returned paths always include a trailing backslash. - // If create is true, the path will be recursively created. - // If append is non-null, it will be appended (and possibly created). - - std::string TempFilename(const Pathname& dir, - const std::string& prefix) override; - - bool GetFileSize(const Pathname& path, size_t* size) override; - - // A folder appropriate for storing temporary files (Contents are - // automatically deleted when the program exists) - bool GetTemporaryFolder(Pathname& path, - bool create, - const std::string* append) override; -}; - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_WIN32FILESYSTEM_H_ diff --git a/webrtc/rtc_base/win32socketinit.h b/webrtc/rtc_base/win32socketinit.h deleted file mode 100644 index 6acac9f956..0000000000 --- a/webrtc/rtc_base/win32socketinit.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2009 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_WIN32SOCKETINIT_H_ -#define WEBRTC_RTC_BASE_WIN32SOCKETINIT_H_ - -namespace rtc { - -void EnsureWinsockInit(); - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_WIN32SOCKETINIT_H_ diff --git a/webrtc/rtc_base/win32socketserver.h b/webrtc/rtc_base/win32socketserver.h deleted file mode 100644 index adb621c7a3..0000000000 --- a/webrtc/rtc_base/win32socketserver.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_WIN32SOCKETSERVER_H_ -#define WEBRTC_RTC_BASE_WIN32SOCKETSERVER_H_ - -#if defined(WEBRTC_WIN) -#include "webrtc/base/asyncsocket.h" -#include "webrtc/base/criticalsection.h" -#include "webrtc/base/messagequeue.h" -#include "webrtc/base/socketserver.h" -#include "webrtc/base/socketfactory.h" -#include "webrtc/base/socket.h" -#include "webrtc/base/thread.h" -#include "webrtc/base/win32window.h" - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// -// Win32Socket -/////////////////////////////////////////////////////////////////////////////// - -class Win32Socket : public AsyncSocket { - public: - Win32Socket(); - virtual ~Win32Socket(); - - bool CreateT(int family, int type); - - int Attach(SOCKET s); - void SetTimeout(int ms); - - // AsyncSocket Interface - virtual SocketAddress GetLocalAddress() const; - virtual SocketAddress GetRemoteAddress() const; - virtual int Bind(const SocketAddress& addr); - virtual int Connect(const SocketAddress& addr); - virtual int Send(const void *buffer, size_t length); - virtual int SendTo(const void *buffer, size_t length, const SocketAddress& addr); - virtual int Recv(void* buffer, size_t length, int64_t* timestamp); - virtual int RecvFrom(void* buffer, - size_t length, - SocketAddress* out_addr, - int64_t* timestamp); - virtual int Listen(int backlog); - virtual Win32Socket *Accept(SocketAddress *out_addr); - virtual int Close(); - virtual int GetError() const; - virtual void SetError(int error); - virtual ConnState GetState() const; - virtual int GetOption(Option opt, int* value); - virtual int SetOption(Option opt, int value); - - private: - void CreateSink(); - bool SetAsync(int events); - int DoConnect(const SocketAddress& addr); - bool HandleClosed(int close_error); - void PostClosed(); - void UpdateLastError(); - static int TranslateOption(Option opt, int* slevel, int* sopt); - - void OnSocketNotify(SOCKET socket, int event, int error); - void OnDnsNotify(HANDLE task, int error); - - SOCKET socket_; - int error_; - ConnState state_; - SocketAddress addr_; // address that we connected to (see DoConnect) - uint32_t connect_time_; - bool closing_; - int close_error_; - - class EventSink; - friend class EventSink; - EventSink * sink_; - - struct DnsLookup; - DnsLookup * dns_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// Win32SocketServer -/////////////////////////////////////////////////////////////////////////////// - -class Win32SocketServer : public SocketServer { - public: - Win32SocketServer(); - virtual ~Win32SocketServer(); - - void set_modeless_dialog(HWND hdlg) { - hdlg_ = hdlg; - } - - // SocketServer Interface - virtual Socket* CreateSocket(int type); - virtual Socket* CreateSocket(int family, int type); - - virtual AsyncSocket* CreateAsyncSocket(int type); - virtual AsyncSocket* CreateAsyncSocket(int family, int type); - - virtual void SetMessageQueue(MessageQueue* queue); - virtual bool Wait(int cms, bool process_io); - virtual void WakeUp(); - - void Pump(); - - HWND handle() { return wnd_.handle(); } - - private: - class MessageWindow : public Win32Window { - public: - explicit MessageWindow(Win32SocketServer* ss) : ss_(ss) {} - private: - virtual bool OnMessage(UINT msg, WPARAM wp, LPARAM lp, LRESULT& result); - Win32SocketServer* ss_; - }; - - static const TCHAR kWindowName[]; - MessageQueue *message_queue_; - MessageWindow wnd_; - CriticalSection cs_; - bool posted_; - HWND hdlg_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// Win32Thread. Automatically pumps Windows messages. -/////////////////////////////////////////////////////////////////////////////// - -class Win32Thread : public Thread { - public: - explicit Win32Thread(SocketServer* ss) : Thread(ss), id_(0) {} - virtual ~Win32Thread() { - Stop(); - } - virtual void Run() { - id_ = GetCurrentThreadId(); - Thread::Run(); - id_ = 0; - } - virtual void Quit() { - PostThreadMessage(id_, WM_QUIT, 0, 0); - } - private: - DWORD id_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_WIN - -#endif // WEBRTC_RTC_BASE_WIN32SOCKETSERVER_H_ diff --git a/webrtc/rtc_base/win32window.h b/webrtc/rtc_base/win32window.h deleted file mode 100644 index 2243a52e0b..0000000000 --- a/webrtc/rtc_base/win32window.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_WIN32WINDOW_H_ -#define WEBRTC_RTC_BASE_WIN32WINDOW_H_ - -#if defined(WEBRTC_WIN) - -#include "webrtc/base/win32.h" - -namespace rtc { - -/////////////////////////////////////////////////////////////////////////////// -// Win32Window -/////////////////////////////////////////////////////////////////////////////// - -class Win32Window { - public: - Win32Window(); - virtual ~Win32Window(); - - HWND handle() const { return wnd_; } - - bool Create(HWND parent, const wchar_t* title, DWORD style, DWORD exstyle, - int x, int y, int cx, int cy); - void Destroy(); - - // Call this when your DLL unloads. - static void Shutdown(); - - protected: - virtual bool OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, - LRESULT& result); - - virtual bool OnClose() { return true; } - virtual void OnNcDestroy() { } - - private: - static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, - LPARAM lParam); - - HWND wnd_; - static HINSTANCE instance_; - static ATOM window_class_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace rtc - -#endif // WEBRTC_WIN - -#endif // WEBRTC_RTC_BASE_WIN32WINDOW_H_ diff --git a/webrtc/rtc_base/window.h b/webrtc/rtc_base/window.h deleted file mode 100644 index 2eed4beafd..0000000000 --- a/webrtc/rtc_base/window.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_RTC_BASE_WINDOW_H_ -#define WEBRTC_RTC_BASE_WINDOW_H_ - -#include - -#include "webrtc/base/stringencode.h" - -// Define platform specific window types. -#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) -typedef unsigned long Window; // Avoid include . -#elif defined(WEBRTC_WIN) -// We commonly include win32.h in webrtc/base so just include it here. -#include "webrtc/base/win32.h" // Include HWND, HMONITOR. -#elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) -typedef unsigned int CGWindowID; -typedef unsigned int CGDirectDisplayID; -#endif - -namespace rtc { - -class WindowId { - public: - // Define WindowT for each platform. -#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) - typedef Window WindowT; -#elif defined(WEBRTC_WIN) - typedef HWND WindowT; -#elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) - typedef CGWindowID WindowT; -#else - typedef unsigned int WindowT; -#endif - - static WindowId Cast(uint64_t id) { -#if defined(WEBRTC_WIN) - return WindowId(reinterpret_cast(id)); -#else - return WindowId(static_cast(id)); -#endif - } - - static uint64_t Format(const WindowT& id) { -#if defined(WEBRTC_WIN) - return static_cast(reinterpret_cast(id)); -#else - return static_cast(id); -#endif - } - - WindowId() : id_(0) {} - WindowId(const WindowT& id) : id_(id) {} // NOLINT - const WindowT& id() const { return id_; } - bool IsValid() const { return id_ != 0; } - bool Equals(const WindowId& other) const { - return id_ == other.id(); - } - - private: - WindowT id_; -}; - -inline std::string ToString(const WindowId& window) { - return ToString(window.id()); -} - -} // namespace rtc - -#endif // WEBRTC_RTC_BASE_WINDOW_H_ diff --git a/webrtc/sdk/android/BUILD.gn b/webrtc/sdk/android/BUILD.gn index a2c0dd4b03..a030dfd39c 100644 --- a/webrtc/sdk/android/BUILD.gn +++ b/webrtc/sdk/android/BUILD.gn @@ -325,7 +325,7 @@ dist_jar("libwebrtc") { deps = [ ":libjingle_peerconnection_java", ":libjingle_peerconnection_metrics_default_java", - "//webrtc/rtc_base:base_java", + "//webrtc/base:base_java", "//webrtc/modules/audio_device:audio_device_java", ] } @@ -414,7 +414,7 @@ android_library("libjingle_peerconnection_java") { ] deps = [ - "//webrtc/rtc_base:base_java", + "//webrtc/base:base_java", "//webrtc/modules/audio_device:audio_device_java", ] } @@ -423,7 +423,7 @@ android_library("libjingle_peerconnection_metrics_default_java") { java_files = [ "api/org/webrtc/Metrics.java" ] deps = [ - "//webrtc/rtc_base:base_java", + "//webrtc/base:base_java", ] } @@ -462,7 +462,7 @@ if (rtc_include_tests) { "//third_party/android_support_test_runner:rules_java", "//third_party/android_support_test_runner:runner_java", "//third_party/junit", - "//webrtc/rtc_base:base_java", + "//webrtc/base:base_java", "//webrtc/sdk/android:libjingle_peerconnection_java", "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java", ] diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn index f54a62252d..0f8914fa87 100644 --- a/webrtc/test/BUILD.gn +++ b/webrtc/test/BUILD.gn @@ -607,7 +607,7 @@ if (!build_with_chromium && is_android) { ] deps = [ "//testing/android/native_test:native_test_java", - "//webrtc/rtc_base:base_java", + "//webrtc/base:base_java", ] } } diff --git a/webrtc/tools/network_tester/BUILD.gn b/webrtc/tools/network_tester/BUILD.gn index 21b1cec995..dc2ce71fdc 100644 --- a/webrtc/tools/network_tester/BUILD.gn +++ b/webrtc/tools/network_tester/BUILD.gn @@ -131,7 +131,7 @@ if (is_android) { ":NetworkTesterMobile_javalib", ":NetworkTesterMobile_resources", "//base:base_java", - "//webrtc/rtc_base:base_java", + "//webrtc/base:base_java", ] shared_libraries = [ "//webrtc/tools/network_tester:network_tester_so" ] @@ -148,7 +148,7 @@ if (is_android) { deps = [ ":NetworkTesterMobile_resources", - "//webrtc/rtc_base:base_java", + "//webrtc/base:base_java", ] }