#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>

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 |
| #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 CONFIG | ( | x | ) | conf.x |
| #define CT_FLUSH_CACHE 19 /* flush cache */ |
| #define CT_FLUSH_MASTER 0 /* flush kernel conntrack table */ |
Referenced by ctnl_local(), and main().
Referenced by ctnl_local(), and main().
| #define CTD_EXPECT (1UL << 6) |
| #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_FLUSH_MASTER 38 /* flush kernel expect table */ |
Referenced by ctnl_local(), and main().
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, | |
| y | |||
| ) | 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 | ( | x | ) | st.x |
Referenced by __attribute__(), close_log(), ct_filter_conntrack(), ct_filter_master(), cthelper_init(), ctnl_init(), ctnl_kill(), ctnl_local(), dlog(), dlog_ct(), dlog_exp(), dump_traffic_stats(), init(), init_log(), killer(), nl_init_event_handler(), tcp_accept(), tcp_recv(), and update_traffic_stats().
| #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 |
Referenced by nethdr_track_seq(), and nethdr_track_update_seq().
| #define STATS 21 /* dump statistics */ |
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_RUNTIME 30 /* extended runtime stats */ |
Referenced by main().
| int cthelper_init | ( | void | ) |
References CONFIG, ct_state::cthelper, dlog(), ctd_helper_instance::head, list_for_each_entry, LOG_ERR, MNL_SOCKET_AUTOPID, mnl_socket_bind(), mnl_socket_get_fd(), mnl_socket_get_portid(), mnl_socket_open(), NETLINK_NETFILTER, NULL, register_fd(), state, STATE, and STATE_CTH.
Referenced by init().


| void cthelper_kill | ( | void | ) |
References ct_state::cthelper, mnl_socket_close(), state, and STATE_CTH.
Referenced by killer().


| int cthelper_local | ( | int | fd, |
| int | type, | ||
| void * | data | ||
| ) |
References LOCAL_RET_OK.
| int ctnl_init | ( | void | ) |
References add_alarm(), CONFIG, CTD_ORIGIN_FLUSH, CTD_POLL, CTD_STATS_MODE, CTD_SYNC_MODE, dlog(), flags, init(), init_alarm(), INTERNAL_F_POPULATE, LOG_ERR, LOG_NOTICE, nfct_callback_register(), nfct_callback_register2(), nfct_fd(), nfct_open(), NFCT_T_ALL, nfexp_callback_register(), nfexp_callback_register2(), nl_dump_conntrack_table(), nl_dump_expect_table(), nl_init_event_handler(), NULL, origin_register(), register_fd(), STATE, stats_mode, and sync_mode.
Referenced by init().


| void ctnl_kill | ( | void | ) |
References CONFIG, ct_filter_destroy(), CTD_POLL, flags, INTERNAL_F_POPULATE, nfct_close(), origin_unregister(), and STATE.
Referenced by killer().


| 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().


| int init_config | ( | char * | filename | ) |
| 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().


| void select_main_loop | ( | void | ) |
Referenced by ctnl_init().
Referenced by ctnl_init().