OpenVPN
Macros | Functions
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)   { errmsg = s; goto error; }
 

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 fragmentfragment_list_get_buf (struct fragment_list *list, int seq_id)
 
struct fragment_masterfragment_init (struct frame *frame)
 Allocate and initialize a fragment_master structure. More...
 
void fragment_free (struct fragment_master *f)
 Free a fragment_master structure and its internal packet buffers. More...
 
void fragment_frame_init (struct fragment_master *f, const struct frame *frame)
 Allocate internal packet buffers for a fragment_master structure. More...
 
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. More...
 
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. More...
 
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. More...
 
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)    { errmsg = s; goto error; }

Definition at line 40 of file fragment.c.

Referenced by fragment_incoming(), and fragment_outgoing().

Function Documentation

◆ fragment_list_buf_free()

static void fragment_list_buf_free ( struct fragment_list list)
static

Definition at line 53 of file fragment.c.

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

Referenced by fragment_free().

◆ fragment_list_buf_init()

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

Definition at line 43 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()

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

◆ fragment_prepend_flags()

static void fragment_prepend_flags ( struct buffer buf,
int  type,
int  seq_id,
int  frag_id,
int  frag_size 
)
static

◆ fragment_ttl_reap()

static void fragment_ttl_reap ( struct fragment_master f)
static

◆ optimal_fragment_size()

static int optimal_fragment_size ( int  len,
int  max_frag_size 
)
inlinestatic

Definition at line 307 of file fragment.c.

References FRAG_SIZE_ROUND_MASK, and min_int().

Referenced by fragment_outgoing().