From 9e5594d540a9365f02b08e136e83a21eb0a2ac60 Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Mon, 28 Oct 2013 16:14:43 +0000 Subject: [PATCH] Migrate ahcpd and babeld to openwrt-routing SVN-Revision: 38569 --- ipv6/ahcpd/Makefile | 53 ------------- ipv6/ahcpd/files/ahcpd.config | 32 -------- ipv6/ahcpd/files/ahcpd.init | 109 ------------------------- net/babel/Makefile | 59 -------------- net/babel/files/babeld.conf | 40 ---------- net/babel/files/babeld.config | 72 ----------------- net/babel/files/babeld.init | 144 ---------------------------------- 7 files changed, 509 deletions(-) delete mode 100644 ipv6/ahcpd/Makefile delete mode 100644 ipv6/ahcpd/files/ahcpd.config delete mode 100644 ipv6/ahcpd/files/ahcpd.init delete mode 100644 net/babel/Makefile delete mode 100644 net/babel/files/babeld.conf delete mode 100644 net/babel/files/babeld.config delete mode 100755 net/babel/files/babeld.init diff --git a/ipv6/ahcpd/Makefile b/ipv6/ahcpd/Makefile deleted file mode 100644 index 95af352242..0000000000 --- a/ipv6/ahcpd/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright (C) 2007-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=ahcpd -PKG_VERSION:=0.53 -PKG_RELEASE:=2 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/files/ -PKG_MD5SUM:=a1a610bf20965aa522cd766bf3d5829a - - -include $(INCLUDE_DIR)/package.mk - -define Package/ahcpd - SECTION:=net - CATEGORY:=Network - TITLE:=Ad-Hoc Configuration Protocol daemon - URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/ahcp/ - MAINTAINER:=Gabriel Kerneis - DEPENDS:=+kmod-ipv6 +ip +librt -endef - -define Package/ahcpd/description - Ahcpd is a daemon for configuring an IPv6 network using the Ad-Hoc - Configuration Protocol (AHCP). AHCP is designed for wireless mesh - networks, where IPv6 autoconfiguration and DHCPv6 do not work, but may - also be used on wired networks. -endef - -define Package/ahcpd/conffiles -/etc/config/ahcpd -endef - -define Package/ahcpd/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_DIR) $(1)/etc/ahcp - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcp-config.sh $(1)/etc/ahcp/ - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcpd $(1)/usr/sbin/ - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/ahcpd.config $(1)/etc/config/ahcpd - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/ahcpd.init $(1)/etc/init.d/ahcpd -endef - -$(eval $(call BuildPackage,ahcpd)) diff --git a/ipv6/ahcpd/files/ahcpd.config b/ipv6/ahcpd/files/ahcpd.config deleted file mode 100644 index 0996251cb2..0000000000 --- a/ipv6/ahcpd/files/ahcpd.config +++ /dev/null @@ -1,32 +0,0 @@ -package ahcpd - -config ahcpd - # Choose ahcp mode: client (default), server or forwarder - ## option 'mode' 'client' - # Uncomment the following lines to enable ahcpd on the desired - # interfaces. - ## list 'interface' 'lan' - ## list 'interface' 'wlan' - - # The following only makes sense in 'server' mode. - # Tweak to suit your needs. - ## list 'prefix' 'fde6:20f5:c9ac:358::/64' - ## list 'prefix' '192.168.4.128/25' - ## list 'name_server' 'fde6:20f5:c9ac:358::1' - ## list 'name_server' '192.168.4.1' - ## list 'ntp_server' '192.168.4.2' - ## option 'lease_dir' '/var/lib/leases' - - # option 'id_file' '/var/lib/ahcp-unique-id' - # option 'log_file' '/var/log/ahcpd.log' - # The configuration file is not necessary since you can configure - # everything from this file. But still, you might prefer using it. - ## option 'conf_file' '/etc/ahcp/ahcp.conf' - - # option 'multicast_address' 'ff02::cca6:c0f9:e182:5359' - # option 'port' '5359' - # option 'ipv4_only' 'false' - # option 'ipv6_only' 'false' - # option 'lease_time' '3666' - # option 'debug' '1' - diff --git a/ipv6/ahcpd/files/ahcpd.init b/ipv6/ahcpd/files/ahcpd.init deleted file mode 100644 index dee21c4c75..0000000000 --- a/ipv6/ahcpd/files/ahcpd.init +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2007-2011 OpenWrt.org - -START=71 - -SERVICE_USE_PID=1 - -EXTRA_COMMANDS="status" -EXTRA_HELP=" status Print ahcpd's status to the log file." - -append_bool() { - local section="$1" - local option="$2" - local value="$3" - local _loctmp - config_get_bool _loctmp "$section" "$option" 0 - [ "$_loctmp" -gt 0 ] && append args "$value" -} - -append_parm() { - local section="$1" - local option="$2" - local switch="$3" - local _loctmp - config_get _loctmp "$section" "$option" - [ -z "$_loctmp" ] && return 0 - append args "$switch $_loctmp" -} - -append_stmt() { - local name="$1" - local switch="$2" - append args "-C '$switch $name'" -} - -append_opt_stmt() { - local section="$1" - local option="$2" - local switch="$3" - local _loctmp - config_get _loctmp "$section" "$option" - [ -z "$_loctmp" ] && return 0 - append args "-C '$switch $_loctmp'" -} - -ahcp_addif() { - local ifname=$(uci_get_state network "$1" ifname "$1") - append interfaces "$ifname" -} - -ahcp_server() { - local cfg="$1" - - append_opt_stmt "$cfg" 'mode' 'mode' - append_opt_stmt "$cfg" 'lease_dir' 'lease-dir' - config_list_foreach "$cfg" 'prefix' append_stmt 'prefix' - config_list_foreach "$cfg" 'name_server' append_stmt 'name-server' - config_list_foreach "$cfg" 'ntp_server' append_stmt 'ntp-server' - - append_parm "$cfg" 'id_file' '-i' - append_parm "$cfg" 'log_file' '-L' -} - -ahcp_config() { - local cfg="$1" - local interface - local _loctmp - - config_list_foreach "$cfg" 'interface' ahcp_addif - - # Add interfaces with "option proto ahcp" in /etc/config/network - # (only for client mode) - config_get _loctmp "$cfg" "mode" - if [ -z "$_loctmp" -o "$_loctmp" = "client" ]; then - for interface in $(uci -P /var/state show network|grep proto=ahcp|cut -d. -f2); do - ahcp_addif $interface - done - fi - - append_bool "$cfg" 'ipv4_only' '-4' - append_bool "$cfg" 'ipv6_only' '-6' - append_bool "$cfg" 'no_dns' '-N' - - append_parm "$cfg" 'multicast_address' '-m' - append_parm "$cfg" 'port' '-p' - append_parm "$cfg" 'lease_time' '-t' - append_parm "$cfg" 'debug' '-d' - append_parm "$cfg" 'conf_file' '-c' - append_parm "$cfg" 'script' '-s' -} - -start() { - mkdir -p /var/lib - config_load ahcpd - unset args - unset interfaces - config_foreach ahcp_config ahcpd - config_foreach ahcp_server ahcpd - [ -z "$interfaces" ] && return 0 - eval "service_start /usr/sbin/ahcpd -D $args $interfaces" -} - -stop() { - service_stop /usr/sbin/ahcpd -} - -status() { - SERVICE_SIG="USR1" service_signal /usr/sbin/ahcpd -} diff --git a/net/babel/Makefile b/net/babel/Makefile deleted file mode 100644 index 9992efe210..0000000000 --- a/net/babel/Makefile +++ /dev/null @@ -1,59 +0,0 @@ -# -# Copyright (C) 2007-2009 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=babeld -PKG_VERSION:=1.4.2 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/files/ -PKG_MD5SUM:=a48e8129f221f66640ae1ccf73190991 - -include $(INCLUDE_DIR)/package.mk - -define Package/babeld - SECTION:=net - CATEGORY:=Network - SUBMENU:=Routing and Redirection - TITLE:=A loop-free distance-vector routing protocol - URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/babel/ - MAINTAINER:=Gabriel Kerneis - DEPENDS:=+kmod-ipv6 +librt -endef - -define Package/babeld/description - Babel is a loop-avoiding distance-vector routing protocol roughly based - on DSDV and AODV, but with provisions for link cost estimation and - redistribution of routes from other routing protocols. - While it is optimised for wireless mesh networks, Babel will also work - efficiently on wired networks. It will generate between 1.2 and 2.4 times - the amount of routing traffic that RIPng would generate, while - never counting to infinity. -endef - -define Package/babeld/conffiles -/etc/babeld.conf -/etc/config/babeld -endef - -MAKE_FLAGS+= \ - CFLAGS="$(TARGET_CFLAGS)" \ - -define Package/babeld/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/babeld $(1)/usr/sbin/ - $(INSTALL_DIR) $(1)/etc - $(INSTALL_CONF) ./files/babeld.conf $(1)/etc/ - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/babeld.config $(1)/etc/config/babeld - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/babeld.init $(1)/etc/init.d/babeld -endef - -$(eval $(call BuildPackage,babeld)) diff --git a/net/babel/files/babeld.conf b/net/babel/files/babeld.conf deleted file mode 100644 index b27e65a455..0000000000 --- a/net/babel/files/babeld.conf +++ /dev/null @@ -1,40 +0,0 @@ -# babel config file -# Copyright (C) 2008-2010 Juliusz Chroboczek, L. Aaron Kaplan -# , -# -# This config file simply documents sample entries. -# "redistribute" means: redistribute routes from other routing protocols -# into babel. "local" means addresses assigned to local interfaces. -# -# You do not need to edit this file: you can use /etc/config/babeld -# instead (sections "interface" and "filter"). Both files can be used -# simultaneously (the rules of this file are executed first). - -# the default rules are: -# -## redistribute local -## redistribute deny -# -# this says, redistribute local addresses but no other routes - - -# redistribute IPv4 default route into babel -## redistribute local ip 0.0.0.0/0 le 0 metric 128 - -# same but for IPv6 -## redistribute local ip ::/0 le 0 metric 128 - - -# don't redistribute all local addresses, only selected ones -# after the first line, the "deny" rules kicks in. After the "deny" -# no redistribute local rules are going to match -## redistribute local ip 192.160.4.0/24 -## redistribute local deny - - -# Babel refuses to redistribute routes with a protocol number of "boot"; -# this is standard practice, and means that you cannot easily -# redistribute the default route installed by dhcp. It is however -# possible to redistribute such route by explicitly specifying "proto 3" -# on the redistribute line. -## redistribute ip 0.0.0.0/0 le 0 proto 3 metric 128 diff --git a/net/babel/files/babeld.config b/net/babel/files/babeld.config deleted file mode 100644 index a4f00e68da..0000000000 --- a/net/babel/files/babeld.config +++ /dev/null @@ -1,72 +0,0 @@ -package babeld - -config general - # option 'multicast_address' 'ff02:0:0:0:0:0:1:6' - # option 'port' '6696' - # option 'state_file' '/var/lib/babel-state' - # option 'hello_interval' '4' - # option 'wired_hello_interval' '20' - # option 'diversity' '0,128' - # option 'smoothing_half_time' '4' - # option 'kernel_priority' '0' - # Do not use this option unless you know what you are doing, as it can - # cause persistent route flapping. - ## option 'duplication_priority' '0' - # option 'carrier_sense' 'false' - # option 'assume_wireless' 'false' - # option 'no_split_horizon' 'false' - # option 'debug' '0' - # Listen for connections from a front-end, e.g. on port 33123. - ## option 'local_server' '33123' - # option 'random_router_id' 'false' - # Keep unfeasible routes - ## option 'keep_unfeasible' 'false' - # Use the given kernel routing table for routes inserted by babeld. - ## option 'export_table' '0' - # Export routes from the given kernel routing tables. - ## list 'import_table' '0' - ## list 'import_table' '42' - # The configuration file is not necessary since you can do everything - # from this file. - # option 'conf_file' '/etc/babeld.conf' - # option 'log_file' '/var/log/babeld.log' - -# You can use aliases (like lan, wlan) or real names (like eth0.0). -# If you use an alias, it must be already defined when babeld starts. -# Otherwise, the name is taken literally and the interface can be -# brought up later (useful for tunnels for instance). -config interface wlan - # Remove this line to enable babeld on this interface - option 'ignore' 'true' - # option 'wired' 'auto' - # option 'link_quality' 'auto' - # option 'split_horizon' 'auto' - # The default is 96 for wired interfaces, and 256 for wireless ones - ## option 'rxcost' '256' - # The default is specified with the -h and -H command-line flags. - ## option 'hello_interval' '4' - # This can be set to a fairly large value, unless significant - # packet loss is expected. The default is four times the hello - # interval. - ## option 'update_interval' '16' - -config interface lan - option 'ignore' 'true' - -# A filter consists in a type ('in', 'out' or 'redistribute'), an action -# ('allow', 'deny' or 'metric xxx') and a set of selectors ('ip', 'eq', -# etc.). See /etc/babeld.conf for more details. -# Here is a sample filter wich redistributes the default route if its -# protocol number is "boot", e.g. when it installed by dhcp. It is -# disabled by default. -config filter - option 'ignore' 'true' - # Type - option 'type' 'redistribute' - # Selectors: ip, eq, le, ge, neigh, id, proto, local, if - option 'ip' '0.0.0.0/0' - option 'le' '0' - option 'proto' '3' - # Action - option 'action' 'metric 128' - diff --git a/net/babel/files/babeld.init b/net/babel/files/babeld.init deleted file mode 100755 index 43514a2ca3..0000000000 --- a/net/babel/files/babeld.init +++ /dev/null @@ -1,144 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=70 - -PID_F='/var/run/babeld.pid' -EXTRA_COMMANDS="status" -EXTRA_HELP=" status Dump Babel's table to the log file." - -listen_ifname() { - local ifname=$(uci_get_state network "$1" ifname "$1") - local switch="$2" - append args "$switch $ifname" - append interfaces "$ifname" -} - -append_ifname() { - local section="$1" - local option="$2" - local switch="$3" - local _name - config_get _name "$section" "$option" - [ -z "$_name" ] && return 0 - local ifname=$(uci_get_state network "$_name" ifname "$_name") - append args "$switch $ifname" -} - -append_bool() { - local section="$1" - local option="$2" - local value="$3" - local _loctmp - config_get_bool _loctmp "$section" "$option" 0 - [ "$_loctmp" -gt 0 ] && append args "$value" -} - -append_switch() { - local value="$1" - local switch="$2" - append args "$switch $value" -} - -append_parm() { - local section="$1" - local option="$2" - local switch="$3" - local _loctmp - config_get _loctmp "$section" "$option" - [ -z "$_loctmp" ] && return 0 - append args "$switch $_loctmp" -} - -babel_filter() { - local cfg="$1" - local _loctmp - - local _ignored - config_get_bool _ignored "$cfg" 'ignore' 0 - [ "$_ignored" -eq 1 ] && return 0 - - append args "-C '" - - append_parm "$cfg" 'type' '' - - append_bool "$cfg" 'local' 'local' - - append_parm "$cfg" 'ip' 'ip' - append_parm "$cfg" 'eq' 'eq' - append_parm "$cfg" 'le' 'le' - append_parm "$cfg" 'ge' 'ge' - append_parm "$cfg" 'neigh' 'neigh' - append_parm "$cfg" 'id' 'id' - append_parm "$cfg" 'proto' 'proto' - - append_ifname "$cfg" 'if' 'if' - - append_parm "$cfg" 'action' '' - - append args ' ' "'" -} - -babel_addif() { - local cfg="$1" - - local _ignored - config_get_bool _ignored "$cfg" 'ignore' 0 - [ "$_ignored" -eq 1 ] && return 0 - - listen_ifname "$cfg" "-C 'interface" - - append_parm "$cfg" 'wired' 'wired' - append_parm "$cfg" 'link_quality' 'link-quality' - append_parm "$cfg" 'split_horizon' 'split-horizon' - append_parm "$cfg" 'rxcost' 'rxcost' - append_parm "$cfg" 'hello_interval' 'hello-interval' - append_parm "$cfg" 'update_interval' 'update-interval' - - append args ' ' "'" -} - -babel_config() { - local cfg="$1" - - append_bool "$cfg" 'carrier_sense' '-l' - append_bool "$cfg" 'assume_wireless' '-w' - append_bool "$cfg" 'no_split_horizon' '-s' - append_bool "$cfg" 'keep_unfeasible' '-u' - append_bool "$cfg" 'random_router_id' '-r' - - append_parm "$cfg" 'multicast_address' '-m' - append_parm "$cfg" 'port' '-p' - append_parm "$cfg" 'state_file' '-S' - append_parm "$cfg" 'hello_interval' '-h' - append_parm "$cfg" 'wired_hello_interval' '-H' - append_parm "$cfg" 'diversity' '-z' - append_parm "$cfg" 'smoothing_half_time' '-M' - append_parm "$cfg" 'kernel_priority' '-k' - append_parm "$cfg" 'duplication_priority' '-A' - append_parm "$cfg" 'debug' '-d' - append_parm "$cfg" 'local_server' '-g' - append_parm "$cfg" 'export_table' '-t' - config_list_foreach "$cfg" 'import_table' append_switch '-T' - append_parm "$cfg" 'conf_file' '-c' - append_parm "$cfg" 'log_file' '-L' -} - -start() { - mkdir -p /var/lib - config_load babeld - unset args - unset interfaces - config_foreach babel_config general - config_foreach babel_addif interface - config_foreach babel_filter filter - [ -z "$interfaces" ] && return 0 - eval "/usr/sbin/babeld -D -I $PID_F $args $interfaces" -} - -stop() { - [ -f $PID_F ] && kill $(cat $PID_F) -} - -status() { - [ -f $PID_F ] && kill -USR1 $(cat $PID_F) -} -- 2.30.2