From d316cd7ebd0d29d636c755d4e10721e2891b6431 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Sun, 5 Feb 2017 13:38:35 +0300 Subject: [PATCH] Initial commit --- .gitattributes | 4 + .gitignore | 50 + Cartfile | 1 + Cartfile.resolved | 1 + OpenVPN Client/AppDelegate.swift | 46 + .../AppIcon.appiconset/Contents.json | 93 + .../Base.lproj/LaunchScreen.storyboard | 27 + OpenVPN Client/Base.lproj/Main.storyboard | 29 + OpenVPN Client/Info.plist | 46 + OpenVPN Tunnel Provider/Bridging-Header.h | 4 + OpenVPN Tunnel Provider/Info.plist | 31 + .../OpenVPN Tunnel Provider.entitlements | 10 + .../PacketTunnelProvider.swift | 21 + .../Vendors/asio/.gitignore | 2 + .../Vendors/asio/Makefile.am | 465 + OpenVPN Tunnel Provider/Vendors/asio/asio.hpp | 146 + .../asio/asio/associated_allocator.hpp | 123 + .../Vendors/asio/asio/associated_executor.hpp | 142 + .../Vendors/asio/asio/async_result.hpp | 125 + .../asio/asio/basic_datagram_socket.hpp | 1037 +++ .../asio/asio/basic_deadline_timer.hpp | 592 ++ .../Vendors/asio/asio/basic_io_object.hpp | 274 + .../Vendors/asio/asio/basic_raw_socket.hpp | 1027 +++ .../asio/asio/basic_seq_packet_socket.hpp | 615 ++ .../Vendors/asio/asio/basic_serial_port.hpp | 683 ++ .../Vendors/asio/asio/basic_signal_set.hpp | 390 + .../Vendors/asio/asio/basic_socket.hpp | 1690 ++++ .../asio/asio/basic_socket_acceptor.hpp | 1921 ++++ .../asio/asio/basic_socket_iostream.hpp | 325 + .../asio/asio/basic_socket_streambuf.hpp | 624 ++ .../Vendors/asio/asio/basic_stream_socket.hpp | 918 ++ .../Vendors/asio/asio/basic_streambuf.hpp | 453 + .../Vendors/asio/asio/basic_streambuf_fwd.hpp | 36 + .../asio/asio/basic_waitable_timer.hpp | 694 ++ .../Vendors/asio/asio/bind_executor.hpp | 578 ++ .../Vendors/asio/asio/buffer.hpp | 2725 ++++++ .../asio/asio/buffered_read_stream.hpp | 262 + .../asio/asio/buffered_read_stream_fwd.hpp | 25 + .../Vendors/asio/asio/buffered_stream.hpp | 277 + .../Vendors/asio/asio/buffered_stream_fwd.hpp | 25 + .../asio/asio/buffered_write_stream.hpp | 254 + .../asio/asio/buffered_write_stream_fwd.hpp | 25 + .../Vendors/asio/asio/buffers_iterator.hpp | 481 + .../asio/asio/completion_condition.hpp | 218 + .../Vendors/asio/asio/connect.hpp | 1059 +++ .../Vendors/asio/asio/coroutine.hpp | 328 + .../asio/asio/datagram_socket_service.hpp | 443 + .../Vendors/asio/asio/deadline_timer.hpp | 38 + .../asio/asio/deadline_timer_service.hpp | 173 + .../Vendors/asio/asio/defer.hpp | 107 + .../Vendors/asio/asio/detail/array.hpp | 38 + .../Vendors/asio/asio/detail/array_fwd.hpp | 34 + .../Vendors/asio/asio/detail/assert.hpp | 32 + .../Vendors/asio/asio/detail/atomic_count.hpp | 45 + .../asio/detail/base_from_completion_cond.hpp | 68 + .../Vendors/asio/asio/detail/bind_handler.hpp | 459 + .../asio/asio/detail/buffer_resize_guard.hpp | 66 + .../asio/detail/buffer_sequence_adapter.hpp | 378 + .../asio/detail/buffered_stream_storage.hpp | 126 + .../Vendors/asio/asio/detail/call_stack.hpp | 125 + .../Vendors/asio/asio/detail/chrono.hpp | 66 + .../asio/asio/detail/chrono_time_traits.hpp | 190 + .../asio/asio/detail/completion_handler.hpp | 83 + .../Vendors/asio/asio/detail/config.hpp | 1183 +++ .../asio/asio/detail/consuming_buffers.hpp | 291 + .../Vendors/asio/asio/detail/cstddef.hpp | 31 + .../Vendors/asio/asio/detail/cstdint.hpp | 60 + .../asio/asio/detail/date_time_fwd.hpp | 34 + .../asio/detail/deadline_timer_service.hpp | 278 + .../asio/asio/detail/dependent_type.hpp | 36 + .../asio/asio/detail/descriptor_ops.hpp | 121 + .../asio/asio/detail/descriptor_read_op.hpp | 127 + .../asio/asio/detail/descriptor_write_op.hpp | 127 + .../asio/asio/detail/dev_poll_reactor.hpp | 212 + .../asio/asio/detail/epoll_reactor.hpp | 248 + .../Vendors/asio/asio/detail/event.hpp | 48 + .../detail/eventfd_select_interrupter.hpp | 83 + .../Vendors/asio/asio/detail/executor_op.hpp | 82 + .../asio/asio/detail/fd_set_adapter.hpp | 39 + .../Vendors/asio/asio/detail/fenced_block.hpp | 76 + .../Vendors/asio/asio/detail/functional.hpp | 38 + .../asio/asio/detail/gcc_arm_fenced_block.hpp | 91 + .../asio/detail/gcc_hppa_fenced_block.hpp | 68 + .../asio/detail/gcc_sync_fenced_block.hpp | 65 + .../asio/asio/detail/gcc_x86_fenced_block.hpp | 99 + .../Vendors/asio/asio/detail/global.hpp | 52 + .../asio/detail/handler_alloc_helpers.hpp | 189 + .../asio/asio/detail/handler_cont_helpers.hpp | 45 + .../asio/detail/handler_invoke_helpers.hpp | 57 + .../asio/asio/detail/handler_tracking.hpp | 238 + .../asio/detail/handler_type_requirements.hpp | 564 ++ .../Vendors/asio/asio/detail/handler_work.hpp | 95 + .../Vendors/asio/asio/detail/hash_map.hpp | 331 + .../detail/impl/buffer_sequence_adapter.ipp | 118 + .../asio/asio/detail/impl/descriptor_ops.ipp | 474 + .../asio/detail/impl/dev_poll_reactor.hpp | 91 + .../asio/detail/impl/dev_poll_reactor.ipp | 430 + .../asio/asio/detail/impl/epoll_reactor.hpp | 89 + .../asio/asio/detail/impl/epoll_reactor.ipp | 707 ++ .../impl/eventfd_select_interrupter.ipp | 165 + .../asio/detail/impl/handler_tracking.ipp | 358 + .../asio/asio/detail/impl/kqueue_reactor.hpp | 93 + .../asio/asio/detail/impl/kqueue_reactor.ipp | 539 ++ .../detail/impl/pipe_select_interrupter.ipp | 124 + .../asio/asio/detail/impl/posix_event.ipp | 47 + .../asio/asio/detail/impl/posix_mutex.ipp | 46 + .../asio/asio/detail/impl/posix_thread.ipp | 84 + .../asio/asio/detail/impl/posix_tss_ptr.ipp | 46 + .../impl/reactive_descriptor_service.ipp | 213 + .../impl/reactive_serial_port_service.ipp | 152 + .../impl/reactive_socket_service_base.ipp | 271 + .../detail/impl/resolver_service_base.ipp | 132 + .../asio/asio/detail/impl/scheduler.ipp | 476 + .../asio/asio/detail/impl/select_reactor.hpp | 100 + .../asio/asio/detail/impl/select_reactor.ipp | 326 + .../asio/detail/impl/service_registry.hpp | 78 + .../asio/detail/impl/service_registry.ipp | 197 + .../asio/detail/impl/signal_set_service.ipp | 649 ++ .../asio/asio/detail/impl/socket_ops.ipp | 3478 ++++++++ .../detail/impl/socket_select_interrupter.ipp | 175 + .../detail/impl/strand_executor_service.hpp | 197 + .../detail/impl/strand_executor_service.ipp | 124 + .../asio/asio/detail/impl/strand_service.hpp | 118 + .../asio/asio/detail/impl/strand_service.ipp | 177 + .../asio/asio/detail/impl/throw_error.ipp | 60 + .../asio/detail/impl/timer_queue_ptime.ipp | 84 + .../asio/asio/detail/impl/timer_queue_set.ipp | 101 + .../asio/asio/detail/impl/win_event.ipp | 75 + .../detail/impl/win_iocp_handle_service.ipp | 525 ++ .../asio/detail/impl/win_iocp_io_context.hpp | 103 + .../asio/detail/impl/win_iocp_io_context.ipp | 536 ++ .../impl/win_iocp_serial_port_service.ipp | 181 + .../impl/win_iocp_socket_service_base.ipp | 737 ++ .../asio/asio/detail/impl/win_mutex.ipp | 82 + .../detail/impl/win_object_handle_service.ipp | 449 + .../asio/detail/impl/win_static_mutex.ipp | 130 + .../asio/asio/detail/impl/win_thread.ipp | 150 + .../asio/asio/detail/impl/win_tss_ptr.ipp | 57 + .../impl/winrt_ssocket_service_base.ipp | 612 ++ .../detail/impl/winrt_timer_scheduler.hpp | 92 + .../detail/impl/winrt_timer_scheduler.ipp | 122 + .../asio/asio/detail/impl/winsock_init.ipp | 82 + .../Vendors/asio/asio/detail/io_control.hpp | 84 + .../asio/asio/detail/is_buffer_sequence.hpp | 199 + .../asio/asio/detail/keyword_tss_ptr.hpp | 70 + .../asio/asio/detail/kqueue_reactor.hpp | 228 + .../Vendors/asio/asio/detail/limits.hpp | 26 + .../asio/detail/local_free_on_block_exit.hpp | 59 + .../asio/asio/detail/macos_fenced_block.hpp | 62 + .../Vendors/asio/asio/detail/memory.hpp | 64 + .../Vendors/asio/asio/detail/mutex.hpp | 48 + .../Vendors/asio/asio/detail/noncopyable.hpp | 43 + .../Vendors/asio/asio/detail/null_event.hpp | 88 + .../asio/asio/detail/null_fenced_block.hpp | 47 + .../Vendors/asio/asio/detail/null_global.hpp | 59 + .../Vendors/asio/asio/detail/null_mutex.hpp | 64 + .../Vendors/asio/asio/detail/null_reactor.hpp | 68 + .../asio/asio/detail/null_signal_blocker.hpp | 69 + .../asio/asio/detail/null_socket_service.hpp | 499 ++ .../asio/asio/detail/null_static_mutex.hpp | 60 + .../Vendors/asio/asio/detail/null_thread.hpp | 67 + .../Vendors/asio/asio/detail/null_tss_ptr.hpp | 68 + .../Vendors/asio/asio/detail/object_pool.hpp | 146 + .../asio/asio/detail/old_win_sdk_compat.hpp | 214 + .../Vendors/asio/asio/detail/op_queue.hpp | 156 + .../Vendors/asio/asio/detail/operation.hpp | 38 + .../asio/detail/pipe_select_interrupter.hpp | 89 + .../Vendors/asio/asio/detail/pop_options.hpp | 131 + .../Vendors/asio/asio/detail/posix_event.hpp | 126 + .../asio/asio/detail/posix_fd_set_adapter.hpp | 118 + .../Vendors/asio/asio/detail/posix_global.hpp | 80 + .../Vendors/asio/asio/detail/posix_mutex.hpp | 76 + .../asio/asio/detail/posix_signal_blocker.hpp | 85 + .../asio/asio/detail/posix_static_mutex.hpp | 64 + .../Vendors/asio/asio/detail/posix_thread.hpp | 109 + .../asio/asio/detail/posix_tss_ptr.hpp | 79 + .../Vendors/asio/asio/detail/push_options.hpp | 170 + .../detail/reactive_descriptor_service.hpp | 388 + .../asio/detail/reactive_null_buffers_op.hpp | 90 + .../detail/reactive_serial_port_service.hpp | 235 + .../asio/detail/reactive_socket_accept_op.hpp | 203 + .../detail/reactive_socket_connect_op.hpp | 112 + .../asio/detail/reactive_socket_recv_op.hpp | 130 + .../detail/reactive_socket_recvfrom_op.hpp | 138 + .../detail/reactive_socket_recvmsg_op.hpp | 132 + .../asio/detail/reactive_socket_send_op.hpp | 127 + .../asio/detail/reactive_socket_sendto_op.hpp | 130 + .../asio/detail/reactive_socket_service.hpp | 523 ++ .../detail/reactive_socket_service_base.hpp | 507 ++ .../asio/asio/detail/reactive_wait_op.hpp | 90 + .../Vendors/asio/asio/detail/reactor.hpp | 32 + .../Vendors/asio/asio/detail/reactor_fwd.hpp | 40 + .../Vendors/asio/asio/detail/reactor_op.hpp | 61 + .../asio/asio/detail/reactor_op_queue.hpp | 168 + .../asio/asio/detail/recycling_allocator.hpp | 100 + .../Vendors/asio/asio/detail/regex_fwd.hpp | 35 + .../asio/asio/detail/resolve_endpoint_op.hpp | 123 + .../Vendors/asio/asio/detail/resolve_op.hpp | 133 + .../asio/asio/detail/resolver_service.hpp | 144 + .../asio/detail/resolver_service_base.hpp | 129 + .../Vendors/asio/asio/detail/scheduler.hpp | 190 + .../asio/asio/detail/scheduler_operation.hpp | 78 + .../asio/detail/scheduler_thread_info.hpp | 40 + .../Vendors/asio/asio/detail/scoped_lock.hpp | 101 + .../Vendors/asio/asio/detail/scoped_ptr.hpp | 87 + .../asio/asio/detail/select_interrupter.hpp | 46 + .../asio/asio/detail/select_reactor.hpp | 231 + .../asio/asio/detail/service_registry.hpp | 151 + .../asio/asio/detail/signal_blocker.hpp | 44 + .../asio/asio/detail/signal_handler.hpp | 86 + .../Vendors/asio/asio/detail/signal_init.hpp | 47 + .../Vendors/asio/asio/detail/signal_op.hpp | 49 + .../asio/asio/detail/signal_set_service.hpp | 217 + .../asio/asio/detail/socket_holder.hpp | 98 + .../Vendors/asio/asio/detail/socket_ops.hpp | 336 + .../asio/asio/detail/socket_option.hpp | 316 + .../asio/detail/socket_select_interrupter.hpp | 91 + .../Vendors/asio/asio/detail/socket_types.hpp | 408 + .../asio/asio/detail/solaris_fenced_block.hpp | 62 + .../Vendors/asio/asio/detail/static_mutex.hpp | 52 + .../Vendors/asio/asio/detail/std_event.hpp | 176 + .../Vendors/asio/asio/detail/std_global.hpp | 70 + .../Vendors/asio/asio/detail/std_mutex.hpp | 73 + .../asio/asio/detail/std_static_mutex.hpp | 81 + .../Vendors/asio/asio/detail/std_thread.hpp | 71 + .../asio/detail/strand_executor_service.hpp | 138 + .../asio/asio/detail/strand_service.hpp | 142 + .../Vendors/asio/asio/detail/thread.hpp | 60 + .../asio/asio/detail/thread_context.hpp | 42 + .../Vendors/asio/asio/detail/thread_group.hpp | 89 + .../asio/asio/detail/thread_info_base.hpp | 91 + .../Vendors/asio/asio/detail/throw_error.hpp | 53 + .../asio/asio/detail/throw_exception.hpp | 51 + .../Vendors/asio/asio/detail/timer_queue.hpp | 358 + .../asio/asio/detail/timer_queue_base.hpp | 68 + .../asio/asio/detail/timer_queue_ptime.hpp | 93 + .../asio/asio/detail/timer_queue_set.hpp | 66 + .../asio/asio/detail/timer_scheduler.hpp | 35 + .../asio/asio/detail/timer_scheduler_fwd.hpp | 40 + .../Vendors/asio/asio/detail/tss_ptr.hpp | 69 + .../Vendors/asio/asio/detail/type_traits.hpp | 77 + .../asio/asio/detail/variadic_templates.hpp | 101 + .../Vendors/asio/asio/detail/wait_handler.hpp | 85 + .../Vendors/asio/asio/detail/wait_op.hpp | 45 + .../Vendors/asio/asio/detail/win_event.hpp | 130 + .../asio/asio/detail/win_fd_set_adapter.hpp | 149 + .../asio/asio/detail/win_fenced_block.hpp | 90 + .../Vendors/asio/asio/detail/win_global.hpp | 73 + .../asio/detail/win_iocp_handle_read_op.hpp | 111 + .../asio/detail/win_iocp_handle_service.hpp | 323 + .../asio/detail/win_iocp_handle_write_op.hpp | 103 + .../asio/asio/detail/win_iocp_io_context.hpp | 316 + .../asio/detail/win_iocp_null_buffers_op.hpp | 121 + .../asio/asio/detail/win_iocp_operation.hpp | 96 + .../asio/detail/win_iocp_overlapped_op.hpp | 90 + .../asio/detail/win_iocp_overlapped_ptr.hpp | 143 + .../detail/win_iocp_serial_port_service.hpp | 229 + .../asio/detail/win_iocp_socket_accept_op.hpp | 297 + .../detail/win_iocp_socket_connect_op.hpp | 126 + .../asio/detail/win_iocp_socket_recv_op.hpp | 117 + .../detail/win_iocp_socket_recvfrom_op.hpp | 125 + .../detail/win_iocp_socket_recvmsg_op.hpp | 118 + .../asio/detail/win_iocp_socket_send_op.hpp | 111 + .../asio/detail/win_iocp_socket_service.hpp | 596 ++ .../detail/win_iocp_socket_service_base.hpp | 575 ++ .../asio/asio/detail/win_iocp_thread_info.hpp | 34 + .../asio/asio/detail/win_iocp_wait_op.hpp | 121 + .../Vendors/asio/asio/detail/win_mutex.hpp | 78 + .../asio/detail/win_object_handle_service.hpp | 184 + .../asio/asio/detail/win_static_mutex.hpp | 74 + .../Vendors/asio/asio/detail/win_thread.hpp | 147 + .../Vendors/asio/asio/detail/win_tss_ptr.hpp | 79 + .../asio/asio/detail/winapp_thread.hpp | 124 + .../Vendors/asio/asio/detail/wince_thread.hpp | 124 + .../asio/asio/detail/winrt_async_manager.hpp | 294 + .../asio/asio/detail/winrt_async_op.hpp | 65 + .../asio/asio/detail/winrt_resolve_op.hpp | 118 + .../asio/detail/winrt_resolver_service.hpp | 186 + .../asio/detail/winrt_socket_connect_op.hpp | 92 + .../asio/asio/detail/winrt_socket_recv_op.hpp | 112 + .../asio/asio/detail/winrt_socket_send_op.hpp | 103 + .../asio/detail/winrt_ssocket_service.hpp | 240 + .../detail/winrt_ssocket_service_base.hpp | 355 + .../asio/detail/winrt_timer_scheduler.hpp | 137 + .../Vendors/asio/asio/detail/winrt_utils.hpp | 105 + .../Vendors/asio/asio/detail/winsock_init.hpp | 128 + .../asio/asio/detail/work_dispatcher.hpp | 72 + .../asio/asio/detail/wrapped_handler.hpp | 291 + .../Vendors/asio/asio/dispatch.hpp | 108 + .../Vendors/asio/asio/error.hpp | 352 + .../Vendors/asio/asio/error_code.hpp | 188 + .../Vendors/asio/asio/execution_context.hpp | 411 + .../Vendors/asio/asio/executor.hpp | 346 + .../Vendors/asio/asio/executor_work_guard.hpp | 168 + .../asio/asio/generic/basic_endpoint.hpp | 193 + .../asio/asio/generic/datagram_protocol.hpp | 123 + .../asio/asio/generic/detail/endpoint.hpp | 133 + .../asio/generic/detail/impl/endpoint.ipp | 109 + .../asio/asio/generic/raw_protocol.hpp | 121 + .../asio/asio/generic/seq_packet_protocol.hpp | 122 + .../asio/asio/generic/stream_protocol.hpp | 127 + .../Vendors/asio/asio/handler_alloc_hook.hpp | 81 + .../asio/asio/handler_continuation_hook.hpp | 54 + .../Vendors/asio/asio/handler_invoke_hook.hpp | 85 + .../Vendors/asio/asio/handler_type.hpp | 52 + .../asio/asio/high_resolution_timer.hpp | 44 + .../asio/asio/impl/buffered_read_stream.hpp | 426 + .../asio/asio/impl/buffered_write_stream.hpp | 406 + .../Vendors/asio/asio/impl/connect.hpp | 805 ++ .../Vendors/asio/asio/impl/defer.hpp | 77 + .../Vendors/asio/asio/impl/dispatch.hpp | 77 + .../Vendors/asio/asio/impl/error.ipp | 128 + .../Vendors/asio/asio/impl/error_code.ipp | 208 + .../asio/asio/impl/execution_context.hpp | 110 + .../asio/asio/impl/execution_context.ipp | 82 + .../Vendors/asio/asio/impl/executor.hpp | 391 + .../Vendors/asio/asio/impl/executor.ipp | 38 + .../asio/asio/impl/handler_alloc_hook.ipp | 52 + .../Vendors/asio/asio/impl/io_context.hpp | 302 + .../Vendors/asio/asio/impl/io_context.ipp | 164 + .../Vendors/asio/asio/impl/post.hpp | 77 + .../Vendors/asio/asio/impl/read.hpp | 936 ++ .../Vendors/asio/asio/impl/read_at.hpp | 888 ++ .../Vendors/asio/asio/impl/read_until.hpp | 1491 ++++ .../asio/asio/impl/serial_port_base.hpp | 59 + .../asio/asio/impl/serial_port_base.ipp | 554 ++ .../Vendors/asio/asio/impl/spawn.hpp | 452 + .../Vendors/asio/asio/impl/src.cpp | 25 + .../Vendors/asio/asio/impl/src.hpp | 81 + .../asio/asio/impl/system_executor.hpp | 99 + .../asio/asio/impl/system_executor.ipp | 57 + .../Vendors/asio/asio/impl/thread_pool.hpp | 145 + .../Vendors/asio/asio/impl/thread_pool.ipp | 76 + .../Vendors/asio/asio/impl/use_future.hpp | 172 + .../Vendors/asio/asio/impl/write.hpp | 971 +++ .../Vendors/asio/asio/impl/write_at.hpp | 897 ++ .../Vendors/asio/asio/io_context.hpp | 764 ++ .../Vendors/asio/asio/io_context_strand.hpp | 382 + .../Vendors/asio/asio/io_service.hpp | 33 + .../Vendors/asio/asio/io_service_strand.hpp | 20 + .../Vendors/asio/asio/ip/address.hpp | 238 + .../Vendors/asio/asio/ip/address_v4.hpp | 309 + .../asio/asio/ip/address_v4_iterator.hpp | 162 + .../Vendors/asio/asio/ip/address_v4_range.hpp | 134 + .../Vendors/asio/asio/ip/address_v6.hpp | 316 + .../asio/asio/ip/address_v6_iterator.hpp | 183 + .../Vendors/asio/asio/ip/address_v6_range.hpp | 129 + .../Vendors/asio/asio/ip/bad_address_cast.hpp | 48 + .../Vendors/asio/asio/ip/basic_endpoint.hpp | 263 + .../Vendors/asio/asio/ip/basic_resolver.hpp | 963 ++ .../asio/asio/ip/basic_resolver_entry.hpp | 112 + .../asio/asio/ip/basic_resolver_iterator.hpp | 192 + .../asio/asio/ip/basic_resolver_query.hpp | 244 + .../asio/asio/ip/basic_resolver_results.hpp | 311 + .../Vendors/asio/asio/ip/detail/endpoint.hpp | 139 + .../asio/asio/ip/detail/impl/endpoint.ipp | 199 + .../asio/asio/ip/detail/socket_option.hpp | 566 ++ .../Vendors/asio/asio/ip/host_name.hpp | 42 + .../Vendors/asio/asio/ip/icmp.hpp | 115 + .../Vendors/asio/asio/ip/impl/address.hpp | 67 + .../Vendors/asio/asio/ip/impl/address.ipp | 219 + .../Vendors/asio/asio/ip/impl/address_v4.hpp | 67 + .../Vendors/asio/asio/ip/impl/address_v4.ipp | 195 + .../Vendors/asio/asio/ip/impl/address_v6.hpp | 67 + .../Vendors/asio/asio/ip/impl/address_v6.ipp | 335 + .../asio/asio/ip/impl/basic_endpoint.hpp | 43 + .../Vendors/asio/asio/ip/impl/host_name.ipp | 54 + .../Vendors/asio/asio/ip/impl/network_v4.hpp | 54 + .../Vendors/asio/asio/ip/impl/network_v4.ipp | 190 + .../Vendors/asio/asio/ip/impl/network_v6.hpp | 53 + .../Vendors/asio/asio/ip/impl/network_v6.ipp | 159 + .../Vendors/asio/asio/ip/multicast.hpp | 191 + .../Vendors/asio/asio/ip/network_v4.hpp | 236 + .../Vendors/asio/asio/ip/network_v6.hpp | 210 + .../Vendors/asio/asio/ip/resolver_base.hpp | 129 + .../asio/asio/ip/resolver_query_base.hpp | 43 + .../Vendors/asio/asio/ip/resolver_service.hpp | 183 + .../Vendors/asio/asio/ip/tcp.hpp | 155 + .../Vendors/asio/asio/ip/udp.hpp | 111 + .../Vendors/asio/asio/ip/unicast.hpp | 70 + .../Vendors/asio/asio/ip/v6_only.hpp | 69 + .../Vendors/asio/asio/is_executor.hpp | 40 + .../Vendors/asio/asio/is_read_buffered.hpp | 59 + .../Vendors/asio/asio/is_write_buffered.hpp | 59 + .../asio/asio/local/basic_endpoint.hpp | 239 + .../Vendors/asio/asio/local/connect_pair.hpp | 104 + .../asio/asio/local/datagram_protocol.hpp | 80 + .../asio/asio/local/detail/endpoint.hpp | 133 + .../asio/asio/local/detail/impl/endpoint.ipp | 128 + .../asio/asio/local/stream_protocol.hpp | 90 + .../Vendors/asio/asio/package.hpp | 294 + .../Vendors/asio/asio/placeholders.hpp | 151 + .../asio/asio/posix/basic_descriptor.hpp | 577 ++ .../asio/posix/basic_stream_descriptor.hpp | 362 + .../Vendors/asio/asio/posix/descriptor.hpp | 639 ++ .../asio/asio/posix/descriptor_base.hpp | 90 + .../asio/asio/posix/stream_descriptor.hpp | 360 + .../asio/posix/stream_descriptor_service.hpp | 272 + .../Vendors/asio/asio/post.hpp | 107 + .../Vendors/asio/asio/raw_socket_service.hpp | 443 + .../Vendors/asio/asio/read.hpp | 940 ++ .../Vendors/asio/asio/read_at.hpp | 664 ++ .../Vendors/asio/asio/read_until.hpp | 1817 ++++ .../asio/asio/seq_packet_socket_service.hpp | 393 + .../Vendors/asio/asio/serial_port.hpp | 764 ++ .../Vendors/asio/asio/serial_port_base.hpp | 167 + .../Vendors/asio/asio/serial_port_service.hpp | 242 + .../Vendors/asio/asio/signal_set.hpp | 444 + .../Vendors/asio/asio/signal_set_service.hpp | 138 + .../asio/asio/socket_acceptor_service.hpp | 347 + .../Vendors/asio/asio/socket_base.hpp | 514 ++ .../Vendors/asio/asio/spawn.hpp | 336 + .../Vendors/asio/asio/ssl.hpp | 27 + .../Vendors/asio/asio/ssl/context.hpp | 758 ++ .../Vendors/asio/asio/ssl/context_base.hpp | 183 + .../asio/ssl/detail/buffered_handshake_op.hpp | 104 + .../Vendors/asio/asio/ssl/detail/engine.hpp | 158 + .../asio/asio/ssl/detail/handshake_op.hpp | 62 + .../asio/asio/ssl/detail/impl/engine.ipp | 314 + .../asio/ssl/detail/impl/openssl_init.ipp | 151 + .../Vendors/asio/asio/ssl/detail/io.hpp | 372 + .../asio/asio/ssl/detail/openssl_init.hpp | 101 + .../asio/asio/ssl/detail/openssl_types.hpp | 28 + .../asio/ssl/detail/password_callback.hpp | 66 + .../Vendors/asio/asio/ssl/detail/read_op.hpp | 67 + .../asio/asio/ssl/detail/shutdown_op.hpp | 54 + .../asio/asio/ssl/detail/stream_core.hpp | 134 + .../asio/asio/ssl/detail/verify_callback.hpp | 62 + .../Vendors/asio/asio/ssl/detail/write_op.hpp | 67 + .../Vendors/asio/asio/ssl/error.hpp | 102 + .../Vendors/asio/asio/ssl/impl/context.hpp | 65 + .../Vendors/asio/asio/ssl/impl/context.ipp | 969 ++ .../Vendors/asio/asio/ssl/impl/error.ipp | 88 + .../asio/ssl/impl/rfc2818_verification.ipp | 160 + .../Vendors/asio/asio/ssl/impl/src.hpp | 28 + .../asio/asio/ssl/rfc2818_verification.hpp | 94 + .../Vendors/asio/asio/ssl/stream.hpp | 755 ++ .../Vendors/asio/asio/ssl/stream_base.hpp | 52 + .../Vendors/asio/asio/ssl/verify_context.hpp | 67 + .../Vendors/asio/asio/ssl/verify_mode.hpp | 63 + .../Vendors/asio/asio/steady_timer.hpp | 42 + .../Vendors/asio/asio/strand.hpp | 290 + .../asio/asio/stream_socket_service.hpp | 389 + .../Vendors/asio/asio/streambuf.hpp | 33 + .../Vendors/asio/asio/system_error.hpp | 131 + .../Vendors/asio/asio/system_executor.hpp | 158 + .../Vendors/asio/asio/system_timer.hpp | 42 + .../Vendors/asio/asio/thread.hpp | 92 + .../Vendors/asio/asio/thread_pool.hpp | 207 + .../Vendors/asio/asio/time_traits.hpp | 86 + .../Vendors/asio/asio/ts/buffer.hpp | 25 + .../Vendors/asio/asio/ts/executor.hpp | 35 + .../Vendors/asio/asio/ts/internet.hpp | 38 + .../Vendors/asio/asio/ts/io_context.hpp | 20 + .../Vendors/asio/asio/ts/networking.hpp | 25 + .../Vendors/asio/asio/ts/socket.hpp | 27 + .../Vendors/asio/asio/ts/thread_pool.hpp | 20 + .../Vendors/asio/asio/ts/timer.hpp | 26 + .../Vendors/asio/asio/unyield.hpp | 21 + .../Vendors/asio/asio/use_future.hpp | 101 + .../Vendors/asio/asio/uses_executor.hpp | 71 + .../Vendors/asio/asio/version.hpp | 23 + .../Vendors/asio/asio/wait_traits.hpp | 56 + .../asio/asio/waitable_timer_service.hpp | 210 + .../asio/asio/windows/basic_handle.hpp | 270 + .../asio/asio/windows/basic_object_handle.hpp | 182 + .../windows/basic_random_access_handle.hpp | 376 + .../asio/asio/windows/basic_stream_handle.hpp | 359 + .../asio/asio/windows/object_handle.hpp | 377 + .../asio/windows/object_handle_service.hpp | 180 + .../asio/asio/windows/overlapped_handle.hpp | 328 + .../asio/asio/windows/overlapped_ptr.hpp | 116 + .../asio/windows/random_access_handle.hpp | 378 + .../windows/random_access_handle_service.hpp | 209 + .../asio/asio/windows/stream_handle.hpp | 362 + .../asio/windows/stream_handle_service.hpp | 207 + .../Vendors/asio/asio/write.hpp | 920 ++ .../Vendors/asio/asio/write_at.hpp | 670 ++ .../Vendors/asio/asio/yield.hpp | 23 + .../Vendors/lz4/include/lz4.h | 360 + .../Vendors/lz4/lib/liblz4.a | Bin 0 -> 98896 bytes .../Vendors/openvpn/openvpn/addr/addrlist.hpp | 65 + .../Vendors/openvpn/openvpn/addr/addrpair.hpp | 218 + .../Vendors/openvpn/openvpn/addr/ip.hpp | 895 ++ .../Vendors/openvpn/openvpn/addr/iperr.hpp | 75 + .../Vendors/openvpn/openvpn/addr/ipv4.hpp | 561 ++ .../Vendors/openvpn/openvpn/addr/ipv6.hpp | 825 ++ .../Vendors/openvpn/openvpn/addr/macaddr.hpp | 67 + .../Vendors/openvpn/openvpn/addr/pool.hpp | 138 + .../Vendors/openvpn/openvpn/addr/range.hpp | 137 + .../Vendors/openvpn/openvpn/addr/regex.hpp | 38 + .../Vendors/openvpn/openvpn/addr/route.hpp | 251 + .../Vendors/openvpn/openvpn/addr/routeinv.hpp | 105 + .../Vendors/openvpn/openvpn/apple/maclife.hpp | 324 + .../openvpn/openvpn/apple/macsleep.hpp | 129 + .../Vendors/openvpn/openvpn/apple/macver.hpp | 75 + .../Vendors/openvpn/openvpn/apple/runloop.hpp | 34 + .../openvpn/openvpn/apple/scdynstore.hpp | 52 + .../Vendors/openvpn/openvpn/apple/ver.hpp | 81 + .../openvpn/openvpn/applecrypto/cf/cf.hpp | 464 + .../openvpn/applecrypto/cf/cfhelper.hpp | 247 + .../openvpn/openvpn/applecrypto/cf/cfsec.hpp | 58 + .../openvpn/applecrypto/cf/cftimer.hpp | 33 + .../openvpn/openvpn/applecrypto/cf/error.hpp | 67 + .../openvpn/applecrypto/crypto/api.hpp | 46 + .../openvpn/applecrypto/crypto/cipher.hpp | 200 + .../openvpn/applecrypto/crypto/digest.hpp | 255 + .../openvpn/applecrypto/crypto/hmac.hpp | 145 + .../openvpn/applecrypto/ssl/sslctx.hpp | 493 ++ .../applecrypto/util/iosactiveiface.hpp | 74 + .../openvpn/openvpn/applecrypto/util/rand.hpp | 72 + .../openvpn/applecrypto/util/reach.hpp | 43 + .../openvpn/applecrypto/util/reachable.hpp | 466 + .../Vendors/openvpn/openvpn/auth/authcert.hpp | 239 + .../openvpn/openvpn/auth/authcreds.hpp | 91 + .../Vendors/openvpn/openvpn/auth/cr.hpp | 228 + .../openvpn/openvpn/auth/validatecreds.hpp | 44 + .../openvpn/openvpn/buffer/asiobuf.hpp | 56 + .../openvpn/openvpn/buffer/bufclamp.hpp | 52 + .../openvpn/openvpn/buffer/bufcomplete.hpp | 112 + .../openvpn/openvpn/buffer/bufcomposed.hpp | 94 + .../Vendors/openvpn/openvpn/buffer/buffer.hpp | 834 ++ .../Vendors/openvpn/openvpn/buffer/bufhex.hpp | 61 + .../openvpn/openvpn/buffer/buflimit.hpp | 92 + .../openvpn/openvpn/buffer/buflist.hpp | 122 + .../Vendors/openvpn/openvpn/buffer/bufstr.hpp | 103 + .../openvpn/openvpn/buffer/bufstream.hpp | 83 + .../Vendors/openvpn/openvpn/buffer/memq.hpp | 96 + .../openvpn/openvpn/buffer/safestr.hpp | 186 + .../Vendors/openvpn/openvpn/buffer/zlib.hpp | 157 + .../openvpn/openvpn/client/cliconnect.hpp | 601 ++ .../openvpn/openvpn/client/cliconstants.hpp | 40 + .../openvpn/openvpn/client/clicreds.hpp | 216 + .../openvpn/openvpn/client/cliemuexr.hpp | 106 + .../openvpn/openvpn/client/clievent.hpp | 394 + .../openvpn/openvpn/client/clihalt.hpp | 119 + .../openvpn/openvpn/client/clilife.hpp | 50 + .../Vendors/openvpn/openvpn/client/cliopt.hpp | 768 ++ .../openvpn/openvpn/client/cliopthelper.hpp | 504 ++ .../openvpn/openvpn/client/cliproto.hpp | 1012 +++ .../openvpn/openvpn/client/ipverflags.hpp | 99 + .../openvpn/openvpn/client/optfilt.hpp | 104 + .../openvpn/openvpn/client/ovpncli.cpp | 1214 +++ .../openvpn/openvpn/client/ovpncli.hpp | 565 ++ .../openvpn/openvpn/client/remotelist.hpp | 918 ++ .../Vendors/openvpn/openvpn/client/rgopt.hpp | 158 + .../Vendors/openvpn/openvpn/common/abort.hpp | 30 + .../Vendors/openvpn/openvpn/common/action.hpp | 215 + .../openvpn/openvpn/common/actionthread.hpp | 113 + .../Vendors/openvpn/openvpn/common/arch.hpp | 37 + .../Vendors/openvpn/openvpn/common/argv.hpp | 133 + .../openvpn/openvpn/common/arraysize.hpp | 34 + .../openvpn/openvpn/common/asioboundsock.hpp | 95 + .../openvpn/openvpn/common/asiocontext.hpp | 51 + .../openvpn/openvpn/common/asioerr.hpp | 41 + .../openvpn/openvpn/common/asiopolysock.hpp | 291 + .../openvpn/openvpn/common/asiosignal.hpp | 105 + .../openvpn/openvpn/common/asiostop.hpp | 52 + .../openvpn/openvpn/common/asyncsleep.hpp | 57 + .../openvpn/openvpn/common/autoreset.hpp | 55 + .../Vendors/openvpn/openvpn/common/base64.hpp | 231 + .../openvpn/openvpn/common/binprefix.hpp | 67 + .../openvpn/openvpn/common/circ_list.hpp | 124 + .../openvpn/openvpn/common/cleanup.hpp | 60 + .../Vendors/openvpn/openvpn/common/core.hpp | 65 + .../Vendors/openvpn/openvpn/common/count.hpp | 29 + .../Vendors/openvpn/openvpn/common/daemon.hpp | 77 + .../openvpn/openvpn/common/demangle.hpp | 48 + .../openvpn/openvpn/common/destruct.hpp | 40 + .../Vendors/openvpn/openvpn/common/endian.hpp | 96 + .../openvpn/openvpn/common/enumdir.hpp | 67 + .../openvpn/openvpn/common/exception.hpp | 146 + .../Vendors/openvpn/openvpn/common/extern.hpp | 29 + .../Vendors/openvpn/openvpn/common/ffs.hpp | 77 + .../Vendors/openvpn/openvpn/common/file.hpp | 204 + .../openvpn/openvpn/common/fileatomic.hpp | 64 + .../Vendors/openvpn/openvpn/common/format.hpp | 361 + .../openvpn/openvpn/common/function.hpp | 124 + .../Vendors/openvpn/openvpn/common/getopt.hpp | 226 + .../Vendors/openvpn/openvpn/common/getpw.hpp | 48 + .../Vendors/openvpn/openvpn/common/glob.hpp | 75 + .../Vendors/openvpn/openvpn/common/hash.hpp | 118 + .../Vendors/openvpn/openvpn/common/hexstr.hpp | 230 + .../openvpn/openvpn/common/hostlist.hpp | 159 + .../openvpn/openvpn/common/hostport.hpp | 127 + .../openvpn/openvpn/common/inotify.hpp | 67 + .../Vendors/openvpn/openvpn/common/lex.hpp | 102 + .../Vendors/openvpn/openvpn/common/likely.hpp | 36 + .../Vendors/openvpn/openvpn/common/link.hpp | 51 + .../openvpn/openvpn/common/logrotate.hpp | 45 + .../Vendors/openvpn/openvpn/common/memneq.hpp | 116 + .../Vendors/openvpn/openvpn/common/mode.hpp | 70 + .../Vendors/openvpn/openvpn/common/msgwin.hpp | 165 + .../Vendors/openvpn/openvpn/common/number.hpp | 152 + .../Vendors/openvpn/openvpn/common/olong.hpp | 38 + .../openvpn/openvpn/common/options.hpp | 1409 +++ .../openvpn/openvpn/common/ostream.hpp | 40 + .../Vendors/openvpn/openvpn/common/path.hpp | 151 + .../openvpn/openvpn/common/peercred.hpp | 93 + .../openvpn/openvpn/common/persistfile.hpp | 106 + .../openvpn/openvpn/common/platform.hpp | 51 + .../openvpn/openvpn/common/platform_name.hpp | 52 + .../openvpn/common/platform_string.hpp | 74 + .../openvpn/openvpn/common/process.hpp | 240 + .../openvpn/openvpn/common/pthreadcond.hpp | 144 + .../Vendors/openvpn/openvpn/common/rc.hpp | 673 ++ .../Vendors/openvpn/openvpn/common/redir.hpp | 348 + .../openvpn/openvpn/common/runcontext.hpp | 400 + .../openvpn/common/scoped_asio_stream.hpp | 108 + .../openvpn/openvpn/common/scoped_fd.hpp | 133 + .../Vendors/openvpn/openvpn/common/signal.hpp | 162 + .../Vendors/openvpn/openvpn/common/size.hpp | 38 + .../Vendors/openvpn/openvpn/common/sleep.hpp | 50 + .../openvpn/openvpn/common/sockopt.hpp | 78 + .../openvpn/openvpn/common/socktypes.hpp | 28 + .../Vendors/openvpn/openvpn/common/split.hpp | 157 + .../openvpn/openvpn/common/splitlines.hpp | 119 + .../Vendors/openvpn/openvpn/common/stat.hpp | 52 + .../Vendors/openvpn/openvpn/common/stop.hpp | 119 + .../Vendors/openvpn/openvpn/common/string.hpp | 569 ++ .../openvpn/openvpn/common/stringize.hpp | 30 + .../openvpn/openvpn/common/tempfile.hpp | 121 + .../Vendors/openvpn/openvpn/common/umask.hpp | 60 + .../openvpn/openvpn/common/unicode-impl.hpp | 653 ++ .../openvpn/openvpn/common/unicode.hpp | 301 + .../openvpn/openvpn/common/uniqueptr.hpp | 33 + .../openvpn/openvpn/common/usecount.hpp | 49 + .../openvpn/openvpn/common/usergroup.hpp | 125 + .../openvpn/openvpn/common/userpass.hpp | 123 + .../openvpn/openvpn/common/version.hpp | 29 + .../openvpn/openvpn/common/waitbarrier.hpp | 51 + .../Vendors/openvpn/openvpn/common/write.hpp | 50 + .../openvpn/openvpn/common/wstring.hpp | 73 + .../openvpn/openvpn/compress/compnull.hpp | 44 + .../openvpn/openvpn/compress/compress.hpp | 501 ++ .../openvpn/openvpn/compress/compstub.hpp | 140 + .../Vendors/openvpn/openvpn/compress/lz4.hpp | 226 + .../Vendors/openvpn/openvpn/compress/lzo.hpp | 169 + .../openvpn/openvpn/compress/lzoasym.hpp | 119 + .../openvpn/openvpn/compress/lzoasym_impl.hpp | 410 + .../openvpn/openvpn/compress/lzoselect.hpp | 40 + .../openvpn/openvpn/compress/snappy.hpp | 136 + .../openvpn/crypto/bs64_data_limit.hpp | 45 + .../Vendors/openvpn/openvpn/crypto/cipher.hpp | 133 + .../openvpn/openvpn/crypto/crypto_aead.hpp | 350 + .../openvpn/openvpn/crypto/crypto_chm.hpp | 182 + .../openvpn/openvpn/crypto/cryptoalgs.hpp | 230 + .../openvpn/openvpn/crypto/cryptodc.hpp | 197 + .../openvpn/openvpn/crypto/cryptodcsel.hpp | 72 + .../openvpn/openvpn/crypto/decrypt_chm.hpp | 140 + .../openvpn/openvpn/crypto/digestapi.hpp | 210 + .../openvpn/openvpn/crypto/encrypt_chm.hpp | 129 + .../openvpn/openvpn/crypto/hashstr.hpp | 79 + .../openvpn/openvpn/crypto/ovpnhmac.hpp | 240 + .../openvpn/openvpn/crypto/packet_id.hpp | 444 + .../openvpn/openvpn/crypto/selftest.hpp | 65 + .../openvpn/openvpn/crypto/static_key.hpp | 162 + .../Vendors/openvpn/openvpn/error/error.hpp | 176 + .../Vendors/openvpn/openvpn/error/excode.hpp | 91 + .../Vendors/openvpn/openvpn/frame/frame.hpp | 307 + .../openvpn/openvpn/frame/frame_init.hpp | 80 + .../openvpn/openvpn/frame/memq_dgram.hpp | 77 + .../openvpn/openvpn/frame/memq_stream.hpp | 110 + .../Vendors/openvpn/openvpn/http/header.hpp | 101 + .../Vendors/openvpn/openvpn/http/htmlskip.hpp | 283 + .../Vendors/openvpn/openvpn/http/method.hpp | 47 + .../openvpn/openvpn/http/parseutil.hpp | 86 + .../Vendors/openvpn/openvpn/http/reply.hpp | 398 + .../Vendors/openvpn/openvpn/http/request.hpp | 398 + .../Vendors/openvpn/openvpn/http/status.hpp | 76 + .../openvpn/openvpn/http/urlencode.hpp | 119 + .../Vendors/openvpn/openvpn/http/urlparm.hpp | 148 + .../Vendors/openvpn/openvpn/http/urlparse.hpp | 264 + .../openvpn/openvpn/http/webexcept.hpp | 70 + .../openvpn/openvpn/init/cryptoinit.hpp | 41 + .../openvpn/openvpn/init/engineinit.hpp | 55 + .../openvpn/openvpn/init/initprocess.hpp | 92 + .../Vendors/openvpn/openvpn/ip/dhcp.hpp | 90 + .../Vendors/openvpn/openvpn/ip/eth.hpp | 42 + .../Vendors/openvpn/openvpn/ip/icmp.hpp | 58 + .../Vendors/openvpn/openvpn/ip/ip.hpp | 101 + .../Vendors/openvpn/openvpn/ip/udp.hpp | 83 + .../openvpn/openvpn/legal/copyright.hpp | 10 + .../Vendors/openvpn/openvpn/linux/core.hpp | 48 + .../openvpn/openvpn/linux/daemon_alive.hpp | 59 + .../Vendors/openvpn/openvpn/log/logbase.hpp | 54 + .../openvpn/openvpn/log/logbasesimple.hpp | 57 + .../Vendors/openvpn/openvpn/log/lognull.hpp | 34 + .../Vendors/openvpn/openvpn/log/logperiod.hpp | 174 + .../Vendors/openvpn/openvpn/log/logsimple.hpp | 51 + .../Vendors/openvpn/openvpn/log/logthread.hpp | 159 + .../openvpn/openvpn/log/sessionstats.hpp | 176 + .../openvpn/openvpn/netconf/enumiface.hpp | 218 + .../openvpn/openvpn/netconf/hwaddr.hpp | 65 + .../openvpn/openvpn/netconf/ios/net-route.h | 248 + .../openvpn/openvpn/netconf/linux/route.hpp | 165 + .../openvpn/openssl/bio/bio_memq_dgram.hpp | 245 + .../openvpn/openssl/bio/bio_memq_stream.hpp | 220 + .../openvpn/openvpn/openssl/crypto/api.hpp | 46 + .../openvpn/openvpn/openssl/crypto/cipher.hpp | 196 + .../openvpn/openssl/crypto/ciphergcm.hpp | 242 + .../openvpn/openvpn/openssl/crypto/digest.hpp | 162 + .../openvpn/openvpn/openssl/crypto/hmac.hpp | 159 + .../openvpn/openvpn/openssl/pki/crl.hpp | 160 + .../openvpn/openvpn/openssl/pki/dh.hpp | 148 + .../openvpn/openvpn/openssl/pki/pkey.hpp | 165 + .../openvpn/openvpn/openssl/pki/x509.hpp | 168 + .../openvpn/openvpn/openssl/pki/x509store.hpp | 104 + .../openvpn/openssl/sign/pkcs7verify.hpp | 87 + .../openvpn/openvpn/openssl/sign/verify.hpp | 91 + .../openvpn/openvpn/openssl/ssl/sslctx.hpp | 1412 +++ .../openvpn/openvpn/openssl/util/engine.hpp | 61 + .../openvpn/openvpn/openssl/util/error.hpp | 200 + .../openvpn/openvpn/openssl/util/init.hpp | 34 + .../openvpn/openvpn/openssl/util/rand.hpp | 72 + .../openvpn/openssl/util/tokenencrypt.hpp | 108 + .../openvpn/openvpn/options/continuation.hpp | 106 + .../Vendors/openvpn/openvpn/options/merge.hpp | 466 + .../openvpn/openvpn/options/sanitize.hpp | 109 + .../openvpn/openvpn/options/servpush.hpp | 78 + .../Vendors/openvpn/openvpn/pki/cclist.hpp | 162 + .../Vendors/openvpn/openvpn/pki/epkibase.hpp | 42 + .../Vendors/openvpn/openvpn/pki/pkcs1.hpp | 56 + .../Vendors/openvpn/openvpn/pki/x509track.hpp | 230 + .../openvpn/openvpn/polarssl/crypto/api.hpp | 46 + .../openvpn/polarssl/crypto/cipher.hpp | 194 + .../openvpn/polarssl/crypto/ciphergcm.hpp | 168 + .../openvpn/polarssl/crypto/digest.hpp | 155 + .../openvpn/openvpn/polarssl/crypto/hmac.hpp | 132 + .../openvpn/openvpn/polarssl/pki/dh.hpp | 114 + .../openvpn/openvpn/polarssl/pki/pkctx.hpp | 108 + .../openvpn/openvpn/polarssl/pki/x509cert.hpp | 121 + .../openvpn/openvpn/polarssl/pki/x509crl.hpp | 109 + .../openvpn/openvpn/polarssl/ssl/sslctx.hpp | 1177 +++ .../openvpn/openvpn/polarssl/util/error.hpp | 108 + .../openvpn/openvpn/polarssl/util/rand.hpp | 91 + .../openvpn/polarssl/util/selftest.hpp | 52 + .../openvpn/openvpn/proxy/httpdigest.hpp | 113 + .../Vendors/openvpn/openvpn/proxy/ntlm.hpp | 226 + .../openvpn/openvpn/proxy/proxyauth.hpp | 86 + .../openvpn/openvpn/random/devurand.hpp | 82 + .../openvpn/openvpn/random/mtrandapi.hpp | 106 + .../openvpn/openvpn/random/randapi.hpp | 103 + .../openvpn/openvpn/random/randbytestore.hpp | 67 + .../openvpn/openvpn/reliable/relack.hpp | 119 + .../openvpn/openvpn/reliable/relcommon.hpp | 63 + .../openvpn/openvpn/reliable/relrecv.hpp | 97 + .../openvpn/openvpn/reliable/relsend.hpp | 148 + .../openvpn/openvpn/server/listenlist.hpp | 281 + .../Vendors/openvpn/openvpn/server/manage.hpp | 126 + .../openvpn/openvpn/server/peeraddr.hpp | 70 + .../openvpn/openvpn/server/peerstats.hpp | 45 + .../openvpn/openvpn/server/servhalt.hpp | 38 + .../openvpn/openvpn/server/servproto.hpp | 647 ++ .../openvpn/server/vpnservnetblock.hpp | 195 + .../openvpn/openvpn/server/vpnservpool.hpp | 159 + .../Vendors/openvpn/openvpn/ssl/datalimit.hpp | 188 + .../openvpn/ssl/is_openvpn_protocol.hpp | 38 + .../Vendors/openvpn/openvpn/ssl/kuparse.hpp | 121 + .../Vendors/openvpn/openvpn/ssl/mssparms.hpp | 68 + .../Vendors/openvpn/openvpn/ssl/nscert.hpp | 58 + .../Vendors/openvpn/openvpn/ssl/peerinfo.hpp | 128 + .../Vendors/openvpn/openvpn/ssl/proto.hpp | 3071 +++++++ .../openvpn/ssl/proto_context_options.hpp | 64 + .../openvpn/openvpn/ssl/protostack.hpp | 481 + .../Vendors/openvpn/openvpn/ssl/psid.hpp | 107 + .../Vendors/openvpn/openvpn/ssl/sslapi.hpp | 127 + .../Vendors/openvpn/openvpn/ssl/sslchoose.hpp | 75 + .../Vendors/openvpn/openvpn/ssl/sslconsts.hpp | 60 + .../openvpn/openvpn/ssl/tls_remote.hpp | 96 + .../Vendors/openvpn/openvpn/ssl/tlsprf.hpp | 398 + .../Vendors/openvpn/openvpn/ssl/tlsver.hpp | 108 + .../Vendors/openvpn/openvpn/tags | 7757 +++++++++++++++++ .../openvpn/openvpn/time/asiotimer.hpp | 75 + .../openvpn/openvpn/time/coarsetime.hpp | 70 + .../openvpn/openvpn/time/durhelper.hpp | 105 + .../Vendors/openvpn/openvpn/time/time.hpp | 346 + .../Vendors/openvpn/openvpn/time/timestr.hpp | 173 + .../openvpn/openvpn/transport/altproxy.hpp | 77 + .../openvpn/transport/client/httpcli.hpp | 1021 +++ .../openvpn/transport/client/tcpcli.hpp | 329 + .../openvpn/transport/client/transbase.hpp | 102 + .../openvpn/transport/client/udpcli.hpp | 310 + .../Vendors/openvpn/openvpn/transport/dco.hpp | 73 + .../openvpn/openvpn/transport/gremlin.hpp | 224 + .../openvpn/openvpn/transport/mutate.hpp | 40 + .../openvpn/openvpn/transport/pktstream.hpp | 163 + .../openvpn/openvpn/transport/protocol.hpp | 260 + .../openvpn/transport/reconnect_notify.hpp | 36 + .../openvpn/transport/server/transbase.hpp | 146 + .../openvpn/transport/socket_protect.hpp | 36 + .../openvpn/openvpn/transport/tcplink.hpp | 440 + .../openvpn/openvpn/transport/udplink.hpp | 246 + .../openvpn/openvpn/tun/builder/base.hpp | 245 + .../openvpn/openvpn/tun/builder/capture.hpp | 865 ++ .../openvpn/openvpn/tun/builder/client.hpp | 324 + .../openvpn/openvpn/tun/builder/rgwflags.hpp | 35 + .../openvpn/openvpn/tun/builder/setup.hpp | 65 + .../openvpn/tun/client/dhcp_capture.hpp | 320 + .../openvpn/openvpn/tun/client/emuexr.hpp | 49 + .../openvpn/openvpn/tun/client/tunbase.hpp | 105 + .../openvpn/openvpn/tun/client/tunnull.hpp | 120 + .../openvpn/openvpn/tun/client/tunprop.hpp | 625 ++ .../openvpn/openvpn/tun/ipv6_setting.hpp | 89 + .../Vendors/openvpn/openvpn/tun/layer.hpp | 130 + .../openvpn/tun/linux/client/tuncli.hpp | 554 ++ .../Vendors/openvpn/openvpn/tun/linux/tun.hpp | 164 + .../openvpn/openvpn/tun/mac/client/tuncli.hpp | 379 + .../openvpn/tun/mac/client/tunsetup.hpp | 472 + .../Vendors/openvpn/openvpn/tun/mac/gwv4.hpp | 280 + .../openvpn/openvpn/tun/mac/macdns.hpp | 508 ++ .../openvpn/tun/mac/macdns_watchdog.hpp | 291 + .../Vendors/openvpn/openvpn/tun/mac/macgw.hpp | 88 + .../openvpn/openvpn/tun/mac/tunutil.hpp | 76 + .../Vendors/openvpn/openvpn/tun/mac/utun.hpp | 92 + .../openvpn/tun/persist/tunpersist.hpp | 164 + .../openvpn/openvpn/tun/persist/tunwrap.hpp | 116 + .../openvpn/tun/persist/tunwrapasio.hpp | 81 + .../openvpn/openvpn/tun/server/tunbase.hpp | 88 + .../Vendors/openvpn/openvpn/tun/tunio.hpp | 276 + .../Vendors/openvpn/openvpn/tun/tunlog.hpp | 45 + .../Vendors/openvpn/openvpn/tun/tunmtu.hpp | 34 + .../Vendors/openvpn/openvpn/tun/tunspec.hpp | 65 + .../openvpn/tun/win/client/setupbase.hpp | 74 + .../openvpn/openvpn/tun/win/client/tuncli.hpp | 453 + .../openvpn/tun/win/client/tunsetup.hpp | 835 ++ .../Vendors/openvpn/openvpn/tun/win/nrpt.hpp | 189 + .../openvpn/openvpn/tun/win/tunutil.hpp | 1051 +++ .../Vendors/openvpn/openvpn/tun/win/wfp.hpp | 314 + .../Vendors/openvpn/openvpn/win/call.hpp | 157 + .../Vendors/openvpn/openvpn/win/cmd.hpp | 65 + .../Vendors/openvpn/openvpn/win/console.hpp | 152 + .../Vendors/openvpn/openvpn/win/handle.hpp | 45 + .../Vendors/openvpn/openvpn/win/modname.hpp | 57 + .../Vendors/openvpn/openvpn/win/reg.hpp | 57 + .../openvpn/openvpn/win/scoped_handle.hpp | 125 + .../Vendors/openvpn/openvpn/win/sleep.hpp | 60 + .../Vendors/openvpn/openvpn/win/unicode.hpp | 68 + .../Vendors/openvpn/openvpn/win/winerr.hpp | 51 + .../Vendors/polarssl/include/polarssl/aes.h | 278 + .../Vendors/polarssl/include/polarssl/aesni.h | 112 + .../Vendors/polarssl/include/polarssl/arc4.h | 114 + .../Vendors/polarssl/include/polarssl/asn1.h | 345 + .../polarssl/include/polarssl/asn1write.h | 240 + .../polarssl/include/polarssl/base64.h | 86 + .../polarssl/include/polarssl/bignum.h | 755 ++ .../polarssl/include/polarssl/blowfish.h | 210 + .../polarssl/include/polarssl/bn_mul.h | 889 ++ .../polarssl/include/polarssl/camellia.h | 242 + .../Vendors/polarssl/include/polarssl/ccm.h | 131 + .../Vendors/polarssl/include/polarssl/certs.h | 74 + .../polarssl/include/polarssl/check_config.h | 540 ++ .../polarssl/include/polarssl/cipher.h | 776 ++ .../polarssl/include/polarssl/cipher_wrap.h | 55 + .../polarssl/include/polarssl/compat-1.2.h | 392 + .../polarssl/include/polarssl/config.h | 2227 +++++ .../polarssl/include/polarssl/config.h.orig | 2374 +++++ .../polarssl/include/polarssl/ctr_drbg.h | 273 + .../Vendors/polarssl/include/polarssl/debug.h | 154 + .../Vendors/polarssl/include/polarssl/des.h | 305 + .../Vendors/polarssl/include/polarssl/dhm.h | 308 + .../Vendors/polarssl/include/polarssl/ecdh.h | 222 + .../Vendors/polarssl/include/polarssl/ecdsa.h | 230 + .../Vendors/polarssl/include/polarssl/ecp.h | 664 ++ .../polarssl/include/polarssl/entropy.h | 243 + .../polarssl/include/polarssl/entropy_poll.h | 76 + .../Vendors/polarssl/include/polarssl/error.h | 120 + .../Vendors/polarssl/include/polarssl/gcm.h | 216 + .../polarssl/include/polarssl/havege.h | 75 + .../polarssl/include/polarssl/hmac_drbg.h | 281 + .../Vendors/polarssl/include/polarssl/md.h | 397 + .../Vendors/polarssl/include/polarssl/md2.h | 191 + .../Vendors/polarssl/include/polarssl/md4.h | 197 + .../Vendors/polarssl/include/polarssl/md5.h | 197 + .../polarssl/include/polarssl/md_wrap.h | 69 + .../polarssl/include/polarssl/memory.h | 62 + .../include/polarssl/memory_buffer_alloc.h | 149 + .../Vendors/polarssl/include/polarssl/net.h | 157 + .../Vendors/polarssl/include/polarssl/oid.h | 571 ++ .../polarssl/include/polarssl/openssl.h | 148 + .../include/polarssl/openvpn-polarssl.h | 2 + .../polarssl/include/polarssl/padlock.h | 113 + .../polarssl/include/polarssl/pbkdf2.h | 90 + .../Vendors/polarssl/include/polarssl/pem.h | 130 + .../Vendors/polarssl/include/polarssl/pk.h | 650 ++ .../polarssl/include/polarssl/pk_wrap.h | 60 + .../polarssl/include/polarssl/pkcs11.h | 168 + .../polarssl/include/polarssl/pkcs12.h | 120 + .../Vendors/polarssl/include/polarssl/pkcs5.h | 101 + .../polarssl/include/polarssl/platform.h | 205 + .../polarssl/include/polarssl/ripemd160.h | 201 + .../Vendors/polarssl/include/polarssl/rsa.h | 667 ++ .../Vendors/polarssl/include/polarssl/sha1.h | 197 + .../polarssl/include/polarssl/sha256.h | 205 + .../polarssl/include/polarssl/sha512.h | 204 + .../Vendors/polarssl/include/polarssl/ssl.h | 2015 +++++ .../polarssl/include/polarssl/ssl_cache.h | 144 + .../include/polarssl/ssl_ciphersuites.h | 302 + .../polarssl/include/polarssl/threading.h | 83 + .../polarssl/include/polarssl/timing.h | 99 + .../polarssl/include/polarssl/version.h | 111 + .../Vendors/polarssl/include/polarssl/x509.h | 342 + .../polarssl/include/polarssl/x509_crl.h | 172 + .../polarssl/include/polarssl/x509_crt.h | 568 ++ .../polarssl/include/polarssl/x509_csr.h | 292 + .../Vendors/polarssl/include/polarssl/xtea.h | 146 + .../Vendors/polarssl/lib/libmbedtls.a | Bin 0 -> 1266208 bytes OpenVPN iOS Client.xcodeproj/project.pbxproj | 789 ++ .../contents.xcworkspacedata | 7 + 909 files changed, 205396 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Cartfile create mode 100644 Cartfile.resolved create mode 100644 OpenVPN Client/AppDelegate.swift create mode 100644 OpenVPN Client/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 OpenVPN Client/Base.lproj/LaunchScreen.storyboard create mode 100644 OpenVPN Client/Base.lproj/Main.storyboard create mode 100644 OpenVPN Client/Info.plist create mode 100644 OpenVPN Tunnel Provider/Bridging-Header.h create mode 100644 OpenVPN Tunnel Provider/Info.plist create mode 100644 OpenVPN Tunnel Provider/OpenVPN Tunnel Provider.entitlements create mode 100644 OpenVPN Tunnel Provider/PacketTunnelProvider.swift create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/.gitignore create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/Makefile.am create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/associated_allocator.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/associated_executor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/async_result.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_datagram_socket.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_deadline_timer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_io_object.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_raw_socket.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_seq_packet_socket.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_serial_port.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_signal_set.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket_acceptor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket_iostream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket_streambuf.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_stream_socket.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_streambuf.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_streambuf_fwd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/basic_waitable_timer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/bind_executor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/buffer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/buffered_read_stream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/buffered_read_stream_fwd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/buffered_stream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/buffered_stream_fwd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/buffered_write_stream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/buffered_write_stream_fwd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/buffers_iterator.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/completion_condition.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/connect.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/coroutine.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/datagram_socket_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/deadline_timer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/deadline_timer_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/defer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/array.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/array_fwd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/assert.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/atomic_count.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/base_from_completion_cond.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/bind_handler.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/buffer_resize_guard.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/buffer_sequence_adapter.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/buffered_stream_storage.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/call_stack.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/chrono.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/chrono_time_traits.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/completion_handler.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/config.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/consuming_buffers.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/cstddef.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/cstdint.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/date_time_fwd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/deadline_timer_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/dependent_type.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/descriptor_ops.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/descriptor_read_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/descriptor_write_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/dev_poll_reactor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/epoll_reactor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/event.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/eventfd_select_interrupter.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/executor_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/fd_set_adapter.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/fenced_block.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/functional.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/gcc_arm_fenced_block.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/gcc_hppa_fenced_block.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/gcc_sync_fenced_block.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/gcc_x86_fenced_block.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/global.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/handler_alloc_helpers.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/handler_cont_helpers.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/handler_invoke_helpers.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/handler_tracking.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/handler_type_requirements.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/handler_work.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/hash_map.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/buffer_sequence_adapter.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/descriptor_ops.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/dev_poll_reactor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/dev_poll_reactor.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/epoll_reactor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/epoll_reactor.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/eventfd_select_interrupter.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/handler_tracking.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/kqueue_reactor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/kqueue_reactor.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/pipe_select_interrupter.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/posix_event.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/posix_mutex.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/posix_thread.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/posix_tss_ptr.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/reactive_descriptor_service.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/reactive_serial_port_service.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/reactive_socket_service_base.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/resolver_service_base.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/scheduler.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/select_reactor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/select_reactor.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/service_registry.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/service_registry.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/signal_set_service.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/socket_ops.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/socket_select_interrupter.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/strand_executor_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/strand_executor_service.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/strand_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/strand_service.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/throw_error.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/timer_queue_ptime.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/timer_queue_set.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_event.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_iocp_handle_service.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_iocp_io_context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_iocp_io_context.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_iocp_serial_port_service.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_iocp_socket_service_base.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_mutex.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_object_handle_service.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_static_mutex.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_thread.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/win_tss_ptr.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/winrt_ssocket_service_base.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/winrt_timer_scheduler.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/winrt_timer_scheduler.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/impl/winsock_init.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/io_control.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/is_buffer_sequence.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/keyword_tss_ptr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/kqueue_reactor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/limits.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/local_free_on_block_exit.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/macos_fenced_block.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/memory.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/mutex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/noncopyable.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/null_event.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/null_fenced_block.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/null_global.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/null_mutex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/null_reactor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/null_signal_blocker.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/null_socket_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/null_static_mutex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/null_thread.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/null_tss_ptr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/object_pool.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/old_win_sdk_compat.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/op_queue.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/operation.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/pipe_select_interrupter.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/pop_options.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/posix_event.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/posix_fd_set_adapter.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/posix_global.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/posix_mutex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/posix_signal_blocker.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/posix_static_mutex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/posix_thread.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/posix_tss_ptr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/push_options.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_descriptor_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_null_buffers_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_serial_port_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_socket_accept_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_socket_connect_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_socket_recv_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_socket_recvfrom_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_socket_recvmsg_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_socket_send_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_socket_sendto_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_socket_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_socket_service_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactive_wait_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactor_fwd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactor_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/reactor_op_queue.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/recycling_allocator.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/regex_fwd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/resolve_endpoint_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/resolve_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/resolver_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/resolver_service_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/scheduler.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/scheduler_operation.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/scheduler_thread_info.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/scoped_lock.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/scoped_ptr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/select_interrupter.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/select_reactor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/service_registry.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/signal_blocker.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/signal_handler.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/signal_init.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/signal_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/signal_set_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/socket_holder.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/socket_ops.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/socket_option.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/socket_select_interrupter.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/socket_types.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/solaris_fenced_block.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/static_mutex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/std_event.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/std_global.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/std_mutex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/std_static_mutex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/std_thread.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/strand_executor_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/strand_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/thread.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/thread_context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/thread_group.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/thread_info_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/throw_error.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/throw_exception.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/timer_queue.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/timer_queue_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/timer_queue_ptime.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/timer_queue_set.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/timer_scheduler.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/timer_scheduler_fwd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/tss_ptr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/type_traits.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/variadic_templates.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/wait_handler.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/wait_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_event.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_fd_set_adapter.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_fenced_block.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_global.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_handle_read_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_handle_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_handle_write_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_io_context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_null_buffers_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_operation.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_overlapped_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_overlapped_ptr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_serial_port_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_socket_accept_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_socket_connect_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_socket_recv_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_socket_recvfrom_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_socket_recvmsg_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_socket_send_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_socket_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_socket_service_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_thread_info.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_iocp_wait_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_mutex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_object_handle_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_static_mutex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_thread.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/win_tss_ptr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winapp_thread.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/wince_thread.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_async_manager.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_async_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_resolve_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_resolver_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_socket_connect_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_socket_recv_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_socket_send_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_ssocket_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_ssocket_service_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_timer_scheduler.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winrt_utils.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/winsock_init.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/work_dispatcher.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/detail/wrapped_handler.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/dispatch.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/error.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/error_code.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/execution_context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/executor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/executor_work_guard.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/generic/basic_endpoint.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/generic/datagram_protocol.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/generic/detail/endpoint.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/generic/detail/impl/endpoint.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/generic/raw_protocol.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/generic/seq_packet_protocol.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/generic/stream_protocol.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/handler_alloc_hook.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/handler_continuation_hook.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/handler_invoke_hook.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/handler_type.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/high_resolution_timer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/buffered_read_stream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/buffered_write_stream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/connect.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/defer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/dispatch.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/error.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/error_code.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/execution_context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/execution_context.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/executor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/executor.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/handler_alloc_hook.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/io_context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/io_context.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/post.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/read.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/read_at.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/read_until.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/serial_port_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/serial_port_base.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/spawn.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/src.cpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/src.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/system_executor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/system_executor.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/thread_pool.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/thread_pool.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/use_future.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/write.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/impl/write_at.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/io_context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/io_context_strand.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/io_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/io_service_strand.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/address.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/address_v4.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/address_v4_iterator.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/address_v4_range.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/address_v6.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/address_v6_iterator.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/address_v6_range.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/bad_address_cast.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/basic_endpoint.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/basic_resolver.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/basic_resolver_entry.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/basic_resolver_iterator.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/basic_resolver_query.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/basic_resolver_results.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/detail/endpoint.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/detail/impl/endpoint.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/detail/socket_option.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/host_name.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/icmp.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/address.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/address.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/address_v4.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/address_v4.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/address_v6.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/address_v6.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/basic_endpoint.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/host_name.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/network_v4.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/network_v4.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/network_v6.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/impl/network_v6.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/multicast.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/network_v4.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/network_v6.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/resolver_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/resolver_query_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/resolver_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/tcp.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/udp.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/unicast.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ip/v6_only.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/is_executor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/is_read_buffered.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/is_write_buffered.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/local/basic_endpoint.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/local/connect_pair.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/local/datagram_protocol.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/local/detail/endpoint.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/local/detail/impl/endpoint.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/local/stream_protocol.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/package.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/placeholders.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/posix/basic_descriptor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/posix/basic_stream_descriptor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/posix/descriptor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/posix/descriptor_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/posix/stream_descriptor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/posix/stream_descriptor_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/post.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/raw_socket_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/read.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/read_at.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/read_until.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/seq_packet_socket_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/serial_port.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/serial_port_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/serial_port_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/signal_set.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/signal_set_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/socket_acceptor_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/socket_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/spawn.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/context_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/buffered_handshake_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/engine.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/handshake_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/impl/engine.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/impl/openssl_init.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/io.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/openssl_init.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/openssl_types.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/password_callback.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/read_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/shutdown_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/stream_core.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/verify_callback.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/detail/write_op.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/error.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/impl/context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/impl/context.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/impl/error.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/impl/rfc2818_verification.ipp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/impl/src.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/rfc2818_verification.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/stream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/stream_base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/verify_context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ssl/verify_mode.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/steady_timer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/strand.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/stream_socket_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/streambuf.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/system_error.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/system_executor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/system_timer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/thread.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/thread_pool.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/time_traits.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ts/buffer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ts/executor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ts/internet.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ts/io_context.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ts/networking.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ts/socket.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ts/thread_pool.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/ts/timer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/unyield.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/use_future.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/uses_executor.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/version.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/wait_traits.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/waitable_timer_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/basic_handle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/basic_object_handle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/basic_random_access_handle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/basic_stream_handle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/object_handle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/object_handle_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/overlapped_handle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/overlapped_ptr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/random_access_handle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/random_access_handle_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/stream_handle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/windows/stream_handle_service.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/write.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/write_at.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/asio/asio/yield.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/lz4/include/lz4.h create mode 100644 OpenVPN Tunnel Provider/Vendors/lz4/lib/liblz4.a create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/addrlist.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/addrpair.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/ip.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/iperr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/ipv4.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/ipv6.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/macaddr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/pool.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/range.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/regex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/route.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/addr/routeinv.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/apple/maclife.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/apple/macsleep.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/apple/macver.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/apple/runloop.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/apple/scdynstore.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/apple/ver.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/cf/cf.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/cf/cfhelper.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/cf/cfsec.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/cf/cftimer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/cf/error.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/crypto/api.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/crypto/cipher.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/crypto/digest.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/crypto/hmac.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/ssl/sslctx.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/util/iosactiveiface.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/util/rand.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/util/reach.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/applecrypto/util/reachable.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/auth/authcert.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/auth/authcreds.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/auth/cr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/auth/validatecreds.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/asiobuf.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/bufclamp.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/bufcomplete.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/bufcomposed.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/buffer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/bufhex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/buflimit.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/buflist.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/bufstr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/bufstream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/memq.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/safestr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/buffer/zlib.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/cliconnect.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/cliconstants.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/clicreds.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/cliemuexr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/clievent.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/clihalt.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/clilife.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/cliopt.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/cliopthelper.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/cliproto.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/ipverflags.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/optfilt.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/ovpncli.cpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/ovpncli.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/remotelist.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/client/rgopt.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/abort.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/action.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/actionthread.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/arch.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/argv.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/arraysize.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/asioboundsock.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/asiocontext.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/asioerr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/asiopolysock.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/asiosignal.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/asiostop.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/asyncsleep.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/autoreset.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/base64.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/binprefix.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/circ_list.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/cleanup.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/core.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/count.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/daemon.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/demangle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/destruct.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/endian.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/enumdir.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/exception.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/extern.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/ffs.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/file.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/fileatomic.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/format.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/function.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/getopt.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/getpw.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/glob.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/hash.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/hexstr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/hostlist.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/hostport.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/inotify.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/lex.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/likely.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/link.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/logrotate.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/memneq.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/mode.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/msgwin.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/number.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/olong.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/options.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/ostream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/path.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/peercred.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/persistfile.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/platform.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/platform_name.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/platform_string.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/process.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/pthreadcond.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/rc.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/redir.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/runcontext.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/scoped_asio_stream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/scoped_fd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/signal.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/size.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/sleep.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/sockopt.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/socktypes.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/split.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/splitlines.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/stat.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/stop.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/string.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/stringize.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/tempfile.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/umask.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/unicode-impl.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/unicode.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/uniqueptr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/usecount.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/usergroup.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/userpass.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/version.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/waitbarrier.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/write.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/common/wstring.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/compress/compnull.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/compress/compress.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/compress/compstub.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/compress/lz4.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/compress/lzo.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/compress/lzoasym.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/compress/lzoasym_impl.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/compress/lzoselect.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/compress/snappy.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/bs64_data_limit.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/cipher.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/crypto_aead.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/crypto_chm.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/cryptoalgs.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/cryptodc.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/cryptodcsel.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/decrypt_chm.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/digestapi.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/encrypt_chm.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/hashstr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/ovpnhmac.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/packet_id.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/selftest.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/crypto/static_key.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/error/error.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/error/excode.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/frame/frame.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/frame/frame_init.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/frame/memq_dgram.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/frame/memq_stream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/header.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/htmlskip.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/method.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/parseutil.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/reply.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/request.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/status.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/urlencode.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/urlparm.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/urlparse.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/http/webexcept.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/init/cryptoinit.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/init/engineinit.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/init/initprocess.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ip/dhcp.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ip/eth.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ip/icmp.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ip/ip.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ip/udp.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/legal/copyright.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/linux/core.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/linux/daemon_alive.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/log/logbase.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/log/logbasesimple.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/log/lognull.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/log/logperiod.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/log/logsimple.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/log/logthread.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/log/sessionstats.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/netconf/enumiface.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/netconf/hwaddr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/netconf/ios/net-route.h create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/netconf/linux/route.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/bio/bio_memq_dgram.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/bio/bio_memq_stream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/crypto/api.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/crypto/cipher.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/crypto/ciphergcm.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/crypto/digest.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/crypto/hmac.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/pki/crl.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/pki/dh.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/pki/pkey.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/pki/x509.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/pki/x509store.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/sign/pkcs7verify.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/sign/verify.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/ssl/sslctx.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/util/engine.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/util/error.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/util/init.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/util/rand.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/openssl/util/tokenencrypt.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/options/continuation.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/options/merge.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/options/sanitize.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/options/servpush.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/pki/cclist.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/pki/epkibase.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/pki/pkcs1.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/pki/x509track.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/crypto/api.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/crypto/cipher.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/crypto/ciphergcm.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/crypto/digest.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/crypto/hmac.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/pki/dh.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/pki/pkctx.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/pki/x509cert.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/pki/x509crl.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/ssl/sslctx.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/util/error.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/util/rand.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/polarssl/util/selftest.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/proxy/httpdigest.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/proxy/ntlm.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/proxy/proxyauth.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/random/devurand.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/random/mtrandapi.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/random/randapi.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/random/randbytestore.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/reliable/relack.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/reliable/relcommon.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/reliable/relrecv.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/reliable/relsend.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/server/listenlist.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/server/manage.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/server/peeraddr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/server/peerstats.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/server/servhalt.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/server/servproto.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/server/vpnservnetblock.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/server/vpnservpool.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/datalimit.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/is_openvpn_protocol.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/kuparse.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/mssparms.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/nscert.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/peerinfo.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/proto.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/proto_context_options.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/protostack.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/psid.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/sslapi.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/sslchoose.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/sslconsts.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/tls_remote.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/tlsprf.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/ssl/tlsver.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tags create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/time/asiotimer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/time/coarsetime.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/time/durhelper.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/time/time.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/time/timestr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/altproxy.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/client/httpcli.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/client/tcpcli.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/client/transbase.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/client/udpcli.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/dco.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/gremlin.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/mutate.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/pktstream.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/protocol.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/reconnect_notify.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/server/transbase.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/socket_protect.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/tcplink.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/transport/udplink.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/builder/base.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/builder/capture.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/builder/client.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/builder/rgwflags.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/builder/setup.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/client/dhcp_capture.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/client/emuexr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/client/tunbase.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/client/tunnull.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/client/tunprop.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/ipv6_setting.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/layer.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/linux/client/tuncli.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/linux/tun.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/mac/client/tuncli.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/mac/client/tunsetup.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/mac/gwv4.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/mac/macdns.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/mac/macdns_watchdog.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/mac/macgw.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/mac/tunutil.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/mac/utun.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/persist/tunpersist.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/persist/tunwrap.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/persist/tunwrapasio.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/server/tunbase.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/tunio.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/tunlog.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/tunmtu.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/tunspec.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/win/client/setupbase.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/win/client/tuncli.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/win/client/tunsetup.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/win/nrpt.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/win/tunutil.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/tun/win/wfp.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/win/call.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/win/cmd.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/win/console.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/win/handle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/win/modname.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/win/reg.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/win/scoped_handle.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/win/sleep.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/win/unicode.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/openvpn/openvpn/win/winerr.hpp create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/aes.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/aesni.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/arc4.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/asn1.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/asn1write.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/base64.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/bignum.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/blowfish.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/bn_mul.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/camellia.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/ccm.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/certs.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/check_config.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/cipher.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/cipher_wrap.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/compat-1.2.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/config.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/config.h.orig create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/ctr_drbg.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/debug.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/des.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/dhm.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/ecdh.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/ecdsa.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/ecp.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/entropy.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/entropy_poll.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/error.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/gcm.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/havege.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/hmac_drbg.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/md.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/md2.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/md4.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/md5.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/md_wrap.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/memory.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/memory_buffer_alloc.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/net.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/oid.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/openssl.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/openvpn-polarssl.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/padlock.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/pbkdf2.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/pem.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/pk.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/pk_wrap.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/pkcs11.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/pkcs12.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/pkcs5.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/platform.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/ripemd160.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/rsa.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/sha1.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/sha256.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/sha512.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/ssl.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/ssl_cache.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/ssl_ciphersuites.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/threading.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/timing.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/version.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/x509.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/x509_crl.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/x509_crt.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/x509_csr.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/include/polarssl/xtea.h create mode 100644 OpenVPN Tunnel Provider/Vendors/polarssl/lib/libmbedtls.a create mode 100644 OpenVPN iOS Client.xcodeproj/project.pbxproj create mode 100644 OpenVPN iOS Client.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e92129d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +# Telling GIT that Xcode pbxproj remote and local files +# should be merged using union of differences +*.pbxproj binary merge=union + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c936c9b --- /dev/null +++ b/.gitignore @@ -0,0 +1,50 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +[bB]uild/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + diff --git a/Cartfile b/Cartfile new file mode 100644 index 0000000..9770784 --- /dev/null +++ b/Cartfile @@ -0,0 +1 @@ +github "kishikawakatsumi/KeychainAccess" ~> 3.0 diff --git a/Cartfile.resolved b/Cartfile.resolved new file mode 100644 index 0000000..2a2f928 --- /dev/null +++ b/Cartfile.resolved @@ -0,0 +1 @@ +github "kishikawakatsumi/KeychainAccess" "v3.0.1" diff --git a/OpenVPN Client/AppDelegate.swift b/OpenVPN Client/AppDelegate.swift new file mode 100644 index 0000000..e4b9e74 --- /dev/null +++ b/OpenVPN Client/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// OpenVPN Client +// +// Created by Sergey Abramchuk on 05.02.17. +// +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/OpenVPN Client/Assets.xcassets/AppIcon.appiconset/Contents.json b/OpenVPN Client/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/OpenVPN Client/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/OpenVPN Client/Base.lproj/LaunchScreen.storyboard b/OpenVPN Client/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..fdf3f97 --- /dev/null +++ b/OpenVPN Client/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenVPN Client/Base.lproj/Main.storyboard b/OpenVPN Client/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f2b5b8d --- /dev/null +++ b/OpenVPN Client/Base.lproj/Main.storyboard @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenVPN Client/Info.plist b/OpenVPN Client/Info.plist new file mode 100644 index 0000000..149fa50 --- /dev/null +++ b/OpenVPN Client/Info.plist @@ -0,0 +1,46 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + OpenVPN Client + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/OpenVPN Tunnel Provider/Bridging-Header.h b/OpenVPN Tunnel Provider/Bridging-Header.h new file mode 100644 index 0000000..1b2cb5d --- /dev/null +++ b/OpenVPN Tunnel Provider/Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + diff --git a/OpenVPN Tunnel Provider/Info.plist b/OpenVPN Tunnel Provider/Info.plist new file mode 100644 index 0000000..abaa3b3 --- /dev/null +++ b/OpenVPN Tunnel Provider/Info.plist @@ -0,0 +1,31 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + OpenVPN Tunnel Provider + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionPointIdentifier + com.apple.networkextension.packet-tunnel + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).PacketTunnelProvider + + + diff --git a/OpenVPN Tunnel Provider/OpenVPN Tunnel Provider.entitlements b/OpenVPN Tunnel Provider/OpenVPN Tunnel Provider.entitlements new file mode 100644 index 0000000..2e96504 --- /dev/null +++ b/OpenVPN Tunnel Provider/OpenVPN Tunnel Provider.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.me.ss-abramchuk.openvpn-client + + + diff --git a/OpenVPN Tunnel Provider/PacketTunnelProvider.swift b/OpenVPN Tunnel Provider/PacketTunnelProvider.swift new file mode 100644 index 0000000..60b585d --- /dev/null +++ b/OpenVPN Tunnel Provider/PacketTunnelProvider.swift @@ -0,0 +1,21 @@ +// +// PacketTunnelProvider.swift +// OpenVPN Tunnel Provider +// +// Created by Sergey Abramchuk on 05.02.17. +// +// + +import NetworkExtension + +class PacketTunnelProvider: NEPacketTunnelProvider { + + override func startTunnel(options: [String : NSObject]? = nil, completionHandler: @escaping (Error?) -> Void) { + // TODO: Some + } + + override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) { + + } + +} diff --git a/OpenVPN Tunnel Provider/Vendors/asio/.gitignore b/OpenVPN Tunnel Provider/Vendors/asio/.gitignore new file mode 100644 index 0000000..282522d --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/.gitignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/OpenVPN Tunnel Provider/Vendors/asio/Makefile.am b/OpenVPN Tunnel Provider/Vendors/asio/Makefile.am new file mode 100644 index 0000000..2009c6b --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/Makefile.am @@ -0,0 +1,465 @@ +# find . -name "*.*pp" | sed -e 's/^\.\///' | sed -e 's/^.*$/ & \\/' | sort +nobase_include_HEADERS = \ + asio/associated_allocator.hpp \ + asio/associated_executor.hpp \ + asio/async_result.hpp \ + asio/basic_datagram_socket.hpp \ + asio/basic_deadline_timer.hpp \ + asio/basic_io_object.hpp \ + asio/basic_raw_socket.hpp \ + asio/basic_seq_packet_socket.hpp \ + asio/basic_serial_port.hpp \ + asio/basic_signal_set.hpp \ + asio/basic_socket_acceptor.hpp \ + asio/basic_socket.hpp \ + asio/basic_socket_iostream.hpp \ + asio/basic_socket_streambuf.hpp \ + asio/basic_streambuf_fwd.hpp \ + asio/basic_streambuf.hpp \ + asio/basic_stream_socket.hpp \ + asio/basic_waitable_timer.hpp \ + asio/bind_executor.hpp \ + asio/buffered_read_stream_fwd.hpp \ + asio/buffered_read_stream.hpp \ + asio/buffered_stream_fwd.hpp \ + asio/buffered_stream.hpp \ + asio/buffered_write_stream_fwd.hpp \ + asio/buffered_write_stream.hpp \ + asio/buffer.hpp \ + asio/buffers_iterator.hpp \ + asio/completion_condition.hpp \ + asio/connect.hpp \ + asio/coroutine.hpp \ + asio/datagram_socket_service.hpp \ + asio/deadline_timer.hpp \ + asio/deadline_timer_service.hpp \ + asio/defer.hpp \ + asio/detail/array_fwd.hpp \ + asio/detail/array.hpp \ + asio/detail/assert.hpp \ + asio/detail/atomic_count.hpp \ + asio/detail/base_from_completion_cond.hpp \ + asio/detail/bind_handler.hpp \ + asio/detail/buffered_stream_storage.hpp \ + asio/detail/buffer_resize_guard.hpp \ + asio/detail/buffer_sequence_adapter.hpp \ + asio/detail/call_stack.hpp \ + asio/detail/chrono_time_traits.hpp \ + asio/detail/completion_handler.hpp \ + asio/detail/config.hpp \ + asio/detail/consuming_buffers.hpp \ + asio/detail/cstddef.hpp \ + asio/detail/cstdint.hpp \ + asio/detail/date_time_fwd.hpp \ + asio/detail/deadline_timer_service.hpp \ + asio/detail/dependent_type.hpp \ + asio/detail/descriptor_ops.hpp \ + asio/detail/descriptor_read_op.hpp \ + asio/detail/descriptor_write_op.hpp \ + asio/detail/dev_poll_reactor.hpp \ + asio/detail/epoll_reactor.hpp \ + asio/detail/eventfd_select_interrupter.hpp \ + asio/detail/event.hpp \ + asio/detail/executor_op.hpp \ + asio/detail/fd_set_adapter.hpp \ + asio/detail/fenced_block.hpp \ + asio/detail/functional.hpp \ + asio/detail/gcc_arm_fenced_block.hpp \ + asio/detail/gcc_hppa_fenced_block.hpp \ + asio/detail/gcc_sync_fenced_block.hpp \ + asio/detail/gcc_x86_fenced_block.hpp \ + asio/detail/global.hpp \ + asio/detail/handler_alloc_helpers.hpp \ + asio/detail/handler_cont_helpers.hpp \ + asio/detail/handler_invoke_helpers.hpp \ + asio/detail/handler_tracking.hpp \ + asio/detail/handler_type_requirements.hpp \ + asio/detail/handler_work.hpp \ + asio/detail/hash_map.hpp \ + asio/detail/impl/buffer_sequence_adapter.ipp \ + asio/detail/impl/descriptor_ops.ipp \ + asio/detail/impl/dev_poll_reactor.hpp \ + asio/detail/impl/dev_poll_reactor.ipp \ + asio/detail/impl/epoll_reactor.hpp \ + asio/detail/impl/epoll_reactor.ipp \ + asio/detail/impl/eventfd_select_interrupter.ipp \ + asio/detail/impl/handler_tracking.ipp \ + asio/detail/impl/kqueue_reactor.hpp \ + asio/detail/impl/kqueue_reactor.ipp \ + asio/detail/impl/pipe_select_interrupter.ipp \ + asio/detail/impl/posix_event.ipp \ + asio/detail/impl/posix_mutex.ipp \ + asio/detail/impl/posix_thread.ipp \ + asio/detail/impl/posix_tss_ptr.ipp \ + asio/detail/impl/reactive_descriptor_service.ipp \ + asio/detail/impl/reactive_serial_port_service.ipp \ + asio/detail/impl/reactive_socket_service_base.ipp \ + asio/detail/impl/resolver_service_base.ipp \ + asio/detail/impl/scheduler.ipp \ + asio/detail/impl/select_reactor.hpp \ + asio/detail/impl/select_reactor.ipp \ + asio/detail/impl/service_registry.hpp \ + asio/detail/impl/service_registry.ipp \ + asio/detail/impl/signal_set_service.ipp \ + asio/detail/impl/socket_ops.ipp \ + asio/detail/impl/socket_select_interrupter.ipp \ + asio/detail/impl/strand_executor_service.hpp \ + asio/detail/impl/strand_executor_service.ipp \ + asio/detail/impl/strand_service.hpp \ + asio/detail/impl/strand_service.ipp \ + asio/detail/impl/throw_error.ipp \ + asio/detail/impl/timer_queue_ptime.ipp \ + asio/detail/impl/timer_queue_set.ipp \ + asio/detail/impl/win_event.ipp \ + asio/detail/impl/win_iocp_handle_service.ipp \ + asio/detail/impl/win_iocp_io_context.hpp \ + asio/detail/impl/win_iocp_io_context.ipp \ + asio/detail/impl/win_iocp_serial_port_service.ipp \ + asio/detail/impl/win_iocp_socket_service_base.ipp \ + asio/detail/impl/win_mutex.ipp \ + asio/detail/impl/win_object_handle_service.ipp \ + asio/detail/impl/winrt_ssocket_service_base.ipp \ + asio/detail/impl/winrt_timer_scheduler.hpp \ + asio/detail/impl/winrt_timer_scheduler.ipp \ + asio/detail/impl/winsock_init.ipp \ + asio/detail/impl/win_static_mutex.ipp \ + asio/detail/impl/win_thread.ipp \ + asio/detail/impl/win_tss_ptr.ipp \ + asio/detail/io_control.hpp \ + asio/detail/is_buffer_sequence.hpp \ + asio/detail/keyword_tss_ptr.hpp \ + asio/detail/kqueue_reactor.hpp \ + asio/detail/limits.hpp \ + asio/detail/local_free_on_block_exit.hpp \ + asio/detail/macos_fenced_block.hpp \ + asio/detail/memory.hpp \ + asio/detail/mutex.hpp \ + asio/detail/noncopyable.hpp \ + asio/detail/null_event.hpp \ + asio/detail/null_fenced_block.hpp \ + asio/detail/null_global.hpp \ + asio/detail/null_mutex.hpp \ + asio/detail/null_reactor.hpp \ + asio/detail/null_signal_blocker.hpp \ + asio/detail/null_socket_service.hpp \ + asio/detail/null_static_mutex.hpp \ + asio/detail/null_thread.hpp \ + asio/detail/null_tss_ptr.hpp \ + asio/detail/object_pool.hpp \ + asio/detail/old_win_sdk_compat.hpp \ + asio/detail/operation.hpp \ + asio/detail/op_queue.hpp \ + asio/detail/pipe_select_interrupter.hpp \ + asio/detail/pop_options.hpp \ + asio/detail/posix_event.hpp \ + asio/detail/posix_fd_set_adapter.hpp \ + asio/detail/posix_global.hpp \ + asio/detail/posix_mutex.hpp \ + asio/detail/posix_signal_blocker.hpp \ + asio/detail/posix_static_mutex.hpp \ + asio/detail/posix_thread.hpp \ + asio/detail/posix_tss_ptr.hpp \ + asio/detail/push_options.hpp \ + asio/detail/reactive_descriptor_service.hpp \ + asio/detail/reactive_null_buffers_op.hpp \ + asio/detail/reactive_serial_port_service.hpp \ + asio/detail/reactive_socket_accept_op.hpp \ + asio/detail/reactive_socket_connect_op.hpp \ + asio/detail/reactive_socket_recvfrom_op.hpp \ + asio/detail/reactive_socket_recvmsg_op.hpp \ + asio/detail/reactive_socket_recv_op.hpp \ + asio/detail/reactive_socket_send_op.hpp \ + asio/detail/reactive_socket_sendto_op.hpp \ + asio/detail/reactive_socket_service_base.hpp \ + asio/detail/reactive_socket_service.hpp \ + asio/detail/reactive_wait_op.hpp \ + asio/detail/reactor_fwd.hpp \ + asio/detail/reactor.hpp \ + asio/detail/reactor_op.hpp \ + asio/detail/reactor_op_queue.hpp \ + asio/detail/recycling_allocator.hpp \ + asio/detail/regex_fwd.hpp \ + asio/detail/resolve_endpoint_op.hpp \ + asio/detail/resolve_op.hpp \ + asio/detail/resolver_service_base.hpp \ + asio/detail/resolver_service.hpp \ + asio/detail/scheduler.hpp \ + asio/detail/scheduler_operation.hpp \ + asio/detail/scheduler_thread_info.hpp \ + asio/detail/scoped_lock.hpp \ + asio/detail/scoped_ptr.hpp \ + asio/detail/select_interrupter.hpp \ + asio/detail/select_reactor.hpp \ + asio/detail/service_registry.hpp \ + asio/detail/signal_blocker.hpp \ + asio/detail/signal_handler.hpp \ + asio/detail/signal_init.hpp \ + asio/detail/signal_op.hpp \ + asio/detail/signal_set_service.hpp \ + asio/detail/socket_holder.hpp \ + asio/detail/socket_ops.hpp \ + asio/detail/socket_option.hpp \ + asio/detail/socket_select_interrupter.hpp \ + asio/detail/socket_types.hpp \ + asio/detail/solaris_fenced_block.hpp \ + asio/detail/static_mutex.hpp \ + asio/detail/std_event.hpp \ + asio/detail/std_global.hpp \ + asio/detail/std_mutex.hpp \ + asio/detail/std_static_mutex.hpp \ + asio/detail/std_thread.hpp \ + asio/detail/strand_executor_service.hpp \ + asio/detail/strand_service.hpp \ + asio/detail/thread_context.hpp \ + asio/detail/thread_group.hpp \ + asio/detail/thread.hpp \ + asio/detail/thread_info_base.hpp \ + asio/detail/throw_error.hpp \ + asio/detail/throw_exception.hpp \ + asio/detail/timer_queue_base.hpp \ + asio/detail/timer_queue.hpp \ + asio/detail/timer_queue_ptime.hpp \ + asio/detail/timer_queue_set.hpp \ + asio/detail/timer_scheduler_fwd.hpp \ + asio/detail/timer_scheduler.hpp \ + asio/detail/tss_ptr.hpp \ + asio/detail/type_traits.hpp \ + asio/detail/variadic_templates.hpp \ + asio/detail/wait_handler.hpp \ + asio/detail/wait_op.hpp \ + asio/detail/winapp_thread.hpp \ + asio/detail/wince_thread.hpp \ + asio/detail/win_event.hpp \ + asio/detail/win_fd_set_adapter.hpp \ + asio/detail/win_fenced_block.hpp \ + asio/detail/win_global.hpp \ + asio/detail/win_iocp_handle_read_op.hpp \ + asio/detail/win_iocp_handle_service.hpp \ + asio/detail/win_iocp_handle_write_op.hpp \ + asio/detail/win_iocp_io_context.hpp \ + asio/detail/win_iocp_null_buffers_op.hpp \ + asio/detail/win_iocp_operation.hpp \ + asio/detail/win_iocp_overlapped_op.hpp \ + asio/detail/win_iocp_overlapped_ptr.hpp \ + asio/detail/win_iocp_serial_port_service.hpp \ + asio/detail/win_iocp_socket_accept_op.hpp \ + asio/detail/win_iocp_socket_connect_op.hpp \ + asio/detail/win_iocp_socket_recvfrom_op.hpp \ + asio/detail/win_iocp_socket_recvmsg_op.hpp \ + asio/detail/win_iocp_socket_recv_op.hpp \ + asio/detail/win_iocp_socket_send_op.hpp \ + asio/detail/win_iocp_socket_service_base.hpp \ + asio/detail/win_iocp_socket_service.hpp \ + asio/detail/win_iocp_thread_info.hpp \ + asio/detail/win_iocp_wait_op.hpp \ + asio/detail/win_mutex.hpp \ + asio/detail/win_object_handle_service.hpp \ + asio/detail/winrt_async_manager.hpp \ + asio/detail/winrt_async_op.hpp \ + asio/detail/winrt_resolve_op.hpp \ + asio/detail/winrt_resolver_service.hpp \ + asio/detail/winrt_socket_connect_op.hpp \ + asio/detail/winrt_socket_recv_op.hpp \ + asio/detail/winrt_socket_send_op.hpp \ + asio/detail/winrt_ssocket_service_base.hpp \ + asio/detail/winrt_ssocket_service.hpp \ + asio/detail/winrt_timer_scheduler.hpp \ + asio/detail/winrt_utils.hpp \ + asio/detail/winsock_init.hpp \ + asio/detail/win_static_mutex.hpp \ + asio/detail/win_thread.hpp \ + asio/detail/win_tss_ptr.hpp \ + asio/detail/work_dispatcher.hpp \ + asio/detail/wrapped_handler.hpp \ + asio/dispatch.hpp \ + asio/error_code.hpp \ + asio/error.hpp \ + asio/execution_context.hpp \ + asio/executor_work_guard.hpp \ + asio/executor.hpp \ + asio/generic/basic_endpoint.hpp \ + asio/generic/datagram_protocol.hpp \ + asio/generic/detail/endpoint.hpp \ + asio/generic/detail/impl/endpoint.ipp \ + asio/generic/raw_protocol.hpp \ + asio/generic/seq_packet_protocol.hpp \ + asio/generic/stream_protocol.hpp \ + asio/handler_alloc_hook.hpp \ + asio/handler_continuation_hook.hpp \ + asio/handler_invoke_hook.hpp \ + asio/handler_type.hpp \ + asio/high_resolution_timer.hpp \ + asio.hpp \ + asio/impl/buffered_read_stream.hpp \ + asio/impl/buffered_write_stream.hpp \ + asio/impl/connect.hpp \ + asio/impl/defer.hpp \ + asio/impl/dispatch.hpp \ + asio/impl/error_code.ipp \ + asio/impl/error.ipp \ + asio/impl/execution_context.hpp \ + asio/impl/execution_context.ipp \ + asio/impl/executor.hpp \ + asio/impl/executor.ipp \ + asio/impl/handler_alloc_hook.ipp \ + asio/impl/io_context.hpp \ + asio/impl/io_context.ipp \ + asio/impl/post.hpp \ + asio/impl/read_at.hpp \ + asio/impl/read.hpp \ + asio/impl/read_until.hpp \ + asio/impl/serial_port_base.hpp \ + asio/impl/serial_port_base.ipp \ + asio/impl/spawn.hpp \ + asio/impl/src.cpp \ + asio/impl/src.hpp \ + asio/impl/system_executor.hpp \ + asio/impl/system_executor.ipp \ + asio/impl/thread_pool.hpp \ + asio/impl/thread_pool.ipp \ + asio/impl/use_future.hpp \ + asio/impl/write_at.hpp \ + asio/impl/write.hpp \ + asio/io_context_strand.hpp \ + asio/io_context.hpp \ + asio/io_service_strand.hpp \ + asio/io_service.hpp \ + asio/ip/address.hpp \ + asio/ip/address_v4.hpp \ + asio/ip/address_v4_iterator.hpp \ + asio/ip/address_v4_range.hpp \ + asio/ip/address_v6.hpp \ + asio/ip/address_v6_iterator.hpp \ + asio/ip/address_v6_range.hpp \ + asio/ip/bad_address_cast.hpp \ + asio/ip/basic_endpoint.hpp \ + asio/ip/basic_resolver_entry.hpp \ + asio/ip/basic_resolver.hpp \ + asio/ip/basic_resolver_iterator.hpp \ + asio/ip/basic_resolver_query.hpp \ + asio/ip/detail/endpoint.hpp \ + asio/ip/detail/impl/endpoint.ipp \ + asio/ip/detail/socket_option.hpp \ + asio/ip/host_name.hpp \ + asio/ip/icmp.hpp \ + asio/ip/impl/address.hpp \ + asio/ip/impl/address.ipp \ + asio/ip/impl/address_v4.hpp \ + asio/ip/impl/address_v4.ipp \ + asio/ip/impl/address_v6.hpp \ + asio/ip/impl/address_v6.ipp \ + asio/ip/impl/basic_endpoint.hpp \ + asio/ip/impl/host_name.ipp \ + asio/ip/impl/network_v4.hpp \ + asio/ip/impl/network_v4.ipp \ + asio/ip/impl/network_v6.hpp \ + asio/ip/impl/network_v6.ipp \ + asio/ip/multicast.hpp \ + asio/ip/network_v4.hpp \ + asio/ip/network_v6.hpp \ + asio/ip/resolver_base.hpp \ + asio/ip/resolver_query_base.hpp \ + asio/ip/resolver_service.hpp \ + asio/ip/tcp.hpp \ + asio/ip/udp.hpp \ + asio/ip/unicast.hpp \ + asio/ip/v6_only.hpp \ + asio/is_executor.hpp \ + asio/is_read_buffered.hpp \ + asio/is_write_buffered.hpp \ + asio/local/basic_endpoint.hpp \ + asio/local/connect_pair.hpp \ + asio/local/datagram_protocol.hpp \ + asio/local/detail/endpoint.hpp \ + asio/local/detail/impl/endpoint.ipp \ + asio/local/stream_protocol.hpp \ + asio/package.hpp \ + asio/placeholders.hpp \ + asio/posix/basic_descriptor.hpp \ + asio/posix/basic_stream_descriptor.hpp \ + asio/posix/descriptor_base.hpp \ + asio/posix/stream_descriptor.hpp \ + asio/posix/stream_descriptor_service.hpp \ + asio/post.hpp \ + asio/raw_socket_service.hpp \ + asio/read_at.hpp \ + asio/read.hpp \ + asio/read_until.hpp \ + asio/seq_packet_socket_service.hpp \ + asio/serial_port_base.hpp \ + asio/serial_port.hpp \ + asio/serial_port_service.hpp \ + asio/signal_set.hpp \ + asio/signal_set_service.hpp \ + asio/socket_acceptor_service.hpp \ + asio/socket_base.hpp \ + asio/spawn.hpp \ + asio/ssl/context_base.hpp \ + asio/ssl/context.hpp \ + asio/ssl/detail/buffered_handshake_op.hpp \ + asio/ssl/detail/engine.hpp \ + asio/ssl/detail/handshake_op.hpp \ + asio/ssl/detail/impl/engine.ipp \ + asio/ssl/detail/impl/openssl_init.ipp \ + asio/ssl/detail/io.hpp \ + asio/ssl/detail/openssl_init.hpp \ + asio/ssl/detail/openssl_types.hpp \ + asio/ssl/detail/password_callback.hpp \ + asio/ssl/detail/read_op.hpp \ + asio/ssl/detail/shutdown_op.hpp \ + asio/ssl/detail/stream_core.hpp \ + asio/ssl/detail/verify_callback.hpp \ + asio/ssl/detail/write_op.hpp \ + asio/ssl/error.hpp \ + asio/ssl.hpp \ + asio/ssl/impl/context.hpp \ + asio/ssl/impl/context.ipp \ + asio/ssl/impl/error.ipp \ + asio/ssl/impl/rfc2818_verification.ipp \ + asio/ssl/impl/src.hpp \ + asio/ssl/rfc2818_verification.hpp \ + asio/ssl/stream_base.hpp \ + asio/ssl/stream.hpp \ + asio/ssl/verify_context.hpp \ + asio/ssl/verify_mode.hpp \ + asio/steady_timer.hpp \ + asio/strand.hpp \ + asio/streambuf.hpp \ + asio/stream_socket_service.hpp \ + asio/system_error.hpp \ + asio/system_executor.hpp \ + asio/system_timer.hpp \ + asio/thread.hpp \ + asio/thread_pool.hpp \ + asio/time_traits.hpp \ + asio/ts/buffer.hpp \ + asio/ts/executor.hpp \ + asio/ts/internet.hpp \ + asio/ts/io_context.hpp \ + asio/ts/networking.hpp \ + asio/ts/socket.hpp \ + asio/ts/thread_pool.hpp \ + asio/ts/timer.hpp \ + asio/unyield.hpp \ + asio/use_future.hpp \ + asio/uses_executor.hpp \ + asio/version.hpp \ + asio/waitable_timer_service.hpp \ + asio/wait_traits.hpp \ + asio/windows/basic_handle.hpp \ + asio/windows/basic_object_handle.hpp \ + asio/windows/basic_random_access_handle.hpp \ + asio/windows/basic_stream_handle.hpp \ + asio/windows/object_handle.hpp \ + asio/windows/object_handle_service.hpp \ + asio/windows/overlapped_ptr.hpp \ + asio/windows/random_access_handle.hpp \ + asio/windows/random_access_handle_service.hpp \ + asio/windows/stream_handle.hpp \ + asio/windows/stream_handle_service.hpp \ + asio/write_at.hpp \ + asio/write.hpp \ + asio/yield.hpp + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio.hpp new file mode 100644 index 0000000..7cbf667 --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio.hpp @@ -0,0 +1,146 @@ +// +// asio.hpp +// ~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_HPP +#define ASIO_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/associated_allocator.hpp" +#include "asio/associated_executor.hpp" +#include "asio/async_result.hpp" +#include "asio/basic_datagram_socket.hpp" +#include "asio/basic_deadline_timer.hpp" +#include "asio/basic_io_object.hpp" +#include "asio/basic_raw_socket.hpp" +#include "asio/basic_seq_packet_socket.hpp" +#include "asio/basic_serial_port.hpp" +#include "asio/basic_signal_set.hpp" +#include "asio/basic_socket_acceptor.hpp" +#include "asio/basic_socket_iostream.hpp" +#include "asio/basic_socket_streambuf.hpp" +#include "asio/basic_stream_socket.hpp" +#include "asio/basic_streambuf.hpp" +#include "asio/basic_waitable_timer.hpp" +#include "asio/bind_executor.hpp" +#include "asio/buffer.hpp" +#include "asio/buffered_read_stream_fwd.hpp" +#include "asio/buffered_read_stream.hpp" +#include "asio/buffered_stream_fwd.hpp" +#include "asio/buffered_stream.hpp" +#include "asio/buffered_write_stream_fwd.hpp" +#include "asio/buffered_write_stream.hpp" +#include "asio/buffers_iterator.hpp" +#include "asio/completion_condition.hpp" +#include "asio/connect.hpp" +#include "asio/coroutine.hpp" +#include "asio/datagram_socket_service.hpp" +#include "asio/deadline_timer_service.hpp" +#include "asio/deadline_timer.hpp" +#include "asio/defer.hpp" +#include "asio/dispatch.hpp" +#include "asio/error.hpp" +#include "asio/error_code.hpp" +#include "asio/execution_context.hpp" +#include "asio/executor.hpp" +#include "asio/executor_work_guard.hpp" +#include "asio/generic/basic_endpoint.hpp" +#include "asio/generic/datagram_protocol.hpp" +#include "asio/generic/raw_protocol.hpp" +#include "asio/generic/seq_packet_protocol.hpp" +#include "asio/generic/stream_protocol.hpp" +#include "asio/handler_alloc_hook.hpp" +#include "asio/handler_continuation_hook.hpp" +#include "asio/handler_invoke_hook.hpp" +#include "asio/handler_type.hpp" +#include "asio/io_context.hpp" +#include "asio/io_context_strand.hpp" +#include "asio/io_service.hpp" +#include "asio/io_service_strand.hpp" +#include "asio/ip/address.hpp" +#include "asio/ip/address_v4.hpp" +#include "asio/ip/address_v4_iterator.hpp" +#include "asio/ip/address_v4_range.hpp" +#include "asio/ip/address_v6.hpp" +#include "asio/ip/address_v6_iterator.hpp" +#include "asio/ip/address_v6_range.hpp" +#include "asio/ip/bad_address_cast.hpp" +#include "asio/ip/basic_endpoint.hpp" +#include "asio/ip/basic_resolver.hpp" +#include "asio/ip/basic_resolver_entry.hpp" +#include "asio/ip/basic_resolver_iterator.hpp" +#include "asio/ip/basic_resolver_query.hpp" +#include "asio/ip/host_name.hpp" +#include "asio/ip/icmp.hpp" +#include "asio/ip/multicast.hpp" +#include "asio/ip/resolver_base.hpp" +#include "asio/ip/resolver_query_base.hpp" +#include "asio/ip/resolver_service.hpp" +#include "asio/ip/tcp.hpp" +#include "asio/ip/udp.hpp" +#include "asio/ip/unicast.hpp" +#include "asio/ip/v6_only.hpp" +#include "asio/is_executor.hpp" +#include "asio/is_read_buffered.hpp" +#include "asio/is_write_buffered.hpp" +#include "asio/local/basic_endpoint.hpp" +#include "asio/local/connect_pair.hpp" +#include "asio/local/datagram_protocol.hpp" +#include "asio/local/stream_protocol.hpp" +#include "asio/placeholders.hpp" +#include "asio/posix/basic_descriptor.hpp" +#include "asio/posix/basic_stream_descriptor.hpp" +#include "asio/posix/descriptor.hpp" +#include "asio/posix/descriptor_base.hpp" +#include "asio/posix/stream_descriptor.hpp" +#include "asio/posix/stream_descriptor_service.hpp" +#include "asio/post.hpp" +#include "asio/raw_socket_service.hpp" +#include "asio/read.hpp" +#include "asio/read_at.hpp" +#include "asio/read_until.hpp" +#include "asio/seq_packet_socket_service.hpp" +#include "asio/serial_port.hpp" +#include "asio/serial_port_base.hpp" +#include "asio/serial_port_service.hpp" +#include "asio/signal_set.hpp" +#include "asio/signal_set_service.hpp" +#include "asio/socket_acceptor_service.hpp" +#include "asio/socket_base.hpp" +#include "asio/strand.hpp" +#include "asio/stream_socket_service.hpp" +#include "asio/streambuf.hpp" +#include "asio/system_error.hpp" +#include "asio/system_executor.hpp" +#include "asio/thread.hpp" +#include "asio/thread_pool.hpp" +#include "asio/time_traits.hpp" +#include "asio/uses_executor.hpp" +#include "asio/version.hpp" +#include "asio/wait_traits.hpp" +#include "asio/waitable_timer_service.hpp" +#include "asio/windows/basic_handle.hpp" +#include "asio/windows/basic_object_handle.hpp" +#include "asio/windows/basic_random_access_handle.hpp" +#include "asio/windows/basic_stream_handle.hpp" +#include "asio/windows/object_handle.hpp" +#include "asio/windows/object_handle_service.hpp" +#include "asio/windows/overlapped_handle.hpp" +#include "asio/windows/overlapped_ptr.hpp" +#include "asio/windows/random_access_handle.hpp" +#include "asio/windows/random_access_handle_service.hpp" +#include "asio/windows/stream_handle.hpp" +#include "asio/windows/stream_handle_service.hpp" +#include "asio/write.hpp" +#include "asio/write_at.hpp" + +#endif // ASIO_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/associated_allocator.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/associated_allocator.hpp new file mode 100644 index 0000000..4b78ba4 --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/associated_allocator.hpp @@ -0,0 +1,123 @@ +// +// associated_allocator.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ASSOCIATED_ALLOCATOR_HPP +#define ASIO_ASSOCIATED_ALLOCATOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/detail/type_traits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct associated_allocator_check +{ + typedef void type; +}; + +template +struct associated_allocator_impl +{ + typedef E type; + + static type get(const T&, const E& e) ASIO_NOEXCEPT + { + return e; + } +}; + +template +struct associated_allocator_impl::type> +{ + typedef typename T::allocator_type type; + + static type get(const T& t, const E&) ASIO_NOEXCEPT + { + return t.get_allocator(); + } +}; + +} // namespace detail + +/// Traits type used to obtain the allocator associated with an object. +/** + * A program may specialise this traits type if the @c T template parameter in + * the specialisation is a user-defined type. The template parameter @c + * Allocator shall be a type meeting the Allocator requirements. + * + * Specialisations shall meet the following requirements, where @c t is a const + * reference to an object of type @c T, and @c a is an object of type @c + * Allocator. + * + * @li Provide a nested typedef @c type that identifies a type meeting the + * Allocator requirements. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t) and with return type @c type. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t,a) and with return type @c type. + */ +template > +struct associated_allocator +{ + /// If @c T has a nested type @c allocator_type, T::allocator_type. + /// Otherwise @c Allocator. +#if defined(GENERATING_DOCUMENTATION) + typedef see_below type; +#else // defined(GENERATING_DOCUMENTATION) + typedef typename detail::associated_allocator_impl::type type; +#endif // defined(GENERATING_DOCUMENTATION) + + /// If @c T has a nested type @c allocator_type, returns + /// t.get_allocator(). Otherwise returns @c a. + static type get(const T& t, + const Allocator& a = Allocator()) ASIO_NOEXCEPT + { + return detail::associated_allocator_impl::get(t, a); + } +}; + +/// Helper function to obtain an object's associated allocator. +/** + * @returns associated_allocator::get(t) + */ +template +inline typename associated_allocator::type +get_associated_allocator(const T& t) ASIO_NOEXCEPT +{ + return associated_allocator::get(t); +} + +/// Helper function to obtain an object's associated allocator. +/** + * @returns associated_allocator::get(t, a) + */ +template +inline typename associated_allocator::type +get_associated_allocator(const T& t, const Allocator& a) ASIO_NOEXCEPT +{ + return associated_allocator::get(t, a); +} + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_ASSOCIATED_ALLOCATOR_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/associated_executor.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/associated_executor.hpp new file mode 100644 index 0000000..9389d55 --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/associated_executor.hpp @@ -0,0 +1,142 @@ +// +// associated_executor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ASSOCIATED_EXECUTOR_HPP +#define ASIO_ASSOCIATED_EXECUTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/is_executor.hpp" +#include "asio/system_executor.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct associated_executor_check +{ + typedef void type; +}; + +template +struct associated_executor_impl +{ + typedef E type; + + static type get(const T&, const E& e) ASIO_NOEXCEPT + { + return e; + } +}; + +template +struct associated_executor_impl::type> +{ + typedef typename T::executor_type type; + + static type get(const T& t, const E&) ASIO_NOEXCEPT + { + return t.get_executor(); + } +}; + +} // namespace detail + +/// Traits type used to obtain the executor associated with an object. +/** + * A program may specialise this traits type if the @c T template parameter in + * the specialisation is a user-defined type. The template parameter @c + * Executor shall be a type meeting the Executor requirements. + * + * Specialisations shall meet the following requirements, where @c t is a const + * reference to an object of type @c T, and @c e is an object of type @c + * Executor. + * + * @li Provide a nested typedef @c type that identifies a type meeting the + * Executor requirements. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t) and with return type @c type. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t,e) and with return type @c type. + */ +template +struct associated_executor +{ + /// If @c T has a nested type @c executor_type, T::executor_type. + /// Otherwise @c Executor. +#if defined(GENERATING_DOCUMENTATION) + typedef see_below type; +#else // defined(GENERATING_DOCUMENTATION) + typedef typename detail::associated_executor_impl::type type; +#endif // defined(GENERATING_DOCUMENTATION) + + /// If @c T has a nested type @c executor_type, returns + /// t.get_executor(). Otherwise returns @c ex. + static type get(const T& t, + const Executor& ex = Executor()) ASIO_NOEXCEPT + { + return detail::associated_executor_impl::get(t, ex); + } +}; + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_executor::get(t) + */ +template +inline typename associated_executor::type +get_associated_executor(const T& t) ASIO_NOEXCEPT +{ + return associated_executor::get(t); +} + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_executor::get(t, ex) + */ +template +inline typename associated_executor::type +get_associated_executor(const T& t, const Executor& ex, + typename enable_if::value>::type* = 0) ASIO_NOEXCEPT +{ + return associated_executor::get(t, ex); +} + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_executor::get(t, ctx.get_executor()) + */ +template +inline typename associated_executor::type +get_associated_executor(const T& t, ExecutionContext& ctx, + typename enable_if::value>::type* = 0) ASIO_NOEXCEPT +{ + return associated_executor::get(t, ctx.get_executor()); +} + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_ASSOCIATED_EXECUTOR_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/async_result.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/async_result.hpp new file mode 100644 index 0000000..12ccd1e --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/async_result.hpp @@ -0,0 +1,125 @@ +// +// async_result.hpp +// ~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ASYNC_RESULT_HPP +#define ASIO_ASYNC_RESULT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/handler_type.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// An interface for customising the behaviour of an initiating function. +/** + * This template may be specialised for user-defined handler types. + */ +template +class async_result +{ +public: + /// The return type of the initiating function. + typedef void type; + + /// Construct an async result from a given handler. + /** + * When using a specalised async_result, the constructor has an opportunity + * to initialise some state associated with the handler, which is then + * returned from the initiating function. + */ + explicit async_result(Handler&) + { + } + + /// Obtain the value to be returned from the initiating function. + type get() + { + } +}; + +/// Helper template to deduce the real type of a handler, capture a local copy +/// of the handler, and then create an async_result for the handler. +template +struct async_completion +{ + /// The real handler type to be used for the asynchronous operation. + typedef typename asio::handler_type< + Handler, Signature>::type handler_type; + + /// Constructor. + /** + * The constructor creates the concrete handler and makes the link between + * the handler and the asynchronous result. + */ +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + explicit async_completion( + Handler& orig_handler) + : handler(static_cast::value, + handler_type&, Handler&&>::type>(orig_handler)), + result(handler) + { + } +#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + explicit async_completion(const Handler& orig_handler) + : handler(orig_handler), + result(handler) + { + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// A copy of, or reference to, a real handler object. +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + typename conditional< + is_same::value, + handler_type&, handler_type>::type handler; +#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + typename asio::handler_type::type handler; +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// The result of the asynchronous operation's initiating function. + async_result::type> result; +}; + +namespace detail { + +template +struct async_result_type_helper +{ + typedef typename async_result< + typename handler_type::type + >::type type; +}; + +} // namespace detail +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if defined(GENERATING_DOCUMENTATION) +# define ASIO_INITFN_RESULT_TYPE(h, sig) \ + void_or_deduced +#elif defined(_MSC_VER) && (_MSC_VER < 1500) +# define ASIO_INITFN_RESULT_TYPE(h, sig) \ + typename ::asio::detail::async_result_type_helper::type +#else +# define ASIO_INITFN_RESULT_TYPE(h, sig) \ + typename ::asio::async_result< \ + typename ::asio::handler_type::type>::type +#endif + +#endif // ASIO_ASYNC_RESULT_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_datagram_socket.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_datagram_socket.hpp new file mode 100644 index 0000000..f72ebbf --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_datagram_socket.hpp @@ -0,0 +1,1037 @@ +// +// basic_datagram_socket.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_DATAGRAM_SOCKET_HPP +#define ASIO_BASIC_DATAGRAM_SOCKET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/basic_socket.hpp" +#include "asio/datagram_socket_service.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Provides datagram-oriented socket functionality. +/** + * The basic_datagram_socket class template provides asynchronous and blocking + * datagram-oriented socket functionality. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + */ +template )> +class basic_datagram_socket + : public basic_socket +{ +public: + /// The native representation of a socket. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename basic_socket< + Protocol ASIO_SVC_TARG>::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// Construct a basic_datagram_socket without opening it. + /** + * This constructor creates a datagram socket without opening it. The open() + * function must be called before data can be sent or received on the socket. + * + * @param io_context The io_context object that the datagram socket will use + * to dispatch handlers for any asynchronous operations performed on the + * socket. + */ + explicit basic_datagram_socket(asio::io_context& io_context) + : basic_socket(io_context) + { + } + + /// Construct and open a basic_datagram_socket. + /** + * This constructor creates and opens a datagram socket. + * + * @param io_context The io_context object that the datagram socket will use + * to dispatch handlers for any asynchronous operations performed on the + * socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_datagram_socket(asio::io_context& io_context, + const protocol_type& protocol) + : basic_socket(io_context, protocol) + { + } + + /// Construct a basic_datagram_socket, opening it and binding it to the given + /// local endpoint. + /** + * This constructor creates a datagram socket and automatically opens it bound + * to the specified endpoint on the local machine. The protocol used is the + * protocol associated with the given endpoint. + * + * @param io_context The io_context object that the datagram socket will use + * to dispatch handlers for any asynchronous operations performed on the + * socket. + * + * @param endpoint An endpoint on the local machine to which the datagram + * socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + basic_datagram_socket(asio::io_context& io_context, + const endpoint_type& endpoint) + : basic_socket(io_context, endpoint) + { + } + + /// Construct a basic_datagram_socket on an existing native socket. + /** + * This constructor creates a datagram socket object to hold an existing + * native socket. + * + * @param io_context The io_context object that the datagram socket will use + * to dispatch handlers for any asynchronous operations performed on the + * socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + basic_datagram_socket(asio::io_context& io_context, + const protocol_type& protocol, const native_handle_type& native_socket) + : basic_socket( + io_context, protocol, native_socket) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_datagram_socket from another. + /** + * This constructor moves a datagram socket from one object to another. + * + * @param other The other basic_datagram_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_datagram_socket(io_context&) constructor. + */ + basic_datagram_socket(basic_datagram_socket&& other) + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_datagram_socket from another. + /** + * This assignment operator moves a datagram socket from one object to + * another. + * + * @param other The other basic_datagram_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_datagram_socket(io_context&) constructor. + */ + basic_datagram_socket& operator=(basic_datagram_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } + + /// Move-construct a basic_datagram_socket from a socket of another protocol + /// type. + /** + * This constructor moves a datagram socket from one object to another. + * + * @param other The other basic_datagram_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_datagram_socket(io_context&) constructor. + */ + template + basic_datagram_socket( + basic_datagram_socket&& other, + typename enable_if::value>::type* = 0) + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_datagram_socket from a socket of another protocol + /// type. + /** + * This assignment operator moves a datagram socket from one object to + * another. + * + * @param other The other basic_datagram_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_datagram_socket(io_context&) constructor. + */ + template + typename enable_if::value, + basic_datagram_socket>::type& operator=( + basic_datagram_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the socket. + /** + * This function destroys the socket, cancelling any outstanding asynchronous + * operations associated with the socket as if by calling @c cancel. + */ + ~basic_datagram_socket() + { + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the datagram socket. The function + * call will block until the data has been sent successfully or an error + * occurs. + * + * @param buffers One ore more data buffers to be sent on the socket. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected datagram socket. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code socket.send(asio::buffer(data, size)); @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send(const ConstBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->get_service().send( + this->get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the datagram socket. The function + * call will block until the data has been sent successfully or an error + * occurs. + * + * @param buffers One ore more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected datagram socket. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->get_service().send( + this->get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the datagram socket. The function + * call will block until the data has been sent successfully or an error + * occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected datagram socket. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->get_service().send( + this->get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous send on a connected socket. + /** + * This function is used to asynchronously send data on the datagram socket. + * The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @note The async_send operation can only be used with a connected socket. + * Use the async_send_to function to send data on an unconnected datagram + * socket. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.async_send(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_send(this->get_implementation(), + buffers, 0, ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send(this->get_implementation(), + buffers, 0, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Start an asynchronous send on a connected socket. + /** + * This function is used to asynchronously send data on the datagram socket. + * The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @note The async_send operation can only be used with a connected socket. + * Use the async_send_to function to send data on an unconnected datagram + * socket. + */ + template + ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_send(this->get_implementation(), + buffers, flags, ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send(this->get_implementation(), + buffers, flags, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Send a datagram to the specified endpoint. + /** + * This function is used to send a datagram to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * asio::ip::udp::endpoint destination( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.send_to(asio::buffer(data, size), destination); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination) + { + asio::error_code ec; + std::size_t s = this->get_service().send_to( + this->get_implementation(), buffers, destination, 0, ec); + asio::detail::throw_error(ec, "send_to"); + return s; + } + + /// Send a datagram to the specified endpoint. + /** + * This function is used to send a datagram to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->get_service().send_to( + this->get_implementation(), buffers, destination, flags, ec); + asio::detail::throw_error(ec, "send_to"); + return s; + } + + /// Send a datagram to the specified endpoint. + /** + * This function is used to send a datagram to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + asio::error_code& ec) + { + return this->get_service().send_to(this->get_implementation(), + buffers, destination, flags, ec); + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send a datagram to the specified + * remote endpoint. The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param destination The remote endpoint to which the data will be sent. + * Copies will be made of the endpoint as required. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * asio::ip::udp::endpoint destination( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.async_send_to( + * asio::buffer(data, size), destination, handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, + ASIO_MOVE_ARG(WriteHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_send_to( + this->get_implementation(), buffers, destination, 0, + ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send_to( + this->get_implementation(), buffers, destination, 0, + init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send a datagram to the specified + * remote endpoint. The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param destination The remote endpoint to which the data will be sent. + * Copies will be made of the endpoint as required. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + */ + template + ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_send_to( + this->get_implementation(), buffers, destination, flags, + ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send_to( + this->get_implementation(), buffers, destination, flags, + init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the datagram socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected datagram + * socket. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code socket.receive(asio::buffer(data, size)); @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive(const MutableBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->get_service().receive( + this->get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the datagram socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected datagram + * socket. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->get_service().receive( + this->get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the datagram socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected datagram + * socket. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->get_service().receive( + this->get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous receive on a connected socket. + /** + * This function is used to asynchronously receive data from the datagram + * socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @note The async_receive operation can only be used with a connected socket. + * Use the async_receive_from function to receive data on an unconnected + * datagram socket. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.async_receive(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_receive(this->get_implementation(), + buffers, 0, ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive(this->get_implementation(), + buffers, 0, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Start an asynchronous receive on a connected socket. + /** + * This function is used to asynchronously receive data from the datagram + * socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @note The async_receive operation can only be used with a connected socket. + * Use the async_receive_from function to receive data on an unconnected + * datagram socket. + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_receive(this->get_implementation(), + buffers, flags, ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive(this->get_implementation(), + buffers, flags, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Receive a datagram with the endpoint of the sender. + /** + * This function is used to receive a datagram. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the datagram. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * asio::ip::udp::endpoint sender_endpoint; + * socket.receive_from( + * asio::buffer(data, size), sender_endpoint); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint) + { + asio::error_code ec; + std::size_t s = this->get_service().receive_from( + this->get_implementation(), buffers, sender_endpoint, 0, ec); + asio::detail::throw_error(ec, "receive_from"); + return s; + } + + /// Receive a datagram with the endpoint of the sender. + /** + * This function is used to receive a datagram. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the datagram. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->get_service().receive_from( + this->get_implementation(), buffers, sender_endpoint, flags, ec); + asio::detail::throw_error(ec, "receive_from"); + return s; + } + + /// Receive a datagram with the endpoint of the sender. + /** + * This function is used to receive a datagram. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the datagram. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + asio::error_code& ec) + { + return this->get_service().receive_from(this->get_implementation(), + buffers, sender_endpoint, flags, ec); + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive a datagram. The function + * call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the datagram. Ownership of the sender_endpoint object + * is retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code socket.async_receive_from( + * asio::buffer(data, size), sender_endpoint, handler); @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, 0, + ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, 0, + init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive a datagram. The function + * call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the datagram. Ownership of the sender_endpoint object + * is retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, flags, + ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, flags, + init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_DATAGRAM_SOCKET_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_deadline_timer.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_deadline_timer.hpp new file mode 100644 index 0000000..24ddec2 --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_deadline_timer.hpp @@ -0,0 +1,592 @@ +// +// basic_deadline_timer.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_DEADLINE_TIMER_HPP +#define ASIO_BASIC_DEADLINE_TIMER_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_HAS_BOOST_DATE_TIME) \ + || defined(GENERATING_DOCUMENTATION) + +#include +#include "asio/basic_io_object.hpp" +#include "asio/deadline_timer_service.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" +#include "asio/time_traits.hpp" + +#if !defined(ASIO_ENABLE_OLD_SERVICES) +# include "asio/detail/deadline_timer_service.hpp" +# define ASIO_SVC_T detail::deadline_timer_service +#endif // !defined(ASIO_ENABLE_OLD_SERVICES) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Provides waitable timer functionality. +/** + * The basic_deadline_timer class template provides the ability to perform a + * blocking or asynchronous wait for a timer to expire. + * + * A deadline timer is always in one of two states: "expired" or "not expired". + * If the wait() or async_wait() function is called on an expired timer, the + * wait operation will complete immediately. + * + * Most applications will use the asio::deadline_timer typedef. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Examples + * Performing a blocking wait: + * @code + * // Construct a timer without setting an expiry time. + * asio::deadline_timer timer(io_context); + * + * // Set an expiry time relative to now. + * timer.expires_from_now(boost::posix_time::seconds(5)); + * + * // Wait for the timer to expire. + * timer.wait(); + * @endcode + * + * @par + * Performing an asynchronous wait: + * @code + * void handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Timer expired. + * } + * } + * + * ... + * + * // Construct a timer with an absolute expiry time. + * asio::deadline_timer timer(io_context, + * boost::posix_time::time_from_string("2005-12-07 23:59:59.000")); + * + * // Start an asynchronous wait. + * timer.async_wait(handler); + * @endcode + * + * @par Changing an active deadline_timer's expiry time + * + * Changing the expiry time of a timer while there are pending asynchronous + * waits causes those wait operations to be cancelled. To ensure that the action + * associated with the timer is performed only once, use something like this: + * used: + * + * @code + * void on_some_event() + * { + * if (my_timer.expires_from_now(seconds(5)) > 0) + * { + * // We managed to cancel the timer. Start new asynchronous wait. + * my_timer.async_wait(on_timeout); + * } + * else + * { + * // Too late, timer has already expired! + * } + * } + * + * void on_timeout(const asio::error_code& e) + * { + * if (e != asio::error::operation_aborted) + * { + * // Timer was not cancelled, take necessary action. + * } + * } + * @endcode + * + * @li The asio::basic_deadline_timer::expires_from_now() function + * cancels any pending asynchronous waits, and returns the number of + * asynchronous waits that were cancelled. If it returns 0 then you were too + * late and the wait handler has already been executed, or will soon be + * executed. If it returns 1 then the wait handler was successfully cancelled. + * + * @li If a wait handler is cancelled, the asio::error_code passed to + * it contains the value asio::error::operation_aborted. + */ +template + ASIO_SVC_TPARAM_DEF2(= deadline_timer_service)> +class basic_deadline_timer + : ASIO_SVC_ACCESS basic_io_object +{ +public: + /// The type of the executor associated with the object. + typedef io_context::executor_type executor_type; + + /// The time traits type. + typedef TimeTraits traits_type; + + /// The time type. + typedef typename traits_type::time_type time_type; + + /// The duration type. + typedef typename traits_type::duration_type duration_type; + + /// Constructor. + /** + * This constructor creates a timer without setting an expiry time. The + * expires_at() or expires_from_now() functions must be called to set an + * expiry time before the timer can be waited on. + * + * @param io_context The io_context object that the timer will use to dispatch + * handlers for any asynchronous operations performed on the timer. + */ + explicit basic_deadline_timer(asio::io_context& io_context) + : basic_io_object(io_context) + { + } + + /// Constructor to set a particular expiry time as an absolute time. + /** + * This constructor creates a timer and sets the expiry time. + * + * @param io_context The io_context object that the timer will use to dispatch + * handlers for any asynchronous operations performed on the timer. + * + * @param expiry_time The expiry time to be used for the timer, expressed + * as an absolute time. + */ + basic_deadline_timer(asio::io_context& io_context, + const time_type& expiry_time) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().expires_at(this->get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_at"); + } + + /// Constructor to set a particular expiry time relative to now. + /** + * This constructor creates a timer and sets the expiry time. + * + * @param io_context The io_context object that the timer will use to dispatch + * handlers for any asynchronous operations performed on the timer. + * + * @param expiry_time The expiry time to be used for the timer, relative to + * now. + */ + basic_deadline_timer(asio::io_context& io_context, + const duration_type& expiry_time) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().expires_from_now( + this->get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_from_now"); + } + + /// Destroys the timer. + /** + * This function destroys the timer, cancelling any outstanding asynchronous + * wait operations associated with the timer as if by calling @c cancel. + */ + ~basic_deadline_timer() + { + } + +#if defined(ASIO_ENABLE_OLD_SERVICES) + // These functions are provided by basic_io_object<>. +#else // defined(ASIO_ENABLE_OLD_SERVICES) +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use get_executor().) Get the io_context associated with the + /// object. + /** + * This function may be used to obtain the io_context object that the I/O + * object uses to dispatch handlers for asynchronous operations. + * + * @return A reference to the io_context object that the I/O object will use + * to dispatch handlers. Ownership is not transferred to the caller. + */ + asio::io_context& get_io_context() + { + return basic_io_object::get_io_context(); + } + + /// (Deprecated: Use get_executor().) Get the io_context associated with the + /// object. + /** + * This function may be used to obtain the io_context object that the I/O + * object uses to dispatch handlers for asynchronous operations. + * + * @return A reference to the io_context object that the I/O object will use + * to dispatch handlers. Ownership is not transferred to the caller. + */ + asio::io_context& get_io_service() + { + return basic_io_object::get_io_service(); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return basic_io_object::get_executor(); + } +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + + /// Cancel any asynchronous operations that are waiting on the timer. + /** + * This function forces the completion of any pending asynchronous wait + * operations against the timer. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @return The number of asynchronous operations that were cancelled. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel() + { + asio::error_code ec; + std::size_t s = this->get_service().cancel(this->get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + return s; + } + + /// Cancel any asynchronous operations that are waiting on the timer. + /** + * This function forces the completion of any pending asynchronous wait + * operations against the timer. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel(asio::error_code& ec) + { + return this->get_service().cancel(this->get_implementation(), ec); + } + + /// Cancels one asynchronous operation that is waiting on the timer. + /** + * This function forces the completion of one pending asynchronous wait + * operation against the timer. Handlers are cancelled in FIFO order. The + * handler for the cancelled operation will be invoked with the + * asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @return The number of asynchronous operations that were cancelled. That is, + * either 0 or 1. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when cancel_one() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel_one() + { + asio::error_code ec; + std::size_t s = this->get_service().cancel_one( + this->get_implementation(), ec); + asio::detail::throw_error(ec, "cancel_one"); + return s; + } + + /// Cancels one asynchronous operation that is waiting on the timer. + /** + * This function forces the completion of one pending asynchronous wait + * operation against the timer. Handlers are cancelled in FIFO order. The + * handler for the cancelled operation will be invoked with the + * asio::error::operation_aborted error code. + * + * Cancelling the timer does not change the expiry time. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. That is, + * either 0 or 1. + * + * @note If the timer has already expired when cancel_one() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t cancel_one(asio::error_code& ec) + { + return this->get_service().cancel_one(this->get_implementation(), ec); + } + + /// Get the timer's expiry time as an absolute time. + /** + * This function may be used to obtain the timer's current expiry time. + * Whether the timer has expired or not does not affect this value. + */ + time_type expires_at() const + { + return this->get_service().expires_at(this->get_implementation()); + } + + /// Set the timer's expiry time as an absolute time. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @return The number of asynchronous operations that were cancelled. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_at() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_at(const time_type& expiry_time) + { + asio::error_code ec; + std::size_t s = this->get_service().expires_at( + this->get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_at"); + return s; + } + + /// Set the timer's expiry time as an absolute time. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when expires_at() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_at(const time_type& expiry_time, + asio::error_code& ec) + { + return this->get_service().expires_at( + this->get_implementation(), expiry_time, ec); + } + + /// Get the timer's expiry time relative to now. + /** + * This function may be used to obtain the timer's current expiry time. + * Whether the timer has expired or not does not affect this value. + */ + duration_type expires_from_now() const + { + return this->get_service().expires_from_now(this->get_implementation()); + } + + /// Set the timer's expiry time relative to now. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @return The number of asynchronous operations that were cancelled. + * + * @throws asio::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_from_now() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_from_now(const duration_type& expiry_time) + { + asio::error_code ec; + std::size_t s = this->get_service().expires_from_now( + this->get_implementation(), expiry_time, ec); + asio::detail::throw_error(ec, "expires_from_now"); + return s; + } + + /// Set the timer's expiry time relative to now. + /** + * This function sets the expiry time. Any pending asynchronous wait + * operations will be cancelled. The handler for each cancelled operation will + * be invoked with the asio::error::operation_aborted error code. + * + * @param expiry_time The expiry time to be used for the timer. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when expires_from_now() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + std::size_t expires_from_now(const duration_type& expiry_time, + asio::error_code& ec) + { + return this->get_service().expires_from_now( + this->get_implementation(), expiry_time, ec); + } + + /// Perform a blocking wait on the timer. + /** + * This function is used to wait for the timer to expire. This function + * blocks and does not return until the timer has expired. + * + * @throws asio::system_error Thrown on failure. + */ + void wait() + { + asio::error_code ec; + this->get_service().wait(this->get_implementation(), ec); + asio::detail::throw_error(ec, "wait"); + } + + /// Perform a blocking wait on the timer. + /** + * This function is used to wait for the timer to expire. This function + * blocks and does not return until the timer has expired. + * + * @param ec Set to indicate what error occurred, if any. + */ + void wait(asio::error_code& ec) + { + this->get_service().wait(this->get_implementation(), ec); + } + + /// Start an asynchronous wait on the timer. + /** + * This function may be used to initiate an asynchronous wait against the + * timer. It always returns immediately. + * + * For each call to async_wait(), the supplied handler will be called exactly + * once. The handler will be called when: + * + * @li The timer has expired. + * + * @li The timer was cancelled, in which case the handler is passed the error + * code asio::error::operation_aborted. + * + * @param handler The handler to be called when the timer expires. Copies + * will be made of the handler as required. The function signature of the + * handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + */ + template + ASIO_INITFN_RESULT_TYPE(WaitHandler, + void (asio::error_code)) + async_wait(ASIO_MOVE_ARG(WaitHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WaitHandler. + ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_wait(this->get_implementation(), + ASIO_MOVE_CAST(WaitHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_wait(this->get_implementation(), init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if !defined(ASIO_ENABLE_OLD_SERVICES) +# undef ASIO_SVC_T +#endif // !defined(ASIO_ENABLE_OLD_SERVICES) + +#endif // defined(ASIO_HAS_BOOST_DATE_TIME) + // || defined(GENERATING_DOCUMENTATION) + +#endif // ASIO_BASIC_DEADLINE_TIMER_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_io_object.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_io_object.hpp new file mode 100644 index 0000000..40cf896 --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_io_object.hpp @@ -0,0 +1,274 @@ +// +// basic_io_object.hpp +// ~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_IO_OBJECT_HPP +#define ASIO_BASIC_IO_OBJECT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/io_context.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +#if defined(ASIO_HAS_MOVE) +namespace detail +{ + // Type trait used to determine whether a service supports move. + template + class service_has_move + { + private: + typedef IoObjectService service_type; + typedef typename service_type::implementation_type implementation_type; + + template + static auto eval(T* t, U* u) -> decltype(t->move_construct(*u, *u), char()); + static char (&eval(...))[2]; + + public: + static const bool value = + sizeof(service_has_move::eval( + static_cast(0), + static_cast(0))) == 1; + }; +} +#endif // defined(ASIO_HAS_MOVE) + +/// Base class for all I/O objects. +/** + * @note All I/O objects are non-copyable. However, when using C++0x, certain + * I/O objects do support move construction and move assignment. + */ +#if !defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +template +#else +template ::value> +#endif +class basic_io_object +{ +public: + /// The type of the service that will be used to provide I/O operations. + typedef IoObjectService service_type; + + /// The underlying implementation type of I/O object. + typedef typename service_type::implementation_type implementation_type; + +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use get_executor().) Get the io_context associated with the + /// object. + /** + * This function may be used to obtain the io_context object that the I/O + * object uses to dispatch handlers for asynchronous operations. + * + * @return A reference to the io_context object that the I/O object will use + * to dispatch handlers. Ownership is not transferred to the caller. + */ + asio::io_context& get_io_context() + { + return service_.get_io_context(); + } + + /// (Deprecated: Use get_executor().) Get the io_context associated with the + /// object. + /** + * This function may be used to obtain the io_context object that the I/O + * object uses to dispatch handlers for asynchronous operations. + * + * @return A reference to the io_context object that the I/O object will use + * to dispatch handlers. Ownership is not transferred to the caller. + */ + asio::io_context& get_io_service() + { + return service_.get_io_context(); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// The type of the executor associated with the object. + typedef asio::io_context::executor_type executor_type; + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return service_.get_io_context().get_executor(); + } + +protected: + /// Construct a basic_io_object. + /** + * Performs: + * @code get_service().construct(get_implementation()); @endcode + */ + explicit basic_io_object(asio::io_context& io_context) + : service_(asio::use_service(io_context)) + { + service_.construct(implementation_); + } + +#if defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_io_object. + /** + * Performs: + * @code get_service().move_construct( + * get_implementation(), other.get_implementation()); @endcode + * + * @note Available only for services that support movability, + */ + basic_io_object(basic_io_object&& other); + + /// Move-assign a basic_io_object. + /** + * Performs: + * @code get_service().move_assign(get_implementation(), + * other.get_service(), other.get_implementation()); @endcode + * + * @note Available only for services that support movability, + */ + basic_io_object& operator=(basic_io_object&& other); +#endif // defined(GENERATING_DOCUMENTATION) + + /// Protected destructor to prevent deletion through this type. + /** + * Performs: + * @code get_service().destroy(get_implementation()); @endcode + */ + ~basic_io_object() + { + service_.destroy(implementation_); + } + + /// Get the service associated with the I/O object. + service_type& get_service() + { + return service_; + } + + /// Get the service associated with the I/O object. + const service_type& get_service() const + { + return service_; + } + + /// Get the underlying implementation of the I/O object. + implementation_type& get_implementation() + { + return implementation_; + } + + /// Get the underlying implementation of the I/O object. + const implementation_type& get_implementation() const + { + return implementation_; + } + +private: + basic_io_object(const basic_io_object&); + basic_io_object& operator=(const basic_io_object&); + + // The service associated with the I/O object. + service_type& service_; + + /// The underlying implementation of the I/O object. + implementation_type implementation_; +}; + +#if defined(ASIO_HAS_MOVE) +// Specialisation for movable objects. +template +class basic_io_object +{ +public: + typedef IoObjectService service_type; + typedef typename service_type::implementation_type implementation_type; + +#if !defined(ASIO_NO_DEPRECATED) + asio::io_context& get_io_context() + { + return service_->get_io_context(); + } + + asio::io_context& get_io_service() + { + return service_->get_io_context(); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + typedef asio::io_context::executor_type executor_type; + + executor_type get_executor() ASIO_NOEXCEPT + { + return service_->get_io_context().get_executor(); + } + +protected: + explicit basic_io_object(asio::io_context& io_context) + : service_(&asio::use_service(io_context)) + { + service_->construct(implementation_); + } + + basic_io_object(basic_io_object&& other) + : service_(&other.get_service()) + { + service_->move_construct(implementation_, other.implementation_); + } + + ~basic_io_object() + { + service_->destroy(implementation_); + } + + basic_io_object& operator=(basic_io_object&& other) + { + service_->move_assign(implementation_, + *other.service_, other.implementation_); + service_ = other.service_; + return *this; + } + + service_type& get_service() + { + return *service_; + } + + const service_type& get_service() const + { + return *service_; + } + + implementation_type& get_implementation() + { + return implementation_; + } + + const implementation_type& get_implementation() const + { + return implementation_; + } + +private: + basic_io_object(const basic_io_object&); + void operator=(const basic_io_object&); + + IoObjectService* service_; + implementation_type implementation_; +}; +#endif // defined(ASIO_HAS_MOVE) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_IO_OBJECT_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_raw_socket.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_raw_socket.hpp new file mode 100644 index 0000000..b66b75d --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_raw_socket.hpp @@ -0,0 +1,1027 @@ +// +// basic_raw_socket.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_RAW_SOCKET_HPP +#define ASIO_BASIC_RAW_SOCKET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/basic_socket.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" +#include "asio/raw_socket_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Provides raw-oriented socket functionality. +/** + * The basic_raw_socket class template provides asynchronous and blocking + * raw-oriented socket functionality. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + */ +template )> +class basic_raw_socket + : public basic_socket +{ +public: + /// The native representation of a socket. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename basic_socket< + Protocol ASIO_SVC_TARG>::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// Construct a basic_raw_socket without opening it. + /** + * This constructor creates a raw socket without opening it. The open() + * function must be called before data can be sent or received on the socket. + * + * @param io_context The io_context object that the raw socket will use + * to dispatch handlers for any asynchronous operations performed on the + * socket. + */ + explicit basic_raw_socket(asio::io_context& io_context) + : basic_socket(io_context) + { + } + + /// Construct and open a basic_raw_socket. + /** + * This constructor creates and opens a raw socket. + * + * @param io_context The io_context object that the raw socket will use + * to dispatch handlers for any asynchronous operations performed on the + * socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_raw_socket(asio::io_context& io_context, + const protocol_type& protocol) + : basic_socket(io_context, protocol) + { + } + + /// Construct a basic_raw_socket, opening it and binding it to the given + /// local endpoint. + /** + * This constructor creates a raw socket and automatically opens it bound + * to the specified endpoint on the local machine. The protocol used is the + * protocol associated with the given endpoint. + * + * @param io_context The io_context object that the raw socket will use + * to dispatch handlers for any asynchronous operations performed on the + * socket. + * + * @param endpoint An endpoint on the local machine to which the raw + * socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + basic_raw_socket(asio::io_context& io_context, + const endpoint_type& endpoint) + : basic_socket(io_context, endpoint) + { + } + + /// Construct a basic_raw_socket on an existing native socket. + /** + * This constructor creates a raw socket object to hold an existing + * native socket. + * + * @param io_context The io_context object that the raw socket will use + * to dispatch handlers for any asynchronous operations performed on the + * socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + basic_raw_socket(asio::io_context& io_context, + const protocol_type& protocol, const native_handle_type& native_socket) + : basic_socket( + io_context, protocol, native_socket) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_raw_socket from another. + /** + * This constructor moves a raw socket from one object to another. + * + * @param other The other basic_raw_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_raw_socket(io_context&) constructor. + */ + basic_raw_socket(basic_raw_socket&& other) + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_raw_socket from another. + /** + * This assignment operator moves a raw socket from one object to another. + * + * @param other The other basic_raw_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_raw_socket(io_context&) constructor. + */ + basic_raw_socket& operator=(basic_raw_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } + + /// Move-construct a basic_raw_socket from a socket of another protocol type. + /** + * This constructor moves a raw socket from one object to another. + * + * @param other The other basic_raw_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_raw_socket(io_context&) constructor. + */ + template + basic_raw_socket(basic_raw_socket&& other, + typename enable_if::value>::type* = 0) + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_raw_socket from a socket of another protocol type. + /** + * This assignment operator moves a raw socket from one object to another. + * + * @param other The other basic_raw_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_raw_socket(io_context&) constructor. + */ + template + typename enable_if::value, + basic_raw_socket>::type& operator=( + basic_raw_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the socket. + /** + * This function destroys the socket, cancelling any outstanding asynchronous + * operations associated with the socket as if by calling @c cancel. + */ + ~basic_raw_socket() + { + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the raw socket. The function call + * will block until the data has been sent successfully or an error occurs. + * + * @param buffers One ore more data buffers to be sent on the socket. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected raw socket. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code socket.send(asio::buffer(data, size)); @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send(const ConstBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->get_service().send( + this->get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the raw socket. The function call + * will block until the data has been sent successfully or an error occurs. + * + * @param buffers One ore more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected raw socket. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->get_service().send( + this->get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on a connected socket. + /** + * This function is used to send data on the raw socket. The function call + * will block until the data has been sent successfully or an error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. + * + * @note The send operation can only be used with a connected socket. Use + * the send_to function to send data on an unconnected raw socket. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->get_service().send( + this->get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous send on a connected socket. + /** + * This function is used to send data on the raw socket. The function call + * will block until the data has been sent successfully or an error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @note The async_send operation can only be used with a connected socket. + * Use the async_send_to function to send data on an unconnected raw + * socket. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.async_send(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_send(this->get_implementation(), + buffers, 0, ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send(this->get_implementation(), + buffers, 0, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Start an asynchronous send on a connected socket. + /** + * This function is used to send data on the raw socket. The function call + * will block until the data has been sent successfully or an error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @note The async_send operation can only be used with a connected socket. + * Use the async_send_to function to send data on an unconnected raw + * socket. + */ + template + ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_send(this->get_implementation(), + buffers, flags, ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send(this->get_implementation(), + buffers, flags, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Send raw data to the specified endpoint. + /** + * This function is used to send raw data to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * asio::ip::udp::endpoint destination( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.send_to(asio::buffer(data, size), destination); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination) + { + asio::error_code ec; + std::size_t s = this->get_service().send_to( + this->get_implementation(), buffers, destination, 0, ec); + asio::detail::throw_error(ec, "send_to"); + return s; + } + + /// Send raw data to the specified endpoint. + /** + * This function is used to send raw data to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->get_service().send_to( + this->get_implementation(), buffers, destination, flags, ec); + asio::detail::throw_error(ec, "send_to"); + return s; + } + + /// Send raw data to the specified endpoint. + /** + * This function is used to send raw data to the specified remote endpoint. + * The function call will block until the data has been sent successfully or + * an error occurs. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * + * @param destination The remote endpoint to which the data will be sent. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. + */ + template + std::size_t send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + asio::error_code& ec) + { + return this->get_service().send_to(this->get_implementation(), + buffers, destination, flags, ec); + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send raw data to the specified + * remote endpoint. The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param destination The remote endpoint to which the data will be sent. + * Copies will be made of the endpoint as required. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * asio::ip::udp::endpoint destination( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.async_send_to( + * asio::buffer(data, size), destination, handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, + ASIO_MOVE_ARG(WriteHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_send_to(this->get_implementation(), + buffers, destination, 0, ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send_to(this->get_implementation(), + buffers, destination, 0, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send raw data to the specified + * remote endpoint. The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent to the remote endpoint. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param destination The remote endpoint to which the data will be sent. + * Copies will be made of the endpoint as required. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + */ + template + ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_send_to( + this->get_implementation(), buffers, destination, flags, + ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send_to( + this->get_implementation(), buffers, destination, flags, + init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the raw socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected raw + * socket. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code socket.receive(asio::buffer(data, size)); @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive(const MutableBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->get_service().receive( + this->get_implementation(), buffers, 0, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the raw socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected raw + * socket. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->get_service().receive( + this->get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the raw socket. The function + * call will block until data has been received successfully or an error + * occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. + * + * @note The receive operation can only be used with a connected socket. Use + * the receive_from function to receive data on an unconnected raw + * socket. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->get_service().receive( + this->get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous receive on a connected socket. + /** + * This function is used to asynchronously receive data from the raw + * socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @note The async_receive operation can only be used with a connected socket. + * Use the async_receive_from function to receive data on an unconnected + * raw socket. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.async_receive(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_receive(this->get_implementation(), + buffers, 0, ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive(this->get_implementation(), + buffers, 0, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Start an asynchronous receive on a connected socket. + /** + * This function is used to asynchronously receive data from the raw + * socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @note The async_receive operation can only be used with a connected socket. + * Use the async_receive_from function to receive data on an unconnected + * raw socket. + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_receive(this->get_implementation(), + buffers, flags, ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive(this->get_implementation(), + buffers, flags, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Receive raw data with the endpoint of the sender. + /** + * This function is used to receive raw data. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the data. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * asio::ip::udp::endpoint sender_endpoint; + * socket.receive_from( + * asio::buffer(data, size), sender_endpoint); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint) + { + asio::error_code ec; + std::size_t s = this->get_service().receive_from( + this->get_implementation(), buffers, sender_endpoint, 0, ec); + asio::detail::throw_error(ec, "receive_from"); + return s; + } + + /// Receive raw data with the endpoint of the sender. + /** + * This function is used to receive raw data. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the data. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->get_service().receive_from( + this->get_implementation(), buffers, sender_endpoint, flags, ec); + asio::detail::throw_error(ec, "receive_from"); + return s; + } + + /// Receive raw data with the endpoint of the sender. + /** + * This function is used to receive raw data. The function call will block + * until data has been received successfully or an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the data. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. + */ + template + std::size_t receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + asio::error_code& ec) + { + return this->get_service().receive_from(this->get_implementation(), + buffers, sender_endpoint, flags, ec); + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive raw data. The function + * call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the data. Ownership of the sender_endpoint object + * is retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code socket.async_receive_from( + * asio::buffer(data, size), 0, sender_endpoint, handler); @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, 0, + ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, 0, + init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive raw data. The function + * call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param sender_endpoint An endpoint object that receives the endpoint of + * the remote sender of the data. Ownership of the sender_endpoint object + * is retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param flags Flags specifying how the receive call is to be made. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, socket_base::message_flags flags, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, flags, + ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, flags, + init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_RAW_SOCKET_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_seq_packet_socket.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_seq_packet_socket.hpp new file mode 100644 index 0000000..ec2ab8f --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_seq_packet_socket.hpp @@ -0,0 +1,615 @@ +// +// basic_seq_packet_socket.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SEQ_PACKET_SOCKET_HPP +#define ASIO_BASIC_SEQ_PACKET_SOCKET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/basic_socket.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" +#include "asio/seq_packet_socket_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Provides sequenced packet socket functionality. +/** + * The basic_seq_packet_socket class template provides asynchronous and blocking + * sequenced packet socket functionality. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + */ +template )> +class basic_seq_packet_socket + : public basic_socket +{ +public: + /// The native representation of a socket. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename basic_socket< + Protocol ASIO_SVC_TARG>::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// Construct a basic_seq_packet_socket without opening it. + /** + * This constructor creates a sequenced packet socket without opening it. The + * socket needs to be opened and then connected or accepted before data can + * be sent or received on it. + * + * @param io_context The io_context object that the sequenced packet socket + * will use to dispatch handlers for any asynchronous operations performed on + * the socket. + */ + explicit basic_seq_packet_socket(asio::io_context& io_context) + : basic_socket(io_context) + { + } + + /// Construct and open a basic_seq_packet_socket. + /** + * This constructor creates and opens a sequenced_packet socket. The socket + * needs to be connected or accepted before data can be sent or received on + * it. + * + * @param io_context The io_context object that the sequenced packet socket + * will use to dispatch handlers for any asynchronous operations performed on + * the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_seq_packet_socket(asio::io_context& io_context, + const protocol_type& protocol) + : basic_socket(io_context, protocol) + { + } + + /// Construct a basic_seq_packet_socket, opening it and binding it to the + /// given local endpoint. + /** + * This constructor creates a sequenced packet socket and automatically opens + * it bound to the specified endpoint on the local machine. The protocol used + * is the protocol associated with the given endpoint. + * + * @param io_context The io_context object that the sequenced packet socket + * will use to dispatch handlers for any asynchronous operations performed on + * the socket. + * + * @param endpoint An endpoint on the local machine to which the sequenced + * packet socket will be bound. + * + * @throws asio::system_error Thrown on failure. + */ + basic_seq_packet_socket(asio::io_context& io_context, + const endpoint_type& endpoint) + : basic_socket(io_context, endpoint) + { + } + + /// Construct a basic_seq_packet_socket on an existing native socket. + /** + * This constructor creates a sequenced packet socket object to hold an + * existing native socket. + * + * @param io_context The io_context object that the sequenced packet socket + * will use to dispatch handlers for any asynchronous operations performed on + * the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws asio::system_error Thrown on failure. + */ + basic_seq_packet_socket(asio::io_context& io_context, + const protocol_type& protocol, const native_handle_type& native_socket) + : basic_socket( + io_context, protocol, native_socket) + { + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_seq_packet_socket from another. + /** + * This constructor moves a sequenced packet socket from one object to + * another. + * + * @param other The other basic_seq_packet_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_seq_packet_socket(io_context&) constructor. + */ + basic_seq_packet_socket(basic_seq_packet_socket&& other) + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_seq_packet_socket from another. + /** + * This assignment operator moves a sequenced packet socket from one object to + * another. + * + * @param other The other basic_seq_packet_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_seq_packet_socket(io_context&) constructor. + */ + basic_seq_packet_socket& operator=(basic_seq_packet_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } + + /// Move-construct a basic_seq_packet_socket from a socket of another protocol + /// type. + /** + * This constructor moves a sequenced packet socket from one object to + * another. + * + * @param other The other basic_seq_packet_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_seq_packet_socket(io_context&) constructor. + */ + template + basic_seq_packet_socket( + basic_seq_packet_socket&& other, + typename enable_if::value>::type* = 0) + : basic_socket(std::move(other)) + { + } + + /// Move-assign a basic_seq_packet_socket from a socket of another protocol + /// type. + /** + * This assignment operator moves a sequenced packet socket from one object to + * another. + * + * @param other The other basic_seq_packet_socket object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_seq_packet_socket(io_context&) constructor. + */ + template + typename enable_if::value, + basic_seq_packet_socket>::type& operator=( + basic_seq_packet_socket&& other) + { + basic_socket::operator=(std::move(other)); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the socket. + /** + * This function destroys the socket, cancelling any outstanding asynchronous + * operations associated with the socket as if by calling @c cancel. + */ + ~basic_seq_packet_socket() + { + } + + /// Send some data on the socket. + /** + * This function is used to send data on the sequenced packet socket. The + * function call will block until the data has been sent successfully, or an + * until error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @returns The number of bytes sent. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.send(asio::buffer(data, size), 0); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags) + { + asio::error_code ec; + std::size_t s = this->get_service().send( + this->get_implementation(), buffers, flags, ec); + asio::detail::throw_error(ec, "send"); + return s; + } + + /// Send some data on the socket. + /** + * This function is used to send data on the sequenced packet socket. The + * function call will block the data has been sent successfully, or an until + * error occurs. + * + * @param buffers One or more data buffers to be sent on the socket. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes sent. Returns 0 if an error occurred. + * + * @note The send operation may not transmit all of the data to the peer. + * Consider using the @ref write function if you need to ensure that all data + * is written before the blocking operation completes. + */ + template + std::size_t send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, asio::error_code& ec) + { + return this->get_service().send( + this->get_implementation(), buffers, flags, ec); + } + + /// Start an asynchronous send. + /** + * This function is used to asynchronously send data on the sequenced packet + * socket. The function call always returns immediately. + * + * @param buffers One or more data buffers to be sent on the socket. Although + * the buffers object may be copied as necessary, ownership of the underlying + * memory blocks is retained by the caller, which must guarantee that they + * remain valid until the handler is called. + * + * @param flags Flags specifying how the send call is to be made. + * + * @param handler The handler to be called when the send operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes sent. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * To send a single data buffer use the @ref buffer function as follows: + * @code + * socket.async_send(asio::buffer(data, size), 0, handler); + * @endcode + * See the @ref buffer documentation for information on sending multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, + ASIO_MOVE_ARG(WriteHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_send(this->get_implementation(), + buffers, flags, ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send(this->get_implementation(), + buffers, flags, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Receive some data on the socket. + /** + * This function is used to receive data on the sequenced packet socket. The + * function call will block until data has been received successfully, or + * until an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param out_flags After the receive call completes, contains flags + * associated with the received data. For example, if the + * socket_base::message_end_of_record bit is set then the received data marks + * the end of a record. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.receive(asio::buffer(data, size), out_flags); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags& out_flags) + { + asio::error_code ec; +#if defined(ASIO_ENABLE_OLD_SERVICES) + std::size_t s = this->get_service().receive( + this->get_implementation(), buffers, 0, out_flags, ec); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + std::size_t s = this->get_service().receive_with_flags( + this->get_implementation(), buffers, 0, out_flags, ec); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on the socket. + /** + * This function is used to receive data on the sequenced packet socket. The + * function call will block until data has been received successfully, or + * until an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param in_flags Flags specifying how the receive call is to be made. + * + * @param out_flags After the receive call completes, contains flags + * associated with the received data. For example, if the + * socket_base::message_end_of_record bit is set then the received data marks + * the end of a record. + * + * @returns The number of bytes received. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @note The receive operation may not receive all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that the + * requested amount of data is read before the blocking operation completes. + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.receive(asio::buffer(data, size), 0, out_flags); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags& out_flags) + { + asio::error_code ec; +#if defined(ASIO_ENABLE_OLD_SERVICES) + std::size_t s = this->get_service().receive( + this->get_implementation(), buffers, in_flags, out_flags, ec); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + std::size_t s = this->get_service().receive_with_flags( + this->get_implementation(), buffers, in_flags, out_flags, ec); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + asio::detail::throw_error(ec, "receive"); + return s; + } + + /// Receive some data on a connected socket. + /** + * This function is used to receive data on the sequenced packet socket. The + * function call will block until data has been received successfully, or + * until an error occurs. + * + * @param buffers One or more buffers into which the data will be received. + * + * @param in_flags Flags specifying how the receive call is to be made. + * + * @param out_flags After the receive call completes, contains flags + * associated with the received data. For example, if the + * socket_base::message_end_of_record bit is set then the received data marks + * the end of a record. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes received. Returns 0 if an error occurred. + * + * @note The receive operation may not receive all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that the + * requested amount of data is read before the blocking operation completes. + */ + template + std::size_t receive(const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, asio::error_code& ec) + { +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().receive(this->get_implementation(), + buffers, in_flags, out_flags, ec); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().receive_with_flags(this->get_implementation(), + buffers, in_flags, out_flags, ec); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive data from the sequenced + * packet socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param out_flags Once the asynchronous operation completes, contains flags + * associated with the received data. For example, if the + * socket_base::message_end_of_record bit is set then the received data marks + * the end of a record. The caller must guarantee that the referenced + * variable remains valid until the handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.async_receive(asio::buffer(data, size), out_flags, handler); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags& out_flags, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_receive( + this->get_implementation(), buffers, 0, out_flags, + ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive_with_flags( + this->get_implementation(), buffers, 0, out_flags, + init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Start an asynchronous receive. + /** + * This function is used to asynchronously receive data from the sequenced + * data socket. The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be received. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param in_flags Flags specifying how the receive call is to be made. + * + * @param out_flags Once the asynchronous operation completes, contains flags + * associated with the received data. For example, if the + * socket_base::message_end_of_record bit is set then the received data marks + * the end of a record. The caller must guarantee that the referenced + * variable remains valid until the handler is called. + * + * @param handler The handler to be called when the receive operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes received. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * To receive into a single data buffer use the @ref buffer function as + * follows: + * @code + * socket.async_receive( + * asio::buffer(data, size), + * 0, out_flags, handler); + * @endcode + * See the @ref buffer documentation for information on receiving into + * multiple buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags in_flags, + socket_base::message_flags& out_flags, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_receive( + this->get_implementation(), buffers, in_flags, out_flags, + ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive_with_flags( + this->get_implementation(), buffers, in_flags, out_flags, + init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_BASIC_SEQ_PACKET_SOCKET_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_serial_port.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_serial_port.hpp new file mode 100644 index 0000000..15a7fb4 --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_serial_port.hpp @@ -0,0 +1,683 @@ +// +// basic_serial_port.hpp +// ~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SERIAL_PORT_HPP +#define ASIO_BASIC_SERIAL_PORT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_ENABLE_OLD_SERVICES) + +#if defined(ASIO_HAS_SERIAL_PORT) \ + || defined(GENERATING_DOCUMENTATION) + +#include +#include "asio/basic_io_object.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" +#include "asio/serial_port_base.hpp" +#include "asio/serial_port_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Provides serial port functionality. +/** + * The basic_serial_port class template provides functionality that is common + * to all serial ports. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + */ +template +class basic_serial_port + : public basic_io_object, + public serial_port_base +{ +public: + /// The native representation of a serial port. + typedef typename SerialPortService::native_handle_type native_handle_type; + + /// A basic_serial_port is always the lowest layer. + typedef basic_serial_port lowest_layer_type; + + /// Construct a basic_serial_port without opening it. + /** + * This constructor creates a serial port without opening it. + * + * @param io_context The io_context object that the serial port will use to + * dispatch handlers for any asynchronous operations performed on the port. + */ + explicit basic_serial_port(asio::io_context& io_context) + : basic_io_object(io_context) + { + } + + /// Construct and open a basic_serial_port. + /** + * This constructor creates and opens a serial port for the specified device + * name. + * + * @param io_context The io_context object that the serial port will use to + * dispatch handlers for any asynchronous operations performed on the port. + * + * @param device The platform-specific device name for this serial + * port. + */ + explicit basic_serial_port(asio::io_context& io_context, + const char* device) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().open(this->get_implementation(), device, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct and open a basic_serial_port. + /** + * This constructor creates and opens a serial port for the specified device + * name. + * + * @param io_context The io_context object that the serial port will use to + * dispatch handlers for any asynchronous operations performed on the port. + * + * @param device The platform-specific device name for this serial + * port. + */ + explicit basic_serial_port(asio::io_context& io_context, + const std::string& device) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().open(this->get_implementation(), device, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct a basic_serial_port on an existing native serial port. + /** + * This constructor creates a serial port object to hold an existing native + * serial port. + * + * @param io_context The io_context object that the serial port will use to + * dispatch handlers for any asynchronous operations performed on the port. + * + * @param native_serial_port A native serial port. + * + * @throws asio::system_error Thrown on failure. + */ + basic_serial_port(asio::io_context& io_context, + const native_handle_type& native_serial_port) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().assign(this->get_implementation(), + native_serial_port, ec); + asio::detail::throw_error(ec, "assign"); + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_serial_port from another. + /** + * This constructor moves a serial port from one object to another. + * + * @param other The other basic_serial_port object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_serial_port(io_context&) constructor. + */ + basic_serial_port(basic_serial_port&& other) + : basic_io_object( + ASIO_MOVE_CAST(basic_serial_port)(other)) + { + } + + /// Move-assign a basic_serial_port from another. + /** + * This assignment operator moves a serial port from one object to another. + * + * @param other The other basic_serial_port object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_serial_port(io_context&) constructor. + */ + basic_serial_port& operator=(basic_serial_port&& other) + { + basic_io_object::operator=( + ASIO_MOVE_CAST(basic_serial_port)(other)); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Get a reference to the lowest layer. + /** + * This function returns a reference to the lowest layer in a stack of + * layers. Since a basic_serial_port cannot contain any further layers, it + * simply returns a reference to itself. + * + * @return A reference to the lowest layer in the stack of layers. Ownership + * is not transferred to the caller. + */ + lowest_layer_type& lowest_layer() + { + return *this; + } + + /// Get a const reference to the lowest layer. + /** + * This function returns a const reference to the lowest layer in a stack of + * layers. Since a basic_serial_port cannot contain any further layers, it + * simply returns a reference to itself. + * + * @return A const reference to the lowest layer in the stack of layers. + * Ownership is not transferred to the caller. + */ + const lowest_layer_type& lowest_layer() const + { + return *this; + } + + /// Open the serial port using the specified device name. + /** + * This function opens the serial port for the specified device name. + * + * @param device The platform-specific device name. + * + * @throws asio::system_error Thrown on failure. + */ + void open(const std::string& device) + { + asio::error_code ec; + this->get_service().open(this->get_implementation(), device, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Open the serial port using the specified device name. + /** + * This function opens the serial port using the given platform-specific + * device name. + * + * @param device The platform-specific device name. + * + * @param ec Set the indicate what error occurred, if any. + */ + asio::error_code open(const std::string& device, + asio::error_code& ec) + { + return this->get_service().open(this->get_implementation(), device, ec); + } + + /// Assign an existing native serial port to the serial port. + /* + * This function opens the serial port to hold an existing native serial port. + * + * @param native_serial_port A native serial port. + * + * @throws asio::system_error Thrown on failure. + */ + void assign(const native_handle_type& native_serial_port) + { + asio::error_code ec; + this->get_service().assign(this->get_implementation(), + native_serial_port, ec); + asio::detail::throw_error(ec, "assign"); + } + + /// Assign an existing native serial port to the serial port. + /* + * This function opens the serial port to hold an existing native serial port. + * + * @param native_serial_port A native serial port. + * + * @param ec Set to indicate what error occurred, if any. + */ + asio::error_code assign(const native_handle_type& native_serial_port, + asio::error_code& ec) + { + return this->get_service().assign(this->get_implementation(), + native_serial_port, ec); + } + + /// Determine whether the serial port is open. + bool is_open() const + { + return this->get_service().is_open(this->get_implementation()); + } + + /// Close the serial port. + /** + * This function is used to close the serial port. Any asynchronous read or + * write operations will be cancelled immediately, and will complete with the + * asio::error::operation_aborted error. + * + * @throws asio::system_error Thrown on failure. + */ + void close() + { + asio::error_code ec; + this->get_service().close(this->get_implementation(), ec); + asio::detail::throw_error(ec, "close"); + } + + /// Close the serial port. + /** + * This function is used to close the serial port. Any asynchronous read or + * write operations will be cancelled immediately, and will complete with the + * asio::error::operation_aborted error. + * + * @param ec Set to indicate what error occurred, if any. + */ + asio::error_code close(asio::error_code& ec) + { + return this->get_service().close(this->get_implementation(), ec); + } + + /// Get the native serial port representation. + /** + * This function may be used to obtain the underlying representation of the + * serial port. This is intended to allow access to native serial port + * functionality that is not otherwise provided. + */ + native_handle_type native_handle() + { + return this->get_service().native_handle(this->get_implementation()); + } + + /// Cancel all asynchronous operations associated with the serial port. + /** + * This function causes all outstanding asynchronous read or write operations + * to finish immediately, and the handlers for cancelled operations will be + * passed the asio::error::operation_aborted error. + * + * @throws asio::system_error Thrown on failure. + */ + void cancel() + { + asio::error_code ec; + this->get_service().cancel(this->get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + } + + /// Cancel all asynchronous operations associated with the serial port. + /** + * This function causes all outstanding asynchronous read or write operations + * to finish immediately, and the handlers for cancelled operations will be + * passed the asio::error::operation_aborted error. + * + * @param ec Set to indicate what error occurred, if any. + */ + asio::error_code cancel(asio::error_code& ec) + { + return this->get_service().cancel(this->get_implementation(), ec); + } + + /// Send a break sequence to the serial port. + /** + * This function causes a break sequence of platform-specific duration to be + * sent out the serial port. + * + * @throws asio::system_error Thrown on failure. + */ + void send_break() + { + asio::error_code ec; + this->get_service().send_break(this->get_implementation(), ec); + asio::detail::throw_error(ec, "send_break"); + } + + /// Send a break sequence to the serial port. + /** + * This function causes a break sequence of platform-specific duration to be + * sent out the serial port. + * + * @param ec Set to indicate what error occurred, if any. + */ + asio::error_code send_break(asio::error_code& ec) + { + return this->get_service().send_break(this->get_implementation(), ec); + } + + /// Set an option on the serial port. + /** + * This function is used to set an option on the serial port. + * + * @param option The option value to be set on the serial port. + * + * @throws asio::system_error Thrown on failure. + * + * @sa SettableSerialPortOption @n + * asio::serial_port_base::baud_rate @n + * asio::serial_port_base::flow_control @n + * asio::serial_port_base::parity @n + * asio::serial_port_base::stop_bits @n + * asio::serial_port_base::character_size + */ + template + void set_option(const SettableSerialPortOption& option) + { + asio::error_code ec; + this->get_service().set_option(this->get_implementation(), option, ec); + asio::detail::throw_error(ec, "set_option"); + } + + /// Set an option on the serial port. + /** + * This function is used to set an option on the serial port. + * + * @param option The option value to be set on the serial port. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa SettableSerialPortOption @n + * asio::serial_port_base::baud_rate @n + * asio::serial_port_base::flow_control @n + * asio::serial_port_base::parity @n + * asio::serial_port_base::stop_bits @n + * asio::serial_port_base::character_size + */ + template + asio::error_code set_option(const SettableSerialPortOption& option, + asio::error_code& ec) + { + return this->get_service().set_option( + this->get_implementation(), option, ec); + } + + /// Get an option from the serial port. + /** + * This function is used to get the current value of an option on the serial + * port. + * + * @param option The option value to be obtained from the serial port. + * + * @throws asio::system_error Thrown on failure. + * + * @sa GettableSerialPortOption @n + * asio::serial_port_base::baud_rate @n + * asio::serial_port_base::flow_control @n + * asio::serial_port_base::parity @n + * asio::serial_port_base::stop_bits @n + * asio::serial_port_base::character_size + */ + template + void get_option(GettableSerialPortOption& option) + { + asio::error_code ec; + this->get_service().get_option(this->get_implementation(), option, ec); + asio::detail::throw_error(ec, "get_option"); + } + + /// Get an option from the serial port. + /** + * This function is used to get the current value of an option on the serial + * port. + * + * @param option The option value to be obtained from the serial port. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa GettableSerialPortOption @n + * asio::serial_port_base::baud_rate @n + * asio::serial_port_base::flow_control @n + * asio::serial_port_base::parity @n + * asio::serial_port_base::stop_bits @n + * asio::serial_port_base::character_size + */ + template + asio::error_code get_option(GettableSerialPortOption& option, + asio::error_code& ec) + { + return this->get_service().get_option( + this->get_implementation(), option, ec); + } + + /// Write some data to the serial port. + /** + * This function is used to write data to the serial port. The function call + * will block until one or more bytes of the data has been written + * successfully, or until an error occurs. + * + * @param buffers One or more data buffers to be written to the serial port. + * + * @returns The number of bytes written. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @note The write_some operation may not transmit all of the data to the + * peer. Consider using the @ref write function if you need to ensure that + * all data is written before the blocking operation completes. + * + * @par Example + * To write a single data buffer use the @ref buffer function as follows: + * @code + * serial_port.write_some(asio::buffer(data, size)); + * @endcode + * See the @ref buffer documentation for information on writing multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t write_some(const ConstBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->get_service().write_some( + this->get_implementation(), buffers, ec); + asio::detail::throw_error(ec, "write_some"); + return s; + } + + /// Write some data to the serial port. + /** + * This function is used to write data to the serial port. The function call + * will block until one or more bytes of the data has been written + * successfully, or until an error occurs. + * + * @param buffers One or more data buffers to be written to the serial port. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes written. Returns 0 if an error occurred. + * + * @note The write_some operation may not transmit all of the data to the + * peer. Consider using the @ref write function if you need to ensure that + * all data is written before the blocking operation completes. + */ + template + std::size_t write_some(const ConstBufferSequence& buffers, + asio::error_code& ec) + { + return this->get_service().write_some( + this->get_implementation(), buffers, ec); + } + + /// Start an asynchronous write. + /** + * This function is used to asynchronously write data to the serial port. + * The function call always returns immediately. + * + * @param buffers One or more data buffers to be written to the serial port. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the write operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes written. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @note The write operation may not transmit all of the data to the peer. + * Consider using the @ref async_write function if you need to ensure that all + * data is written before the asynchronous operation completes. + * + * @par Example + * To write a single data buffer use the @ref buffer function as follows: + * @code + * serial_port.async_write_some(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on writing multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(WriteHandler, + void (asio::error_code, std::size_t)) + async_write_some(const ConstBufferSequence& buffers, + ASIO_MOVE_ARG(WriteHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WriteHandler. + ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + + return this->get_service().async_write_some(this->get_implementation(), + buffers, ASIO_MOVE_CAST(WriteHandler)(handler)); + } + + /// Read some data from the serial port. + /** + * This function is used to read data from the serial port. The function + * call will block until one or more bytes of data has been read successfully, + * or until an error occurs. + * + * @param buffers One or more buffers into which the data will be read. + * + * @returns The number of bytes read. + * + * @throws asio::system_error Thrown on failure. An error code of + * asio::error::eof indicates that the connection was closed by the + * peer. + * + * @note The read_some operation may not read all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that + * the requested amount of data is read before the blocking operation + * completes. + * + * @par Example + * To read into a single data buffer use the @ref buffer function as follows: + * @code + * serial_port.read_some(asio::buffer(data, size)); + * @endcode + * See the @ref buffer documentation for information on reading into multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + std::size_t read_some(const MutableBufferSequence& buffers) + { + asio::error_code ec; + std::size_t s = this->get_service().read_some( + this->get_implementation(), buffers, ec); + asio::detail::throw_error(ec, "read_some"); + return s; + } + + /// Read some data from the serial port. + /** + * This function is used to read data from the serial port. The function + * call will block until one or more bytes of data has been read successfully, + * or until an error occurs. + * + * @param buffers One or more buffers into which the data will be read. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes read. Returns 0 if an error occurred. + * + * @note The read_some operation may not read all of the requested number of + * bytes. Consider using the @ref read function if you need to ensure that + * the requested amount of data is read before the blocking operation + * completes. + */ + template + std::size_t read_some(const MutableBufferSequence& buffers, + asio::error_code& ec) + { + return this->get_service().read_some( + this->get_implementation(), buffers, ec); + } + + /// Start an asynchronous read. + /** + * This function is used to asynchronously read data from the serial port. + * The function call always returns immediately. + * + * @param buffers One or more buffers into which the data will be read. + * Although the buffers object may be copied as necessary, ownership of the + * underlying memory blocks is retained by the caller, which must guarantee + * that they remain valid until the handler is called. + * + * @param handler The handler to be called when the read operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * std::size_t bytes_transferred // Number of bytes read. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @note The read operation may not read all of the requested number of bytes. + * Consider using the @ref async_read function if you need to ensure that the + * requested amount of data is read before the asynchronous operation + * completes. + * + * @par Example + * To read into a single data buffer use the @ref buffer function as follows: + * @code + * serial_port.async_read_some(asio::buffer(data, size), handler); + * @endcode + * See the @ref buffer documentation for information on reading into multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + */ + template + ASIO_INITFN_RESULT_TYPE(ReadHandler, + void (asio::error_code, std::size_t)) + async_read_some(const MutableBufferSequence& buffers, + ASIO_MOVE_ARG(ReadHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ReadHandler. + ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + + return this->get_service().async_read_some(this->get_implementation(), + buffers, ASIO_MOVE_CAST(ReadHandler)(handler)); + } +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_HAS_SERIAL_PORT) + // || defined(GENERATING_DOCUMENTATION) + +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + +#endif // ASIO_BASIC_SERIAL_PORT_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_signal_set.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_signal_set.hpp new file mode 100644 index 0000000..978fb36 --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_signal_set.hpp @@ -0,0 +1,390 @@ +// +// basic_signal_set.hpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SIGNAL_SET_HPP +#define ASIO_BASIC_SIGNAL_SET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if defined(ASIO_ENABLE_OLD_SERVICES) + +#include "asio/basic_io_object.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" +#include "asio/signal_set_service.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Provides signal functionality. +/** + * The basic_signal_set class template provides the ability to perform an + * asynchronous wait for one or more signals to occur. + * + * Most applications will use the asio::signal_set typedef. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Example + * Performing an asynchronous wait: + * @code + * void handler( + * const asio::error_code& error, + * int signal_number) + * { + * if (!error) + * { + * // A signal occurred. + * } + * } + * + * ... + * + * // Construct a signal set registered for process termination. + * asio::signal_set signals(io_context, SIGINT, SIGTERM); + * + * // Start an asynchronous wait for one of the signals to occur. + * signals.async_wait(handler); + * @endcode + * + * @par Queueing of signal notifications + * + * If a signal is registered with a signal_set, and the signal occurs when + * there are no waiting handlers, then the signal notification is queued. The + * next async_wait operation on that signal_set will dequeue the notification. + * If multiple notifications are queued, subsequent async_wait operations + * dequeue them one at a time. Signal notifications are dequeued in order of + * ascending signal number. + * + * If a signal number is removed from a signal_set (using the @c remove or @c + * erase member functions) then any queued notifications for that signal are + * discarded. + * + * @par Multiple registration of signals + * + * The same signal number may be registered with different signal_set objects. + * When the signal occurs, one handler is called for each signal_set object. + * + * Note that multiple registration only works for signals that are registered + * using Asio. The application must not also register a signal handler using + * functions such as @c signal() or @c sigaction(). + * + * @par Signal masking on POSIX platforms + * + * POSIX allows signals to be blocked using functions such as @c sigprocmask() + * and @c pthread_sigmask(). For signals to be delivered, programs must ensure + * that any signals registered using signal_set objects are unblocked in at + * least one thread. + */ +template +class basic_signal_set + : public basic_io_object +{ +public: + /// Construct a signal set without adding any signals. + /** + * This constructor creates a signal set without registering for any signals. + * + * @param io_context The io_context object that the signal set will use to + * dispatch handlers for any asynchronous operations performed on the set. + */ + explicit basic_signal_set(asio::io_context& io_context) + : basic_io_object(io_context) + { + } + + /// Construct a signal set and add one signal. + /** + * This constructor creates a signal set and registers for one signal. + * + * @param io_context The io_context object that the signal set will use to + * dispatch handlers for any asynchronous operations performed on the set. + * + * @param signal_number_1 The signal number to be added. + * + * @note This constructor is equivalent to performing: + * @code asio::signal_set signals(io_context); + * signals.add(signal_number_1); @endcode + */ + basic_signal_set(asio::io_context& io_context, int signal_number_1) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().add(this->get_implementation(), signal_number_1, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Construct a signal set and add two signals. + /** + * This constructor creates a signal set and registers for two signals. + * + * @param io_context The io_context object that the signal set will use to + * dispatch handlers for any asynchronous operations performed on the set. + * + * @param signal_number_1 The first signal number to be added. + * + * @param signal_number_2 The second signal number to be added. + * + * @note This constructor is equivalent to performing: + * @code asio::signal_set signals(io_context); + * signals.add(signal_number_1); + * signals.add(signal_number_2); @endcode + */ + basic_signal_set(asio::io_context& io_context, int signal_number_1, + int signal_number_2) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().add(this->get_implementation(), signal_number_1, ec); + asio::detail::throw_error(ec, "add"); + this->get_service().add(this->get_implementation(), signal_number_2, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Construct a signal set and add three signals. + /** + * This constructor creates a signal set and registers for three signals. + * + * @param io_context The io_context object that the signal set will use to + * dispatch handlers for any asynchronous operations performed on the set. + * + * @param signal_number_1 The first signal number to be added. + * + * @param signal_number_2 The second signal number to be added. + * + * @param signal_number_3 The third signal number to be added. + * + * @note This constructor is equivalent to performing: + * @code asio::signal_set signals(io_context); + * signals.add(signal_number_1); + * signals.add(signal_number_2); + * signals.add(signal_number_3); @endcode + */ + basic_signal_set(asio::io_context& io_context, int signal_number_1, + int signal_number_2, int signal_number_3) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().add(this->get_implementation(), signal_number_1, ec); + asio::detail::throw_error(ec, "add"); + this->get_service().add(this->get_implementation(), signal_number_2, ec); + asio::detail::throw_error(ec, "add"); + this->get_service().add(this->get_implementation(), signal_number_3, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Add a signal to a signal_set. + /** + * This function adds the specified signal to the set. It has no effect if the + * signal is already in the set. + * + * @param signal_number The signal to be added to the set. + * + * @throws asio::system_error Thrown on failure. + */ + void add(int signal_number) + { + asio::error_code ec; + this->get_service().add(this->get_implementation(), signal_number, ec); + asio::detail::throw_error(ec, "add"); + } + + /// Add a signal to a signal_set. + /** + * This function adds the specified signal to the set. It has no effect if the + * signal is already in the set. + * + * @param signal_number The signal to be added to the set. + * + * @param ec Set to indicate what error occurred, if any. + */ + asio::error_code add(int signal_number, + asio::error_code& ec) + { + return this->get_service().add( + this->get_implementation(), signal_number, ec); + } + + /// Remove a signal from a signal_set. + /** + * This function removes the specified signal from the set. It has no effect + * if the signal is not in the set. + * + * @param signal_number The signal to be removed from the set. + * + * @throws asio::system_error Thrown on failure. + * + * @note Removes any notifications that have been queued for the specified + * signal number. + */ + void remove(int signal_number) + { + asio::error_code ec; + this->get_service().remove(this->get_implementation(), signal_number, ec); + asio::detail::throw_error(ec, "remove"); + } + + /// Remove a signal from a signal_set. + /** + * This function removes the specified signal from the set. It has no effect + * if the signal is not in the set. + * + * @param signal_number The signal to be removed from the set. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note Removes any notifications that have been queued for the specified + * signal number. + */ + asio::error_code remove(int signal_number, + asio::error_code& ec) + { + return this->get_service().remove( + this->get_implementation(), signal_number, ec); + } + + /// Remove all signals from a signal_set. + /** + * This function removes all signals from the set. It has no effect if the set + * is already empty. + * + * @throws asio::system_error Thrown on failure. + * + * @note Removes all queued notifications. + */ + void clear() + { + asio::error_code ec; + this->get_service().clear(this->get_implementation(), ec); + asio::detail::throw_error(ec, "clear"); + } + + /// Remove all signals from a signal_set. + /** + * This function removes all signals from the set. It has no effect if the set + * is already empty. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note Removes all queued notifications. + */ + asio::error_code clear(asio::error_code& ec) + { + return this->get_service().clear(this->get_implementation(), ec); + } + + /// Cancel all operations associated with the signal set. + /** + * This function forces the completion of any pending asynchronous wait + * operations against the signal set. The handler for each cancelled + * operation will be invoked with the asio::error::operation_aborted + * error code. + * + * Cancellation does not alter the set of registered signals. + * + * @throws asio::system_error Thrown on failure. + * + * @note If a registered signal occurred before cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + void cancel() + { + asio::error_code ec; + this->get_service().cancel(this->get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + } + + /// Cancel all operations associated with the signal set. + /** + * This function forces the completion of any pending asynchronous wait + * operations against the signal set. The handler for each cancelled + * operation will be invoked with the asio::error::operation_aborted + * error code. + * + * Cancellation does not alter the set of registered signals. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note If a registered signal occurred before cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. + */ + asio::error_code cancel(asio::error_code& ec) + { + return this->get_service().cancel(this->get_implementation(), ec); + } + + /// Start an asynchronous operation to wait for a signal to be delivered. + /** + * This function may be used to initiate an asynchronous wait against the + * signal set. It always returns immediately. + * + * For each call to async_wait(), the supplied handler will be called exactly + * once. The handler will be called when: + * + * @li One of the registered signals in the signal set occurs; or + * + * @li The signal set was cancelled, in which case the handler is passed the + * error code asio::error::operation_aborted. + * + * @param handler The handler to be called when the signal occurs. Copies + * will be made of the handler as required. The function signature of the + * handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * int signal_number // Indicates which signal occurred. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + */ + template + ASIO_INITFN_RESULT_TYPE(SignalHandler, + void (asio::error_code, int)) + async_wait(ASIO_MOVE_ARG(SignalHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a SignalHandler. + ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check; + + return this->get_service().async_wait(this->get_implementation(), + ASIO_MOVE_CAST(SignalHandler)(handler)); + } +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + +#endif // ASIO_BASIC_SIGNAL_SET_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket.hpp new file mode 100644 index 0000000..c4ae0df --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket.hpp @@ -0,0 +1,1690 @@ +// +// basic_socket.hpp +// ~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SOCKET_HPP +#define ASIO_BASIC_SOCKET_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/async_result.hpp" +#include "asio/basic_io_object.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" +#include "asio/post.hpp" +#include "asio/socket_base.hpp" + +#if defined(ASIO_HAS_MOVE) +# include +#endif // defined(ASIO_HAS_MOVE) + +#if !defined(ASIO_ENABLE_OLD_SERVICES) +# if defined(ASIO_WINDOWS_RUNTIME) +# include "asio/detail/winrt_ssocket_service.hpp" +# define ASIO_SVC_T detail::winrt_ssocket_service +# elif defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_socket_service.hpp" +# define ASIO_SVC_T detail::win_iocp_socket_service +# else +# include "asio/detail/reactive_socket_service.hpp" +# define ASIO_SVC_T detail::reactive_socket_service +# endif +#endif // !defined(ASIO_ENABLE_OLD_SERVICES) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Provides socket functionality. +/** + * The basic_socket class template provides functionality that is common to both + * stream-oriented and datagram-oriented sockets. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + */ +template +class basic_socket + : ASIO_SVC_ACCESS basic_io_object, + public socket_base +{ +public: + /// The type of the executor associated with the object. + typedef io_context::executor_type executor_type; + + /// The native representation of a socket. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename ASIO_SVC_T::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// A basic_socket is always the lowest layer. + typedef basic_socket lowest_layer_type; + + /// Construct a basic_socket without opening it. + /** + * This constructor creates a socket without opening it. + * + * @param io_context The io_context object that the socket will use to + * dispatch handlers for any asynchronous operations performed on the socket. + */ + explicit basic_socket(asio::io_context& io_context) + : basic_io_object(io_context) + { + } + + /// Construct and open a basic_socket. + /** + * This constructor creates and opens a socket. + * + * @param io_context The io_context object that the socket will use to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_socket(asio::io_context& io_context, + const protocol_type& protocol) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().open(this->get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct a basic_socket, opening it and binding it to the given local + /// endpoint. + /** + * This constructor creates a socket and automatically opens it bound to the + * specified endpoint on the local machine. The protocol used is the protocol + * associated with the given endpoint. + * + * @param io_context The io_context object that the socket will use to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the socket will + * be bound. + * + * @throws asio::system_error Thrown on failure. + */ + basic_socket(asio::io_context& io_context, + const endpoint_type& endpoint) + : basic_io_object(io_context) + { + asio::error_code ec; + const protocol_type protocol = endpoint.protocol(); + this->get_service().open(this->get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + this->get_service().bind(this->get_implementation(), endpoint, ec); + asio::detail::throw_error(ec, "bind"); + } + + /// Construct a basic_socket on an existing native socket. + /** + * This constructor creates a socket object to hold an existing native socket. + * + * @param io_context The io_context object that the socket will use to + * dispatch handlers for any asynchronous operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket A native socket. + * + * @throws asio::system_error Thrown on failure. + */ + basic_socket(asio::io_context& io_context, + const protocol_type& protocol, const native_handle_type& native_socket) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().assign(this->get_implementation(), + protocol, native_socket, ec); + asio::detail::throw_error(ec, "assign"); + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_socket from another. + /** + * This constructor moves a socket from one object to another. + * + * @param other The other basic_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(io_context&) constructor. + */ + basic_socket(basic_socket&& other) + : basic_io_object(std::move(other)) + { + } + + /// Move-assign a basic_socket from another. + /** + * This assignment operator moves a socket from one object to another. + * + * @param other The other basic_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(io_context&) constructor. + */ + basic_socket& operator=(basic_socket&& other) + { + basic_io_object::operator=(std::move(other)); + return *this; + } + + // All sockets have access to each other's implementations. + template + friend class basic_socket; + + /// Move-construct a basic_socket from a socket of another protocol type. + /** + * This constructor moves a socket from one object to another. + * + * @param other The other basic_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(io_context&) constructor. + */ + template + basic_socket(basic_socket&& other, + typename enable_if::value>::type* = 0) + : basic_io_object(other.get_service().get_io_context()) + { + this->get_service().template converting_move_construct( + this->get_implementation(), other.get_implementation()); + } + + /// Move-assign a basic_socket from a socket of another protocol type. + /** + * This assignment operator moves a socket from one object to another. + * + * @param other The other basic_socket object from which the move will + * occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(io_context&) constructor. + */ + template + typename enable_if::value, + basic_socket>::type& operator=( + basic_socket&& other) + { + basic_socket tmp(std::move(other)); + basic_io_object::operator=(std::move(tmp)); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + +#if defined(ASIO_ENABLE_OLD_SERVICES) + // These functions are provided by basic_io_object<>. +#else // defined(ASIO_ENABLE_OLD_SERVICES) +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use get_executor().) Get the io_context associated with the + /// object. + /** + * This function may be used to obtain the io_context object that the I/O + * object uses to dispatch handlers for asynchronous operations. + * + * @return A reference to the io_context object that the I/O object will use + * to dispatch handlers. Ownership is not transferred to the caller. + */ + asio::io_context& get_io_context() + { + return basic_io_object::get_io_context(); + } + + /// (Deprecated: Use get_executor().) Get the io_context associated with the + /// object. + /** + * This function may be used to obtain the io_context object that the I/O + * object uses to dispatch handlers for asynchronous operations. + * + * @return A reference to the io_context object that the I/O object will use + * to dispatch handlers. Ownership is not transferred to the caller. + */ + asio::io_context& get_io_service() + { + return basic_io_object::get_io_service(); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return basic_io_object::get_executor(); + } +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + + /// Get a reference to the lowest layer. + /** + * This function returns a reference to the lowest layer in a stack of + * layers. Since a basic_socket cannot contain any further layers, it simply + * returns a reference to itself. + * + * @return A reference to the lowest layer in the stack of layers. Ownership + * is not transferred to the caller. + */ + lowest_layer_type& lowest_layer() + { + return *this; + } + + /// Get a const reference to the lowest layer. + /** + * This function returns a const reference to the lowest layer in a stack of + * layers. Since a basic_socket cannot contain any further layers, it simply + * returns a reference to itself. + * + * @return A const reference to the lowest layer in the stack of layers. + * Ownership is not transferred to the caller. + */ + const lowest_layer_type& lowest_layer() const + { + return *this; + } + + /// Open the socket using the specified protocol. + /** + * This function opens the socket so that it will use the specified protocol. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * socket.open(asio::ip::tcp::v4()); + * @endcode + */ + void open(const protocol_type& protocol = protocol_type()) + { + asio::error_code ec; + this->get_service().open(this->get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Open the socket using the specified protocol. + /** + * This function opens the socket so that it will use the specified protocol. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * asio::error_code ec; + * socket.open(asio::ip::tcp::v4(), ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + asio::error_code open(const protocol_type& protocol, + asio::error_code& ec) + { + return this->get_service().open(this->get_implementation(), protocol, ec); + } + + /// Assign an existing native socket to the socket. + /* + * This function opens the socket to hold an existing native socket. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param native_socket A native socket. + * + * @throws asio::system_error Thrown on failure. + */ + void assign(const protocol_type& protocol, + const native_handle_type& native_socket) + { + asio::error_code ec; + this->get_service().assign(this->get_implementation(), + protocol, native_socket, ec); + asio::detail::throw_error(ec, "assign"); + } + + /// Assign an existing native socket to the socket. + /* + * This function opens the socket to hold an existing native socket. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param native_socket A native socket. + * + * @param ec Set to indicate what error occurred, if any. + */ + asio::error_code assign(const protocol_type& protocol, + const native_handle_type& native_socket, asio::error_code& ec) + { + return this->get_service().assign(this->get_implementation(), + protocol, native_socket, ec); + } + + /// Determine whether the socket is open. + bool is_open() const + { + return this->get_service().is_open(this->get_implementation()); + } + + /// Close the socket. + /** + * This function is used to close the socket. Any asynchronous send, receive + * or connect operations will be cancelled immediately, and will complete + * with the asio::error::operation_aborted error. + * + * @throws asio::system_error Thrown on failure. Note that, even if + * the function indicates an error, the underlying descriptor is closed. + * + * @note For portable behaviour with respect to graceful closure of a + * connected socket, call shutdown() before closing the socket. + */ + void close() + { + asio::error_code ec; + this->get_service().close(this->get_implementation(), ec); + asio::detail::throw_error(ec, "close"); + } + + /// Close the socket. + /** + * This function is used to close the socket. Any asynchronous send, receive + * or connect operations will be cancelled immediately, and will complete + * with the asio::error::operation_aborted error. + * + * @param ec Set to indicate what error occurred, if any. Note that, even if + * the function indicates an error, the underlying descriptor is closed. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::error_code ec; + * socket.close(ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + * + * @note For portable behaviour with respect to graceful closure of a + * connected socket, call shutdown() before closing the socket. + */ + asio::error_code close(asio::error_code& ec) + { + return this->get_service().close(this->get_implementation(), ec); + } + + /// Get the native socket representation. + /** + * This function may be used to obtain the underlying representation of the + * socket. This is intended to allow access to native socket functionality + * that is not otherwise provided. + */ + native_handle_type native_handle() + { + return this->get_service().native_handle(this->get_implementation()); + } + + /// Cancel all asynchronous operations associated with the socket. + /** + * This function causes all outstanding asynchronous connect, send and receive + * operations to finish immediately, and the handlers for cancelled operations + * will be passed the asio::error::operation_aborted error. + * + * @throws asio::system_error Thrown on failure. + * + * @note Calls to cancel() will always fail with + * asio::error::operation_not_supported when run on Windows XP, Windows + * Server 2003, and earlier versions of Windows, unless + * ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has + * two issues that should be considered before enabling its use: + * + * @li It will only cancel asynchronous operations that were initiated in the + * current thread. + * + * @li It can appear to complete without error, but the request to cancel the + * unfinished operations may be silently ignored by the operating system. + * Whether it works or not seems to depend on the drivers that are installed. + * + * For portable cancellation, consider using one of the following + * alternatives: + * + * @li Disable asio's I/O completion port backend by defining + * ASIO_DISABLE_IOCP. + * + * @li Use the close() function to simultaneously cancel the outstanding + * operations and close the socket. + * + * When running on Windows Vista, Windows Server 2008, and later, the + * CancelIoEx function is always used. This function does not have the + * problems described above. + */ +#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ + && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \ + && !defined(ASIO_ENABLE_CANCELIO) + __declspec(deprecated("By default, this function always fails with " + "operation_not_supported when used on Windows XP, Windows Server 2003, " + "or earlier. Consult documentation for details.")) +#endif + void cancel() + { + asio::error_code ec; + this->get_service().cancel(this->get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + } + + /// Cancel all asynchronous operations associated with the socket. + /** + * This function causes all outstanding asynchronous connect, send and receive + * operations to finish immediately, and the handlers for cancelled operations + * will be passed the asio::error::operation_aborted error. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note Calls to cancel() will always fail with + * asio::error::operation_not_supported when run on Windows XP, Windows + * Server 2003, and earlier versions of Windows, unless + * ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has + * two issues that should be considered before enabling its use: + * + * @li It will only cancel asynchronous operations that were initiated in the + * current thread. + * + * @li It can appear to complete without error, but the request to cancel the + * unfinished operations may be silently ignored by the operating system. + * Whether it works or not seems to depend on the drivers that are installed. + * + * For portable cancellation, consider using one of the following + * alternatives: + * + * @li Disable asio's I/O completion port backend by defining + * ASIO_DISABLE_IOCP. + * + * @li Use the close() function to simultaneously cancel the outstanding + * operations and close the socket. + * + * When running on Windows Vista, Windows Server 2008, and later, the + * CancelIoEx function is always used. This function does not have the + * problems described above. + */ +#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \ + && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \ + && !defined(ASIO_ENABLE_CANCELIO) + __declspec(deprecated("By default, this function always fails with " + "operation_not_supported when used on Windows XP, Windows Server 2003, " + "or earlier. Consult documentation for details.")) +#endif + asio::error_code cancel(asio::error_code& ec) + { + return this->get_service().cancel(this->get_implementation(), ec); + } + + /// Determine whether the socket is at the out-of-band data mark. + /** + * This function is used to check whether the socket input is currently + * positioned at the out-of-band data mark. + * + * @return A bool indicating whether the socket is at the out-of-band data + * mark. + * + * @throws asio::system_error Thrown on failure. + */ + bool at_mark() const + { + asio::error_code ec; + bool b = this->get_service().at_mark(this->get_implementation(), ec); + asio::detail::throw_error(ec, "at_mark"); + return b; + } + + /// Determine whether the socket is at the out-of-band data mark. + /** + * This function is used to check whether the socket input is currently + * positioned at the out-of-band data mark. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return A bool indicating whether the socket is at the out-of-band data + * mark. + */ + bool at_mark(asio::error_code& ec) const + { + return this->get_service().at_mark(this->get_implementation(), ec); + } + + /// Determine the number of bytes available for reading. + /** + * This function is used to determine the number of bytes that may be read + * without blocking. + * + * @return The number of bytes that may be read without blocking, or 0 if an + * error occurs. + * + * @throws asio::system_error Thrown on failure. + */ + std::size_t available() const + { + asio::error_code ec; + std::size_t s = this->get_service().available( + this->get_implementation(), ec); + asio::detail::throw_error(ec, "available"); + return s; + } + + /// Determine the number of bytes available for reading. + /** + * This function is used to determine the number of bytes that may be read + * without blocking. + * + * @param ec Set to indicate what error occurred, if any. + * + * @return The number of bytes that may be read without blocking, or 0 if an + * error occurs. + */ + std::size_t available(asio::error_code& ec) const + { + return this->get_service().available(this->get_implementation(), ec); + } + + /// Bind the socket to the given local endpoint. + /** + * This function binds the socket to the specified endpoint on the local + * machine. + * + * @param endpoint An endpoint on the local machine to which the socket will + * be bound. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * socket.open(asio::ip::tcp::v4()); + * socket.bind(asio::ip::tcp::endpoint( + * asio::ip::tcp::v4(), 12345)); + * @endcode + */ + void bind(const endpoint_type& endpoint) + { + asio::error_code ec; + this->get_service().bind(this->get_implementation(), endpoint, ec); + asio::detail::throw_error(ec, "bind"); + } + + /// Bind the socket to the given local endpoint. + /** + * This function binds the socket to the specified endpoint on the local + * machine. + * + * @param endpoint An endpoint on the local machine to which the socket will + * be bound. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * socket.open(asio::ip::tcp::v4()); + * asio::error_code ec; + * socket.bind(asio::ip::tcp::endpoint( + * asio::ip::tcp::v4(), 12345), ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + asio::error_code bind(const endpoint_type& endpoint, + asio::error_code& ec) + { + return this->get_service().bind(this->get_implementation(), endpoint, ec); + } + + /// Connect the socket to the specified endpoint. + /** + * This function is used to connect a socket to the specified remote endpoint. + * The function call will block until the connection is successfully made or + * an error occurs. + * + * The socket is automatically opened if it is not already open. If the + * connect fails, and the socket was automatically opened, the socket is + * not returned to the closed state. + * + * @param peer_endpoint The remote endpoint to which the socket will be + * connected. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * asio::ip::tcp::endpoint endpoint( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.connect(endpoint); + * @endcode + */ + void connect(const endpoint_type& peer_endpoint) + { + asio::error_code ec; + if (!is_open()) + { + this->get_service().open(this->get_implementation(), + peer_endpoint.protocol(), ec); + asio::detail::throw_error(ec, "connect"); + } + this->get_service().connect(this->get_implementation(), peer_endpoint, ec); + asio::detail::throw_error(ec, "connect"); + } + + /// Connect the socket to the specified endpoint. + /** + * This function is used to connect a socket to the specified remote endpoint. + * The function call will block until the connection is successfully made or + * an error occurs. + * + * The socket is automatically opened if it is not already open. If the + * connect fails, and the socket was automatically opened, the socket is + * not returned to the closed state. + * + * @param peer_endpoint The remote endpoint to which the socket will be + * connected. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * asio::ip::tcp::endpoint endpoint( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * asio::error_code ec; + * socket.connect(endpoint, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + asio::error_code connect(const endpoint_type& peer_endpoint, + asio::error_code& ec) + { + if (!is_open()) + { + if (this->get_service().open(this->get_implementation(), + peer_endpoint.protocol(), ec)) + { + return ec; + } + } + + return this->get_service().connect( + this->get_implementation(), peer_endpoint, ec); + } + + /// Start an asynchronous connect. + /** + * This function is used to asynchronously connect a socket to the specified + * remote endpoint. The function call always returns immediately. + * + * The socket is automatically opened if it is not already open. If the + * connect fails, and the socket was automatically opened, the socket is + * not returned to the closed state. + * + * @param peer_endpoint The remote endpoint to which the socket will be + * connected. Copies will be made of the endpoint object as required. + * + * @param handler The handler to be called when the connection operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * @code + * void connect_handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Connect succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::socket socket(io_context); + * asio::ip::tcp::endpoint endpoint( + * asio::ip::address::from_string("1.2.3.4"), 12345); + * socket.async_connect(endpoint, connect_handler); + * @endcode + */ + template + ASIO_INITFN_RESULT_TYPE(ConnectHandler, + void (asio::error_code)) + async_connect(const endpoint_type& peer_endpoint, + ASIO_MOVE_ARG(ConnectHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a ConnectHandler. + ASIO_CONNECT_HANDLER_CHECK(ConnectHandler, handler) type_check; + + if (!is_open()) + { + asio::error_code ec; + const protocol_type protocol = peer_endpoint.protocol(); + if (this->get_service().open(this->get_implementation(), protocol, ec)) + { + async_completion init(handler); + + asio::post(this->get_executor(), + asio::detail::bind_handler( + ASIO_MOVE_CAST(ASIO_HANDLER_TYPE( + ConnectHandler, void (asio::error_code)))( + init.handler), ec)); + + return init.result.get(); + } + } + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_connect(this->get_implementation(), + peer_endpoint, ASIO_MOVE_CAST(ConnectHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_connect( + this->get_implementation(), peer_endpoint, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Set an option on the socket. + /** + * This function is used to set an option on the socket. + * + * @param option The new option value to be set on the socket. + * + * @throws asio::system_error Thrown on failure. + * + * @sa SettableSocketOption @n + * asio::socket_base::broadcast @n + * asio::socket_base::do_not_route @n + * asio::socket_base::keep_alive @n + * asio::socket_base::linger @n + * asio::socket_base::receive_buffer_size @n + * asio::socket_base::receive_low_watermark @n + * asio::socket_base::reuse_address @n + * asio::socket_base::send_buffer_size @n + * asio::socket_base::send_low_watermark @n + * asio::ip::multicast::join_group @n + * asio::ip::multicast::leave_group @n + * asio::ip::multicast::enable_loopback @n + * asio::ip::multicast::outbound_interface @n + * asio::ip::multicast::hops @n + * asio::ip::tcp::no_delay + * + * @par Example + * Setting the IPPROTO_TCP/TCP_NODELAY option: + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::ip::tcp::no_delay option(true); + * socket.set_option(option); + * @endcode + */ + template + void set_option(const SettableSocketOption& option) + { + asio::error_code ec; + this->get_service().set_option(this->get_implementation(), option, ec); + asio::detail::throw_error(ec, "set_option"); + } + + /// Set an option on the socket. + /** + * This function is used to set an option on the socket. + * + * @param option The new option value to be set on the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa SettableSocketOption @n + * asio::socket_base::broadcast @n + * asio::socket_base::do_not_route @n + * asio::socket_base::keep_alive @n + * asio::socket_base::linger @n + * asio::socket_base::receive_buffer_size @n + * asio::socket_base::receive_low_watermark @n + * asio::socket_base::reuse_address @n + * asio::socket_base::send_buffer_size @n + * asio::socket_base::send_low_watermark @n + * asio::ip::multicast::join_group @n + * asio::ip::multicast::leave_group @n + * asio::ip::multicast::enable_loopback @n + * asio::ip::multicast::outbound_interface @n + * asio::ip::multicast::hops @n + * asio::ip::tcp::no_delay + * + * @par Example + * Setting the IPPROTO_TCP/TCP_NODELAY option: + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::ip::tcp::no_delay option(true); + * asio::error_code ec; + * socket.set_option(option, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + asio::error_code set_option(const SettableSocketOption& option, + asio::error_code& ec) + { + return this->get_service().set_option( + this->get_implementation(), option, ec); + } + + /// Get an option from the socket. + /** + * This function is used to get the current value of an option on the socket. + * + * @param option The option value to be obtained from the socket. + * + * @throws asio::system_error Thrown on failure. + * + * @sa GettableSocketOption @n + * asio::socket_base::broadcast @n + * asio::socket_base::do_not_route @n + * asio::socket_base::keep_alive @n + * asio::socket_base::linger @n + * asio::socket_base::receive_buffer_size @n + * asio::socket_base::receive_low_watermark @n + * asio::socket_base::reuse_address @n + * asio::socket_base::send_buffer_size @n + * asio::socket_base::send_low_watermark @n + * asio::ip::multicast::join_group @n + * asio::ip::multicast::leave_group @n + * asio::ip::multicast::enable_loopback @n + * asio::ip::multicast::outbound_interface @n + * asio::ip::multicast::hops @n + * asio::ip::tcp::no_delay + * + * @par Example + * Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::ip::tcp::socket::keep_alive option; + * socket.get_option(option); + * bool is_set = option.value(); + * @endcode + */ + template + void get_option(GettableSocketOption& option) const + { + asio::error_code ec; + this->get_service().get_option(this->get_implementation(), option, ec); + asio::detail::throw_error(ec, "get_option"); + } + + /// Get an option from the socket. + /** + * This function is used to get the current value of an option on the socket. + * + * @param option The option value to be obtained from the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa GettableSocketOption @n + * asio::socket_base::broadcast @n + * asio::socket_base::do_not_route @n + * asio::socket_base::keep_alive @n + * asio::socket_base::linger @n + * asio::socket_base::receive_buffer_size @n + * asio::socket_base::receive_low_watermark @n + * asio::socket_base::reuse_address @n + * asio::socket_base::send_buffer_size @n + * asio::socket_base::send_low_watermark @n + * asio::ip::multicast::join_group @n + * asio::ip::multicast::leave_group @n + * asio::ip::multicast::enable_loopback @n + * asio::ip::multicast::outbound_interface @n + * asio::ip::multicast::hops @n + * asio::ip::tcp::no_delay + * + * @par Example + * Getting the value of the SOL_SOCKET/SO_KEEPALIVE option: + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::ip::tcp::socket::keep_alive option; + * asio::error_code ec; + * socket.get_option(option, ec); + * if (ec) + * { + * // An error occurred. + * } + * bool is_set = option.value(); + * @endcode + */ + template + asio::error_code get_option(GettableSocketOption& option, + asio::error_code& ec) const + { + return this->get_service().get_option( + this->get_implementation(), option, ec); + } + + /// Perform an IO control command on the socket. + /** + * This function is used to execute an IO control command on the socket. + * + * @param command The IO control command to be performed on the socket. + * + * @throws asio::system_error Thrown on failure. + * + * @sa IoControlCommand @n + * asio::socket_base::bytes_readable @n + * asio::socket_base::non_blocking_io + * + * @par Example + * Getting the number of bytes ready to read: + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::ip::tcp::socket::bytes_readable command; + * socket.io_control(command); + * std::size_t bytes_readable = command.get(); + * @endcode + */ + template + void io_control(IoControlCommand& command) + { + asio::error_code ec; + this->get_service().io_control(this->get_implementation(), command, ec); + asio::detail::throw_error(ec, "io_control"); + } + + /// Perform an IO control command on the socket. + /** + * This function is used to execute an IO control command on the socket. + * + * @param command The IO control command to be performed on the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa IoControlCommand @n + * asio::socket_base::bytes_readable @n + * asio::socket_base::non_blocking_io + * + * @par Example + * Getting the number of bytes ready to read: + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::ip::tcp::socket::bytes_readable command; + * asio::error_code ec; + * socket.io_control(command, ec); + * if (ec) + * { + * // An error occurred. + * } + * std::size_t bytes_readable = command.get(); + * @endcode + */ + template + asio::error_code io_control(IoControlCommand& command, + asio::error_code& ec) + { + return this->get_service().io_control( + this->get_implementation(), command, ec); + } + + /// Gets the non-blocking mode of the socket. + /** + * @returns @c true if the socket's synchronous operations will fail with + * asio::error::would_block if they are unable to perform the requested + * operation immediately. If @c false, synchronous operations will block + * until complete. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + bool non_blocking() const + { + return this->get_service().non_blocking(this->get_implementation()); + } + + /// Sets the non-blocking mode of the socket. + /** + * @param mode If @c true, the socket's synchronous operations will fail with + * asio::error::would_block if they are unable to perform the requested + * operation immediately. If @c false, synchronous operations will block + * until complete. + * + * @throws asio::system_error Thrown on failure. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + void non_blocking(bool mode) + { + asio::error_code ec; + this->get_service().non_blocking(this->get_implementation(), mode, ec); + asio::detail::throw_error(ec, "non_blocking"); + } + + /// Sets the non-blocking mode of the socket. + /** + * @param mode If @c true, the socket's synchronous operations will fail with + * asio::error::would_block if they are unable to perform the requested + * operation immediately. If @c false, synchronous operations will block + * until complete. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + asio::error_code non_blocking( + bool mode, asio::error_code& ec) + { + return this->get_service().non_blocking( + this->get_implementation(), mode, ec); + } + + /// Gets the non-blocking mode of the native socket implementation. + /** + * This function is used to retrieve the non-blocking mode of the underlying + * native socket. This mode has no effect on the behaviour of the socket + * object's synchronous operations. + * + * @returns @c true if the underlying socket is in non-blocking mode and + * direct system calls may fail with asio::error::would_block (or the + * equivalent system error). + * + * @note The current non-blocking mode is cached by the socket object. + * Consequently, the return value may be incorrect if the non-blocking mode + * was set directly on the native socket. + * + * @par Example + * This function is intended to allow the encapsulation of arbitrary + * non-blocking system calls as asynchronous operations, in a way that is + * transparent to the user of the socket object. The following example + * illustrates how Linux's @c sendfile system call might be encapsulated: + * @code template + * struct sendfile_op + * { + * tcp::socket& sock_; + * int fd_; + * Handler handler_; + * off_t offset_; + * std::size_t total_bytes_transferred_; + * + * // Function call operator meeting WriteHandler requirements. + * // Used as the handler for the async_write_some operation. + * void operator()(asio::error_code ec, std::size_t) + * { + * // Put the underlying socket into non-blocking mode. + * if (!ec) + * if (!sock_.native_non_blocking()) + * sock_.native_non_blocking(true, ec); + * + * if (!ec) + * { + * for (;;) + * { + * // Try the system call. + * errno = 0; + * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536); + * ec = asio::error_code(n < 0 ? errno : 0, + * asio::error::get_system_category()); + * total_bytes_transferred_ += ec ? 0 : n; + * + * // Retry operation immediately if interrupted by signal. + * if (ec == asio::error::interrupted) + * continue; + * + * // Check if we need to run the operation again. + * if (ec == asio::error::would_block + * || ec == asio::error::try_again) + * { + * // We have to wait for the socket to become ready again. + * sock_.async_wait(tcp::socket::wait_write, *this); + * return; + * } + * + * if (ec || n == 0) + * { + * // An error occurred, or we have reached the end of the file. + * // Either way we must exit the loop so we can call the handler. + * break; + * } + * + * // Loop around to try calling sendfile again. + * } + * } + * + * // Pass result back to user's handler. + * handler_(ec, total_bytes_transferred_); + * } + * }; + * + * template + * void async_sendfile(tcp::socket& sock, int fd, Handler h) + * { + * sendfile_op op = { sock, fd, h, 0, 0 }; + * sock.async_wait(tcp::socket::wait_write, op); + * } @endcode + */ + bool native_non_blocking() const + { + return this->get_service().native_non_blocking(this->get_implementation()); + } + + /// Sets the non-blocking mode of the native socket implementation. + /** + * This function is used to modify the non-blocking mode of the underlying + * native socket. It has no effect on the behaviour of the socket object's + * synchronous operations. + * + * @param mode If @c true, the underlying socket is put into non-blocking + * mode and direct system calls may fail with asio::error::would_block + * (or the equivalent system error). + * + * @throws asio::system_error Thrown on failure. If the @c mode is + * @c false, but the current value of @c non_blocking() is @c true, this + * function fails with asio::error::invalid_argument, as the + * combination does not make sense. + * + * @par Example + * This function is intended to allow the encapsulation of arbitrary + * non-blocking system calls as asynchronous operations, in a way that is + * transparent to the user of the socket object. The following example + * illustrates how Linux's @c sendfile system call might be encapsulated: + * @code template + * struct sendfile_op + * { + * tcp::socket& sock_; + * int fd_; + * Handler handler_; + * off_t offset_; + * std::size_t total_bytes_transferred_; + * + * // Function call operator meeting WriteHandler requirements. + * // Used as the handler for the async_write_some operation. + * void operator()(asio::error_code ec, std::size_t) + * { + * // Put the underlying socket into non-blocking mode. + * if (!ec) + * if (!sock_.native_non_blocking()) + * sock_.native_non_blocking(true, ec); + * + * if (!ec) + * { + * for (;;) + * { + * // Try the system call. + * errno = 0; + * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536); + * ec = asio::error_code(n < 0 ? errno : 0, + * asio::error::get_system_category()); + * total_bytes_transferred_ += ec ? 0 : n; + * + * // Retry operation immediately if interrupted by signal. + * if (ec == asio::error::interrupted) + * continue; + * + * // Check if we need to run the operation again. + * if (ec == asio::error::would_block + * || ec == asio::error::try_again) + * { + * // We have to wait for the socket to become ready again. + * sock_.async_wait(tcp::socket::wait_write, *this); + * return; + * } + * + * if (ec || n == 0) + * { + * // An error occurred, or we have reached the end of the file. + * // Either way we must exit the loop so we can call the handler. + * break; + * } + * + * // Loop around to try calling sendfile again. + * } + * } + * + * // Pass result back to user's handler. + * handler_(ec, total_bytes_transferred_); + * } + * }; + * + * template + * void async_sendfile(tcp::socket& sock, int fd, Handler h) + * { + * sendfile_op op = { sock, fd, h, 0, 0 }; + * sock.async_wait(tcp::socket::wait_write, op); + * } @endcode + */ + void native_non_blocking(bool mode) + { + asio::error_code ec; + this->get_service().native_non_blocking( + this->get_implementation(), mode, ec); + asio::detail::throw_error(ec, "native_non_blocking"); + } + + /// Sets the non-blocking mode of the native socket implementation. + /** + * This function is used to modify the non-blocking mode of the underlying + * native socket. It has no effect on the behaviour of the socket object's + * synchronous operations. + * + * @param mode If @c true, the underlying socket is put into non-blocking + * mode and direct system calls may fail with asio::error::would_block + * (or the equivalent system error). + * + * @param ec Set to indicate what error occurred, if any. If the @c mode is + * @c false, but the current value of @c non_blocking() is @c true, this + * function fails with asio::error::invalid_argument, as the + * combination does not make sense. + * + * @par Example + * This function is intended to allow the encapsulation of arbitrary + * non-blocking system calls as asynchronous operations, in a way that is + * transparent to the user of the socket object. The following example + * illustrates how Linux's @c sendfile system call might be encapsulated: + * @code template + * struct sendfile_op + * { + * tcp::socket& sock_; + * int fd_; + * Handler handler_; + * off_t offset_; + * std::size_t total_bytes_transferred_; + * + * // Function call operator meeting WriteHandler requirements. + * // Used as the handler for the async_write_some operation. + * void operator()(asio::error_code ec, std::size_t) + * { + * // Put the underlying socket into non-blocking mode. + * if (!ec) + * if (!sock_.native_non_blocking()) + * sock_.native_non_blocking(true, ec); + * + * if (!ec) + * { + * for (;;) + * { + * // Try the system call. + * errno = 0; + * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536); + * ec = asio::error_code(n < 0 ? errno : 0, + * asio::error::get_system_category()); + * total_bytes_transferred_ += ec ? 0 : n; + * + * // Retry operation immediately if interrupted by signal. + * if (ec == asio::error::interrupted) + * continue; + * + * // Check if we need to run the operation again. + * if (ec == asio::error::would_block + * || ec == asio::error::try_again) + * { + * // We have to wait for the socket to become ready again. + * sock_.async_wait(tcp::socket::wait_write, *this); + * return; + * } + * + * if (ec || n == 0) + * { + * // An error occurred, or we have reached the end of the file. + * // Either way we must exit the loop so we can call the handler. + * break; + * } + * + * // Loop around to try calling sendfile again. + * } + * } + * + * // Pass result back to user's handler. + * handler_(ec, total_bytes_transferred_); + * } + * }; + * + * template + * void async_sendfile(tcp::socket& sock, int fd, Handler h) + * { + * sendfile_op op = { sock, fd, h, 0, 0 }; + * sock.async_wait(tcp::socket::wait_write, op); + * } @endcode + */ + asio::error_code native_non_blocking( + bool mode, asio::error_code& ec) + { + return this->get_service().native_non_blocking( + this->get_implementation(), mode, ec); + } + + /// Get the local endpoint of the socket. + /** + * This function is used to obtain the locally bound endpoint of the socket. + * + * @returns An object that represents the local endpoint of the socket. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); + * @endcode + */ + endpoint_type local_endpoint() const + { + asio::error_code ec; + endpoint_type ep = this->get_service().local_endpoint( + this->get_implementation(), ec); + asio::detail::throw_error(ec, "local_endpoint"); + return ep; + } + + /// Get the local endpoint of the socket. + /** + * This function is used to obtain the locally bound endpoint of the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns An object that represents the local endpoint of the socket. + * Returns a default-constructed endpoint object if an error occurred. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::error_code ec; + * asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + endpoint_type local_endpoint(asio::error_code& ec) const + { + return this->get_service().local_endpoint(this->get_implementation(), ec); + } + + /// Get the remote endpoint of the socket. + /** + * This function is used to obtain the remote endpoint of the socket. + * + * @returns An object that represents the remote endpoint of the socket. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); + * @endcode + */ + endpoint_type remote_endpoint() const + { + asio::error_code ec; + endpoint_type ep = this->get_service().remote_endpoint( + this->get_implementation(), ec); + asio::detail::throw_error(ec, "remote_endpoint"); + return ep; + } + + /// Get the remote endpoint of the socket. + /** + * This function is used to obtain the remote endpoint of the socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns An object that represents the remote endpoint of the socket. + * Returns a default-constructed endpoint object if an error occurred. + * + * @par Example + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::error_code ec; + * asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + endpoint_type remote_endpoint(asio::error_code& ec) const + { + return this->get_service().remote_endpoint(this->get_implementation(), ec); + } + + /// Disable sends or receives on the socket. + /** + * This function is used to disable send operations, receive operations, or + * both. + * + * @param what Determines what types of operation will no longer be allowed. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * Shutting down the send side of the socket: + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * socket.shutdown(asio::ip::tcp::socket::shutdown_send); + * @endcode + */ + void shutdown(shutdown_type what) + { + asio::error_code ec; + this->get_service().shutdown(this->get_implementation(), what, ec); + asio::detail::throw_error(ec, "shutdown"); + } + + /// Disable sends or receives on the socket. + /** + * This function is used to disable send operations, receive operations, or + * both. + * + * @param what Determines what types of operation will no longer be allowed. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * Shutting down the send side of the socket: + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::error_code ec; + * socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + asio::error_code shutdown(shutdown_type what, + asio::error_code& ec) + { + return this->get_service().shutdown(this->get_implementation(), what, ec); + } + + /// Wait for the socket to become ready to read, ready to write, or to have + /// pending error conditions. + /** + * This function is used to perform a blocking wait for a socket to enter + * a ready to read, write or error condition state. + * + * @param w Specifies the desired socket state. + * + * @par Example + * Waiting for a socket to become readable. + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * socket.wait(asio::ip::tcp::socket::wait_read); + * @endcode + */ + void wait(wait_type w) + { + asio::error_code ec; + this->get_service().wait(this->get_implementation(), w, ec); + asio::detail::throw_error(ec, "wait"); + } + + /// Wait for the socket to become ready to read, ready to write, or to have + /// pending error conditions. + /** + * This function is used to perform a blocking wait for a socket to enter + * a ready to read, write or error condition state. + * + * @param w Specifies the desired socket state. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * Waiting for a socket to become readable. + * @code + * asio::ip::tcp::socket socket(io_context); + * ... + * asio::error_code ec; + * socket.wait(asio::ip::tcp::socket::wait_read, ec); + * @endcode + */ + asio::error_code wait(wait_type w, asio::error_code& ec) + { + return this->get_service().wait(this->get_implementation(), w, ec); + } + + /// Asynchronously wait for the socket to become ready to read, ready to + /// write, or to have pending error conditions. + /** + * This function is used to perform an asynchronous wait for a socket to enter + * a ready to read, write or error condition state. + * + * @param w Specifies the desired socket state. + * + * @param handler The handler to be called when the wait operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * @code + * void wait_handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Wait succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::socket socket(io_context); + * ... + * socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); + * @endcode + */ + template + ASIO_INITFN_RESULT_TYPE(WaitHandler, + void (asio::error_code)) + async_wait(wait_type w, ASIO_MOVE_ARG(WaitHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WaitHandler. + ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_wait(this->get_implementation(), + w, ASIO_MOVE_CAST(WaitHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_wait(this->get_implementation(), w, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + +protected: + /// Protected destructor to prevent deletion through this type. + /** + * This function destroys the socket, cancelling any outstanding asynchronous + * operations associated with the socket as if by calling @c cancel. + */ + ~basic_socket() + { + } + + // Disallow copying and assignment. + basic_socket(const basic_socket&) ASIO_DELETED; + basic_socket& operator=(const basic_socket&) ASIO_DELETED; +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if !defined(ASIO_ENABLE_OLD_SERVICES) +# undef ASIO_SVC_T +#endif // !defined(ASIO_ENABLE_OLD_SERVICES) + +#endif // ASIO_BASIC_SOCKET_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket_acceptor.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket_acceptor.hpp new file mode 100644 index 0000000..3d8b7e5 --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket_acceptor.hpp @@ -0,0 +1,1921 @@ +// +// basic_socket_acceptor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SOCKET_ACCEPTOR_HPP +#define ASIO_BASIC_SOCKET_ACCEPTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/basic_io_object.hpp" +#include "asio/basic_socket.hpp" +#include "asio/detail/handler_type_requirements.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/error.hpp" +#include "asio/socket_acceptor_service.hpp" +#include "asio/socket_base.hpp" + +#if defined(ASIO_HAS_MOVE) +# include +#endif // defined(ASIO_HAS_MOVE) + +#if !defined(ASIO_ENABLE_OLD_SERVICES) +# if defined(ASIO_WINDOWS_RUNTIME) +# include "asio/detail/null_socket_service.hpp" +# define ASIO_SVC_T detail::null_socket_service +# elif defined(ASIO_HAS_IOCP) +# include "asio/detail/win_iocp_socket_service.hpp" +# define ASIO_SVC_T detail::win_iocp_socket_service +# else +# include "asio/detail/reactive_socket_service.hpp" +# define ASIO_SVC_T detail::reactive_socket_service +# endif +#endif // !defined(ASIO_ENABLE_OLD_SERVICES) + +#include "asio/detail/push_options.hpp" + +namespace asio { + +/// Provides the ability to accept new connections. +/** + * The basic_socket_acceptor class template is used for accepting new socket + * connections. + * + * @par Thread Safety + * @e Distinct @e objects: Safe.@n + * @e Shared @e objects: Unsafe. + * + * @par Example + * Opening a socket acceptor with the SO_REUSEADDR option enabled: + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port); + * acceptor.open(endpoint.protocol()); + * acceptor.set_option(asio::ip::tcp::acceptor::reuse_address(true)); + * acceptor.bind(endpoint); + * acceptor.listen(); + * @endcode + */ +template )> +class basic_socket_acceptor + : ASIO_SVC_ACCESS basic_io_object, + public socket_base +{ +public: + /// The type of the executor associated with the object. + typedef io_context::executor_type executor_type; + + /// The native representation of an acceptor. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename ASIO_SVC_T::native_handle_type native_handle_type; +#endif + + /// The protocol type. + typedef Protocol protocol_type; + + /// The endpoint type. + typedef typename Protocol::endpoint endpoint_type; + + /// Construct an acceptor without opening it. + /** + * This constructor creates an acceptor without opening it to listen for new + * connections. The open() function must be called before the acceptor can + * accept new socket connections. + * + * @param io_context The io_context object that the acceptor will use to + * dispatch handlers for any asynchronous operations performed on the + * acceptor. + */ + explicit basic_socket_acceptor(asio::io_context& io_context) + : basic_io_object(io_context) + { + } + + /// Construct an open acceptor. + /** + * This constructor creates an acceptor and automatically opens it. + * + * @param io_context The io_context object that the acceptor will use to + * dispatch handlers for any asynchronous operations performed on the + * acceptor. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws asio::system_error Thrown on failure. + */ + basic_socket_acceptor(asio::io_context& io_context, + const protocol_type& protocol) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().open(this->get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Construct an acceptor opened on the given endpoint. + /** + * This constructor creates an acceptor and automatically opens it to listen + * for new connections on the specified endpoint. + * + * @param io_context The io_context object that the acceptor will use to + * dispatch handlers for any asynchronous operations performed on the + * acceptor. + * + * @param endpoint An endpoint on the local machine on which the acceptor + * will listen for new connections. + * + * @param reuse_addr Whether the constructor should set the socket option + * socket_base::reuse_address. + * + * @throws asio::system_error Thrown on failure. + * + * @note This constructor is equivalent to the following code: + * @code + * basic_socket_acceptor acceptor(io_context); + * acceptor.open(endpoint.protocol()); + * if (reuse_addr) + * acceptor.set_option(socket_base::reuse_address(true)); + * acceptor.bind(endpoint); + * acceptor.listen(listen_backlog); + * @endcode + */ + basic_socket_acceptor(asio::io_context& io_context, + const endpoint_type& endpoint, bool reuse_addr = true) + : basic_io_object(io_context) + { + asio::error_code ec; + const protocol_type protocol = endpoint.protocol(); + this->get_service().open(this->get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + if (reuse_addr) + { + this->get_service().set_option(this->get_implementation(), + socket_base::reuse_address(true), ec); + asio::detail::throw_error(ec, "set_option"); + } + this->get_service().bind(this->get_implementation(), endpoint, ec); + asio::detail::throw_error(ec, "bind"); + this->get_service().listen(this->get_implementation(), + socket_base::max_connections, ec); + asio::detail::throw_error(ec, "listen"); + } + + /// Construct a basic_socket_acceptor on an existing native acceptor. + /** + * This constructor creates an acceptor object to hold an existing native + * acceptor. + * + * @param io_context The io_context object that the acceptor will use to + * dispatch handlers for any asynchronous operations performed on the + * acceptor. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_acceptor A native acceptor. + * + * @throws asio::system_error Thrown on failure. + */ + basic_socket_acceptor(asio::io_context& io_context, + const protocol_type& protocol, const native_handle_type& native_acceptor) + : basic_io_object(io_context) + { + asio::error_code ec; + this->get_service().assign(this->get_implementation(), + protocol, native_acceptor, ec); + asio::detail::throw_error(ec, "assign"); + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a basic_socket_acceptor from another. + /** + * This constructor moves an acceptor from one object to another. + * + * @param other The other basic_socket_acceptor object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket_acceptor(io_context&) constructor. + */ + basic_socket_acceptor(basic_socket_acceptor&& other) + : basic_io_object(std::move(other)) + { + } + + /// Move-assign a basic_socket_acceptor from another. + /** + * This assignment operator moves an acceptor from one object to another. + * + * @param other The other basic_socket_acceptor object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket_acceptor(io_context&) constructor. + */ + basic_socket_acceptor& operator=(basic_socket_acceptor&& other) + { + basic_io_object::operator=(std::move(other)); + return *this; + } + + // All socket acceptors have access to each other's implementations. + template + friend class basic_socket_acceptor; + + /// Move-construct a basic_socket_acceptor from an acceptor of another + /// protocol type. + /** + * This constructor moves an acceptor from one object to another. + * + * @param other The other basic_socket_acceptor object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(io_context&) constructor. + */ + template + basic_socket_acceptor( + basic_socket_acceptor&& other, + typename enable_if::value>::type* = 0) + : basic_io_object( + other.get_service().get_io_context()) + { + this->get_service().template converting_move_construct( + this->get_implementation(), other.get_implementation()); + } + + /// Move-assign a basic_socket_acceptor from an acceptor of another protocol + /// type. + /** + * This assignment operator moves an acceptor from one object to another. + * + * @param other The other basic_socket_acceptor object from which the move + * will occur. + * + * @note Following the move, the moved-from object is in the same state as if + * constructed using the @c basic_socket(io_context&) constructor. + */ + template + typename enable_if::value, + basic_socket_acceptor>::type& operator=( + basic_socket_acceptor&& other) + { + basic_socket_acceptor tmp(std::move(other)); + basic_io_object::operator=(std::move(tmp)); + return *this; + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Destroys the acceptor. + /** + * This function destroys the acceptor, cancelling any outstanding + * asynchronous operations associated with the acceptor as if by calling + * @c cancel. + */ + ~basic_socket_acceptor() + { + } + +#if defined(ASIO_ENABLE_OLD_SERVICES) + // These functions are provided by basic_io_object<>. +#else // defined(ASIO_ENABLE_OLD_SERVICES) +#if !defined(ASIO_NO_DEPRECATED) + /// (Deprecated: Use get_executor().) Get the io_context associated with the + /// object. + /** + * This function may be used to obtain the io_context object that the I/O + * object uses to dispatch handlers for asynchronous operations. + * + * @return A reference to the io_context object that the I/O object will use + * to dispatch handlers. Ownership is not transferred to the caller. + */ + asio::io_context& get_io_context() + { + return basic_io_object::get_io_context(); + } + + /// (Deprecated: Use get_executor().) Get the io_context associated with the + /// object. + /** + * This function may be used to obtain the io_context object that the I/O + * object uses to dispatch handlers for asynchronous operations. + * + * @return A reference to the io_context object that the I/O object will use + * to dispatch handlers. Ownership is not transferred to the caller. + */ + asio::io_context& get_io_service() + { + return basic_io_object::get_io_service(); + } +#endif // !defined(ASIO_NO_DEPRECATED) + + /// Get the executor associated with the object. + executor_type get_executor() ASIO_NOEXCEPT + { + return basic_io_object::get_executor(); + } +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + + /// Open the acceptor using the specified protocol. + /** + * This function opens the socket acceptor so that it will use the specified + * protocol. + * + * @param protocol An object specifying which protocol is to be used. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * acceptor.open(asio::ip::tcp::v4()); + * @endcode + */ + void open(const protocol_type& protocol = protocol_type()) + { + asio::error_code ec; + this->get_service().open(this->get_implementation(), protocol, ec); + asio::detail::throw_error(ec, "open"); + } + + /// Open the acceptor using the specified protocol. + /** + * This function opens the socket acceptor so that it will use the specified + * protocol. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * asio::error_code ec; + * acceptor.open(asio::ip::tcp::v4(), ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + asio::error_code open(const protocol_type& protocol, + asio::error_code& ec) + { + return this->get_service().open(this->get_implementation(), protocol, ec); + } + + /// Assigns an existing native acceptor to the acceptor. + /* + * This function opens the acceptor to hold an existing native acceptor. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param native_acceptor A native acceptor. + * + * @throws asio::system_error Thrown on failure. + */ + void assign(const protocol_type& protocol, + const native_handle_type& native_acceptor) + { + asio::error_code ec; + this->get_service().assign(this->get_implementation(), + protocol, native_acceptor, ec); + asio::detail::throw_error(ec, "assign"); + } + + /// Assigns an existing native acceptor to the acceptor. + /* + * This function opens the acceptor to hold an existing native acceptor. + * + * @param protocol An object specifying which protocol is to be used. + * + * @param native_acceptor A native acceptor. + * + * @param ec Set to indicate what error occurred, if any. + */ + asio::error_code assign(const protocol_type& protocol, + const native_handle_type& native_acceptor, asio::error_code& ec) + { + return this->get_service().assign(this->get_implementation(), + protocol, native_acceptor, ec); + } + + /// Determine whether the acceptor is open. + bool is_open() const + { + return this->get_service().is_open(this->get_implementation()); + } + + /// Bind the acceptor to the given local endpoint. + /** + * This function binds the socket acceptor to the specified endpoint on the + * local machine. + * + * @param endpoint An endpoint on the local machine to which the socket + * acceptor will be bound. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345); + * acceptor.open(endpoint.protocol()); + * acceptor.bind(endpoint); + * @endcode + */ + void bind(const endpoint_type& endpoint) + { + asio::error_code ec; + this->get_service().bind(this->get_implementation(), endpoint, ec); + asio::detail::throw_error(ec, "bind"); + } + + /// Bind the acceptor to the given local endpoint. + /** + * This function binds the socket acceptor to the specified endpoint on the + * local machine. + * + * @param endpoint An endpoint on the local machine to which the socket + * acceptor will be bound. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345); + * acceptor.open(endpoint.protocol()); + * asio::error_code ec; + * acceptor.bind(endpoint, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + asio::error_code bind(const endpoint_type& endpoint, + asio::error_code& ec) + { + return this->get_service().bind(this->get_implementation(), endpoint, ec); + } + + /// Place the acceptor into the state where it will listen for new + /// connections. + /** + * This function puts the socket acceptor into the state where it may accept + * new connections. + * + * @param backlog The maximum length of the queue of pending connections. + * + * @throws asio::system_error Thrown on failure. + */ + void listen(int backlog = socket_base::max_connections) + { + asio::error_code ec; + this->get_service().listen(this->get_implementation(), backlog, ec); + asio::detail::throw_error(ec, "listen"); + } + + /// Place the acceptor into the state where it will listen for new + /// connections. + /** + * This function puts the socket acceptor into the state where it may accept + * new connections. + * + * @param backlog The maximum length of the queue of pending connections. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::error_code ec; + * acceptor.listen(asio::socket_base::max_connections, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + asio::error_code listen(int backlog, asio::error_code& ec) + { + return this->get_service().listen(this->get_implementation(), backlog, ec); + } + + /// Close the acceptor. + /** + * This function is used to close the acceptor. Any asynchronous accept + * operations will be cancelled immediately. + * + * A subsequent call to open() is required before the acceptor can again be + * used to again perform socket accept operations. + * + * @throws asio::system_error Thrown on failure. + */ + void close() + { + asio::error_code ec; + this->get_service().close(this->get_implementation(), ec); + asio::detail::throw_error(ec, "close"); + } + + /// Close the acceptor. + /** + * This function is used to close the acceptor. Any asynchronous accept + * operations will be cancelled immediately. + * + * A subsequent call to open() is required before the acceptor can again be + * used to again perform socket accept operations. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::error_code ec; + * acceptor.close(ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + asio::error_code close(asio::error_code& ec) + { + return this->get_service().close(this->get_implementation(), ec); + } + + /// Get the native acceptor representation. + /** + * This function may be used to obtain the underlying representation of the + * acceptor. This is intended to allow access to native acceptor functionality + * that is not otherwise provided. + */ + native_handle_type native_handle() + { + return this->get_service().native_handle(this->get_implementation()); + } + + /// Cancel all asynchronous operations associated with the acceptor. + /** + * This function causes all outstanding asynchronous connect, send and receive + * operations to finish immediately, and the handlers for cancelled operations + * will be passed the asio::error::operation_aborted error. + * + * @throws asio::system_error Thrown on failure. + */ + void cancel() + { + asio::error_code ec; + this->get_service().cancel(this->get_implementation(), ec); + asio::detail::throw_error(ec, "cancel"); + } + + /// Cancel all asynchronous operations associated with the acceptor. + /** + * This function causes all outstanding asynchronous connect, send and receive + * operations to finish immediately, and the handlers for cancelled operations + * will be passed the asio::error::operation_aborted error. + * + * @param ec Set to indicate what error occurred, if any. + */ + asio::error_code cancel(asio::error_code& ec) + { + return this->get_service().cancel(this->get_implementation(), ec); + } + + /// Set an option on the acceptor. + /** + * This function is used to set an option on the acceptor. + * + * @param option The new option value to be set on the acceptor. + * + * @throws asio::system_error Thrown on failure. + * + * @sa SettableSocketOption @n + * asio::socket_base::reuse_address + * asio::socket_base::enable_connection_aborted + * + * @par Example + * Setting the SOL_SOCKET/SO_REUSEADDR option: + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::acceptor::reuse_address option(true); + * acceptor.set_option(option); + * @endcode + */ + template + void set_option(const SettableSocketOption& option) + { + asio::error_code ec; + this->get_service().set_option(this->get_implementation(), option, ec); + asio::detail::throw_error(ec, "set_option"); + } + + /// Set an option on the acceptor. + /** + * This function is used to set an option on the acceptor. + * + * @param option The new option value to be set on the acceptor. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa SettableSocketOption @n + * asio::socket_base::reuse_address + * asio::socket_base::enable_connection_aborted + * + * @par Example + * Setting the SOL_SOCKET/SO_REUSEADDR option: + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::acceptor::reuse_address option(true); + * asio::error_code ec; + * acceptor.set_option(option, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + asio::error_code set_option(const SettableSocketOption& option, + asio::error_code& ec) + { + return this->get_service().set_option( + this->get_implementation(), option, ec); + } + + /// Get an option from the acceptor. + /** + * This function is used to get the current value of an option on the + * acceptor. + * + * @param option The option value to be obtained from the acceptor. + * + * @throws asio::system_error Thrown on failure. + * + * @sa GettableSocketOption @n + * asio::socket_base::reuse_address + * + * @par Example + * Getting the value of the SOL_SOCKET/SO_REUSEADDR option: + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::acceptor::reuse_address option; + * acceptor.get_option(option); + * bool is_set = option.get(); + * @endcode + */ + template + void get_option(GettableSocketOption& option) + { + asio::error_code ec; + this->get_service().get_option(this->get_implementation(), option, ec); + asio::detail::throw_error(ec, "get_option"); + } + + /// Get an option from the acceptor. + /** + * This function is used to get the current value of an option on the + * acceptor. + * + * @param option The option value to be obtained from the acceptor. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa GettableSocketOption @n + * asio::socket_base::reuse_address + * + * @par Example + * Getting the value of the SOL_SOCKET/SO_REUSEADDR option: + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::acceptor::reuse_address option; + * asio::error_code ec; + * acceptor.get_option(option, ec); + * if (ec) + * { + * // An error occurred. + * } + * bool is_set = option.get(); + * @endcode + */ + template + asio::error_code get_option(GettableSocketOption& option, + asio::error_code& ec) + { + return this->get_service().get_option( + this->get_implementation(), option, ec); + } + + /// Perform an IO control command on the acceptor. + /** + * This function is used to execute an IO control command on the acceptor. + * + * @param command The IO control command to be performed on the acceptor. + * + * @throws asio::system_error Thrown on failure. + * + * @sa IoControlCommand @n + * asio::socket_base::non_blocking_io + * + * @par Example + * Getting the number of bytes ready to read: + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::acceptor::non_blocking_io command(true); + * socket.io_control(command); + * @endcode + */ + template + void io_control(IoControlCommand& command) + { + asio::error_code ec; + this->get_service().io_control(this->get_implementation(), command, ec); + asio::detail::throw_error(ec, "io_control"); + } + + /// Perform an IO control command on the acceptor. + /** + * This function is used to execute an IO control command on the acceptor. + * + * @param command The IO control command to be performed on the acceptor. + * + * @param ec Set to indicate what error occurred, if any. + * + * @sa IoControlCommand @n + * asio::socket_base::non_blocking_io + * + * @par Example + * Getting the number of bytes ready to read: + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::acceptor::non_blocking_io command(true); + * asio::error_code ec; + * socket.io_control(command, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + template + asio::error_code io_control(IoControlCommand& command, + asio::error_code& ec) + { + return this->get_service().io_control( + this->get_implementation(), command, ec); + } + + /// Gets the non-blocking mode of the acceptor. + /** + * @returns @c true if the acceptor's synchronous operations will fail with + * asio::error::would_block if they are unable to perform the requested + * operation immediately. If @c false, synchronous operations will block + * until complete. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + bool non_blocking() const + { + return this->get_service().non_blocking(this->get_implementation()); + } + + /// Sets the non-blocking mode of the acceptor. + /** + * @param mode If @c true, the acceptor's synchronous operations will fail + * with asio::error::would_block if they are unable to perform the + * requested operation immediately. If @c false, synchronous operations will + * block until complete. + * + * @throws asio::system_error Thrown on failure. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + void non_blocking(bool mode) + { + asio::error_code ec; + this->get_service().non_blocking(this->get_implementation(), mode, ec); + asio::detail::throw_error(ec, "non_blocking"); + } + + /// Sets the non-blocking mode of the acceptor. + /** + * @param mode If @c true, the acceptor's synchronous operations will fail + * with asio::error::would_block if they are unable to perform the + * requested operation immediately. If @c false, synchronous operations will + * block until complete. + * + * @param ec Set to indicate what error occurred, if any. + * + * @note The non-blocking mode has no effect on the behaviour of asynchronous + * operations. Asynchronous operations will never fail with the error + * asio::error::would_block. + */ + asio::error_code non_blocking( + bool mode, asio::error_code& ec) + { + return this->get_service().non_blocking( + this->get_implementation(), mode, ec); + } + + /// Gets the non-blocking mode of the native acceptor implementation. + /** + * This function is used to retrieve the non-blocking mode of the underlying + * native acceptor. This mode has no effect on the behaviour of the acceptor + * object's synchronous operations. + * + * @returns @c true if the underlying acceptor is in non-blocking mode and + * direct system calls may fail with asio::error::would_block (or the + * equivalent system error). + * + * @note The current non-blocking mode is cached by the acceptor object. + * Consequently, the return value may be incorrect if the non-blocking mode + * was set directly on the native acceptor. + */ + bool native_non_blocking() const + { + return this->get_service().native_non_blocking(this->get_implementation()); + } + + /// Sets the non-blocking mode of the native acceptor implementation. + /** + * This function is used to modify the non-blocking mode of the underlying + * native acceptor. It has no effect on the behaviour of the acceptor object's + * synchronous operations. + * + * @param mode If @c true, the underlying acceptor is put into non-blocking + * mode and direct system calls may fail with asio::error::would_block + * (or the equivalent system error). + * + * @throws asio::system_error Thrown on failure. If the @c mode is + * @c false, but the current value of @c non_blocking() is @c true, this + * function fails with asio::error::invalid_argument, as the + * combination does not make sense. + */ + void native_non_blocking(bool mode) + { + asio::error_code ec; + this->get_service().native_non_blocking( + this->get_implementation(), mode, ec); + asio::detail::throw_error(ec, "native_non_blocking"); + } + + /// Sets the non-blocking mode of the native acceptor implementation. + /** + * This function is used to modify the non-blocking mode of the underlying + * native acceptor. It has no effect on the behaviour of the acceptor object's + * synchronous operations. + * + * @param mode If @c true, the underlying acceptor is put into non-blocking + * mode and direct system calls may fail with asio::error::would_block + * (or the equivalent system error). + * + * @param ec Set to indicate what error occurred, if any. If the @c mode is + * @c false, but the current value of @c non_blocking() is @c true, this + * function fails with asio::error::invalid_argument, as the + * combination does not make sense. + */ + asio::error_code native_non_blocking( + bool mode, asio::error_code& ec) + { + return this->get_service().native_non_blocking( + this->get_implementation(), mode, ec); + } + + /// Get the local endpoint of the acceptor. + /** + * This function is used to obtain the locally bound endpoint of the acceptor. + * + * @returns An object that represents the local endpoint of the acceptor. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(); + * @endcode + */ + endpoint_type local_endpoint() const + { + asio::error_code ec; + endpoint_type ep = this->get_service().local_endpoint( + this->get_implementation(), ec); + asio::detail::throw_error(ec, "local_endpoint"); + return ep; + } + + /// Get the local endpoint of the acceptor. + /** + * This function is used to obtain the locally bound endpoint of the acceptor. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns An object that represents the local endpoint of the acceptor. + * Returns a default-constructed endpoint object if an error occurred and the + * error handler did not throw an exception. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::error_code ec; + * asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + endpoint_type local_endpoint(asio::error_code& ec) const + { + return this->get_service().local_endpoint(this->get_implementation(), ec); + } + + /// Wait for the acceptor to become ready to read, ready to write, or to have + /// pending error conditions. + /** + * This function is used to perform a blocking wait for an acceptor to enter + * a ready to read, write or error condition state. + * + * @param w Specifies the desired acceptor state. + * + * @par Example + * Waiting for an acceptor to become readable. + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * acceptor.wait(asio::ip::tcp::acceptor::wait_read); + * @endcode + */ + void wait(wait_type w) + { + asio::error_code ec; + this->get_service().wait(this->get_implementation(), w, ec); + asio::detail::throw_error(ec, "wait"); + } + + /// Wait for the acceptor to become ready to read, ready to write, or to have + /// pending error conditions. + /** + * This function is used to perform a blocking wait for an acceptor to enter + * a ready to read, write or error condition state. + * + * @param w Specifies the desired acceptor state. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * Waiting for an acceptor to become readable. + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::error_code ec; + * acceptor.wait(asio::ip::tcp::acceptor::wait_read, ec); + * @endcode + */ + asio::error_code wait(wait_type w, asio::error_code& ec) + { + return this->get_service().wait(this->get_implementation(), w, ec); + } + + /// Asynchronously wait for the acceptor to become ready to read, ready to + /// write, or to have pending error conditions. + /** + * This function is used to perform an asynchronous wait for an acceptor to + * enter a ready to read, write or error condition state. + * + * @param w Specifies the desired acceptor state. + * + * @param handler The handler to be called when the wait operation completes. + * Copies will be made of the handler as required. The function signature of + * the handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * @code + * void wait_handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Wait succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * acceptor.async_wait( + * asio::ip::tcp::acceptor::wait_read, + * wait_handler); + * @endcode + */ + template + ASIO_INITFN_RESULT_TYPE(WaitHandler, + void (asio::error_code)) + async_wait(wait_type w, ASIO_MOVE_ARG(WaitHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a WaitHandler. + ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_wait(this->get_implementation(), + w, ASIO_MOVE_CAST(WaitHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_wait(this->get_implementation(), w, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer into the + * given socket. The function call will block until a new connection has been + * accepted successfully or an error occurs. + * + * @param peer The socket into which the new connection will be accepted. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::socket socket(io_context); + * acceptor.accept(socket); + * @endcode + */ +#if defined(ASIO_ENABLE_OLD_SERVICES) + template + void accept(basic_socket& peer, + typename enable_if::value>::type* = 0) +#else // defined(ASIO_ENABLE_OLD_SERVICES) + template + void accept(basic_socket& peer, + typename enable_if::value>::type* = 0) +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + { + asio::error_code ec; + this->get_service().accept(this->get_implementation(), + peer, static_cast(0), ec); + asio::detail::throw_error(ec, "accept"); + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer into the + * given socket. The function call will block until a new connection has been + * accepted successfully or an error occurs. + * + * @param peer The socket into which the new connection will be accepted. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::socket socket(io_context); + * asio::error_code ec; + * acceptor.accept(socket, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ +#if defined(ASIO_ENABLE_OLD_SERVICES) + template + asio::error_code accept( + basic_socket& peer, + asio::error_code& ec, + typename enable_if::value>::type* = 0) +#else // defined(ASIO_ENABLE_OLD_SERVICES) + template + asio::error_code accept( + basic_socket& peer, asio::error_code& ec, + typename enable_if::value>::type* = 0) +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + { + return this->get_service().accept(this->get_implementation(), + peer, static_cast(0), ec); + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection into a + * socket. The function call always returns immediately. + * + * @param peer The socket into which the new connection will be accepted. + * Ownership of the peer object is retained by the caller, which must + * guarantee that it is valid until the handler is called. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::socket socket(io_context); + * acceptor.async_accept(socket, accept_handler); + * @endcode + */ +#if defined(ASIO_ENABLE_OLD_SERVICES) + template + ASIO_INITFN_RESULT_TYPE(AcceptHandler, + void (asio::error_code)) + async_accept(basic_socket& peer, + ASIO_MOVE_ARG(AcceptHandler) handler, + typename enable_if::value>::type* = 0) +#else // defined(ASIO_ENABLE_OLD_SERVICES) + template + ASIO_INITFN_RESULT_TYPE(AcceptHandler, + void (asio::error_code)) + async_accept(basic_socket& peer, + ASIO_MOVE_ARG(AcceptHandler) handler, + typename enable_if::value>::type* = 0) +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a AcceptHandler. + ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_accept(this->get_implementation(), + peer, static_cast(0), + ASIO_MOVE_CAST(AcceptHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_accept(this->get_implementation(), + peer, static_cast(0), init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Accept a new connection and obtain the endpoint of the peer + /** + * This function is used to accept a new connection from a peer into the + * given socket, and additionally provide the endpoint of the remote peer. + * The function call will block until a new connection has been accepted + * successfully or an error occurs. + * + * @param peer The socket into which the new connection will be accepted. + * + * @param peer_endpoint An endpoint object which will receive the endpoint of + * the remote peer. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::socket socket(io_context); + * asio::ip::tcp::endpoint endpoint; + * acceptor.accept(socket, endpoint); + * @endcode + */ +#if defined(ASIO_ENABLE_OLD_SERVICES) + template + void accept(basic_socket& peer, + endpoint_type& peer_endpoint) +#else // defined(ASIO_ENABLE_OLD_SERVICES) + void accept(basic_socket& peer, endpoint_type& peer_endpoint) +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + { + asio::error_code ec; + this->get_service().accept(this->get_implementation(), + peer, &peer_endpoint, ec); + asio::detail::throw_error(ec, "accept"); + } + + /// Accept a new connection and obtain the endpoint of the peer + /** + * This function is used to accept a new connection from a peer into the + * given socket, and additionally provide the endpoint of the remote peer. + * The function call will block until a new connection has been accepted + * successfully or an error occurs. + * + * @param peer The socket into which the new connection will be accepted. + * + * @param peer_endpoint An endpoint object which will receive the endpoint of + * the remote peer. + * + * @param ec Set to indicate what error occurred, if any. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::socket socket(io_context); + * asio::ip::tcp::endpoint endpoint; + * asio::error_code ec; + * acceptor.accept(socket, endpoint, ec); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ +#if defined(ASIO_ENABLE_OLD_SERVICES) + template + asio::error_code accept( + basic_socket& peer, + endpoint_type& peer_endpoint, asio::error_code& ec) +#else // defined(ASIO_ENABLE_OLD_SERVICES) + asio::error_code accept(basic_socket& peer, + endpoint_type& peer_endpoint, asio::error_code& ec) +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + { + return this->get_service().accept( + this->get_implementation(), peer, &peer_endpoint, ec); + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection into a + * socket, and additionally obtain the endpoint of the remote peer. The + * function call always returns immediately. + * + * @param peer The socket into which the new connection will be accepted. + * Ownership of the peer object is retained by the caller, which must + * guarantee that it is valid until the handler is called. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. Ownership of the peer_endpoint object is + * retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error // Result of operation. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + */ +#if defined(ASIO_ENABLE_OLD_SERVICES) + template + ASIO_INITFN_RESULT_TYPE(AcceptHandler, + void (asio::error_code)) + async_accept(basic_socket& peer, + endpoint_type& peer_endpoint, ASIO_MOVE_ARG(AcceptHandler) handler) +#else // defined(ASIO_ENABLE_OLD_SERVICES) + template + ASIO_INITFN_RESULT_TYPE(AcceptHandler, + void (asio::error_code)) + async_accept(basic_socket& peer, + endpoint_type& peer_endpoint, ASIO_MOVE_ARG(AcceptHandler) handler) +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a AcceptHandler. + ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_accept(this->get_implementation(), peer, + &peer_endpoint, ASIO_MOVE_CAST(AcceptHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_accept(this->get_implementation(), + peer, &peer_endpoint, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @returns A socket object representing the newly accepted connection. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::socket socket(acceptor.accept()); + * @endcode + */ + typename Protocol::socket accept() + { + asio::error_code ec; + typename Protocol::socket peer( + this->get_service().accept( + this->get_implementation(), 0, 0, ec)); + asio::detail::throw_error(ec, "accept"); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns On success, a socket object representing the newly accepted + * connection. On error, a socket object where is_open() is false. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::socket socket(acceptor.accept(ec)); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + typename Protocol::socket accept(asio::error_code& ec) + { + return this->get_service().accept(this->get_implementation(), 0, 0, ec); + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection. The + * function call always returns immediately. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * typename Protocol::socket peer // On success, the newly accepted socket. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error, + * asio::ip::tcp::socket peer) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * acceptor.async_accept(accept_handler); + * @endcode + */ + template + ASIO_INITFN_RESULT_TYPE(MoveAcceptHandler, + void (asio::error_code, typename Protocol::socket)) + async_accept(ASIO_MOVE_ARG(MoveAcceptHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a MoveAcceptHandler. + ASIO_MOVE_ACCEPT_HANDLER_CHECK(MoveAcceptHandler, + handler, typename Protocol::socket) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_accept( + this->get_implementation(), static_cast(0), + static_cast(0), + ASIO_MOVE_CAST(MoveAcceptHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_accept( + this->get_implementation(), static_cast(0), + static_cast(0), init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param io_context The io_context object to be used for the newly accepted + * socket. + * + * @returns A socket object representing the newly accepted connection. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::socket socket(acceptor.accept()); + * @endcode + */ + typename Protocol::socket accept(asio::io_context& io_context) + { + asio::error_code ec; + typename Protocol::socket peer( + this->get_service().accept(this->get_implementation(), + &io_context, static_cast(0), ec)); + asio::detail::throw_error(ec, "accept"); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param io_context The io_context object to be used for the newly accepted + * socket. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns On success, a socket object representing the newly accepted + * connection. On error, a socket object where is_open() is false. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::socket socket(acceptor.accept(io_context2, ec)); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + typename Protocol::socket accept( + asio::io_context& io_context, asio::error_code& ec) + { + return this->get_service().accept(this->get_implementation(), + &io_context, static_cast(0), ec); + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection. The + * function call always returns immediately. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param io_context The io_context object to be used for the newly accepted + * socket. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * typename Protocol::socket peer // On success, the newly accepted socket. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error, + * asio::ip::tcp::socket peer) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * acceptor.async_accept(io_context2, accept_handler); + * @endcode + */ + template + ASIO_INITFN_RESULT_TYPE(MoveAcceptHandler, + void (asio::error_code, typename Protocol::socket)) + async_accept(asio::io_context& io_context, + ASIO_MOVE_ARG(MoveAcceptHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a MoveAcceptHandler. + ASIO_MOVE_ACCEPT_HANDLER_CHECK(MoveAcceptHandler, + handler, typename Protocol::socket) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_accept(this->get_implementation(), + &io_context, static_cast(0), + ASIO_MOVE_CAST(MoveAcceptHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_accept(this->get_implementation(), + &io_context, static_cast(0), init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. + * + * @returns A socket object representing the newly accepted connection. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * asio::ip::tcp::socket socket(acceptor.accept(endpoint)); + * @endcode + */ + typename Protocol::socket accept(endpoint_type& peer_endpoint) + { + asio::error_code ec; + typename Protocol::socket peer( + this->get_service().accept(this->get_implementation(), + static_cast(0), &peer_endpoint, ec)); + asio::detail::throw_error(ec, "accept"); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns On success, a socket object representing the newly accepted + * connection. On error, a socket object where is_open() is false. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * asio::ip::tcp::socket socket(acceptor.accept(endpoint, ec)); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + typename Protocol::socket accept( + endpoint_type& peer_endpoint, asio::error_code& ec) + { + return this->get_service().accept(this->get_implementation(), + static_cast(0), &peer_endpoint, ec); + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection. The + * function call always returns immediately. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. Ownership of the peer_endpoint object is + * retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * typename Protocol::socket peer // On success, the newly accepted socket. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error, + * asio::ip::tcp::socket peer) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * acceptor.async_accept(endpoint, accept_handler); + * @endcode + */ + template + ASIO_INITFN_RESULT_TYPE(MoveAcceptHandler, + void (asio::error_code, typename Protocol::socket)) + async_accept(endpoint_type& peer_endpoint, + ASIO_MOVE_ARG(MoveAcceptHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a MoveAcceptHandler. + ASIO_MOVE_ACCEPT_HANDLER_CHECK(MoveAcceptHandler, + handler, typename Protocol::socket) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_accept(this->get_implementation(), + static_cast(0), &peer_endpoint, + ASIO_MOVE_CAST(MoveAcceptHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_accept(this->get_implementation(), + static_cast(0), &peer_endpoint, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param io_context The io_context object to be used for the newly accepted + * socket. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. + * + * @returns A socket object representing the newly accepted connection. + * + * @throws asio::system_error Thrown on failure. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * asio::ip::tcp::socket socket( + * acceptor.accept(io_context2, endpoint)); + * @endcode + */ + typename Protocol::socket accept( + asio::io_context& io_context, endpoint_type& peer_endpoint) + { + asio::error_code ec; + typename Protocol::socket peer( + this->get_service().accept(this->get_implementation(), + &io_context, &peer_endpoint, ec)); + asio::detail::throw_error(ec, "accept"); + return peer; + } + + /// Accept a new connection. + /** + * This function is used to accept a new connection from a peer. The function + * call will block until a new connection has been accepted successfully or + * an error occurs. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param io_context The io_context object to be used for the newly accepted + * socket. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns On success, a socket object representing the newly accepted + * connection. On error, a socket object where is_open() is false. + * + * @par Example + * @code + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * asio::ip::tcp::socket socket( + * acceptor.accept(io_context2, endpoint, ec)); + * if (ec) + * { + * // An error occurred. + * } + * @endcode + */ + typename Protocol::socket accept(asio::io_context& io_context, + endpoint_type& peer_endpoint, asio::error_code& ec) + { + return this->get_service().accept(this->get_implementation(), + &io_context, &peer_endpoint, ec); + } + + /// Start an asynchronous accept. + /** + * This function is used to asynchronously accept a new connection. The + * function call always returns immediately. + * + * This overload requires that the Protocol template parameter satisfy the + * AcceptableProtocol type requirements. + * + * @param io_context The io_context object to be used for the newly accepted + * socket. + * + * @param peer_endpoint An endpoint object into which the endpoint of the + * remote peer will be written. Ownership of the peer_endpoint object is + * retained by the caller, which must guarantee that it is valid until the + * handler is called. + * + * @param handler The handler to be called when the accept operation + * completes. Copies will be made of the handler as required. The function + * signature of the handler must be: + * @code void handler( + * const asio::error_code& error, // Result of operation. + * typename Protocol::socket peer // On success, the newly accepted socket. + * ); @endcode + * Regardless of whether the asynchronous operation completes immediately or + * not, the handler will not be invoked from within this function. Invocation + * of the handler will be performed in a manner equivalent to using + * asio::io_context::post(). + * + * @par Example + * @code + * void accept_handler(const asio::error_code& error, + * asio::ip::tcp::socket peer) + * { + * if (!error) + * { + * // Accept succeeded. + * } + * } + * + * ... + * + * asio::ip::tcp::acceptor acceptor(io_context); + * ... + * asio::ip::tcp::endpoint endpoint; + * acceptor.async_accept(io_context2, endpoint, accept_handler); + * @endcode + */ + template + ASIO_INITFN_RESULT_TYPE(MoveAcceptHandler, + void (asio::error_code, typename Protocol::socket)) + async_accept(asio::io_context& io_context, + endpoint_type& peer_endpoint, + ASIO_MOVE_ARG(MoveAcceptHandler) handler) + { + // If you get an error on the following line it means that your handler does + // not meet the documented type requirements for a MoveAcceptHandler. + ASIO_MOVE_ACCEPT_HANDLER_CHECK(MoveAcceptHandler, + handler, typename Protocol::socket) type_check; + +#if defined(ASIO_ENABLE_OLD_SERVICES) + return this->get_service().async_accept( + this->get_implementation(), &io_context, &peer_endpoint, + ASIO_MOVE_CAST(MoveAcceptHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_accept(this->get_implementation(), + &io_context, &peer_endpoint, init.handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#if !defined(ASIO_ENABLE_OLD_SERVICES) +# undef ASIO_SVC_T +#endif // !defined(ASIO_ENABLE_OLD_SERVICES) + +#endif // ASIO_BASIC_SOCKET_ACCEPTOR_HPP diff --git a/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket_iostream.hpp b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket_iostream.hpp new file mode 100644 index 0000000..2f89269 --- /dev/null +++ b/OpenVPN Tunnel Provider/Vendors/asio/asio/basic_socket_iostream.hpp @@ -0,0 +1,325 @@ +// +// basic_socket_iostream.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_BASIC_SOCKET_IOSTREAM_HPP +#define ASIO_BASIC_SOCKET_IOSTREAM_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" + +#if !defined(ASIO_NO_IOSTREAM) + +#include +#include +#include "asio/basic_socket_streambuf.hpp" +#include "asio/stream_socket_service.hpp" + +#if !defined(ASIO_HAS_VARIADIC_TEMPLATES) + +# include "asio/detail/variadic_templates.hpp" + +// A macro that should expand to: +// template +// explicit basic_socket_iostream(T1 x1, ..., Tn xn) +// : std::basic_iostream( +// &this->detail::socket_iostream_base< +// Protocol ASIO_SVC_TARG, Time, +// TimeTraits ASIO_SVC_TARG1>::streambuf_) +// { +// if (rdbuf()->connect(x1, ..., xn) == 0) +// this->setstate(std::ios_base::failbit); +// } +// This macro should only persist within this file. + +# define ASIO_PRIVATE_CTR_DEF(n) \ + template \ + explicit basic_socket_iostream(ASIO_VARIADIC_BYVAL_PARAMS(n)) \ + : std::basic_iostream( \ + &this->detail::socket_iostream_base< \ + Protocol ASIO_SVC_TARG, Time, \ + TimeTraits ASIO_SVC_TARG1>::streambuf_) \ + { \ + this->setf(std::ios_base::unitbuf); \ + if (rdbuf()->connect(ASIO_VARIADIC_BYVAL_ARGS(n)) == 0) \ + this->setstate(std::ios_base::failbit); \ + } \ + /**/ + +// A macro that should expand to: +// template +// void connect(T1 x1, ..., Tn xn) +// { +// if (rdbuf()->connect(x1, ..., xn) == 0) +// this->setstate(std::ios_base::failbit); +// } +// This macro should only persist within this file. + +# define ASIO_PRIVATE_CONNECT_DEF(n) \ + template \ + void connect(ASIO_VARIADIC_BYVAL_PARAMS(n)) \ + { \ + if (rdbuf()->connect(ASIO_VARIADIC_BYVAL_ARGS(n)) == 0) \ + this->setstate(std::ios_base::failbit); \ + } \ + /**/ + +#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +// A separate base class is used to ensure that the streambuf is initialised +// prior to the basic_socket_iostream's basic_iostream base class. +template +class socket_iostream_base +{ +protected: + basic_socket_streambuf streambuf_; +}; + +} // namespace detail + +/// Iostream interface for a socket. +template ), +#if defined(ASIO_HAS_BOOST_DATE_TIME) \ + || defined(GENERATING_DOCUMENTATION) + typename Time = boost::posix_time::ptime, + typename TimeTraits = asio::time_traits