OpenVAS Libraries
9.0.3
|
#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 *) |
int get_datalink_size | ( | int | ) |
Definition at line 442 of file pcap.c.
Referenced by capture_next_packet(), capture_next_v6_packet(), ids_open_sock_tcp(), ids_send(), nasl_pcap_next(), nasl_send_capture(), scan(), and v6_get_mac_addr().
int islocalhost | ( | struct in_addr * | ) |
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 :(
Definition at line 1244 of file pcap.c.
Referenced by ids_open_sock_tcp(), ids_send(), init_capture_device(), nasl_pcap_next(), nasl_send_capture(), nasl_tcp_ping(), and openbpf().
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.
Definition at line 171 of file pcap.c.
References bpf_close(), bpf_datalink(), bpf_next(), bpf_open_live(), get_datalink_size(), and v6_routethrough().
int v6_getsourceip | ( | struct in6_addr * | , |
struct in6_addr * | |||
) |
Definition at line 692 of file pcap.c.
References get_random_bytes(), and name.
Referenced by nasl_this_host().
int v6_is_local_ip | ( | struct in6_addr * | ) |
Definition at line 106 of file pcap.c.
References getipv6routes(), MAXROUTES, name, and v6_getinterfaces().
Referenced by nasl_islocalnet().
int v6_islocalhost | ( | struct in6_addr * | ) |
Tests whether a packet sent to IP is LIKELY to route through the kernel localhost interface.
Definition at line 378 of file pcap.c.
References interface_info::addr, and v6_ipaddr2devname().
Referenced by init_v6_capture_device(), nasl_islocalhost(), nasl_send_v6packet(), nasl_tcp_v6_ping(), and nasl_this_host().
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 :(
Definition at line 1061 of file pcap.c.
Referenced by ids_open_sock_tcp(), ids_send(), init_v6_capture_device(), nasl_pcap_next(), nasl_send_capture(), nasl_tcp_v6_ping(), v6_get_mac_addr(), and v6_openbpf().