unbound 0.1
Functions
unittcpreuse.c File Reference

Tests the tcp_reuse functionality. More...

#include "config.h"
#include "testcode/unitmain.h"
#include "util/log.h"
#include "util/random.h"
#include "services/outside_network.h"

Functions

static void tcpid_addmore (struct reuse_tcp *reuse, struct outside_network *outnet, unsigned int addnum)
 add number of new IDs to the reuse tree, randomly chosen
 
static void tcpid_fillup (struct reuse_tcp *reuse, struct outside_network *outnet)
 fill up the reuse ID tree and test assertions
 
static void tcpid_test (void)
 test TCP ID selection
 
static void check_tree_and_list (struct outside_network *outnet, int present)
 check that the tree has present number of nodes and the LRU is linked properly.
 
static int create_pending_tcp (struct outside_network *outnet)
 creates pending_tcp. More...
 
static void empty_tree (struct outside_network *outnet)
 empty the tcp_reuse tree and LRU list
 
static void check_removal (struct outside_network *outnet, int position, int total)
 check removal of the LRU element on the given position of total elements
 
static void check_snip (struct outside_network *outnet, int total)
 check snipping off the last element of the LRU with total elements
 
static void tcp_reuse_tree_list_test (void)
 test tcp_reuse tree and LRU list functions
 
void tcpreuse_test (void)
 unit test for tcp_reuse functions
 

Detailed Description

Tests the tcp_reuse functionality.

Function Documentation

◆ create_pending_tcp()

static int create_pending_tcp ( struct outside_network outnet)
static