OpenVAS Libraries  8.0.3
Functions
pcap_openvas.h File Reference
#include <pcap.h>

Go to the source code of this file.

Functions

int v6_is_local_ip (struct in6_addr *)
 
int v6_get_mac_addr (struct in6_addr *, char **)
 We send an empty UDP packet to the remote host, and read back its mac. More...
 
int islocalhost (struct in_addr *)
 Tests whether a packet sent to IP is LIKELY to route through the kernel localhost interface. More...
 
int v6_islocalhost (struct in6_addr *)
 Tests whether a packet sent to IP is LIKELY to route through the kernel localhost interface. More...
 
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. More...
 
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. More...
 
int v6_getsourceip (struct in6_addr *, struct in6_addr *)
 

Function Documentation

int get_datalink_size ( int  )
int islocalhost ( struct in_addr *  )

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

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, oterwise 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 :(

int v6_get_mac_addr ( struct in6_addr *  addr,
char **  mac 
)

We send an empty UDP packet to the remote host, and read back its mac.

address.

(we should first interrogate the kernel's arp cache - we may rely on libdnet in the future to do that)

As a bonus, this function works well as a local ping.

int v6_getsourceip ( struct in6_addr *  ,
struct in6_addr *   
)
int v6_is_local_ip ( struct in6_addr *  )
int v6_islocalhost ( struct in6_addr *  )

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

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, oterwise 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 :(