export-bacnet-csv.c File Reference

BACnet Monitoring Plugin - CSV output plugin. Masaryk University, Institute of Computer Science. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <arpa/inet.h>
#include <flowmonexp/plugin_export.h>

Go to the source code of this file.

Data Structures

struct  bacnet_export_csv_private_t
 Plugin's private structure with information passed from init to the calls of PLUGIN_EXPORT_* functions. More...
struct  getter_pair
 Auxiliary container connecting name string of the getter with the ID needed for processing in PLUGIN_EXPORT_EXPORT function. More...

Defines

#define VERSION   "1.0"
#define PRINT(format, args...)
#define PRINTERR(format, args...)   fprintf(stderr,format,##args)
#define PRINTWARN(format, args...)   fprintf(stderr,format,##args)
#define PRINT_SQL_INIT   char obuf[16384],dummy[1024];obuf[0]='\0'
#define PRINT_SQL(format, args...)   sprintf(dummy,format,##args);strcat(obuf, dummy)
#define PRINT_SQL_FLUSH   printf("%s", obuf);fflush(stdout)
#define ADDR_BUF_SIZE   128

Enumerations

enum  TIME_UNITS {
  TU_NO,
  TU_YEAR,
  TU_MONTH,
  TU_DAY,
  TU_HOUR,
  TU_MINUTE
}
 Time units for DB partitioning. More...
enum  GETTER_ID {
  FLOW_START_USEC,
  FLOW_END_USEC,
  L2_VLAN_0,
  L2_VLAN_1,
  L2_VLAN_2,
  L2_VLAN_3,
  L2_SRC_MAC,
  L2_DST_MAC,
  ETHERTYPE,
  L3_PROTO,
  L3_IPV4_ADDR_SRC,
  L3_IPV4_ADDR_DST,
  L3_IPV4_TOS,
  L3_IPV6_ADDR_SRC,
  L3_IPV6_ADDR_DST,
  L4_PROTO,
  L4_TCP_FLAGS,
  L4_PORT_SRC,
  L4_PORT_DST,
  L4_ICMP_TYPE_CODE,
  BACNET_CONTROL,
  BACNET_HOP_COUNT,
  BACNET_MESSAGE_TYPE,
  BACNET_VENDOR_ID,
  BACNET_SNET,
  BACNET_DNET,
  BACNET_SADR,
  BACNET_DADR,
  PACKETS,
  BYTES,
  GETTER_MAX
}
 List of possible getters that have implemented a printer in the EXPORT function. Feel free to add any new item with its printer implemented in PLUGIN_EXPORT_EXPORT, but the last item must not be changed. This list do not actually affects currently printed items - see selected_getters[].

Functions

plugin_desc_t * plugin_export_desc ()
 API for flowmonexp to get plugin description structure.
void * plugin_export_init (char *params, flow_record_getter_t *getter_list)
 Initialize all needed structures/devices/files etc. The function is called once as the first part of the plugin.
void print_headers (flow_record_getter_t *getters)
 Print titles of used columns in records.
int plugin_export_export (void *plugin_private, flow_record_t *record)
 Export (print record content as CSV) expired flow records.
int plugin_export_flush (void *plugin_private)
 Flush data.

Variables

unsigned int plugin_type = (PLUGIN_TYPE_EXPORT)
struct getter_pair selected_getters []
 The list of the printed getters. The order in this list determine the order of the information printed to the output.


Detailed Description

BACnet Monitoring Plugin - CSV output plugin. Masaryk University, Institute of Computer Science.

Date:
2011
Author:
Pavel CELEDA <celeda@ics.muni.cz>

Radek KREJCI <radek.krejci@mail.muni.cz>

Copyright (C) 2011 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.

Id
export-bacnet-csv.c 170 2012-01-02 13:36:20Z 98863

Definition in file export-bacnet-csv.c.


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