flowmon-http-plugins  1.0
FlowMon HTTP Input/Process/export plugins
 All Data Structures Files Functions Variables Typedefs Macros
flowmon-export-http_postgres.c File Reference

Export plugin for flowmon, export HTTP data to postgres. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <flowmonexp/plugin_export.h>
#include <libpq-fe.h>
#include <inttypes.h>
#include <time.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  plugin_private_export
 Plugin private structure. More...

Macros

#define PRINTV(format, args...)   do {if (VERBOSE) { fprintf(stdout, format, ##args); fflush(stdout); } } while (0)
#define PRINTD(format, args...)   do {if (DEBUG) { fprintf(stdout, format, ##args); fflush(stdout); } } while (0)
#define PRINTA(format, args...)   do {if (VERBOSE || DEBUG) { fprintf(stdout, format, ##args); fflush(stdout); } } while (0)
#define MAX_CONNINFO_LENGTH   2000
#define VALUES_SIZE   600

Functions

 SET_PLUGIN_TYPE (PLUGIN_TYPE_EXPORT)
 Set plugin type for flowmon.
int parse_conninfo (char *params, plugin_private_export *conf)
 function parse parameters for remote connection
int SQLconnection (plugin_private_export *p)
 Function connect to database specified in plugin private structure.

Variables

int verbose_level
int debug_level
bool VERBOSE
bool DEBUG

Detailed Description

Export plugin for flowmon, export HTTP data to postgres.

Author:
Tomas Sima simat.nosp@m.omas.nosp@m.@mail.nosp@m..mun.nosp@m.i.cz#
Date:
16.12.2012

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:
flowmon-export-http_postgres.c 1090 2013-02-26 21:20:54Z 374541

Definition in file flowmon-export-http_postgres.c.


Macro Definition Documentation

#define PRINTV (   format,
  args... 
)    do {if (VERBOSE) { fprintf(stdout, format, ##args); fflush(stdout); } } while (0)

Print when verbose mode is on

Definition at line 50 of file flowmon-export-http_postgres.c.

#define PRINTD (   format,
  args... 
)    do {if (DEBUG) { fprintf(stdout, format, ##args); fflush(stdout); } } while (0)

Print when debug mode is on

Definition at line 52 of file flowmon-export-http_postgres.c.

#define PRINTA (   format,
  args... 
)    do {if (VERBOSE || DEBUG) { fprintf(stdout, format, ##args); fflush(stdout); } } while (0)

Print when debug of verbose mode is on

Definition at line 54 of file flowmon-export-http_postgres.c.

#define MAX_CONNINFO_LENGTH   2000

Definition at line 56 of file flowmon-export-http_postgres.c.

#define VALUES_SIZE   600

Definition at line 57 of file flowmon-export-http_postgres.c.


Function Documentation

SET_PLUGIN_TYPE ( PLUGIN_TYPE_EXPORT  )

Set plugin type for flowmon.

int parse_conninfo ( char *  params,
plugin_private_export conf 
)

function parse parameters for remote connection

Parameters:
*paramspointer to start of string with parameters
*confpointer to plugin private structure
Returns:
0 if OK, non zero otherwise

Definition at line 161 of file flowmon-export-http_postgres.c.

int SQLconnection ( plugin_private_export p)

Function connect to database specified in plugin private structure.

Parameters:
*ppointer to plugin private structire
Returns:
0 if OK, non_zero otherwise

Definition at line 284 of file flowmon-export-http_postgres.c.


Variable Documentation

int verbose_level

verbose flag

int debug_level

debug flag

bool VERBOSE

verbose flag

Definition at line 71 of file flowmon-export-http_postgres.c.

bool DEBUG

debug flag

Definition at line 74 of file flowmon-export-http_postgres.c.