|
OpenVPN
|
#include "syshead.h"#include "test_common.h"#include "route.h"#include "networking.h"#include "test_route.h"
Go to the source code of this file.
Functions | |
| struct argv | argv_new (void) |
| Allocates a new struct argv and ensures it is initialised. | |
| void | argv_free (struct argv *a) |
| Frees all memory allocations allocated by the struct argv related functions. | |
| bool | get_ipv6_addr (const char *prefix_str, struct in6_addr *network, unsigned int *netbits, msglvl_t msglevel) |
| Translate an IPv6 addr or hostname from string form to in6_addr. | |
| in_addr_t | getaddr (unsigned int flags, const char *hostname, int resolve_retry, bool *succeeded, struct signal_info *sig_info) |
| Translate an IPv4 addr or hostname from string form to in_addr_t. | |
| int | openvpn_getaddrinfo (unsigned int flags, const char *hostname, const char *servname, int resolve_retry_seconds, struct signal_info *sig_info, int ai_family, struct addrinfo **res) |
| int | signal_reset (struct signal_info *si, int signum) |
| Clear the signal if its current value equals signum. | |
| static void | test_is_special_addr (void **state) |
| static void | test_netmask_to_netbits (void **state) |
| static void | test_netmask_to_netbits2 (void **state) |
| static void | assert_clear_host_bits (const char *addr, unsigned int netbits, const char *expected) |
| static void | test_route_ipv6_clear_host_bits (void **state) |
| int | route_tests (void) |
| Runs the route.c unit tests, returns the number of failures. | |
Variables | |
| struct signal_info | siginfo_static |
| static const struct CMUnitTest | route_test_list [] |
| void argv_free | ( | struct argv * | a | ) |
Frees all memory allocations allocated by the struct argv related functions.
| a | Valid pointer to a struct argv to release memory from |
Definition at line 49 of file test_route.c.
| struct argv argv_new | ( | void | ) |
Allocates a new struct argv and ensures it is initialised.
Note that it does not return a pointer, but a struct argv directly.
Definition at line 41 of file test_route.c.
References argv_new().
|
static |
Definition at line 139 of file test_route.c.
References CLEAR, r6, and route_ipv6_clear_host_bits().
Referenced by test_route_ipv6_clear_host_bits().
| bool get_ipv6_addr | ( | const char * | prefix_str, |
| struct in6_addr * | network, | ||
| unsigned int * | netbits, | ||
| msglvl_t | msglevel ) |
Translate an IPv6 addr or hostname from string form to in6_addr.
Definition at line 55 of file test_route.c.
Referenced by ipv6_addr_safe_hexplusbits().
| in_addr_t getaddr | ( | unsigned int | flags, |
| const char * | hostname, | ||
| int | resolve_retry_seconds, | ||
| bool * | succeeded, | ||
| struct signal_info * | sig_info ) |
Translate an IPv4 addr or hostname from string form to in_addr_t.
In case of resolve error, it will try again for resolve_retry_seconds seconds.
Definition at line 63 of file test_route.c.
| int openvpn_getaddrinfo | ( | unsigned int | flags, |
| const char * | hostname, | ||
| const char * | servname, | ||
| int | resolve_retry_seconds, | ||
| struct signal_info * | sig_info, | ||
| int | ai_family, | ||
| struct addrinfo ** | res ) |
Definition at line 71 of file test_route.c.
| int route_tests | ( | void | ) |
Runs the route.c unit tests, returns the number of failures.
Definition at line 177 of file test_route.c.
References openvpn_unit_test_setup(), and route_test_list.
Referenced by main().
| int signal_reset | ( | struct signal_info * | si, |
| int | signum ) |
Clear the signal if its current value equals signum.
If signum is zero the signal is cleared independent of its current value.
If signum is zero the signal is cleared independent of its current value. Returns the current value of the signal.
Definition at line 82 of file test_route.c.
|
static |
Definition at line 89 of file test_route.c.
References is_special_addr().
|
static |
Definition at line 101 of file test_route.c.
References netmask_to_netbits().
|
static |
Definition at line 126 of file test_route.c.
References netmask_to_netbits2().
|
static |
Definition at line 154 of file test_route.c.
References assert_clear_host_bits().
|
static |
Definition at line 169 of file test_route.c.
Referenced by route_tests().
| struct signal_info siginfo_static |
Definition at line 79 of file test_route.c.