OpenVAS Scanner 23.23.1
pcap_tests.c File Reference
#include "pcap.c"
#include <cgreen/cgreen.h>
#include <cgreen/mocks.h>
#include <gvm/base/hosts.h>

Functions

 Describe (pcap)
 BeforeEach (pcap)
 AfterEach (pcap)
 __attribute__ ((weak))
int __wrap_setsockopt (__attribute__((unused)) int sockfd, __attribute__((unused)) int level, __attribute__((unused)) int optname, __attribute__((unused)) const void *optval, __attribute__((unused)) socklen_t optlen)
 Ensure (pcap, routethrough_dst_is_localhost)
 Ensure (pcap, routethrough_dst_is_not_localhost)
 Ensure (pcap, routethrough_no_src_dst_given)
 Ensure (pcap, routethrough_src_globalsource_set)
 Ensure (pcap, routethrough_src_globalsource_not_set)
 Ensure (pcap, v6_islocalhost)
 Ensure (pcap, islocalhost)
static void apply_ipv6_mask (struct in6_addr *network, struct in6_addr *dest, struct in6_addr *mask)
 Apply mask to dest addr.
 Ensure (pcap, ipv6_prefix_to_mask)
static TestSuite * openvas_routethrough ()
int main (int argc, char **argv)

Variables

bool g_setsockopt_use_real = true

Function Documentation

◆ __attribute__()

__attribute__ ( (weak) )

◆ __wrap_setsockopt()

int __wrap_setsockopt ( __attribute__((unused)) int sockfd,
__attribute__((unused)) int level,
__attribute__((unused)) int optname,
__attribute__((unused)) const void * optval,
__attribute__((unused)) socklen_t optlen )

◆ AfterEach()

AfterEach ( pcap )

◆ apply_ipv6_mask()

void apply_ipv6_mask ( struct in6_addr * network,
struct in6_addr * dest,
struct in6_addr * mask )
static

Apply mask to dest addr.

Parameters
[out]networkMasked dest addr.
[in]destDestination addr.
[in]maskMask to apply.

◆ BeforeEach()

BeforeEach ( pcap )

◆ Describe()

Describe ( pcap )

◆ Ensure() [1/8]

Ensure ( pcap ,
ipv6_prefix_to_mask  )

◆ Ensure() [2/8]

Ensure ( pcap ,
islocalhost  )

◆ Ensure() [3/8]

Ensure ( pcap ,
routethrough_dst_is_localhost  )

◆ Ensure() [4/8]

Ensure ( pcap ,
routethrough_dst_is_not_localhost  )

◆ Ensure() [5/8]

Ensure ( pcap ,
routethrough_no_src_dst_given  )

◆ Ensure() [6/8]

Ensure ( pcap ,
routethrough_src_globalsource_not_set  )

◆ Ensure() [7/8]

Ensure ( pcap ,
routethrough_src_globalsource_set  )

◆ Ensure() [8/8]

Ensure ( pcap ,
v6_islocalhost  )

◆ main()

int main ( int argc,
char ** argv )

◆ openvas_routethrough()

TestSuite * openvas_routethrough ( )
static

Variable Documentation

◆ g_setsockopt_use_real

bool g_setsockopt_use_real = true