OpenVPN
Macros | Functions
test_dhcp.c File Reference
#include "syshead.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <setjmp.h>
#include <cmocka.h>
#include "test_common.h"
#include "mock_msg.h"
#include "dhcp.c"
Include dependency graph for test_dhcp.c:

Go to the source code of this file.

Macros

#define LONGDOMAIN   "a-reaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaally-long-domain"
 

Functions

uint16_t ip_checksum (const sa_family_t af, const uint8_t *payload, const int len_payload, const uint8_t *src_addr, const uint8_t *dest_addr, const int proto)
 Calculates an IP or IPv6 checksum with a pseudo header as required by TCP, UDP and ICMPv6.
 
const char * print_in_addr_t (in_addr_t addr, unsigned int flags, struct gc_arena *gc)
 
static void test_write_dhcp_search_str (void **state)
 
int main (void)
 

Macro Definition Documentation

◆ LONGDOMAIN

#define LONGDOMAIN   "a-reaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaally-long-domain"

Function Documentation

◆ ip_checksum()

uint16_t ip_checksum ( const sa_family_t  af,
const uint8_t *  payload,
const int  len_payload,
const uint8_t *  src_addr,
const uint8_t *  dest_addr,
const int  proto 
)

Calculates an IP or IPv6 checksum with a pseudo header as required by TCP, UDP and ICMPv6.

Parameters
af- Address family for which the checksum is calculated AF_INET or AF_INET6
payload- the TCP, ICMPv6 or UDP packet
len_payload- length of payload
src_addr- Source address of the packet
dest_addr- Destination address of the packet
protonext - header or IP protocol of the packet
Returns
The calculated checksum in host order

Definition at line 42 of file test_dhcp.c.

◆ main()

int main ( void  )

Definition at line 127 of file test_dhcp.c.

References test_write_dhcp_search_str().

◆ print_in_addr_t()

const char * print_in_addr_t ( in_addr_t  addr,
unsigned int  flags,
struct gc_arena gc 
)

Definition at line 48 of file test_dhcp.c.

◆ test_write_dhcp_search_str()

static void test_write_dhcp_search_str ( void **  state)
static