]> git.ipfire.org Git - people/arne_f/network.git/blob - functions.constants
Fix weird device CLI command.
[people/arne_f/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 # Enable colors by default
23 COLOURS="auto"
24
25 BASE_DIR=/lib/network
26 CONFIG_DIR=/etc/network
27 HOOKS_DIR=${BASE_DIR}/hooks
28 LOG_DIR=/var/log/network
29 RUN_DIR=/var/run/network
30 ZONE_DIR=${CONFIG_DIR}
31
32 RED_RUN=${RUN_DIR}/red
33 PPP_SECRETS=/etc/ppp/secrets
34
35 CONFIG_FILE=${CONFIG_DIR}/network_config
36 CONFIG_FILE_PARAMS="COLOURS DEBUG SHELL TIMEOUT_RESTART"
37
38 RED_DB_DIR=${RUN_DIR}/red
39
40 DB_CONNECTION_FILE="${LOG_DIR}/connections.db"
41
42 # Proper error codes
43 EXIT_OK=0
44 EXIT_ERROR=1
45 EXIT_CONF_ERROR=2
46 EXIT_ERROR_ASSERT=3
47
48 STATUS_UP=0
49 STATUS_DOWN=1
50 STATUS_NOCARRIER=2
51
52 STATUS_TEXT[${STATUS_UP}]="UP"
53 STATUS_TEXT[${STATUS_DOWN}]="DOWN"
54 STATUS_TEXT[${STATUS_NOCARRIER}]="NO CARRIER"
55
56 STATUS_COLOUR[${STATUS_UP}]=${COLOUR_GREEN}
57 STATUS_COLOUR[${STATUS_DOWN}]=${COLOUR_RED}
58 STATUS_COLOUR[${STATUS_NOCARRIER}]=${COLOUR_YELLOW}
59
60 DISCOVER_OK=0
61 DISCOVER_ERROR=1
62 DISCOVER_NOT_SUPPORTED=2
63
64 # The user is able to create zones that begin with these names
65 VALID_ZONES="green orange red grey"
66
67 SYS_CLASS_NET="/sys/class/net"
68
69 # Timeout values
70 TIMEOUT_RESTART=2
71
72 DEVICE_PRINT_LINE1=" %-24s %s\n"