OpenVPN
Data Fields
buffer Struct Reference

Wrapper structure for dynamically allocated memory. More...

#include <buffer.h>

Data Fields

int capacity
 Size in bytes of memory allocated by malloc(). More...
 
int offset
 Offset in bytes of the actual content within the allocated memory. More...
 
int len
 Length in bytes of the actual content within the allocated memory. More...
 
uint8_tdata
 Pointer to the allocated memory. More...
 

Detailed Description

Wrapper structure for dynamically allocated memory.

The actual content stored in a buffer structure starts at the memory location buffer.data + buffer.offset, and has a length of buffer.len bytes. This, together with the space available before and after the content, is represented in the pseudocode below:

uint8_t *content_start = buffer.data + buffer.offset;
uint8_t *content_end = buffer.data + buffer.offset + buffer.len;
int prepend_capacity = buffer.offset;
int append_capacity = buffer.capacity - (buffer.offset + buffer.len);

Definition at line 60 of file buffer.h.

Field Documentation

◆ capacity

int buffer::capacity

◆ data

uint8_t* buffer::data

◆ len

int buffer::len

Length in bytes of the actual content within the allocated memory.

Definition at line 66 of file buffer.h.

Referenced by alloc_buf(), alloc_buf_gc(), alloc_buf_sock_tun(), bio_read(), bio_write_post(), buf_advance(), buf_catrunc(), buf_clear(), buf_copy_excess(), buf_copy_range(), buf_forward_capacity(), buf_inc_len(), buf_init_dowork(), buf_len(), buf_prepend(), buf_printf(), buf_puts(), buf_read_alloc(), buf_reset(), buf_reset_len(), buf_rmtail(), buf_safe(), buf_safe_bidir(), buf_set_read(), buf_set_write(), buf_string_match(), buf_string_match_head(), buf_string_match_head_str(), buf_valid(), buf_write_alloc(), buffer_list_push(), buffer_list_push_data(), check_file_access_chroot(), check_fragment_dowork(), check_ping_send_dowork(), cipher_ctx_update_ad(), clone_buf(), convert_to_one_line(), drop_if_recursive_routing(), encrypt_sign(), flush_payload_buffer(), foreign_option(), fragment_incoming(), fragment_outgoing(), fragment_prepend_flags(), fragment_ready_to_send(), ipset2ascii_all(), key_method_1_read(), key_method_2_read(), link_socket_bad_incoming_addr(), link_socket_get_outgoing_addr(), link_socket_read_tcp(), link_socket_set_outgoing_addr(), link_socket_verify_incoming_addr(), make_arg_copy(), make_inline_array(), man_write(), multi_get_create_instance_udp(), multi_process_drop_outgoing_tun(), multi_process_float(), multi_process_incoming_link(), multi_process_outgoing_tun(), multi_process_post(), ntlm_phase_3(), openvpn_decrypt(), openvpn_decrypt_aead(), openvpn_decrypt_v1(), openvpn_encrypt(), openvpn_encrypt_aead(), openvpn_encrypt_v1(), openvpn_snprintf(), openvpn_swprintf(), p2p_iow_flags(), process_incoming_link_part1(), process_incoming_link_part2(), process_incoming_tun(), process_ip_header(), process_outgoing_link(), process_outgoing_tun(), process_received_occ_msg(), protocol_dump(), read_control_auth(), read_incoming_tun(), read_key_file(), reliable_ack_read_packet_id(), reliable_mark_deleted(), reliable_send(), rm_trailing_chars(), secure_memzero(), socket_finalize(), socket_send_queue(), socks_process_incoming_udp(), stream_buf_added(), stream_buf_get_final(), stream_buf_get_next(), stream_buf_init(), stream_buf_read_setup_dowork(), stream_buf_set_next(), string_alloc_buf(), string_null_terminate(), string_replace_leading(), swap_hmac(), tap_win_getinfo(), test_crypto(), tls_crypt_unwrap(), tls_crypt_wrap(), tls_post_encrypt(), tls_pre_decrypt(), tls_pre_decrypt_lite(), tls_pre_encrypt(), tls_process(), tls_rec_payload(), tun_finalize(), tun_show_debug(), tun_write_queue(), wide_cmd_line(), write_control_auth(), write_dhcp_str(), and write_dhcp_u32_array().

◆ offset

int buffer::offset

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