]>
Commit | Line | Data |
---|---|---|
1848564d MT |
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 | ||
e9ea243e MT |
22 | # Set gettext text domain. |
23 | TEXTDOMAIN="network" | |
24 | ||
059469a8 | 25 | LOG_DIR=/var/log/network |
65c75fad | 26 | RUN_DIR=/run/network |
f5ba5f6b | 27 | LOCK_DIR=/var/lock |
1848564d | 28 | |
059469a8 | 29 | RED_RUN=${RUN_DIR}/red |
1848564d MT |
30 | PPP_SECRETS=/etc/ppp/secrets |
31 | ||
d2a21d01 MT |
32 | # Network directory configuration. |
33 | NETWORK_CONFIG_DIR="/etc/network" | |
c041b631 | 34 | NETWORK_DB_DIR="${RUN_DIR}/db" |
d2a21d01 | 35 | NETWORK_HOOKS_DIR=/usr/lib/network/hooks |
67baa452 | 36 | NETWORK_HELPERS_DIR=/usr/lib/network/helpers |
0d994c19 | 37 | NETWORK_PORTS_DIR="${NETWORK_CONFIG_DIR}/ports" |
de3cecef | 38 | NETWORK_TRIGGERS_DIR=/usr/lib/network/triggers |
04c27fe9 | 39 | NETWORK_ZONES_DIR="${NETWORK_CONFIG_DIR}/zones" |
83d5eb04 | 40 | NETWORK_SHARE_DIR=/usr/share/network |
e1947a76 | 41 | NETWORK_CACHE_DIR=/var/cache/network |
d2a21d01 | 42 | |
cf8685a1 | 43 | NETWORK_IPSEC_CONNS_DIR="${NETWORK_CONFIG_DIR}/vpn/ipsec/connections" |
7c623df2 | 44 | NETWORK_IPSEC_POOLS_DIR="${NETWORK_CONFIG_DIR}/vpn/ipsec/pools" |
67baa452 | 45 | NETWORK_IPSEC_SWANCTL_CONNECTIONS_DIR="/etc/swanctl/connections" |
940bb51b | 46 | NETWORK_IPSEC_SWANCTL_POOLS_DIR="/etc/swanctl/pools" |
cf8685a1 | 47 | |
231bce76 MT |
48 | # WPA supplicant |
49 | WPA_SUPPLICANT_CONF_DIR="/etc/wpa_supplicant" | |
50 | ||
d2a21d01 | 51 | # Network file configuration. |
e9df08ad MT |
52 | NETWORK_SETTINGS_FILE=${NETWORK_CONFIG_DIR}/config |
53 | NETWORK_SETTINGS_FILE_PARAMS="DEBUG" | |
85da4764 | 54 | NETWORK_WIRELESS_NETWORKS_DIR="${NETWORK_CONFIG_DIR}/wireless/networks" |
47feaba1 | 55 | |
4ed1b754 | 56 | CA_BUNDLE="/etc/pki/tls/certs/ca-bundle.crt" |
31e59f2b | 57 | CONFIG_HOSTNAME="/etc/hostname" |
ff8ec5ef MT |
58 | |
59 | RED_DB_DIR=${RUN_DIR}/red | |
b816e04b | 60 | ROUTING_DB_DIR=${RUN_DIR}/routing |
1848564d | 61 | |
059469a8 MT |
62 | DB_CONNECTION_FILE="${LOG_DIR}/connections.db" |
63 | ||
cb965348 MT |
64 | # (Static) route settings. |
65 | NETWORK_CONFIG_ROUTES="${NETWORK_CONFIG_DIR}/routes" | |
478de6f9 | 66 | NETWORK_CONFIG_ROUTES_PARAMS="network gateway unreachable prohibit blackhole mtu" |
cb965348 | 67 | |
1848564d MT |
68 | # Proper error codes |
69 | EXIT_OK=0 | |
70 | EXIT_ERROR=1 | |
71 | EXIT_CONF_ERROR=2 | |
828eb94a | 72 | EXIT_NOT_SUPPORTED=3 |
05365355 | 73 | EXIT_NOT_HANDLED=4 |
2181765d | 74 | EXIT_COMMAND_NOT_FOUND=127 |
6cae8097 | 75 | EXIT_ERROR_ASSERT=128 |
1848564d | 76 | |
2eaf16f3 MT |
77 | EXIT_TRUE=0 |
78 | EXIT_FALSE=1 | |
8666b68f | 79 | EXIT_UNKNOWN=2 |
2eaf16f3 | 80 | |
83d72e63 MT |
81 | # Exit codes for IPv6 duplicate address detection (DAD) |
82 | EXIT_DAD_OK=0 | |
83 | EXIT_DAD_FAILED=8 | |
84 | EXIT_DAD_TENTATIVE=8 | |
85 | ||
1848564d MT |
86 | STATUS_UP=0 |
87 | STATUS_DOWN=1 | |
711ffac1 MT |
88 | STATUS_NOCARRIER=2 |
89 | ||
1848564d MT |
90 | DISCOVER_OK=0 |
91 | DISCOVER_ERROR=1 | |
92 | DISCOVER_NOT_SUPPORTED=2 | |
93 | ||
e68f13c0 MT |
94 | # Default MTU |
95 | DEFAULT_MTU=1500 | |
96 | ||
c3db1412 MT |
97 | # A list of supported device offloading mechanisms |
98 | # that are being mapped to the ethtool command | |
99 | declare -A DEVICE_SUPPORTED_OFFLOADINGS=( | |
100 | [generic-receive-offload]="gro" | |
101 | [generic-segmentation-offload]="gso" | |
102 | [large-receive-offload]="lro" | |
103 | [rx-checksumming]="rx" | |
104 | [scatter-gather]="sg" | |
105 | [tcp-segmentation-offload]="tso" | |
106 | [tx-checksumming]="tx" | |
107 | [udp-fragmentation-offload]="ufo" | |
108 | ) | |
109 | ||
110 | # These offloadings will automatically be enabled (if supported) | |
111 | DEVICE_AUTO_OFFLOADINGS=( | |
112 | generic-receive-offload | |
113 | generic-segmentation-offload | |
114 | rx-checksumming | |
115 | scatter-gather | |
116 | tcp-segmentation-offload | |
117 | tx-checksumming | |
118 | udp-fragmentation-offload | |
119 | ) | |
120 | ||
7de0637a MT |
121 | # The user is able to create zones that begin |
122 | # with these names followed by a number. | |
4da7fbed | 123 | ZONE_LOCAL="net" |
7de0637a MT |
124 | ZONE_NONLOCAL="upl" |
125 | VALID_ZONES="${ZONE_LOCAL} ${ZONE_NONLOCAL}" | |
1848564d MT |
126 | |
127 | SYS_CLASS_NET="/sys/class/net" | |
2ae4f579 MT |
128 | |
129 | # Timeout values | |
130 | TIMEOUT_RESTART=2 | |
711ffac1 | 131 | |
feb76eaf | 132 | DEVICE_PRINT_LINE1=" %-24s %s\n" |
a1a8f0f4 | 133 | |
8c63fa13 | 134 | PORT_PATTERN="pN" |
8ee92277 | 135 | PORT_PATTERN_ACCESSPOINT="apN" |
727248f0 | 136 | PORT_PATTERN_MESH="mN" |
8ee92277 | 137 | PORT_PATTERN_WIRELESS="wN" |
b8026986 | 138 | PORT_PATTERN_WIRELESS_ADHOC="adhocN" |
a23fdc0e | 139 | PORT_PATTERN_WIRELESS_MONITOR="wmonN" |