]> git.ipfire.org Git - people/stevee/network.git/blob - functions.constants
Improve yes/no decisions.
[people/stevee/network.git] / functions.constants
1 #!/bin/bash
2 ###############################################################################
3 # #
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2010 Michael Tremer & Christian Schmidt #
6 # #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
11 # #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
16 # #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 # #
20 ###############################################################################
21
22 # Set gettext text domain.
23 TEXTDOMAIN="network"
24
25 # Enable colors by default
26 COLOURS="auto"
27
28 LOG_DIR=/var/log/network
29 RUN_DIR=/run/network
30
31 RED_RUN=${RUN_DIR}/red
32 PPP_SECRETS=/etc/ppp/secrets
33
34 # Network directory configuration.
35 NETWORK_CONFIG_DIR="/etc/network"
36 NETWORK_ZONE_DIR="${NETWORK_CONFIG_DIR}"
37 NETWORK_HOOKS_DIR=/usr/lib/network/hooks
38
39 # Network file configuration.
40 NETWORK_CONFIG_FILE=${NETWORK_CONFIG_DIR}/config
41 NETWORK_CONFIG_FILE_PARAMS="COLOURS DEBUG"
42 CONFIG_HOSTNAME="/etc/hostname"
43
44 RED_DB_DIR=${RUN_DIR}/red
45 ROUTING_DB_DIR=${RUN_DIR}/routing
46
47 DB_CONNECTION_FILE="${LOG_DIR}/connections.db"
48
49 # Proper error codes
50 EXIT_OK=0
51 EXIT_ERROR=1
52 EXIT_CONF_ERROR=2
53 EXIT_ERROR_ASSERT=3
54
55 EXIT_TRUE=0
56 EXIT_FALSE=1
57
58 STATUS_UP=0
59 STATUS_DOWN=1
60 STATUS_NOCARRIER=2
61
62 STATUS_TEXT[${STATUS_UP}]="UP"
63 STATUS_TEXT[${STATUS_DOWN}]="DOWN"
64 STATUS_TEXT[${STATUS_NOCARRIER}]="NO CARRIER"
65
66 STATUS_COLOUR[${STATUS_UP}]=${COLOUR_GREEN}
67 STATUS_COLOUR[${STATUS_DOWN}]=${COLOUR_RED}
68 STATUS_COLOUR[${STATUS_NOCARRIER}]=${COLOUR_YELLOW}
69
70 DISCOVER_OK=0
71 DISCOVER_ERROR=1
72 DISCOVER_NOT_SUPPORTED=2
73
74 # The user is able to create zones that begin
75 # with these names followed by a number.
76 ZONE_LOCAL="lan"
77 ZONE_NONLOCAL="upl"
78 VALID_ZONES="${ZONE_LOCAL} ${ZONE_NONLOCAL}"
79
80 SYS_CLASS_NET="/sys/class/net"
81
82 # Timeout values
83 TIMEOUT_RESTART=2
84
85 DEVICE_PRINT_LINE1=" %-24s %s\n"
86
87 PORT_PATTERN="pN"
88 PORT_PATTERN_ACCESSPOINT="apN"
89 PORT_PATTERN_WIRELESS="wN"
90
91 # This variable is used to point to a directory
92 # in which the iptables ruleset will be generated.
93 IPTABLES_TMPDIR=
94
95 FIREWALL_CONFIG_DIR="/etc/firewall"
96 FIREWALL_ZONES_DIR="${FIREWALL_CONFIG_DIR}/zones"
97 FIREWALL_CONFIG_FILE="${FIREWALL_CONFIG_DIR}/config"
98 FIREWALL_CONFIG_PORTFW="${FIREWALL_CONFIG_DIR}/portfw"
99
100 FIREWALL_CONFIG_PARAMS=""
101
102 FIREWALL_LOG_FACILITY="syslog"