This module controls the processing of packets as they pass through the data channel. More...
|void||encrypt_sign (struct context *c, bool comp_frag)|
|Process a data channel packet that will be sent through a VPN tunnel. |
This module controls the processing of packets as they pass through the data channel.
The Data Channel Control module controls the processing of packets as they pass through the data channel. The processing includes packet compression, fragmentation, and the performing of security operations on the packets. This module does not do the processing itself, but passes the packet to other data channel modules to perform the appropriate actions.
Packets can travel in two directions through the data channel. They can be going to a remote destination which is reachable through a VPN tunnel, in which case this module prepares them to be sent out through a VPN tunnel. On the other hand, they can have been received through a VPN tunnel from a remote OpenVPN peer, in which case this module retrieves the packet in its original form as it was before entering the VPN tunnel on the remote OpenVPN peer. How this module processes packets traveling in the two directions is discussed in more detail below.
encrypt_sign(), which performs the following processing steps:
encrypt_sign()documentation for details of these interactions.
process_incoming_link(). That function, however, also performs some of the tasks required for the External Multiplexer and is therefore listed as part of that module, instead of here.
process_incoming_link()function has determined that a received packet is a data channel packet, it performs the following processing steps:
process_incoming_link()documentation for details of these interactions.
Process a data channel packet that will be sent through a VPN tunnel.
This function controls the processing of a data channel packet which will be sent through a VPN tunnel to a remote OpenVPN peer. It's general structure is as follows:
c->c2.to_linkso that it can be sent over the external network interface to its remote destination by the External Multiplexer.
|c||- The context structure of the VPN tunnel associated with this packet.|
|comp_frag||- Whether to do packet compression and fragmentation. This flag is set to true the first time a packet is processed. If the packet then gets fragmented, this function will be called again once for each remaining fragment with this parameter set to false.|
References ASSERT, context_2::buf, buf_init, buffer_turnover(), context_2::buffers, context::c2, CAS_SUCCEEDED, context_2::context_auth, context_2::crypto_options, buffer::data, context_buffers::encrypt_buf, context_2::fragment, fragment_outgoing(), context_2::frame, context_2::frame_fragment, FRAME_HEADROOM, get_link_socket_info(), buffer::len, link_socket_get_outgoing_addr(), openvpn_encrypt(), tls_multi::opt, context_buffers::read_tun_buf, tls_options::server, context_2::tls_multi, tls_post_encrypt(), tls_pre_encrypt(), tls_prepend_opcode_v1(), tls_prepend_opcode_v2(), context_2::to_link, context_2::to_link_addr, and tls_multi::use_peer_id.