OpenVAS Libraries  4.0+rc3.SVN
Data Structures | Defines | Functions
nasl/nasl_packet_forgery_v6.c File Reference

NASL IPv6 Packet Forgery functions. More...

#include <arpa/inet.h>
#include <ctype.h>
#include <pcap.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <netinet/icmp6.h>
#include "bpf_share.h"
#include "pcap_openvas.h"
#include "plugutils.h"
#include "system.h"
#include "nasl_raw.h"
#include "nasl_tree.h"
#include "nasl_global_ctxt.h"
#include "nasl_func.h"
#include "nasl_var.h"
#include "nasl_lex_ctxt.h"
#include "exec.h"
#include "nasl_socket.h"
#include "nasl_debug.h"
#include "capture_packet.h"
#include "strutils.h"
#include "nasl_packet_forgery_v6.h"

Data Structures

struct  v6pseudohdr
struct  v6pseudo_udp_hdr
struct  v6pseudo_icmp_hdr
struct  igmp6_hdr

Defines

#define FIX(n)   htons(n)
#define UNFIX(n)   ntohs(n)
#define rnd_tcp_port()   (rand() % 65535 + 1024)

Functions

tree_cellforge_ipv6_packet (lex_ctxt *lexic)
 Forge IPv6 packet.
tree_cellget_ipv6_element (lex_ctxt *lexic)
 Obtain IPv6 header element.
tree_cellset_ipv6_elements (lex_ctxt *lexic)
 Set IPv6 header element.
tree_celldump_ipv6_packet (lex_ctxt *lexic)
 Print IPv6 Header.
tree_cellinsert_ipv6_options (lex_ctxt *lexic)
tree_cellforge_tcp_v6_packet (lex_ctxt *lexic)
 Forge TCP packet.
tree_cellget_tcp_v6_element (lex_ctxt *lexic)
 Get TCP Header element.
tree_cellset_tcp_v6_elements (lex_ctxt *lexic)
 Set TCP Header element.
tree_celldump_tcp_v6_packet (lex_ctxt *lexic)
 Print TCP/IPv6 packet.
tree_cellforge_udp_v6_packet (lex_ctxt *lexic)
tree_cellget_udp_v6_element (lex_ctxt *lexic)
tree_cellset_udp_v6_elements (lex_ctxt *lexic)
tree_celldump_udp_v6_packet (lex_ctxt *lexic)
tree_cellforge_icmp_v6_packet (lex_ctxt *lexic)
tree_cellget_icmp_v6_element (lex_ctxt *lexic)
tree_cellforge_igmp_v6_packet (lex_ctxt *lexic)
tree_cellnasl_tcp_v6_ping (lex_ctxt *lexic)
 Performs TCP Connect to test if host is alive.
tree_cellnasl_send_v6packet (lex_ctxt *lexic)
 Send forged IPv6 Packet.

Detailed Description

NASL IPv6 Packet Forgery functions.

Provides IPv6 Packet Forgery functionalities The API set offers forgery for, 1. TCP 2. IPv6


Define Documentation

#define FIX (   n)    htons(n)
Todo:
: It still needs to be taken care BSD_BYTE_ORDERING gets here if defined (e.g. by config.h)

Function Documentation

tree_cell* dump_ipv6_packet ( lex_ctxt lexic)

Print IPv6 Header.

Parameters:
[in]lexicLexical context of NASL interpreter.
Returns:
Print and returns FAKE_CELL.
tree_cell* dump_tcp_v6_packet ( lex_ctxt lexic)

Print TCP/IPv6 packet.

Parameters:
[in]lexicLexical context of NASL interpreter.
Returns:
Print and return FAKE_CELL.
tree_cell* forge_ipv6_packet ( lex_ctxt lexic)

Forge IPv6 packet.

Parameters:
[in]lexicLexical context of NASL interpreter.
Returns:
tree_cell with the forged IP packet.
tree_cell* forge_tcp_v6_packet ( lex_ctxt lexic)

Forge TCP packet.

Parameters:
[in]lexicLexical context of NASL interpreter.
Returns:
tree_cell with the forged TCP packet containing IPv6 header.
tree_cell* get_ipv6_element ( lex_ctxt lexic)

Obtain IPv6 header element.

Parameters:
[in]lexicLexical context of NASL interpreter.
Returns:
tree_cell with the IP header element.
tree_cell* get_tcp_v6_element ( lex_ctxt lexic)

Get TCP Header element.

Parameters:
[in]lexicLexical context of NASL interpreter.
Returns:
tree_cell with the forged IP packet.
tree_cell* nasl_send_v6packet ( lex_ctxt lexic)

Send forged IPv6 Packet.

Parameters:
[in]lexicLexical context of NASL interpreter.
Returns:
tree_cell with the response to the sent packet.
tree_cell* nasl_tcp_v6_ping ( lex_ctxt lexic)

Performs TCP Connect to test if host is alive.

Parameters:
[in]lexicLexical context of NASL interpreter.
Returns:
tree_cell > 0 if host is alive, 0 otherwise.
tree_cell* set_ipv6_elements ( lex_ctxt lexic)

Set IPv6 header element.

Parameters:
[in]lexicLexical context of NASL interpreter.
Returns:
tree_cell with the forged IP packet.
tree_cell* set_tcp_v6_elements ( lex_ctxt lexic)

Set TCP Header element.

Parameters:
[in]lexicLexical context of NASL interpreter.
Returns:
tree_cell with the forged TCP packet and IPv6.