/
cmd_opts.h
146 lines (139 loc) · 4.05 KB
/
cmd_opts.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/*
******************************************************************************
*
* File: cmd_opts.h
*
* Author: Damien Stuart
*
* Purpose: Header file for fwknopd command line options.
*
* Copyright 2010 Damien Stuart (dstuart@dstuart.org)
*
* License (GNU Public License):
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
******************************************************************************
*/
#ifndef CMD_OPTS_H
#define CMD_OPTS_H
/* The config entry indexes are defined in the fwknopd_common.h, and now we
* create a config entry name map as well (too lazy to make a hash table).
*
* Note: It is very important this list matches the enum in fwknopd_common.h
*
*/
static char *config_map[NUMBER_OF_CONFIG_ENTRIES] = {
"CONFIG_FILE",
"OVERRIDE_CONFIG",
//"FIREWALL_TYPE",
"PCAP_INTF",
"ENABLE_PCAP_PROMISC",
"PCAP_FILTER",
"MAX_SNIFF_BYTES",
"ENABLE_SPA_PACKET_AGING",
"MAX_SPA_PACKET_AGE",
"ENABLE_DIGEST_PERSISTENCE",
"CMD_EXEC_TIMEOUT",
//"BLACKLIST",
"ENABLE_SPA_OVER_HTTP",
"ENABLE_TCP_SERVER",
"TCPSERV_PORT",
"LOCALE",
"SYSLOG_IDENTITY",
"SYSLOG_FACILITY",
//"ENABLE_EXTERNAL_CMDS",
//"EXTERNAL_CMD_OPEN",
//"EXTERNAL_CMD_CLOSE",
//"EXTERNAL_CMD_ALARM",
//"ENABLE_EXT_CMD_PREFIX",
//"EXT_CMD_PREFIX",
#if FIREWALL_IPTABLES
"ENABLE_IPT_FORWARDING",
"ENABLE_IPT_LOCAL_NAT",
"ENABLE_IPT_SNAT",
"SNAT_TRANSLATE_IP",
"ENABLE_IPT_OUTPUT",
"FLUSH_IPT_AT_INIT",
"FLUSH_IPT_AT_EXIT",
"IPT_INPUT_ACCESS",
"IPT_OUTPUT_ACCESS",
"IPT_FORWARD_ACCESS",
"IPT_DNAT_ACCESS",
"IPT_SNAT_ACCESS",
"IPT_MASQUERADE_ACCESS",
#elif FIREWALL_IPFW
"IPFW_START_RULE_NUM",
"IPFW_MAX_RULES",
"IPFW_ACTIVE_SET_NUM",
"IPFW_EXPIRE_SET_NUM",
"IPFW_EXPIRE_PURGE_INTERVAL",
"IPFW_ADD_CHECK_STATE",
#elif FIREWALL_PF
"PF_ANCHOR_NAME",
"PF_EXPIRE_INTERVAL",
#elif FIREWALL_IPF
/* --DSS Place-holder */
#endif /* FIREWALL type */
"FWKNOP_RUN_DIR",
"FWKNOP_CONF_DIR",
"ACCESS_FILE",
"FWKNOP_PID_FILE",
#if USE_FILE_CACHE
"DIGEST_FILE",
#else
"DIGEST_DB_FILE",
#endif
"GPG_HOME_DIR",
"FIREWALL_EXE",
};
/* Long options values (for those that may not have a short option).
*/
enum {
FW_LIST = 0x200,
GPG_HOME_DIR,
ROTATE_DIGEST_CACHE,
NOOP /* Just to be a marker for the end */
};
/* Our getopt_long options string.
*/
#define GETOPTS_OPTION_STRING "a:c:C:Dfhi:Kl:O:P:RSvV"
/* Our program command-line options...
*/
static struct option cmd_opts[] =
{
{"access-file", 1, NULL, 'a'},
{"config-file", 1, NULL, 'c'},
{"packet-limit", 1, NULL, 'C'},
{"dump-config", 0, NULL, 'D'},
{"foreground", 0, NULL, 'f'},
{"help", 0, NULL, 'h'},
{"interface", 1, NULL, 'i'},
{"kill", 0, NULL, 'K'},
{"fw-list", 0, NULL, FW_LIST },
{"gpg-home-dir", 1, NULL, GPG_HOME_DIR },
{"locale", 1, NULL, 'l' },
{"rotate-digest-cache", 0, NULL, ROTATE_DIGEST_CACHE },
{"override-config", 1, NULL, 'O' },
{"pcap-filter", 1, NULL, 'P'},
{"restart", 0, NULL, 'R'},
{"status", 0, NULL, 'S'},
{"verbose", 0, NULL, 'v'},
{"version", 0, NULL, 'V'},
{0, 0, 0, 0}
};
#endif /* CMD_OPTS_H */
/***EOF***/