netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
conntrackd.h File Reference
#include "mcast.h"
#include "local.h"
#include "alarm.h"
#include "filter.h"
#include "channel.h"
#include "internal.h"
#include <stdint.h>
#include <stdio.h>
#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
#include <syslog.h>
Include dependency graph for conntrackd.h:
This graph shows which files directly or indirectly include this file:

Data Structures

union  inet_address
 
struct  ct_conf
 
struct  ct_general_state
 
struct  commit_runqueue
 
struct  ct_sync_state
 
struct  ct_stats_state
 
struct  ct_helper_state
 
struct  ct_state
 
struct  ct_mode
 

Macros

#define CT_FLUSH_MASTER   0 /* flush kernel conntrack table */
 
#define CT_RESYNC_MASTER   1 /* resync with kernel ct table */
 
#define CT_DUMP_INTERNAL   16 /* dump internal cache */
 
#define CT_DUMP_EXTERNAL   17 /* dump external cache */
 
#define CT_COMMIT   18 /* commit external cache */
 
#define CT_FLUSH_CACHE   19 /* flush cache */
 
#define KILL   20 /* kill conntrackd */
 
#define STATS   21 /* dump statistics */
 
#define SEND_BULK   22 /* send a bulk */
 
#define REQUEST_DUMP   23 /* request dump */
 
#define CT_DUMP_INT_XML   24 /* dump internal cache in XML */
 
#define CT_DUMP_EXT_XML   25 /* dump external cache in XML */
 
#define RESET_TIMERS   26 /* reset kernel timers */
 
#define DEBUG_INFO   27 /* unused */
 
#define STATS_NETWORK   28 /* extended network stats */
 
#define STATS_CACHE   29 /* extended cache stats */
 
#define STATS_RUNTIME   30 /* extended runtime stats */
 
#define STATS_LINK   31 /* dedicated link stats */
 
#define STATS_RSQUEUE   32 /* resend queue stats */
 
#define CT_FLUSH_INT_CACHE   33 /* flush internal cache */
 
#define CT_FLUSH_EXT_CACHE   34 /* flush external cache */
 
#define STATS_PROCESS   35 /* child process stats */
 
#define STATS_QUEUE   36 /* queue stats */
 
#define EXP_STATS   37 /* dump statistics */
 
#define EXP_FLUSH_MASTER   38 /* flush kernel expect table */
 
#define EXP_RESYNC_MASTER   39 /* resync with kernel exp table */
 
#define EXP_DUMP_INTERNAL   40 /* dump internal expect cache */
 
#define EXP_DUMP_EXTERNAL   41 /* dump external expect cache */
 
#define EXP_COMMIT   42 /* commit expectations */
 
#define ALL_FLUSH_MASTER   43 /* flush all kernel tables */
 
#define ALL_RESYNC_MASTER   44 /* resync w/all kernel tables */
 
#define ALL_FLUSH_CACHE   45 /* flush all caches */
 
#define ALL_COMMIT   46 /* commit all tables */
 
#define EXP_DUMP_INT_XML   47 /* dump internal cache in XML */
 
#define EXP_DUMP_EXT_XML   48 /* dump external cache in XML */
 
#define DEFAULT_CONFIGFILE   "/etc/conntrackd/conntrackd.conf"
 
#define DEFAULT_LOCKFILE   "/var/lock/conntrackd.lock"
 
#define DEFAULT_LOGFILE   "/var/log/conntrackd.log"
 
#define DEFAULT_STATS_LOGFILE   "/var/log/conntrackd-stats.log"
 
#define DEFAULT_SYSLOG_FACILITY   LOG_DAEMON
 
#define NOT_SET   0
 
#define DAEMON   1
 
#define REQUEST   2
 
#define CTD_SYNC_MODE   (1UL << 0)
 
#define CTD_STATS_MODE   (1UL << 1)
 
#define CTD_SYNC_FTFW   (1UL << 2)
 
#define CTD_SYNC_ALARM   (1UL << 3)
 
#define CTD_SYNC_NOTRACK   (1UL << 4)
 
#define CTD_POLL   (1UL << 5)
 
#define CTD_EXPECT   (1UL << 6)
 
#define CTD_HELPER   (1UL << 7)
 
#define FILENAME_MAXLEN   256
 
#define CONFIG(x)   conf.x
 
#define STATE(x)   st.x
 
#define STATE_SYNC(x)   state.sync->x
 
#define COMMIT_STATE_INACTIVE   0
 
#define COMMIT_STATE_MASTER   1
 
#define COMMIT_STATE_RELATED   2
 
#define STATE_STATS(x)   state.stats->x
 
#define STATE_CTH(x)   state.cthelper->x
 
#define MAX(x, y)   x > y ? x : y
 

Functions

void ctnl_kill (void)
 
int ctnl_local (int fd, int type, void *data)
 
int ctnl_init (void)
 
void cthelper_kill (void)
 
int cthelper_local (int fd, int type, void *data)
 
int cthelper_init (void)
 
void killer (int foo)
 
int init (void)
 
void select_main_loop (void)
 
int init_config (char *filename)
 

Variables

struct ct_conf conf
 
struct ct_state state
 
struct ct_general_state st
 
struct ct_mode sync_mode
 
struct ct_mode stats_mode
 

Macro Definition Documentation

#define ALL_COMMIT   46 /* commit all tables */

Referenced by main().

#define ALL_FLUSH_CACHE   45 /* flush all caches */

Referenced by main().

#define ALL_FLUSH_MASTER   43 /* flush all kernel tables */

Referenced by ctnl_local(), and main().

#define ALL_RESYNC_MASTER   44 /* resync w/all kernel tables */

Referenced by ctnl_local(), and main().

#define COMMIT_STATE_INACTIVE   0
#define COMMIT_STATE_MASTER   1
#define COMMIT_STATE_RELATED   2
#define CT_COMMIT   18 /* commit external cache */

Referenced by main().

#define CT_DUMP_EXT_XML   25 /* dump external cache in XML */

Referenced by main().

#define CT_DUMP_EXTERNAL   17 /* dump external cache */

Referenced by main().

#define CT_DUMP_INT_XML   24 /* dump internal cache in XML */

Referenced by main().

#define CT_DUMP_INTERNAL   16 /* dump internal cache */

Referenced by main().

#define CT_FLUSH_CACHE   19 /* flush cache */
#define CT_FLUSH_EXT_CACHE   34 /* flush external cache */

Referenced by main().

#define CT_FLUSH_INT_CACHE   33 /* flush internal cache */

Referenced by main().

#define CT_FLUSH_MASTER   0 /* flush kernel conntrack table */

Referenced by ctnl_local(), and main().

#define CT_RESYNC_MASTER   1 /* resync with kernel ct table */

Referenced by ctnl_local(), and main().

#define CTD_EXPECT   (1UL << 6)
#define CTD_HELPER   (1UL << 7)

Referenced by init(), and killer().

#define CTD_POLL   (1UL << 5)

Referenced by ctnl_init(), and ctnl_kill().

#define CTD_STATS_MODE   (1UL << 1)

Referenced by ctnl_init(), init(), and killer().

#define CTD_SYNC_ALARM   (1UL << 3)
#define CTD_SYNC_FTFW   (1UL << 2)
#define CTD_SYNC_MODE   (1UL << 0)

Referenced by ctnl_init(), init(), and killer().

#define CTD_SYNC_NOTRACK   (1UL << 4)
#define DAEMON   1

Referenced by main().

#define DEBUG_INFO   27 /* unused */
#define DEFAULT_CONFIGFILE   "/etc/conntrackd/conntrackd.conf"

Referenced by main().

#define DEFAULT_LOCKFILE   "/var/lock/conntrackd.lock"
#define DEFAULT_LOGFILE   "/var/log/conntrackd.log"
#define DEFAULT_STATS_LOGFILE   "/var/log/conntrackd-stats.log"
#define DEFAULT_SYSLOG_FACILITY   LOG_DAEMON
#define EXP_COMMIT   42 /* commit expectations */

Referenced by main().

#define EXP_DUMP_EXT_XML   48 /* dump external cache in XML */

Referenced by main().

#define EXP_DUMP_EXTERNAL   41 /* dump external expect cache */

Referenced by main().

#define EXP_DUMP_INT_XML   47 /* dump internal cache in XML */

Referenced by main().

#define EXP_DUMP_INTERNAL   40 /* dump internal expect cache */

Referenced by main().

#define EXP_FLUSH_MASTER   38 /* flush kernel expect table */

Referenced by ctnl_local(), and main().

#define EXP_RESYNC_MASTER   39 /* resync with kernel exp table */

Referenced by ctnl_local(), and main().

#define EXP_STATS   37 /* dump statistics */
#define FILENAME_MAXLEN   256
#define KILL   20 /* kill conntrackd */

Referenced by main().

#define MAX (   x,
 
)    x > y ? x : y
#define NOT_SET   0
#define REQUEST   2

Referenced by main(), and nl_nlmsg_flags2str().

#define REQUEST_DUMP   23 /* request dump */

Referenced by main().

#define RESET_TIMERS   26 /* reset kernel timers */

Referenced by main().

#define SEND_BULK   22 /* send a bulk */

Referenced by main().

#define STATE_CTH (   x)    state.cthelper->x

Referenced by cthelper_init(), and cthelper_kill().

#define STATE_STATS (   x)    state.stats->x
#define STATE_SYNC (   x)    state.sync->x
#define STATS   21 /* dump statistics */

Referenced by main().

#define STATS_CACHE   29 /* extended cache stats */

Referenced by main().

#define STATS_LINK   31 /* dedicated link stats */

Referenced by main().

#define STATS_NETWORK   28 /* extended network stats */

Referenced by main().

#define STATS_PROCESS   35 /* child process stats */

Referenced by main().

#define STATS_QUEUE   36 /* queue stats */

Referenced by main().

#define STATS_RSQUEUE   32 /* resend queue stats */

Referenced by main().

#define STATS_RUNTIME   30 /* extended runtime stats */

Referenced by main().

Function Documentation

int cthelper_init ( void  )
void cthelper_kill ( void  )

References ct_state::cthelper, mnl_socket_close(), state, and STATE_CTH.

Referenced by killer().

Here is the call graph for this function:

Here is the caller graph for this function:

int cthelper_local ( int  fd,
int  type,
void *  data 
)

References LOCAL_RET_OK.

void ctnl_kill ( void  )

References CONFIG, ct_filter_destroy(), CTD_POLL, flags, INTERNAL_F_POPULATE, nfct_close(), origin_unregister(), and STATE.

Referenced by killer().

Here is the call graph for this function:

Here is the caller graph for this function:

int ctnl_local ( int  fd,
int  type,
void *  data 
)
int init ( void  )

References CONFIG, create_fds(), CTD_HELPER, CTD_STATS_MODE, CTD_SYNC_MODE, cthelper_init(), ctnl_init(), dlog(), do_gettimeofday(), flags, killer(), local_server_create(), LOG_ERR, LOG_NOTICE, NULL, register_fd(), and STATE.

Referenced by ctnl_init(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

int init_config ( char *  filename)

Referenced by main().

Here is the caller graph for this function:

void killer ( int  foo)

References close_log(), CONFIG, CTD_HELPER, CTD_STATS_MODE, CTD_SYNC_MODE, cthelper_kill(), ctnl_kill(), destroy_fds(), dlog(), flags, local_server_destroy(), LOG_NOTICE, NULL, and STATE.

Referenced by init().

Here is the call graph for this function:

Here is the caller graph for this function:

void select_main_loop ( void  )

Referenced by main().

Here is the caller graph for this function:

Variable Documentation

Referenced by main().

struct ct_mode stats_mode

Referenced by ctnl_init().