FlowMon IPv6 Tunnel Monitoring Plugin
FlowMon IPv6 Tunnel Monitoring Plugin
 All Data Structures Files Functions Variables Macros Pages
input-ip6tun.c File Reference

IPv6 Tunnels Monitoring Plugin - input plugin. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pcap.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/ether.h>
#include <poll.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <sys/types.h>
#include <endian.h>
#include <openssl/md5.h>
#include <flowmonexp/plugin_input.h>
#include "input-ip6tun.h"
#include <byteswap.h>

Go to the source code of this file.

Data Structures

struct  ip6tun_record_t
 Structure to hold ip6tun specific record. More...

Macros

#define VERSION   "0.1"
#define le32toh(x)   (x)

Functions

unsigned int __attribute__ ((used))
 Structure to hold ip6tun internal data.
plugin_desc_t * plugin_input_desc ()
 API for flowmonexp to get plugin description structure.
int parse_ipv6 (unsigned char *buf, uint32_t caplen, flow_record_t *record, ip6tun_record_t *ip6tun_record, int teredo)
 Parse IPv6 header and fill required information into the flow record.
int parse_proto41 (unsigned char *buf, uint32_t caplen, flow_record_t *record, ip6tun_record_t *ip6tun_record)
 Parse possible proto 41 headers and fill required information into the flow record.
int parse_teredo (unsigned char *buf, uint32_t caplen, flow_record_t *record, ip6tun_record_t *ip6tun_record)
 Parse possible teredo header and fill required information into the flow record.
int parse_ayiya (unsigned char *buf, uint32_t caplen, flow_record_t *record, ip6tun_record_t *ip6tun_record)
 Parse possible ayiya header and fill required information into the flow record.
int parse_eth (unsigned char *buf, uint32_t caplen, flow_record_t *record, ip6tun_record_t *ip6tun_record)
 Parse ethernet header and fill required information into the flow record.
void value_fill_srcaddr6 (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ip6tun source address.
void value_fill_dstaddr6 (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ip6tun destination address.
void value_fill_srcport (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ip6tun source port.
void value_fill_icmp_type_code (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ip6tun icmp type and code.
void value_fill_dstport (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ip6tun destination port.
void value_fill_tcp_flags (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ip6tun tcp flags.
void value_fill_teredo_headers (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ip6tun teredo headers.
void value_fill_teredo_trailers (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ip6tun teredo trailers.
void value_fill_ttl_hop (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ttl.
void value_fill_hop (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ttl.
void value_fill_l4protocol (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ip6tun L4 protocol number.
void value_fill_mechnism (void *self, flow_record_t *record, void *dst, int len, int to_network_byte_order)
 Get/Fill value of the ip6tun mechanism mask.
int validity_addr6 (void *self, flow_record_t *record)
 Validity checker for ip6tun record's address fields.
int validity_port (void *self, flow_record_t *record)
 Validity checker for ip6tun record's port fields.
int validity_tcp_flags (void *self, flow_record_t *record)
 Validity checker for ip6tun record's tcp flags field.
int validity_teredo_headers (void *self, flow_record_t *record)
 Validity checker for ip6tun record's teredo headers field.
int validity_teredo_trailers (void *self, flow_record_t *record)
 Validity checker for ip6tun record's tteredo trailers field.
int validity_ttl_hop (void *self, flow_record_t *record)
 Validity checker for ip6tun record's tteredo trailers field.
int validity_hop (void *self, flow_record_t *record)
 Validity checker for ip6tun record's tteredo trailers field.
int validity_l4protocol (void *self, flow_record_t *record)
 Validity checker for ip6tun record's L4 protocol field.
int validity_icmp_type_code (void *self, flow_record_t *record)
 Validity checker for ip6tun record's L4 protocol field.
int validity_mechanism (void *self, flow_record_t *record)
 Validity checker for ip6tun record's mechanism fields.
int value_length_mechanism (void *self, flow_record_t *record)
 Get actual length for ip6tun record's mechanism field.
int value_length_ttl_hop (void *self, flow_record_t *record)
 Get actual length for ip6tun record's tcp flags fields.
int value_length_tcp_flags (void *self, flow_record_t *record)
 Get actual length for ip6tun record's tcp flags fields.
int value_length_protocol (void *self, flow_record_t *record)
 Get actual length for ip6tun record's protocol fields.
int value_length_port (void *self, flow_record_t *record)
 Get actual length for ip6tun record's port fields.
int value_length_teredo_headers_trailers (void *self, flow_record_t *record)
 Get actual length for ip6tun record's teredo trailers and headers fields.
int value_length_icmp_type_code (void *self, flow_record_t *record)
 Get actual length for icmp type and code fields.
int value_length_addr6 (void *self, flow_record_t *record)
 Get actual length for ip6tun record's IPv6 address fields.
void plugin_input_getter_init (void *plugin_private, flow_record_getter_t **getter_list)
 Init flowmonexp's getters for ip6tun record's fields.
int ip6tun_init_pcap_file (ip6tun_input_private_t *plugin_private, char *source)
 Initialize PCAP file as a source of packets.
int ip6tun_init_pcap_if (ip6tun_input_private_t *plugin_private, char *source)
 Initialize PCAP interface as a source of packets.
int ip6tun_shutdown_uni (ip6tun_input_private_t *plugin_private)
int ip6tun_get_packet_pcap_file (unsigned char **buf, packet_info_t *packet_info, ip6tun_input_private_t *plugin_private)
 Get packet from initialized PCAP file source.
int ip6tun_get_packet_pcap_if (unsigned char **buf, packet_info_t *packet_info, ip6tun_input_private_t *plugin_private)
 Get packet from initialized PCAP interface source.
void * plugin_input_init (char *params, flow_record_getter_t **getter_list, int full_packet, int data_offset)
 Initialize all needed structures/devices/files etc. The function is called once as the first part of the plugin.
uint64_t plugin_input_get_flow (void *plugin_private, flow_record_t *record)
 Get flow record implementation - add flow record into the flowmonexp's flow cache.
unsigned char * plugin_input_get_flow_packet (void *plugin_private, unsigned int *length, unsigned int *data_offset)
 Get flow packet implementation.
int plugin_input_shutdown (void *plugin_private)
 Shutdown function.

Variables

 ip6tun_input_private_t
int ip6tun_input_record_offset
 ip6tun record offset

Detailed Description

IPv6 Tunnels Monitoring Plugin - input plugin.

IPv6 Tunnels Monitoring Plugin - input plugin.

Date
2012
Author
Martin ELICH elich.nosp@m.@mai.nosp@m.l.mun.nosp@m.i.cz

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the Masaryk University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

This software is provided ``as is'', and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Date
2012
Author
Martin ELICH elich.nosp@m.@mai.nosp@m.l.mun.nosp@m.i.cz

Copyright (C) 2012 Masaryk University, Institute of Computer Science

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the Masaryk University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

This software is provided ``as is'', and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Definition in file input-ip6tun.c.

Macro Definition Documentation

#define VERSION   "0.1"

Plugin version

Definition at line 39 of file input-ip6tun.c.

#define le32toh (   x)    (x)

include for le32toh macro to convert little endian (read from COMBO) to host endianity

Definition at line 86 of file input-ip6tun.c.

Function Documentation

unsigned int __attribute__ ( (used)  )

Structure to hold ip6tun internal data.

< PCAP handler for interface

< PCAP handler for file

< interface id

< packet getter

< shutdown function pointer

< ip6tun record offset

< packet pointer for get_flow_packet function

< packet data offset

< 'brief packet length

Definition at line 93 of file input-ip6tun.c.

plugin_desc_t* plugin_input_desc ( )

API for flowmonexp to get plugin description structure.

Returns
Plugin description structure

Definition at line 177 of file input-ip6tun.c.

int parse_ipv6 ( unsigned char *  buf,
uint32_t  caplen,
flow_record_t *  record,
ip6tun_record_t ip6tun_record,
int  teredo 
)

Parse IPv6 header and fill required information into the flow record.

Parameters
[in]bufData buffer.
[in]caplenLength of portion present.
[in,out]recordFlow record structure.
[in]ip6tun_recordPlugin's private structure with ip6tun specific record offset
[in]teredoset to 1 if this called from parse_teredo
Return values
0on success, nonzero otherwise.

Definition at line 1556 of file input-ip6tun.c.

int parse_proto41 ( unsigned char *  buf,
uint32_t  caplen,
flow_record_t *  record,
ip6tun_record_t ip6tun_record 
)

Parse possible proto 41 headers and fill required information into the flow record.

Parameters
[in]bufData buffer.
[in]caplenLength of portion present.
[in,out]recordFlow record structure.
[in]ip6tun_recordPlugin's private structure with ip6tun specific record offset
Return values
0on success, nonzero otherwise.

Definition at line 1724 of file input-ip6tun.c.

int parse_teredo ( unsigned char *  buf,
uint32_t  caplen,
flow_record_t *  record,
ip6tun_record_t ip6tun_record 
)

Parse possible teredo header and fill required information into the flow record.

Parameters
[in]bufData buffer.
[in]caplenLength of portion present.
[in,out]recordFlow record structure.
[in]ip6tun_recordPlugin's private structure with ip6tun specific record offset
Return values
0on success, nonzero otherwise.

Definition at line 1799 of file input-ip6tun.c.

int parse_ayiya ( unsigned char *  buf,
uint32_t  caplen,
flow_record_t *  record,
ip6tun_record_t ip6tun_record 
)

Parse possible ayiya header and fill required information into the flow record.

Parameters
[in]bufData buffer.
[in]caplenLength of portion present.
[in,out]recordFlow record structure.
[in]ip6tun_recordPlugin's private structure with ip6tun specific record offset
Return values
0on success, nonzero otherwise.

Definition at line 1885 of file input-ip6tun.c.

int parse_eth ( unsigned char *  buf,
uint32_t  caplen,
flow_record_t *  record,
ip6tun_record_t ip6tun_record 
)

Parse ethernet header and fill required information into the flow record.

Parameters
[in]bufData buffer.
[in]caplenLength of portion present.
[in,out]recordFlow record structure.
[in]ip6tun_recordPlugin's private structure with ip6tun specific record offset
Return values
0on success, nonzero otherwise.

Definition at line 1369 of file input-ip6tun.c.

void value_fill_srcaddr6 ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ip6tun source address.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 251 of file input-ip6tun.c.

void value_fill_dstaddr6 ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ip6tun destination address.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 267 of file input-ip6tun.c.

void value_fill_srcport ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ip6tun source port.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 283 of file input-ip6tun.c.

void value_fill_icmp_type_code ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ip6tun icmp type and code.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 299 of file input-ip6tun.c.

void value_fill_dstport ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ip6tun destination port.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 315 of file input-ip6tun.c.

void value_fill_tcp_flags ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ip6tun tcp flags.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 331 of file input-ip6tun.c.

void value_fill_teredo_headers ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ip6tun teredo headers.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 347 of file input-ip6tun.c.

void value_fill_teredo_trailers ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ip6tun teredo trailers.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 363 of file input-ip6tun.c.

void value_fill_ttl_hop ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ttl.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 379 of file input-ip6tun.c.

void value_fill_hop ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ttl.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 395 of file input-ip6tun.c.

void value_fill_l4protocol ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ip6tun L4 protocol number.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 411 of file input-ip6tun.c.

void value_fill_mechnism ( void *  self,
flow_record_t *  record,
void *  dst,
int  len,
int  to_network_byte_order 
)

Get/Fill value of the ip6tun mechanism mask.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
[in]dstWhere to copy resulted data
[in]lenData length
[in]to_network_byte_orderif other than zero, convert value to network byte order (work only for lengths: 1,2,4,8)

Definition at line 427 of file input-ip6tun.c.

int validity_addr6 ( void *  self,
flow_record_t *  record 
)

Validity checker for ip6tun record's address fields.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 550 of file input-ip6tun.c.

int validity_port ( void *  self,
flow_record_t *  record 
)

Validity checker for ip6tun record's port fields.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 570 of file input-ip6tun.c.

int validity_tcp_flags ( void *  self,
flow_record_t *  record 
)

Validity checker for ip6tun record's tcp flags field.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 590 of file input-ip6tun.c.

int validity_teredo_headers ( void *  self,
flow_record_t *  record 
)

Validity checker for ip6tun record's teredo headers field.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 609 of file input-ip6tun.c.

int validity_teredo_trailers ( void *  self,
flow_record_t *  record 
)

Validity checker for ip6tun record's tteredo trailers field.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 629 of file input-ip6tun.c.

int validity_ttl_hop ( void *  self,
flow_record_t *  record 
)

Validity checker for ip6tun record's tteredo trailers field.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 649 of file input-ip6tun.c.

int validity_hop ( void *  self,
flow_record_t *  record 
)

Validity checker for ip6tun record's tteredo trailers field.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 669 of file input-ip6tun.c.

int validity_l4protocol ( void *  self,
flow_record_t *  record 
)

Validity checker for ip6tun record's L4 protocol field.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 689 of file input-ip6tun.c.

int validity_icmp_type_code ( void *  self,
flow_record_t *  record 
)

Validity checker for ip6tun record's L4 protocol field.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 709 of file input-ip6tun.c.

int validity_mechanism ( void *  self,
flow_record_t *  record 
)

Validity checker for ip6tun record's mechanism fields.

Parameters
[in]selfPlugin's specific record part (ip6tun_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 729 of file input-ip6tun.c.

int value_length_mechanism ( void *  self,
flow_record_t *  record 
)

Get actual length for ip6tun record's mechanism field.

Parameters
[in]selfPlugin's specific record part (bacnet_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 764 of file input-ip6tun.c.

int value_length_ttl_hop ( void *  self,
flow_record_t *  record 
)

Get actual length for ip6tun record's tcp flags fields.

Parameters
[in]selfPlugin's specific record part (bacnet_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 777 of file input-ip6tun.c.

int value_length_tcp_flags ( void *  self,
flow_record_t *  record 
)

Get actual length for ip6tun record's tcp flags fields.

Parameters
[in]selfPlugin's specific record part (bacnet_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 790 of file input-ip6tun.c.

int value_length_protocol ( void *  self,
flow_record_t *  record 
)

Get actual length for ip6tun record's protocol fields.

Parameters
[in]selfPlugin's specific record part (bacnet_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 803 of file input-ip6tun.c.

int value_length_port ( void *  self,
flow_record_t *  record 
)

Get actual length for ip6tun record's port fields.

Parameters
[in]selfPlugin's specific record part (bacnet_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 816 of file input-ip6tun.c.

int value_length_teredo_headers_trailers ( void *  self,
flow_record_t *  record 
)

Get actual length for ip6tun record's teredo trailers and headers fields.

Parameters
[in]selfPlugin's specific record part (bacnet_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 829 of file input-ip6tun.c.

int value_length_icmp_type_code ( void *  self,
flow_record_t *  record 
)

Get actual length for icmp type and code fields.

Parameters
[in]selfPlugin's specific record part (bacnet_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 842 of file input-ip6tun.c.

int value_length_addr6 ( void *  self,
flow_record_t *  record 
)

Get actual length for ip6tun record's IPv6 address fields.

Parameters
[in]selfPlugin's specific record part (bacnet_record_t) allocated after standard flow record
[in]recordStandard flowmonexp's flow record
Returns
  • zero as invalid
  • nonzero as valid

Definition at line 855 of file input-ip6tun.c.

void plugin_input_getter_init ( void *  plugin_private,
flow_record_getter_t **  getter_list 
)

Init flowmonexp's getters for ip6tun record's fields.

Parameters
[in]plugin_privatePlugin's private structure from init with all necessary information
[in,out]getter_listList of available getters for a complete flow record

Definition at line 866 of file input-ip6tun.c.

int ip6tun_init_pcap_file ( ip6tun_input_private_t plugin_private,
char *  source 
)

Initialize PCAP file as a source of packets.

Parameters
[in,out]plugin_privatePlugin's private structure with ip6tun specific record offset
[in]sourceData buffer.
Return values
EXIT_SUCCESSon success, EXIT_FAILURE otherwise.

Definition at line 905 of file input-ip6tun.c.

int ip6tun_init_pcap_if ( ip6tun_input_private_t plugin_private,
char *  source 
)

Initialize PCAP interface as a source of packets.

Parameters
[in,out]plugin_privatePlugin's private structure with ip6tun specific record offset
[in]sourceData buffer.
Return values
EXIT_SUCCESSon success, EXIT_FAILURE otherwise.

Definition at line 925 of file input-ip6tun.c.

int ip6tun_shutdown_uni ( ip6tun_input_private_t plugin_private)

Definition at line 1011 of file input-ip6tun.c.

int ip6tun_get_packet_pcap_file ( unsigned char **  buf,
packet_info_t *  packet_info,
ip6tun_input_private_t plugin_private 
)

Get packet from initialized PCAP file source.

Parameters
[in,out]bufData buffer.
[in,out]packet_infoPacket info structure.
[in]plugin_privatePlugin's private structure with ip6tun specific record offset
Return values
EXIT_SUCCESSon success, EXIT_FAILURE otherwise.

Definition at line 1024 of file input-ip6tun.c.

int ip6tun_get_packet_pcap_if ( unsigned char **  buf,
packet_info_t *  packet_info,
ip6tun_input_private_t plugin_private 
)

Get packet from initialized PCAP interface source.

Parameters
[in,out]bufData buffer.
[in,out]packet_infoPacket info structure.
[in]plugin_privatePlugin's private structure with ip6tun specific record offset
Return values
EXIT_SUCCESSon success, EXIT_FAILURE otherwise.

Definition at line 1054 of file input-ip6tun.c.

void* plugin_input_init ( char *  params,
flow_record_getter_t **  getter_list,
int  full_packet,
int  data_offset 
)

Initialize all needed structures/devices/files etc. The function is called once as the first part of the plugin.

Parameters
[in]paramsPlugin parameters as string from command line
[in]full_packetSpecify if plugin_input_get_packet() function (if implemented) is forced to return full packet or some cropping can be done
[in]getter_listGlobal list of getters, used for getter registration
[in]data_offsetOffset of the plugin specific data (bacnet_record_t) in flowmonexp's standard flow record
Returns
Created and initialized plugin internal structure (ip6tun_private_t)

Definition at line 1154 of file input-ip6tun.c.

uint64_t plugin_input_get_flow ( void *  plugin_private,
flow_record_t *  record 
)

Get flow record implementation - add flow record into the flowmonexp's flow cache.

Parameters
[in]plugin_privatePlugin's private structure from init with all necessary information
[in,out]recordFlow record from input plugin(s)
Returns
  • zero on error,
  • hash of the flow record (actually of the flow key items)

Definition at line 1286 of file input-ip6tun.c.

unsigned char* plugin_input_get_flow_packet ( void *  plugin_private,
unsigned int *  length,
unsigned int *  data_offset 
)

Get flow packet implementation.

Returns full packet for further processing if necessary

Definition at line 1339 of file input-ip6tun.c.

int plugin_input_shutdown ( void *  plugin_private)

Shutdown function.

Definition at line 1352 of file input-ip6tun.c.

Variable Documentation

ip6tun_input_private_t

Definition at line 113 of file input-ip6tun.c.

int ip6tun_input_record_offset

ip6tun record offset

Definition at line 140 of file input-ip6tun.c.


© 2012 Masaryk University - Institute of Computer Science - visit http://www.muni.cz/ics/