#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"
Go to the source code of this file.
|
| #define | LONGDOMAIN "a-reaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaally-long-domain" |
| |
| #define | D50 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" |
| |
| #define | D47 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" |
| |
◆ D47
| #define D47 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" |
◆ D50
| #define D50 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" |
◆ LONGDOMAIN
| #define LONGDOMAIN "a-reaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaally-long-domain" |
◆ 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 |
| proto | next - header or IP protocol of the packet |
- Returns
- The calculated checksum in host order
Definition at line 42 of file test_dhcp.c.
◆ main()
◆ print_in_addr_t()
| const char * print_in_addr_t |
( |
in_addr_t |
addr, |
|
|
unsigned int |
flags, |
|
|
struct gc_arena * |
gc |
|
) |
| |
◆ test_write_dhcp_search_str()
| static void test_write_dhcp_search_str |
( |
void ** |
state | ) |
|
|
static |
Definition at line 54 of file test_dhcp.c.
References alloc_buf_gc(), BPTR, buf_clear(), buf_forward_capacity_total(), D47, D50, DHCP_DOMAIN_SEARCH, gc, gc_free(), gc_new(), buffer::len, LONGDOMAIN, and write_dhcp_search_str().
Referenced by main().