OpenVPN
fragment.c File Reference
#include "syshead.h"
#include "crypto.h"
#include "misc.h"
#include "fragment.h"
#include "integer.h"
#include "memdbg.h"
Include dependency graph for fragment.c:

Go to the source code of this file.

Macros

#define FRAG_ERR(s)

Functions

static void fragment_list_buf_init (struct fragment_list *list, const struct frame *frame)
static void fragment_list_buf_free (struct fragment_list *list)
static struct fragment * fragment_list_get_buf (struct fragment_list *list, int seq_id)
struct fragment_master * fragment_init (struct frame *frame)
 Allocate and initialize a fragment_master structure.
void fragment_free (struct fragment_master *f)
 Free a fragment_master structure and its internal packet buffers.
void fragment_frame_init (struct fragment_master *f, const struct frame *frame)
 Allocate internal packet buffers for a fragment_master structure.
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.
static void fragment_prepend_flags (struct buffer *buf, int type, int seq_id, int frag_id, int frag_size)
static int optimal_fragment_size (int len, int max_frag_size)
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 void fragment_ttl_reap (struct fragment_master *f)
void fragment_wakeup (struct fragment_master *f, struct frame *frame)

Macro Definition Documentation

◆ FRAG_ERR

#define FRAG_ERR ( s)
Value:
{ \
errmsg = s; \
goto error; \
}

Definition at line 37 of file fragment.c.

Referenced by fragment_incoming(), and fragment_outgoing().

Function Documentation

◆ fragment_list_buf_free()

void fragment_list_buf_free ( struct fragment_list * list)
static

Definition at line 54 of file fragment.c.

References fragment::buf, fragment_list::fragments, free_buf(), and N_FRAG_BUF.

Referenced by fragment_free().

◆ fragment_list_buf_init()

void fragment_list_buf_init ( struct fragment_list * list,
const struct frame * frame )
static

Definition at line 44 of file fragment.c.

References alloc_buf(), fragment::buf, BUF_SIZE, fragment_list::fragments, and N_FRAG_BUF.

Referenced by fragment_frame_init().

◆ fragment_list_get_buf()

struct fragment * fragment_list_get_buf ( struct fragment_list * list,
int seq_id )
static

◆ fragment_prepend_flags()

◆ fragment_ttl_reap()

void fragment_ttl_reap ( struct fragment_master * f)
static

◆ optimal_fragment_size()

int optimal_fragment_size ( int len,
int max_frag_size )
inlinestatic

Definition at line 293 of file fragment.c.

References FRAG_SIZE_ROUND_MASK, fragment::max_frag_size, and min_int().

Referenced by fragment_outgoing().