]> git.ipfire.org Git - people/stevee/network.git/blob - header-port
Don't use connection tracking for loopback traffic.
[people/stevee/network.git] / header-port
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 INFO_SETTINGS="HOOK PORT_PARENTS PORT_CHILDREN"
23
24 # This function is called after a device has been plugged
25 # into the system and got its correct name.
26 # The function is intended to create child ports and things
27 # like that.
28 function _hotplug() {
29 exit ${EXIT_OK}
30 }
31
32 # This function gets called when a device is plugged in
33 # to determine the right name.
34 # The first argument is the port which should be tested
35 # against the second argument which is the device that
36 # has been plugged in.
37 function _hotplug_rename() {
38 exit ${EXIT_FALSE}
39 }
40
41 function _info() {
42 local port=${1}
43 shift
44
45 assert isset port
46
47 config_read $(port_file ${port})
48
49 local key
50 local val
51 for key in PORT_PARENTS PORT_CHILDREN; do
52 val="${key}_VAR"
53 val=${!val}
54 eval "${key}=\"${!val}\""
55 done
56
57 for key in ${INFO_SETTINGS}; do
58 echo "${key}=\"${!key}\""
59 done
60
61 exit ${ERROR_OK}
62 }
63
64 function _status() {
65 local port=${1}
66 assert isset port
67
68 cli_device_headline ${port} --long
69 exit ${EXIT_OK}
70 }