OpenVAS Scanner 23.23.1
pcap_openvas.h File Reference

Header file for module pcap. More...

#include <arpa/inet.h>
#include <pcap.h>
#include <sys/param.h>

Go to the source code of this file.

Functions

int v6_is_local_ip (struct in6_addr *)
int islocalhost (struct in_addr *)
 Tests whether a packet sent to IP is LIKELY to route through the kernel localhost interface.
int v6_islocalhost (struct in6_addr *)
 Tests whether a packet sent to IP is LIKELY to route through the kernel localhost interface.
int get_datalink_size (int)
char * routethrough (struct in_addr *, struct in_addr *)
 An awesome function to determine what interface a packet to a given destination should be routed through.
char * v6_routethrough (struct in6_addr *, struct in6_addr *)
 An awesome function to determine what interface a packet to a given destination should be routed through.
int v6_getsourceip (struct in6_addr *, struct in6_addr *)
char * get_iface_from_ip (const char *)
 Given an IP address, determines which interface belongs to.
int get_iface_index (struct in6_addr *, int *)
 Get the interface index depending on the target's IP.

Detailed Description

Header file for module pcap.

Function Documentation

◆ get_datalink_size()

int get_datalink_size ( int datalink)

◆ get_iface_from_ip()

char * get_iface_from_ip ( const char * local_ip)

Given an IP address, determines which interface belongs to.

Parameters
local_ipIP address.
Returns
Iface name if found, Null otherwise.

◆ get_iface_index()

int get_iface_index ( struct in6_addr * ipaddr,
int * ifindex )

Get the interface index depending on the target's IP.

Parameters
[in]ipaddrThe ip address of the target.
[out]ifindexthe index of the selected iface
Returns
0 on success, otherwise -1.

◆ islocalhost()

int islocalhost ( struct in_addr * addr)

Tests whether a packet sent to IP is LIKELY to route through the kernel localhost interface.

◆ routethrough()

char * routethrough ( struct in_addr * dest,
struct in_addr * source )

An awesome function to determine what interface a packet to a given destination should be routed through.

It returns NULL if no appropriate interface is found, otherwise it returns the device name and fills in the source parameter. Some of the stuff is from Stevens' Unix Network Programming V2. He had an easier suggestion for doing this (in the book), but it isn't portable :(

◆ v6_getsourceip()

int v6_getsourceip ( struct in6_addr * src,
struct in6_addr * dst )

◆ v6_is_local_ip()

int v6_is_local_ip ( struct in6_addr * addr)

◆ v6_islocalhost()

int v6_islocalhost ( struct in6_addr * addr)

Tests whether a packet sent to IP is LIKELY to route through the kernel localhost interface.

◆ v6_routethrough()

char * v6_routethrough ( struct in6_addr * dest,
struct in6_addr * source )

An awesome function to determine what interface a packet to a given destination should be routed through.

It returns NULL if no appropriate interface is found, otherwise it returns the device name and fills in the source parameter. Some of the stuff is from Stevens' Unix Network Programming V2. He had an easier suggestion for doing this (in the book), but it isn't portable :(