OpenVPN
Data Fields
stream_buf Struct Reference

struct used to extract packets encapsulated in streams into a buffer, in this case OpenVPN packets (data or control) embedded in a TCP stream. More...

#include <socket.h>

Collaboration diagram for stream_buf:
Collaboration graph
[legend]

Data Fields

struct buffer buf_init
 
struct buffer residual
 buffer holding the excess bytes that are not part of the packet.
 
int maxlen
 Maximum length of a packet that we accept.
 
bool residual_fully_formed
 The buffer in buf contains a full packet without a header.
 
struct buffer buf
 Holds the data of the current packet.
 
int len
 -1 if not yet known.
 
bool error
 if true, a fatal TCP error has occurred, requiring that connection be restarted
 

Detailed Description

struct used to extract packets encapsulated in streams into a buffer, in this case OpenVPN packets (data or control) embedded in a TCP stream.

This struct is used to packetise the TCP stream into the OpenVPN packet. Each OpenVPN packet has a two-byte header determining the length of the packet.

Definition at line 106 of file socket.h.

Field Documentation

◆ buf

struct buffer stream_buf::buf

Holds the data of the current packet.

This might be a partial packet

Definition at line 123 of file socket.h.

◆ buf_init

struct buffer stream_buf::buf_init

Definition at line 109 of file socket.h.

◆ error

bool stream_buf::error

if true, a fatal TCP error has occurred, requiring that connection be restarted

Definition at line 132 of file socket.h.

Referenced by socket_connection_reset().

◆ len

int stream_buf::len

-1 if not yet known.

Otherwise holds the length of the packet. If >= 0, buf is already moved past the initial size header

Definition at line 128 of file socket.h.

◆ maxlen

int stream_buf::maxlen

Maximum length of a packet that we accept.

Definition at line 116 of file socket.h.

Referenced by link_socket_write_tcp().

◆ residual

struct buffer stream_buf::residual

buffer holding the excess bytes that are not part of the packet.

Definition at line 113 of file socket.h.

Referenced by phase2_tcp_client().

◆ residual_fully_formed

bool stream_buf::residual_fully_formed

The buffer in buf contains a full packet without a header.

Any extra data is in residual

Definition at line 120 of file socket.h.

Referenced by link_socket_read_tcp(), and sockets_read_residual().


The documentation for this struct was generated from the following file: