|
OpenVPN
|
Data Channel Fragmentation module header file. More...
#include "common.h"#include "buffer.h"#include "interval.h"#include "mtu.h"#include "shaper.h"#include "error.h"

Go to the source code of this file.
Data Structures | |
| struct | fragment |
| Structure for reassembling one incoming fragmented packet. More... | |
| struct | fragment_list |
| List of fragment structures for reassembling multiple incoming packets concurrently. More... | |
| struct | fragment_master |
| Fragmentation and reassembly state for one VPN tunnel instance. More... | |
Macros | |
| #define | N_FRAG_BUF 25 |
| Number of packet buffers for reassembling incoming fragmented packets. | |
| #define | FRAG_TTL_SEC 10 |
| Time-to-live in seconds for a fragment. | |
| #define | FRAG_WAKEUP_INTERVAL 5 |
| Interval in seconds between calls to wakeup code. | |
| #define | FRAG_MAP_MASK 0xFFFFFFFF |
| Mask for reassembly map. | |
| #define | MAX_FRAGS 32 |
| Maximum number of fragments per packet. | |
| #define | N_SEQ_ID 256 |
| One more than the maximum fragment sequence ID, above which the IDs wrap to zero. | |
| #define | MAX_FRAG_PKT_SIZE 65536 |
| (Not used) Maximum packet size before fragmenting. | |
Functions | |
| void | fragment_wakeup (struct fragment_master *f, struct frame *frame) |
Functions for initialization and cleanup | |
| struct fragment_master * | fragment_init (struct frame *frame) |
Allocate and initialize a fragment_master structure. | |
| void | fragment_frame_init (struct fragment_master *f, const struct frame *frame) |
Allocate internal packet buffers for a fragment_master structure. | |
| void | fragment_free (struct fragment_master *f) |
Free a fragment_master structure and its internal packet buffers. | |
Functions for processing packets received from a remote OpenVPN peer | |
| void | fragment_incoming (struct fragment_master *f, struct buffer *buf, const struct frame *frame) |
| Process an incoming packet, which may or may not be fragmented. | |
Functions for processing packets to be sent to a remote OpenVPN peer | |
| void | fragment_outgoing (struct fragment_master *f, struct buffer *buf, const struct frame *frame) |
| Process an outgoing packet, which may or may not need to be fragmented. | |
| bool | fragment_ready_to_send (struct fragment_master *f, struct buffer *buf, const struct frame *frame) |
| Check whether outgoing fragments are ready to be send, and if so make one available. | |
| static bool | fragment_outgoing_defined (struct fragment_master *f) |
Check whether a fragment_master structure contains fragments ready to be sent. | |
Functions for regular housekeeping | |
| static void | fragment_housekeeping (struct fragment_master *f, struct frame *frame, struct timeval *tv) |
Perform housekeeping of a fragment_master structure. | |
Fragment header | |
| |
| #define | hton_fragment_header_type(x) htonl(x) |
| Convert a fragment_header_type from host to network order. | |
| #define | ntoh_fragment_header_type(x) ntohl(x) |
Convert a fragment_header_type from network to host order. | |
| #define | FRAG_TYPE_MASK 0x00000003 |
| Bit mask for fragment type info. | |
| #define | FRAG_TYPE_SHIFT 0 |
| Bit shift for fragment type info. | |
| #define | FRAG_WHOLE 0 |
| Fragment type indicating packet is whole. | |
| #define | FRAG_YES_NOTLAST 1 |
| Fragment type indicating packet is part of a fragmented packet, but not the last part in the sequence. | |
| #define | FRAG_YES_LAST 2 |
| Fragment type indicating packet is the last part in the sequence of parts. | |
| #define | FRAG_TEST 3 |
| Fragment type not implemented yet. | |
| #define | FRAG_SEQ_ID_MASK 0x000000ff |
| Bit mask for fragment sequence ID. | |
| #define | FRAG_SEQ_ID_SHIFT 2 |
| Bit shift for fragment sequence ID. | |
| #define | FRAG_ID_MASK 0x0000001f |
| Bit mask for fragment ID. | |
| #define | FRAG_ID_SHIFT 10 |
| Bit shift for fragment ID. | |
| #define | FRAG_SIZE_MASK 0x00003fff |
| Bit mask for fragment size. | |
| #define | FRAG_SIZE_SHIFT 15 |
| Bit shift for fragment size. | |
| #define | FRAG_SIZE_ROUND_SHIFT 2 |
| Bit shift for fragment size rounding. | |
| #define | FRAG_SIZE_ROUND_MASK ((1 << FRAG_SIZE_ROUND_SHIFT) - 1) |
| Bit mask for fragment size rounding. | |
| #define | FRAG_EXTRA_MASK 0x0000ffff |
| Bit mask for extra bits. | |
| #define | FRAG_EXTRA_SHIFT 15 |
| Bit shift for extra bits. | |
| typedef uint32_t | fragment_header_type |
| Fragmentation information is stored in a 32-bit packet header. | |
Data Channel Fragmentation module header file.
Definition in file fragment.h.
| #define FRAG_MAP_MASK 0xFFFFFFFF |
Mask for reassembly map.
Definition at line 72 of file fragment.h.
| #define MAX_FRAG_PKT_SIZE 65536 |
(Not used) Maximum packet size before fragmenting.
Definition at line 156 of file fragment.h.
| #define MAX_FRAGS 32 |
Maximum number of fragments per packet.
Definition at line 73 of file fragment.h.
| #define N_SEQ_ID 256 |
One more than the maximum fragment sequence ID, above which the IDs wrap to zero.
Should be a power of 2.
Definition at line 147 of file fragment.h.