src/functions/functions.settings \
src/functions/functions.stp \
src/functions/functions.sysctl \
- src/functions/functions.teredo \
src/functions/functions.usb \
src/functions/functions.util \
src/functions/functions.vlan \
src/helpers/dhcpd-config-helper \
src/helpers/firewall-kernel-init \
src/helpers/hostapd-config-helper \
- src/helpers/miredo-config-helper \
- src/helpers/miredo-helper \
src/helpers/pppd-angel \
src/helpers/wpa_supplicant \
src/helpers/wpa_supplicant-config-helper
src/hooks/zones/modem \
src/hooks/zones/pppoe \
src/hooks/zones/pptp \
- src/hooks/zones/teredo \
src/hooks/zones/wireless
# ------------------------------------------------------------------------------
+++ /dev/null
-#!/bin/bash
-###############################################################################
-# #
-# IPFire.org - A linux based firewall #
-# Copyright (C) 2012 IPFire Network Development Team #
-# #
-# 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 3 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, see <http://www.gnu.org/licenses/>. #
-# #
-###############################################################################
-
-function teredo_start() {
- local zone=${1}
- assert isset zone
-
- service_start "miredo-client@${zone}.service"
-}
-
-function teredo_stop() {
- local zone=${1}
- assert isset zone
-
- # Just stop the miredo daemon for this device.
- service_stop "miredo-client@${zone}.service"
-}
-
-function teredo_write_config() {
- local zone=${1}
- local file=${2}
- shift 2
-
- assert isset zone
- assert isset file
-
- local server
-
- while [ $# -gt 0 ]; do
- case "${1}" in
- --server=*)
- server=$(cli_get_val ${1})
- ;;
- esac
- shift
- done
-
- # Check if all required parameters are correctly set.
- assert isset server
-
- # Create the file's directory if necessary and
- # make sure there is nothing in the file, yet.
- mkdir -p $(dirname ${file}) 2>/dev/null
- : > ${file}
-
- # Print the header.
- ( echo "#"
- echo "# This is a miredo client configuration file for ${interface}."
- echo "# THIS FILE IS AUTOMATICALLY GENERATED AND WILL OVERWRITE"
- echo "# ANY CUSTOM CHANGES!"
- echo "#"
- echo "# $(date -u)"
- echo "#"
- echo
- ) >>${file}
-
- # All teredo connections we have are in client mode.
- echo "RelayType client" >> ${file}
-
- # The interface equals the name of the zone.
- echo "InterfaceName ${zone}" >> ${file}
-
- # Add the server information.
- echo "ServerAddress ${server}" >> ${file}
-
- exit ${EXIT_OK}
-}
+++ /dev/null
-#!/bin/bash
-###############################################################################
-# #
-# IPFire.org - A linux based firewall #
-# Copyright (C) 2012 IPFire Network Development Team #
-# #
-# 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 3 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, see <http://www.gnu.org/licenses/>. #
-# #
-###############################################################################
-
-. /usr/lib/network/functions
-
-# Read network settings
-network_settings_read
-
-action="${1}"
-assert isset action
-
-zone="${2}"
-assert isset zone
-assert zone_exists ${zone}
-
-config_file="${RUN_DIR}/miredo/${zone}/client.conf"
-
-case "${action}" in
- create)
- # Create the configuration file for this zone.
- zone_settings_read ${zone}
-
- teredo_write_config ${zone} ${config_file} \
- --server="${SERVER}"
- ;;
-
- remove)
- rm -f ${config_file}
- ;;
-
- *)
- log ERROR "Unknown action passed: ${action}"
- exit ${EXIT_ERROR}
- ;;
-esac
-
-exit ${EXIT_OK}
+++ /dev/null
-#!/bin/bash
-###############################################################################
-# #
-# IPFire.org - A linux based firewall #
-# Copyright (C) 2012 IPFire Network Development Team #
-# #
-# 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 3 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, see <http://www.gnu.org/licenses/>. #
-# #
-###############################################################################
-
-LOG_FACILITY="miredo-helper"
-
-. /usr/lib/network/functions
-
-# Read network settings
-network_settings_read
-
-action="${STATE}"
-assert isset action
-
-zone="${IFACE}"
-assert zone_exists ${zone}
-
-log DEBUG "Called for zone=${zone} action=${action}."
-
-case "${action}" in
- up)
- # Configure the requested MTU.
- isset MTU && device_set_mtu ${zone} ${MTU}
-
- # Bring up the device.
- device_set_up ${zone}
-
- # Apply the link-local address.
- ip_address_add ${zone} "${LLADDRESS}/64"
-
- # Apply the public IP address.
- ip_address_add ${zone} "${ADDRESS}/32"
-
- # Write all data to the routing database.
- routing_db_set ${zone} ipv6 type "teredo"
- routing_db_set ${zone} ipv6 local-ip-address "${ADDRESS}/32"
- routing_db_set ${zone} ipv6 active 1
-
- # Update the routing database.
- routing_update ${zone} ipv6
- routing_default_update
- ;;
-
- down)
- # Remove the routing database and update the tables.
- routing_db_remove ${zone} ipv6
- routing_update ${zone} ipv6
- routing_default_update
-
- # Set down the device.
- device_set_down ${zone}
- ;;
-
- destroy)
- # Do nothing here.
- ;;
-
- *)
- log ERROR "Unknown action passed: ${action}"
- exit ${EXIT_ERROR}
- ;;
-esac
-
-exit ${EXIT_OK}
+++ /dev/null
-#!/bin/bash
-###############################################################################
-# #
-# IPFire.org - A linux based firewall #
-# Copyright (C) 2010 Michael Tremer & Christian Schmidt #
-# #
-# 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 3 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, see <http://www.gnu.org/licenses/>. #
-# #
-###############################################################################
-
-. /usr/lib/network/header-zone
-
-HOOK_SETTINGS="HOOK SERVER"
-
-SERVER=""
-
-function hook_check() {
- assert isset SERVER
-}
-
-function hook_parse_cmdline() {
- local value
-
- while [ $# -gt 0 ]; do
- case "${1}" in
- --server=*)
- SERVER=$(cli_get_val ${1})
- ;;
- *)
- echo "Unknown option: ${1}" >&2
- exit ${EXIT_ERROR}
- ;;
- esac
- shift
- done
-}
-
-function hook_up() {
- local zone=${1}
- assert isset zone
-
- teredo_start ${zone}
-
- exit ${EXIT_OK}
-}
-
-function hook_down() {
- local zone=${1}
- assert isset zone
-
- teredo_stop ${zone}
-
- exit ${EXIT_OK}
-}
-
-function hook_status() {
- local zone=${1}
- assert isset zone
-
- # Print a nice header.
- cli_device_headline ${zone}
-
- zone_settings_read "${zone}" ${HOOK_SETTINGS}
-
- cli_headline 2 "Configuration"
- cli_print_fmt1 2 "Server" "${SERVER}"
-
- # Exit if zone is down
- if ! zone_is_up ${zone}; then
- cli_space
- exit ${EXIT_ERROR}
- fi
-
- cli_headline 2 "Protocol information"
- cli_print_fmt1 2 "MTU" "$(device_get_mtu ${zone})"
- cli_space
-
- exit ${EXIT_OK}
-}