smcroute: Add package for version 2.0.0.
Nicolás Echániz <nicoechaniz@altermundi.net>
Pau Escrich <pau@dabax.net>
Saverio Proto <zioproto@gmail.com>
-Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
+Simon Wunderlich <sw@simonwunderlich.de>
Steven Barth <cyrus@openwrt.org>
Vasilis "acinonyx" Tsiligiannis <acinonyx@openwrt.gr>
source "$(SOURCE)/Config.in"
endef
+define Package/kmod-batman-adv/conffiles
+/etc/config/batman-adv
+endef
+
MAKE_BATMAN_ADV_ARGS += \
CROSS_COMPILE="$(TARGET_CROSS)" \
KERNELPATH="$(LINUX_DIR)" \
+++ /dev/null
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-# Please note this is not an officially released version of bcp38
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=bcp38
-PKG_VERSION:=4
-PKG_RELEASE:=1
-PKG_LICENSE:=GPL-2.0
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/bcp38
- SECTION:=net
- CATEGORY:=Network
- SUBMENU:=Routing and Redirection
- TITLE:=BCP38 compliance
- URL:=http://www.github.com/dtaht/bcp38
- MAINTAINER:=Dave Taht <d+bcp38@taht.net>
- DEPENDS:=+ipset
-endef
-
-define Package/bcp38/description
- bcp38 implements rfc bcp 38 for home routers.
-endef
-
-define Package/bcp38/conffiles
-/etc/config/bcp38
-endef
-
-define Build/Prepare
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/bcp38/install
- $(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_CONF) ./files/bcp38.config $(1)/etc/config/bcp38
- $(INSTALL_DIR) $(1)/usr/lib/bcp38
- $(INSTALL_BIN) ./files/run.sh $(1)/usr/lib/bcp38/run.sh
- $(INSTALL_DIR) $(1)/etc/uci-defaults
- $(INSTALL_BIN) ./files/bcp38.defaults $(1)/etc/uci-defaults/bcp38
-endef
-
-define Package/bcp38/postinst
-#!/bin/sh
-[ -x /etc/uci-defaults/bcp38 ] && /etc/uci-defaults/bcp38 || exit 0
-endef
-
-define Package/bcp38/postrm
-#!/bin/sh
-uci delete firewall.bcp38
-uci commit
-endef
-
-$(eval $(call BuildPackage,bcp38))
+++ /dev/null
-config bcp38
- option enabled 1
- option interface 'ge00'
- option detect_upstream 1
- list match '127.0.0.0/8'
- list match '0.0.0.0/8' # RFC 1700
- list match '240.0.0.0/4' # RFC 5745
- list match '192.0.2.0/24' # RFC 5737
- list match '198.51.100.0/24' # RFC 5737
- list match '203.0.113.0/24' # RFC 5737
- list match '192.168.0.0/16' # RFC 1918
- list match '10.0.0.0/8' # RFC 1918
- list match '172.16.0.0/12' # RFC 1918
- list match '169.254.0.0/16' # RFC 3927
-
-# list nomatch '172.26.0.0/21' # Example of something not to match
-# There is a dhcp trigger to do this for the netmask of a
-# double natted connection needed
-
-# I will argue that this level of indirection doesn't scale
-# very well - see how to block china as an example
-# http://www.okean.com/china.txt
+++ /dev/null
-#!/bin/sh
-
-uci -q batch <<-EOT
- delete firewall.bcp38
- set firewall.bcp38=include
- set firewall.bcp38.type=script
- set firewall.bcp38.path=/usr/lib/bcp38/run.sh
- set firewall.bcp38.family=IPv4
- set firewall.bcp38.reload=1
- commit firewall
-EOT
-
-exit 0
+++ /dev/null
-#!/bin/sh
-
-STOP=$1
-IPSET_NAME=bcp38-ipv4
-IPTABLES_CHAIN=BCP38
-
-. /lib/functions.sh
-
-config_load bcp38
-
-add_bcp38_rule()
-{
- local subnet="$1"
- local action="$2"
-
- if [ "$action" == "nomatch" ]; then
- ipset add "$IPSET_NAME" "$subnet" nomatch
- else
- ipset add "$IPSET_NAME" "$subnet"
- fi
-}
-
-detect_upstream()
-{
- local interface="$1"
-
- subnets=$(ip route show dev "$interface" | grep 'scope link' | awk '{print $1}')
- for subnet in $subnets; do
- # ipset test doesn't work for subnets, so strip out the subnet part
- # and test for that; add as exception if there's a match
- addr=$(echo $subnet | sed 's|/[0-9]\+$||')
- ipset test "$IPSET_NAME" $addr 2>/dev/null && add_bcp38_rule $subnet nomatch
- done
-}
-
-run() {
- local section="$1"
- local enabled
- local interface
- local detect_upstream
- config_get_bool enabled "$section" enabled 0
- config_get interface "$section" interface
- config_get detect_upstream "$section" detect_upstream
-
- if [ "$enabled" -eq "1" -a -n "$interface" -a -z "$STOP" ] ; then
- setup_ipset
- setup_iptables "$interface"
- config_list_foreach "$section" match add_bcp38_rule match
- config_list_foreach "$section" nomatch add_bcp38_rule nomatch
- [ "$detect_upstream" -eq "1" ] && detect_upstream "$interface"
- fi
- exit 0
-}
-
-setup_ipset()
-{
- ipset create "$IPSET_NAME" hash:net family ipv4
- ipset flush "$IPSET_NAME"
-}
-
-setup_iptables()
-{
- local interface="$1"
- iptables -N "$IPTABLES_CHAIN" 2>/dev/null
- iptables -F "$IPTABLES_CHAIN" 2>/dev/null
-
- iptables -I output_rule -j "$IPTABLES_CHAIN"
- iptables -I input_rule -j "$IPTABLES_CHAIN"
- iptables -I forwarding_rule -j "$IPTABLES_CHAIN"
-
- # always accept DHCP traffic
- iptables -A "$IPTABLES_CHAIN" -p udp --dport 67:68 --sport 67:68 -j RETURN
- iptables -A "$IPTABLES_CHAIN" -o "$interface" -m set --match-set "$IPSET_NAME" dst -j REJECT --reject-with icmp-net-unreachable
- iptables -A "$IPTABLES_CHAIN" -i "$interface" -m set --match-set "$IPSET_NAME" src -j DROP
-}
-
-destroy_ipset()
-{
- ipset flush "$IPSET_NAME" 2>/dev/null
- ipset destroy "$IPSET_NAME" 2>/dev/null
-}
-
-destroy_iptables()
-{
- iptables -D output_rule -j "$IPTABLES_CHAIN" 2>/dev/null
- iptables -D input_rule -j "$IPTABLES_CHAIN" 2>/dev/null
- iptables -D forwarding_rule -j "$IPTABLES_CHAIN" 2>/dev/null
- iptables -F "$IPTABLES_CHAIN" 2>/dev/null
- iptables -X "$IPTABLES_CHAIN" 2>/dev/null
-}
-
-destroy_iptables
-destroy_ipset
-config_foreach run bcp38
-
-exit 0
+++ /dev/null
-#
-# Copyright (C) 2010 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:=luci-app-bcp38
-PKG_VERSION:=2
-PKG_RELEASE:=1
-PKG_LICENSE:=Apache-2.0
-LUCI_DIR:=/usr/lib/lua/luci
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-app-bcp38
- SECTION:=luci
- CATEGORY:=LuCI
- TITLE:=BCP38 LuCI interface
- MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
- PKGARCH:=all
- DEPENDS:= lua luci-base +bcp38
- SUBMENU:=3. Applications
-endef
-
-define Package/luci-app-bcp38/description
- Control BCP38 subnet blocking
-endef
-
-define Build/Compile
-endef
-
-define Build/Configure
-endef
-
-define Package/luci-app-bcp38/install
- $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
- $(INSTALL_DATA) ./files/bcp38-controller.lua $(1)$(LUCI_DIR)/controller/bcp38.lua
- $(INSTALL_DATA) ./files/bcp38-cbi.lua $(1)$(LUCI_DIR)/model/cbi/bcp38.lua
- $(INSTALL_DIR) $(1)/etc/uci-defaults
- $(INSTALL_BIN) ./files/uci-defaults-bcp38 $(1)/etc/uci-defaults/luci-bcp38
-endef
-
-define Package/luci-app-bcp38/postinst
-#!/bin/sh
-[ -x /etc/uci-defaults/luci-bcp38 ] && /etc/uci-defaults/luci-bcp38 || exit 0
-endef
-
-define Package/luci-app-bcp38/postrm
-#!/bin/sh
-uci delete ucitrack.@bcp38[0]
-uci commit
-endef
-
-$(eval $(call BuildPackage,luci-app-bcp38))
+++ /dev/null
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Toke Høiland-Jørgensen <toke@toke.dk>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-local wa = require "luci.tools.webadmin"
-local net = require "luci.model.network".init()
-local ifaces = net:get_interfaces()
-
-m = Map("bcp38", translate("BCP38"),
- translate("This function blocks packets with private address destinations " ..
- "from going out onto the internet as per " ..
- "<a href=\"http://tools.ietf.org/html/bcp38\">BCP 38</a>."))
-
-s = m:section(TypedSection, "bcp38", translate("BCP38 config"))
-s.anonymous = true
--- BASIC
-e = s:option(Flag, "enabled", translate("Enable"))
-e.rmempty = false
-
-a = s:option(Flag, "detect_upstream", translate("Auto-detect upstream IP"),
- translate("Attempt to automatically detect if the upstream IP " ..
- "will be blocked by the configuration, and add an exception if it will. " ..
- "If this does not work correctly, you can add exceptions manually below."))
-a.rmempty = false
-
-n = s:option(ListValue, "interface", translate("Interface name"), translate("Interface to apply the blocking to " ..
- "(should be the upstream WAN interface)."))
-for _, iface in ipairs(ifaces) do
- if iface:is_up() then
- n:value(iface:name())
- end
-end
-n.rmempty = false
-
-ma = s:option(DynamicList, "match",
- translate("Blocked IP ranges"))
-
-ma.datatype = "ip4addr"
-
-nm = s:option(DynamicList, "nomatch",
- translate("Allowed IP ranges"), translate("Takes precedence over blocked ranges. "..
- "Use to whitelist your upstream network if you're behind a double NAT " ..
- "and the auto-detection doesn't work."))
-
-nm.datatype = "ip4addr"
-
-
-return m
+++ /dev/null
-module("luci.controller.bcp38", package.seeall)
-
-function index()
- entry({"admin", "network", "firewall", "bcp38"},
- cbi("bcp38"),
- _("BCP38"), 50).dependent = false
-end
+++ /dev/null
-#!/bin/sh
-
-uci -q batch <<-EOF >/dev/null
- delete ucitrack.@bcp38[-1]
- add ucitrack bcp38
- add_list ucitrack.@bcp38[0].affects=firewall
- commit ucitrack
-EOF
-
-rm -f /tmp/luci-indexcache
-exit 0
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=nat46
-PKG_VERSION:=1
+PKG_VERSION:=2
PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/ayourtch/nat46.git
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=758a02e6f9e4c43553e0fc37d83c286c77febe94
+PKG_SOURCE_VERSION:=5589212cb35527929fd66218721ab54040c6b788
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=GPL-2.0
define Build/Compile
$(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)/nat46/modules" \
MODFLAGS="-DMODULE -mlong-calls" \
+ EXTRA_CFLAGS="-DNAT46_VERSION=\\\"$(PKG_SOURCE_VERSION)\\\"" \
modules
endef