├── LICENSE ├── MAINTAINERS ├── README.md ├── ahcpd ├── Makefile └── files │ ├── ahcpd.config │ └── ahcpd.init ├── alfred ├── Config.in ├── Makefile └── files │ ├── alfred.config │ ├── alfred.init │ └── bat-hosts.lua ├── babel-pinger └── Makefile ├── babeld ├── Makefile ├── files │ ├── babeld.conf │ ├── babeld.config │ └── babeld.init ├── patches │ └── 600-add-ubus.patch └── src │ ├── ubus.c │ └── ubus.h ├── batctl └── Makefile ├── batman-adv ├── Config.in ├── Makefile ├── files │ ├── etc │ │ └── uci-defaults │ │ │ └── 99-migrate-batadv_hardif │ └── lib │ │ └── netifd │ │ └── proto │ │ ├── batadv.sh │ │ ├── batadv_hardif.sh │ │ └── batadv_vlan.sh ├── patches │ ├── 0001-Revert-batman-adv-Migrate-to-linux-container_of.h.patch │ ├── 0002-fix-batadv_is_cfg80211_netdev.patch │ ├── 0003-convert_NETIF_F_LLTX.patch │ └── 0004-convert_NETIF_F_NETNS_LOCAL.patch └── src │ └── compat-hacks.h ├── batmand ├── Makefile ├── files │ └── etc │ │ ├── config │ │ └── batmand │ │ └── init.d │ │ └── batmand └── patches │ └── 0001-Allow-one-to-disable-forking-to-background-in-debug_.patch ├── bird1-openwrt ├── LUCI-DOCUMENTATION.md ├── README.md ├── UCI-DOCUMENTATION.md ├── bird1-ipv4-openwrt │ ├── Makefile │ └── src │ │ ├── config │ │ └── bird4 │ │ ├── controller │ │ └── bird4.lua │ │ ├── init.d │ │ ├── bird4 │ │ └── bird4-lib.sh │ │ ├── model │ │ ├── bgp_proto.lua │ │ ├── filters.lua │ │ ├── functions.lua │ │ ├── gen_proto.lua │ │ ├── overview.lua │ │ └── status.lua │ │ ├── uci-defaults │ │ ├── 99-relocate-filters │ │ └── bird-uci-install-init.d │ │ └── view │ │ ├── log.htm │ │ └── tvalue.htm └── bird1-ipv6-openwrt │ ├── Makefile │ └── src │ ├── config │ └── bird6 │ ├── controller │ └── bird6.lua │ ├── init.d │ ├── bird6 │ └── bird6-lib.sh │ ├── model │ ├── bgp_proto.lua │ ├── filters.lua │ ├── functions.lua │ ├── gen_proto.lua │ ├── overview.lua │ └── status.lua │ ├── uci-defaults │ ├── 99-relocate-filters │ └── bird-uci-install-init.d │ └── view │ ├── log.htm │ └── tvalue.htm ├── bird1 ├── Makefile ├── files │ ├── bird4.conf │ ├── bird4.init │ ├── bird6.conf │ └── bird6.init └── patches │ └── 010-gcc10.patch ├── bird2 ├── Makefile ├── files │ ├── bird.conf │ └── bird.init └── patches │ └── 000-ospf-bus-error.patch ├── bmx6 ├── Makefile ├── files │ └── etc │ │ ├── config │ │ └── bmx6 │ │ └── init.d │ │ └── bmx6 └── patches │ └── 010-siocgstamp.patch ├── bmx7 ├── Makefile ├── files │ └── etc │ │ ├── config │ │ └── bmx7 │ │ └── init.d │ │ └── bmx7 └── patches │ ├── 010-gcc10.patch │ └── 020-siocgstamp.patch ├── cjdns ├── Makefile ├── files │ ├── cjdns.defaults │ ├── cjdns.init │ └── cjdrouteconf ├── lua │ └── cjdns │ │ ├── admin.lua │ │ ├── common.lua │ │ ├── init.lua │ │ ├── uci.lua │ │ └── udp.lua └── patches │ ├── 001-five-mins-builder-zonk.patch │ ├── 020-prefer-python2.patch │ └── 030-fix-invalid-pointer.patch ├── hnetd ├── Makefile ├── files │ ├── hnet.config │ ├── hnetd.defaults │ └── hnetd.init └── patches │ ├── 010-openssl-deprecated.patch │ └── 020-unused.patch ├── luci-app-bmx6 ├── COPYING ├── Makefile ├── bmx6 │ ├── etc │ │ └── config │ │ │ └── luci-bmx6 │ ├── usr │ │ └── lib │ │ │ └── lua │ │ │ └── luci │ │ │ ├── controller │ │ │ └── bmx6.lua │ │ │ ├── model │ │ │ ├── bmx6json.lua │ │ │ └── cbi │ │ │ │ └── bmx6 │ │ │ │ ├── advanced.lua │ │ │ │ ├── hna.lua │ │ │ │ ├── interfaces.lua │ │ │ │ ├── main.lua │ │ │ │ ├── plugins.lua │ │ │ │ └── tunnels.lua │ │ │ └── view │ │ │ ├── admin_status │ │ │ └── index │ │ │ │ └── neighbours_simple.htm │ │ │ └── bmx6 │ │ │ ├── chat.htm │ │ │ ├── error.htm │ │ │ ├── gateways_j.htm │ │ │ ├── graph.htm │ │ │ ├── links.htm │ │ │ ├── nodes_j.htm │ │ │ ├── status_j.htm │ │ │ └── tunnels_j.htm │ └── www │ │ ├── cgi-bin │ │ └── bmx6-info │ │ └── luci-static │ │ └── resources │ │ └── bmx6 │ │ ├── bmx6logo.png │ │ ├── js │ │ ├── bmx6-graph.js │ │ └── polling.js │ │ ├── link.png │ │ ├── style.css │ │ ├── wifi.png │ │ ├── world.png │ │ └── world_small.png ├── dracula │ ├── dracula_graffle.js │ ├── dracula_graph.js │ └── raphael-min.js └── jquery │ └── jquery-1.4.js ├── luci-app-cjdns ├── Makefile ├── files │ └── luci-app-cjdns.json └── luasrc │ ├── controller │ └── cjdns.lua │ ├── model │ └── cbi │ │ └── cjdns │ │ ├── cjdrouteconf.lua │ │ ├── iptunnel.lua │ │ ├── overview.lua │ │ ├── peering.lua │ │ └── settings.lua │ └── view │ ├── admin_status │ └── index │ │ └── cjdns.htm │ └── cjdns │ ├── status.htm │ └── value.htm ├── mcproxy ├── Makefile ├── files │ ├── mcproxy.conf │ ├── mcproxy.config │ └── mcproxy.init └── patches │ ├── 0001-add-cmake.patch │ ├── 0002-rm-stoi.patch │ ├── 0003-add-sourcefilter.patch │ ├── 0004-add-defs.patch │ ├── 0005-fix-match-filter-calls.patch │ ├── 0006-block-ingress.patch │ └── 0007-igmpv2-queries.patch ├── mesh11sd └── Makefile ├── minimalist-pcproxy ├── Makefile └── files │ └── minimalist-pcproxy.defaults ├── naywatch ├── Makefile └── files │ ├── naywatch.config │ ├── naywatch.init │ └── naywatch.sh ├── ndppd ├── Makefile ├── files │ └── ndppd.init └── patches │ ├── 0001-Version-bump.patch │ ├── 0002-Fixes-strerror_r-GNU-XSI.patch │ └── 0003-fix-poll-header.patch ├── nodogsplash └── Makefile ├── ohybridproxy ├── Makefile └── files │ ├── ohybridproxy.config │ ├── ohybridproxy.hotplug │ └── ohybridproxy.init ├── olsrd ├── Makefile ├── files │ ├── olsrd-neigh.sh │ ├── olsrd.config │ ├── olsrd.pud.position.conf │ ├── olsrd.sgw.speed.conf │ ├── olsrd.sh │ ├── olsrd4.init │ ├── olsrd6.config │ ├── olsrd6.init │ └── olsrd_secure_key ├── patches │ ├── 100-rename-avl-to-olsrd_avl.patch │ └── 600-add-ubus-support.patch └── src │ └── src │ ├── ubus.c │ └── ubus.h ├── oonf-dlep-proxy ├── Makefile ├── files │ ├── dlep_proxy.hotplug │ ├── dlep_proxy.init │ └── dlep_proxy.uci └── patches │ └── 010-gcc10.patch ├── oonf-dlep-radio ├── Makefile ├── files │ ├── dlep_radio.hotplug │ ├── dlep_radio.init │ └── dlep_radio.uci └── patches │ └── 010-gcc10.patch ├── oonf-init-scripts ├── Makefile └── files │ ├── oonf_hotplug.sh │ └── oonf_init.sh ├── oonf-olsrd2 ├── Config.in ├── Makefile ├── files │ ├── olsrd2.hotplug │ ├── olsrd2.init │ └── olsrd2.uci └── patches │ ├── 010-gcc10.patch │ └── 020-static.patch ├── opennds └── Makefile ├── pimbd ├── Makefile └── files │ ├── firewall-uci.sh │ ├── pimb.config │ └── pimbd.init ├── prince ├── Makefile ├── files │ ├── prince.conf │ └── prince.init └── patches │ └── 010-gcc10.patch ├── quagga ├── Makefile ├── files │ ├── quagga │ ├── quagga.conf │ └── quagga.init └── patches │ ├── 140-holdtimer-set.patch │ ├── 170-use-supported-pagers.patch │ └── 200-gcc10.patch └── vis ├── Makefile ├── files └── etc │ ├── config │ └── vis │ └── init.d │ └── vis └── patches └── 0001-Allow-one-to-disable-forking-to-background-in-debug_.patch /MAINTAINERS: -------------------------------------------------------------------------------- 1 | # _______ ________ __ 2 | # | |.-----.-----.-----.| | | |.----.| |_ 3 | # | - || _ | -__| || | | || _|| _| 4 | # |_______|| __|_____|__|__||________||__| |____| 5 | # |__| W I R E L E S S F R E E D O M 6 | # 7 | # People listed here are managing the OpenWrt routing feed, 8 | # use alphabetical order when updating the list. 9 | 10 | Axel "axn" Neumann 11 | Baptiste Jonglez 12 | Bastian Bittorf 13 | Corinna "Elektra" Aichele 14 | Gabriel Kerneis 15 | Gui Iribarren 16 | Jo-Philipp Wich 17 | Luka Perkov 18 | Marek Lindner 19 | Moritz Warning 20 | Nicolás Echániz 21 | Pau Escrich 22 | Saverio Proto 23 | Simon Wunderlich 24 | Steven Barth 25 | Vasilis "acinonyx" Tsiligiannis 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenWrt Routing Feed 2 | 3 | ## Description 4 | 5 | This OpenWrt package feed contains community maintained routing packages. 6 | 7 | ## Usage 8 | 9 | 10 | This repository is intended to be layered on-top of an OpenWrt buildroot. 11 | If you do not have an OpenWrt buildroot installed, see the documentation at: 12 | [OpenWrt Buildroot – Installation][1] on the OpenWrt support site. 13 | 14 | This feed is enabled by default. To install all its package definitions, run: 15 | 16 | ``` 17 | ./scripts/feeds update routing 18 | ./scripts/feeds install -a -p routing 19 | ``` 20 | 21 | [1]: https://openwrt.org/docs/guide-developer/build-system/install-buildsystem 22 | -------------------------------------------------------------------------------- /ahcpd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2007-2011 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | 8 | include $(TOPDIR)/rules.mk 9 | 10 | PKG_NAME:=ahcpd 11 | PKG_VERSION:=0.53 12 | PKG_RELEASE:=3 13 | 14 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 15 | PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/ 16 | PKG_HASH:=a4622e817d2b2a9b878653f085585bd57f3838cc546cca6028d3b73ffcac0d52 17 | 18 | PKG_MAINTAINER:=Gabriel Kerneis 19 | PKG_LICENSE:=MIT 20 | PKG_LICENSE_FILES:=LICENCE 21 | 22 | include $(INCLUDE_DIR)/package.mk 23 | 24 | define Package/ahcpd 25 | SECTION:=net 26 | CATEGORY:=Network 27 | TITLE:=Ad-Hoc Configuration Protocol daemon 28 | URL:=https://www.irif.fr/~jch/software/ahcp/ 29 | DEPENDS:=@IPV6 +ip +librt 30 | endef 31 | 32 | define Package/ahcpd/description 33 | Ahcpd is a daemon for configuring an IPv6 network using the Ad-Hoc 34 | Configuration Protocol (AHCP). AHCP is designed for wireless mesh 35 | networks, where IPv6 autoconfiguration and DHCPv6 do not work, but may 36 | also be used on wired networks. 37 | endef 38 | 39 | define Package/ahcpd/conffiles 40 | /etc/config/ahcpd 41 | endef 42 | 43 | MAKE_FLAGS += \ 44 | EXTRA_DEFINES="$(TARGET_CFLAGS)" 45 | 46 | define Package/ahcpd/install 47 | $(INSTALL_DIR) $(1)/usr/bin 48 | $(INSTALL_DIR) $(1)/etc/ahcp 49 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcp-config.sh $(1)/etc/ahcp/ 50 | $(INSTALL_DIR) $(1)/usr/sbin 51 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcpd $(1)/usr/sbin/ 52 | $(INSTALL_DIR) $(1)/etc/config 53 | $(INSTALL_CONF) ./files/ahcpd.config $(1)/etc/config/ahcpd 54 | $(INSTALL_DIR) $(1)/etc/init.d 55 | $(INSTALL_BIN) ./files/ahcpd.init $(1)/etc/init.d/ahcpd 56 | endef 57 | 58 | $(eval $(call BuildPackage,ahcpd)) 59 | -------------------------------------------------------------------------------- /ahcpd/files/ahcpd.config: -------------------------------------------------------------------------------- 1 | package ahcpd 2 | 3 | config ahcpd 4 | # Choose ahcp mode: client (default), server or forwarder 5 | ## option 'mode' 'client' 6 | # Uncomment the following lines to enable ahcpd on the desired 7 | # interfaces. 8 | ## list 'interface' 'lan' 9 | ## list 'interface' 'wlan' 10 | 11 | # The following only makes sense in 'server' mode. 12 | # Tweak to suit your needs. 13 | ## list 'prefix' 'fde6:20f5:c9ac:358::/64' 14 | ## list 'prefix' '192.168.4.128/25' 15 | ## list 'name_server' 'fde6:20f5:c9ac:358::1' 16 | ## list 'name_server' '192.168.4.1' 17 | ## list 'ntp_server' '192.168.4.2' 18 | ## option 'lease_dir' '/var/lib/leases' 19 | 20 | # option 'id_file' '/var/lib/ahcp-unique-id' 21 | # option 'log_file' '/var/log/ahcpd.log' 22 | # The configuration file is not necessary since you can configure 23 | # everything from this file. But still, you might prefer using it. 24 | ## option 'conf_file' '/etc/ahcp/ahcp.conf' 25 | 26 | # option 'multicast_address' 'ff02::cca6:c0f9:e182:5359' 27 | # option 'port' '5359' 28 | # option 'ipv4_only' 'false' 29 | # option 'ipv6_only' 'false' 30 | # option 'lease_time' '3666' 31 | # option 'debug' '1' 32 | 33 | -------------------------------------------------------------------------------- /ahcpd/files/ahcpd.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2007-2011 OpenWrt.org 3 | 4 | START=71 5 | 6 | SERVICE_USE_PID=1 7 | 8 | EXTRA_COMMANDS="status" 9 | EXTRA_HELP=" status Print ahcpd's status to the log file." 10 | 11 | append_bool() { 12 | local section="$1" 13 | local option="$2" 14 | local value="$3" 15 | local _loctmp 16 | config_get_bool _loctmp "$section" "$option" 0 17 | [ "$_loctmp" -gt 0 ] && append args "$value" 18 | } 19 | 20 | append_parm() { 21 | local section="$1" 22 | local option="$2" 23 | local switch="$3" 24 | local _loctmp 25 | config_get _loctmp "$section" "$option" 26 | [ -z "$_loctmp" ] && return 0 27 | append args "$switch $_loctmp" 28 | } 29 | 30 | append_stmt() { 31 | local name="$1" 32 | local switch="$2" 33 | append args "-C '$switch $name'" 34 | } 35 | 36 | append_opt_stmt() { 37 | local section="$1" 38 | local option="$2" 39 | local switch="$3" 40 | local _loctmp 41 | config_get _loctmp "$section" "$option" 42 | [ -z "$_loctmp" ] && return 0 43 | append args "-C '$switch $_loctmp'" 44 | } 45 | 46 | ahcp_addif() { 47 | local ifname=$(uci_get_state network "$1" ifname "$1") 48 | append interfaces "$ifname" 49 | } 50 | 51 | ahcp_server() { 52 | local cfg="$1" 53 | 54 | append_opt_stmt "$cfg" 'mode' 'mode' 55 | append_opt_stmt "$cfg" 'lease_dir' 'lease-dir' 56 | config_list_foreach "$cfg" 'prefix' append_stmt 'prefix' 57 | config_list_foreach "$cfg" 'name_server' append_stmt 'name-server' 58 | config_list_foreach "$cfg" 'ntp_server' append_stmt 'ntp-server' 59 | 60 | append_parm "$cfg" 'id_file' '-i' 61 | append_parm "$cfg" 'log_file' '-L' 62 | } 63 | 64 | ahcp_config() { 65 | local cfg="$1" 66 | local interface 67 | local _loctmp 68 | 69 | config_list_foreach "$cfg" 'interface' ahcp_addif 70 | 71 | # Add interfaces with "option proto ahcp" in /etc/config/network 72 | # (only for client mode) 73 | config_get _loctmp "$cfg" "mode" 74 | if [ -z "$_loctmp" -o "$_loctmp" = "client" ]; then 75 | for interface in $(uci -P /var/state show network|grep proto=ahcp|cut -d. -f2); do 76 | ahcp_addif $interface 77 | done 78 | fi 79 | 80 | append_bool "$cfg" 'ipv4_only' '-4' 81 | append_bool "$cfg" 'ipv6_only' '-6' 82 | append_bool "$cfg" 'no_dns' '-N' 83 | 84 | append_parm "$cfg" 'multicast_address' '-m' 85 | append_parm "$cfg" 'port' '-p' 86 | append_parm "$cfg" 'lease_time' '-t' 87 | append_parm "$cfg" 'debug' '-d' 88 | append_parm "$cfg" 'conf_file' '-c' 89 | append_parm "$cfg" 'script' '-s' 90 | } 91 | 92 | start() { 93 | mkdir -p /var/lib 94 | config_load ahcpd 95 | unset args 96 | unset interfaces 97 | config_foreach ahcp_config ahcpd 98 | config_foreach ahcp_server ahcpd 99 | [ -z "$interfaces" ] && return 0 100 | eval "service_start /usr/sbin/ahcpd -D $args $interfaces" 101 | } 102 | 103 | stop() { 104 | service_stop /usr/sbin/ahcpd 105 | } 106 | 107 | status() { 108 | SERVICE_SIG="USR1" service_signal /usr/sbin/ahcpd 109 | } 110 | -------------------------------------------------------------------------------- /alfred/Config.in: -------------------------------------------------------------------------------- 1 | config ALFRED_NEEDS_lua 2 | bool 3 | 4 | config ALFRED_NEEDS_libgps 5 | bool 6 | 7 | config PACKAGE_ALFRED_VIS 8 | bool "enable vis server for alfred" 9 | depends on PACKAGE_alfred 10 | default y 11 | 12 | config PACKAGE_ALFRED_BATHOSTS 13 | bool "enable autogeneration of /etc/bat-hosts" 14 | depends on PACKAGE_alfred 15 | select ALFRED_NEEDS_lua 16 | default n 17 | 18 | config PACKAGE_ALFRED_GPSD 19 | bool "enable gpsd service for alfred" 20 | depends on PACKAGE_alfred 21 | select ALFRED_NEEDS_libgps 22 | default n 23 | -------------------------------------------------------------------------------- /alfred/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | 3 | include $(TOPDIR)/rules.mk 4 | 5 | PKG_NAME:=alfred 6 | PKG_VERSION:=2022.0 7 | PKG_RELEASE:=$(AUTORELEASE) 8 | 9 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 10 | PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) 11 | PKG_HASH:=abba1dac61eccfcd6329e7331d0555fecc937760fb36c6cf55ce6c1d751cfd98 12 | 13 | PKG_MAINTAINER:=Simon Wunderlich 14 | PKG_LICENSE:=GPL-2.0-only MIT 15 | PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT 16 | 17 | PKG_BUILD_PARALLEL:=1 18 | 19 | include $(INCLUDE_DIR)/package.mk 20 | 21 | define Package/alfred 22 | SECTION:=net 23 | CATEGORY:=Network 24 | TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon 25 | URL:=https://www.open-mesh.org/ 26 | DEPENDS:= +libc @IPV6 +libnl-tiny +librt \ 27 | +ALFRED_NEEDS_lua:lua \ 28 | +ALFRED_NEEDS_libgps:libgps 29 | endef 30 | 31 | define Package/alfred/description 32 | alfred is a user space daemon for distributing arbitrary local information 33 | over the mesh/network in a decentralized fashion. This data can be anything 34 | which appears to be useful - originally designed to replace the batman-adv 35 | visualization (vis), you may distribute hostnames, phone books, administration 36 | information, DNS information, the local weather forecast ... 37 | 38 | alfred runs as daemon in the background of the system. A user may insert 39 | information by using the alfred binary on the command line, or use special 40 | programs to communicate with alfred (done via unix sockets). alfred then takes 41 | care of distributing the local information to other alfred servers on other 42 | nodes. This is done via IPv6 link-local multicast, and does not require any 43 | configuration. A user can request data from alfred, and will receive the 44 | information available from all alfred servers in the network. 45 | endef 46 | 47 | define Package/alfred/conffiles 48 | /etc/config/alfred 49 | endef 50 | 51 | define Package/alfred/config 52 | source "$(SOURCE)/Config.in" 53 | endef 54 | 55 | MAKE_FLAGS += \ 56 | CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n) \ 57 | CONFIG_ALFRED_GPSD=$(if $(CONFIG_PACKAGE_ALFRED_GPSD),y,n) \ 58 | CONFIG_ALFRED_CAPABILITIES=n \ 59 | LIBNL_NAME="libnl-tiny" \ 60 | LIBNL_GENL_NAME="libnl-tiny" \ 61 | REVISION="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)" 62 | 63 | TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto 64 | TARGET_LDFLAGS += -Wl,--gc-sections -fuse-linker-plugin 65 | 66 | define Package/alfred/install 67 | $(INSTALL_DIR) $(1)/usr/sbin 68 | cp -fpR $(PKG_BUILD_DIR)/alfred $(1)/usr/sbin/ 69 | [ "x$(CONFIG_PACKAGE_ALFRED_VIS)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/vis/batadv-vis $(1)/usr/sbin/ ; true 70 | [ "x$(CONFIG_PACKAGE_ALFRED_GPSD)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/gpsd/alfred-gpsd $(1)/usr/sbin/ ; true 71 | $(INSTALL_DIR) $(1)/etc/init.d 72 | $(INSTALL_BIN) ./files/alfred.init $(1)/etc/init.d/alfred 73 | $(INSTALL_DIR) $(1)/etc/config 74 | $(INSTALL_DATA) ./files/alfred.config $(1)/etc/config/alfred 75 | $(INSTALL_DIR) $(1)/etc/alfred 76 | [ "x$(CONFIG_PACKAGE_ALFRED_BATHOSTS)" == "xy" ] && $(INSTALL_BIN) ./files/bat-hosts.lua $(1)/etc/alfred/bat-hosts.lua ; true 77 | endef 78 | 79 | $(eval $(call BuildPackage,alfred)) 80 | -------------------------------------------------------------------------------- /alfred/files/alfred.config: -------------------------------------------------------------------------------- 1 | config 'alfred' 'alfred' 2 | list interface 'br-lan' 3 | option mode 'master' 4 | option batmanif 'bat0' 5 | option start_vis '1' 6 | option run_facters '1' 7 | # REMOVE THIS LINE TO ENABLE ALFRED 8 | option disabled '1' 9 | -------------------------------------------------------------------------------- /alfred/files/alfred.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | 8 | START=99 9 | USE_PROCD=1 10 | alfred_args="" 11 | vis_args="" 12 | facters_dir="/etc/alfred" 13 | enable=0 14 | vis_enable=0 15 | 16 | append_interface() 17 | { 18 | append "interfaces" "$1" "," 19 | } 20 | 21 | alfred_start() { 22 | local args="" 23 | local section="$1" 24 | local disabled interface mode 25 | local interfaces 26 | 27 | # check if section is disabled 28 | config_get_bool disabled "$section" disabled 0 29 | [ $disabled = 0 ] || return 1 30 | 31 | args="-f" 32 | 33 | config_list_foreach "$section" "interface" append_interface 34 | if [ -z "$interfaces" ]; then 35 | config_get interface "$section" interface 36 | append_interface "$interface" 37 | fi 38 | append args "-i $interfaces" 39 | 40 | config_get mode "$section" mode 41 | [ "$mode" = "master" ] && append args "-m" 42 | 43 | config_get batmanif "$section" batmanif 44 | append args "-b $batmanif" 45 | 46 | append alfred_args "$args" 47 | enable=1 48 | 49 | config_get_bool start_vis "$section" start_vis 0 50 | if [ "$start_vis" = 1 ] && [ -x /usr/sbin/batadv-vis ]; then 51 | vis_enable=1 52 | append vis_args "-i $batmanif -s" 53 | fi 54 | 55 | config_get_bool run_facters "$section" run_facters 0 56 | 57 | return 0 58 | } 59 | 60 | start_service() { 61 | config_load "alfred" 62 | config_foreach alfred_start alfred 63 | 64 | [ "$enable" = "0" ] && return 0 65 | 66 | procd_open_instance "alfred" 67 | procd_set_param command /usr/sbin/alfred 68 | procd_append_param command ${alfred_args} 69 | procd_close_instance 70 | 71 | [ "$vis_enable" = "1" ] && { 72 | procd_open_instance "batadv-vis" 73 | procd_set_param command /usr/sbin/batadv-vis 74 | procd_append_param command ${vis_args} 75 | procd_close_instance 76 | } 77 | 78 | [ "$run_facters" = "1" ] && { 79 | ( for file in $facters_dir/* ; do [ -x $file ] && $file ; done ) 80 | if ! ( grep -q "for file in $facters_dir/\* ; do " /etc/crontabs/root 2>/dev/null ) ; then 81 | echo "*/5 * * * * ( for file in $facters_dir/* ; do [ -x \$file ] && \$file ; done )" >> /etc/crontabs/root 82 | /etc/init.d/cron enable 83 | /etc/init.d/cron restart 84 | fi 85 | } 86 | } 87 | 88 | service_triggers() { 89 | procd_add_reload_trigger "alfred" 90 | } 91 | 92 | stop_service() { 93 | [ -e /etc/crontabs/root ] && { 94 | sed "\|for file in $facters_dir/\* ; do |d" -i /etc/crontabs/root 95 | /etc/init.d/cron restart 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /babel-pinger/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012-2014 OpenWrt.org 2 | # 3 | # This is free software, licensed under the GNU General Public License v2. 4 | 5 | include $(TOPDIR)/rules.mk 6 | 7 | PKG_NAME:=babel-pinger 8 | PKG_VERSION:=0.1 9 | PKG_RELEASE:=1 10 | 11 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 12 | PKG_SOURCE_URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/files/ 13 | PKG_HASH:=c411430bb102f08d3d68d2fb5010b5da0149908b671ac0fb12abd8c8ee6380c5 14 | 15 | include $(INCLUDE_DIR)/package.mk 16 | 17 | define Package/babel-pinger 18 | SECTION:=net 19 | CATEGORY:=Network 20 | SUBMENU:=Routing and Redirection 21 | TITLE:=Babel-pinger 22 | URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/babel/ 23 | MAINTAINER:=Gabriel Kerneis 24 | DEPENDS:=+librt 25 | endef 26 | 27 | define Package/babel-pinger/description 28 | Babel-pinger is a hack to export a default route into Babel for people 29 | using DHCP to configure their routers rather than speaking to their 30 | upstream provider with a proper routing protocol. 31 | endef 32 | 33 | MAKE_FLAGS+= \ 34 | CFLAGS="$(TARGET_CFLAGS)" \ 35 | 36 | define Package/babel-pinger/install 37 | $(INSTALL_DIR) $(1)/usr/sbin 38 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/babel-pinger $(1)/usr/sbin/ 39 | endef 40 | 41 | $(eval $(call BuildPackage,babel-pinger)) 42 | -------------------------------------------------------------------------------- /babeld/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-or-later 2 | # 3 | # Copyright (C) 2007-2021 OpenWrt.org 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | PKG_NAME:=babeld 9 | PKG_VERSION:=1.11 10 | PKG_RELEASE:=$(AUTORELEASE) 11 | 12 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 13 | PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/ 14 | PKG_HASH:=99315aeaf2ea207f177c16855ffa34fc354af1b5988c070e0f2fca3a0d4d0fa5 15 | 16 | PKG_MAINTAINER:=Gabriel Kerneis , \ 17 | Baptiste Jonglez , \ 18 | Nick Hainke 19 | PKG_LICENSE:=MIT 20 | PKG_LICENSE_FILES:=LICENCE 21 | 22 | include $(INCLUDE_DIR)/package.mk 23 | 24 | define Package/babeld 25 | SECTION:=net 26 | CATEGORY:=Network 27 | SUBMENU:=Routing and Redirection 28 | TITLE:=A loop-avoiding distance-vector routing protocol 29 | URL:=https://www.irif.fr/~jch/software/babel/ 30 | DEPENDS:=@IPV6 +libubus +libubox 31 | endef 32 | 33 | define Package/babeld/description 34 | Babel is a loop-avoiding distance-vector routing protocol for IPv6 and IPv4 35 | with fast convergence properties. It is based on the ideas in DSDV, AODV and 36 | Cisco's EIGRP, but is designed to work well not only in wired networks but 37 | also in wireless mesh networks, and has been extended with support for 38 | overlay networks. Babel is in the process of becoming an IETF Standard. 39 | endef 40 | 41 | define Package/babeld/conffiles 42 | /etc/babeld.conf 43 | /etc/config/babeld 44 | endef 45 | 46 | MAKE_FLAGS+= \ 47 | CFLAGS="$(TARGET_CFLAGS)" \ 48 | LDLIBS="" \ 49 | LDLIBS+="-lubus -lubox" 50 | 51 | define Package/babeld/install 52 | $(INSTALL_DIR) $(1)/usr/sbin 53 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/babeld $(1)/usr/sbin/ 54 | $(INSTALL_DIR) $(1)/etc 55 | $(INSTALL_CONF) ./files/babeld.conf $(1)/etc/ 56 | $(INSTALL_DIR) $(1)/etc/config 57 | $(INSTALL_CONF) ./files/babeld.config $(1)/etc/config/babeld 58 | $(INSTALL_DIR) $(1)/etc/init.d 59 | $(INSTALL_BIN) ./files/babeld.init $(1)/etc/init.d/babeld 60 | endef 61 | 62 | $(eval $(call BuildPackage,babeld)) 63 | -------------------------------------------------------------------------------- /babeld/files/babeld.conf: -------------------------------------------------------------------------------- 1 | # babel config file 2 | # 3 | # This config file simply documents sample entries. 4 | # "redistribute" means: redistribute routes from other routing protocols 5 | # into babel. "local" means addresses assigned to local interfaces. 6 | # 7 | # You do not need to edit this file: you can use /etc/config/babeld 8 | # instead (sections "interface" and "filter"). Both files can be used 9 | # simultaneously (the rules of this file are executed first). 10 | 11 | # the default rules are: 12 | # 13 | ## redistribute local 14 | ## redistribute deny 15 | # 16 | # this says, redistribute local addresses but no other routes 17 | 18 | 19 | # redistribute IPv4 default route into babel 20 | ## redistribute local ip 0.0.0.0/0 le 0 metric 128 21 | 22 | # same but for IPv6 23 | ## redistribute local ip ::/0 le 0 metric 128 24 | 25 | 26 | # don't redistribute all local addresses, only selected ones 27 | # after the first line, the "deny" rules kicks in. After the "deny" 28 | # no redistribute local rules are going to match 29 | ## redistribute local ip 192.160.4.0/24 30 | ## redistribute local deny 31 | 32 | 33 | # Babel refuses to redistribute routes with a protocol number of "boot"; 34 | # this is standard practice, and means that you cannot easily 35 | # redistribute the default route installed by dhcp. It is however 36 | # possible to redistribute such route by explicitly specifying "proto 3" 37 | # on the redistribute line. 38 | ## redistribute ip 0.0.0.0/0 le 0 proto 3 metric 128 39 | -------------------------------------------------------------------------------- /babeld/src/ubus.h: -------------------------------------------------------------------------------- 1 | /* 2 | IPC integration of babeld with OpenWrt. 3 | 4 | The ubus interface offers following functions: 5 | - add_filter '{"ifname":"eth0", "type":0, "metric":5000}' 6 | type: 7 | 0: FILTER_TYPE_INPUT 8 | 1: FILTER_TYPE_OUTPUT 9 | 2: FILTER_TYPE_REDISTRIBUTE 10 | 3: FILTER_TYPE_INSTALL 11 | - add_interface '{"ifname":"eth0"}' 12 | - get_info 13 | - get_neighbours 14 | - get_xroutes 15 | - get_routes 16 | 17 | All output is divided into IPv4 and IPv6. 18 | 19 | Ubus notifications are sent if we receive updates for 20 | - xroutes 21 | - routes 22 | - neighbours 23 | 24 | The format is: 25 | - {route,xroute,neighbour}.add: Object was added 26 | - {route,xroute,neighbour}.change: Object was changed 27 | - {route,xroute,neighbour}.flush: Object was flushed 28 | 29 | */ 30 | 31 | #include 32 | #include 33 | 34 | struct babel_route; 35 | struct neighbour; 36 | struct xroute; 37 | 38 | // Whether to enable ubus bindings (boolean option). 39 | extern int ubus_bindings; 40 | 41 | /** 42 | * Initialize ubus interface. 43 | * 44 | * Connect to the ubus daemon and expose the ubus functions. 45 | * 46 | * @return if initializing ubus was successful 47 | */ 48 | bool babeld_add_ubus(); 49 | 50 | /** 51 | * Add ubus socket to given filedescriptor set. 52 | * 53 | * We need to check repeatedly if the ubus socket has something to read. 54 | * The functions allows to add the ubus socket to the normal while(1)-loop of 55 | * babeld. 56 | * 57 | * @param readfs: the filedescriptor set 58 | * @param maxfd: the current maximum file descriptor 59 | * @return the maximum file descriptor 60 | */ 61 | int babeld_ubus_add_read_sock(fd_set *readfds, int maxfd); 62 | 63 | /** 64 | * Check and process ubus socket. 65 | * 66 | * If the ubus-socket signals that data is available, the ubus_handle_event is 67 | * called. 68 | */ 69 | void babeld_ubus_receive(fd_set *readfds); 70 | 71 | /*** 72 | * Notify the ubus bus that a new xroute is received. 73 | * 74 | * If a new xroute is received or changed, we will notify subscribers. 75 | * 76 | * @param xroute: xroute that experienced some change 77 | * @param kind: kind that describes if we have a flush, add or change 78 | */ 79 | void ubus_notify_xroute(struct xroute *xroute, int kind); 80 | 81 | /*** 82 | * Notify the ubus bus that a new route is received. 83 | * 84 | * If a new route is received or changed, we will notify subscribers. 85 | * 86 | * @param route: route that experienced some change 87 | * @param kind: kind that describes if we have a flush, add or change 88 | */ 89 | void ubus_notify_route(struct babel_route *route, int kind); 90 | 91 | /*** 92 | * Notify the ubus bus that a new neighbour is received. 93 | * 94 | * If a new neighbour is received or changed, we will notify subscribers. 95 | * 96 | * @param neigh: neighbour that experienced some change 97 | * @param kind: kind that describes if we have a flush, add or change 98 | */ 99 | void ubus_notify_neighbour(struct neighbour *neigh, int kind); 100 | -------------------------------------------------------------------------------- /batman-adv/files/lib/netifd/proto/batadv_hardif.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | [ -n "$INCLUDE_ONLY" ] || { 4 | . /lib/functions.sh 5 | . ../netifd-proto.sh 6 | init_proto "$@" 7 | } 8 | 9 | proto_batadv_hardif_init_config() { 10 | proto_config_add_int 'elp_interval' 11 | proto_config_add_int 'hop_penalty' 12 | proto_config_add_string "master" 13 | proto_config_add_string 'throughput_override' 14 | } 15 | 16 | proto_batadv_hardif_setup() { 17 | local config="$1" 18 | local iface="$2" 19 | 20 | local elp_interval 21 | local hop_penalty 22 | local master 23 | local throughput_override 24 | 25 | json_get_vars elp_interval 26 | json_get_vars hop_penalty 27 | json_get_vars master 28 | json_get_vars throughput_override 29 | 30 | ( proto_add_host_dependency "$config" '' "$master" ) 31 | 32 | batctl meshif "$master" interface -M add "$iface" 33 | 34 | [ -n "$elp_interval" ] && batctl hardif "$iface" elp_interval "$elp_interval" 35 | [ -n "$hop_penalty" ] && batctl hardif "$iface" hop_penalty "$hop_penalty" 36 | [ -n "$throughput_override" ] && batctl hardif "$iface" throughput_override "$throughput_override" 37 | 38 | proto_init_update "$iface" 1 39 | proto_send_update "$config" 40 | } 41 | 42 | proto_batadv_hardif_teardown() { 43 | local config="$1" 44 | local iface="$2" 45 | 46 | local master 47 | 48 | json_get_vars master 49 | 50 | batctl meshif "$master" interface -M del "$iface" || true 51 | } 52 | 53 | add_protocol batadv_hardif 54 | -------------------------------------------------------------------------------- /batman-adv/files/lib/netifd/proto/batadv_vlan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /lib/functions.sh 4 | . ../netifd-proto.sh 5 | init_proto "$@" 6 | 7 | proto_batadv_vlan_init_config() { 8 | proto_config_add_boolean 'ap_isolation:bool' 9 | } 10 | 11 | proto_batadv_vlan_setup() { 12 | local config="$1" 13 | local iface="$2" 14 | 15 | # batadv_vlan options 16 | local ap_isolation 17 | 18 | json_get_vars ap_isolation 19 | 20 | [ -n "$ap_isolation" ] && batctl vlan "$iface" ap_isolation "$ap_isolation" 21 | proto_init_update "$iface" 1 22 | proto_send_update "$config" 23 | } 24 | 25 | add_protocol batadv_vlan 26 | -------------------------------------------------------------------------------- /batman-adv/patches/0002-fix-batadv_is_cfg80211_netdev.patch: -------------------------------------------------------------------------------- 1 | From: Alexandru Gagniuc 2 | Date: Thu, 6 Apr 2023 18:05:50 -0500 3 | Subject: fix batadv_is_cfg80211_netdev 4 | 5 | Replace CONFIG_CFG80211 with CPTCFG_CFG80211, which is the correct 6 | macro to use when building under backports. 7 | 8 | --- a/net/batman-adv/hard-interface.c 9 | +++ b/net/batman-adv/hard-interface.c 10 | @@ -308,8 +308,7 @@ static bool batadv_is_cfg80211_netdev(st 11 | { 12 | if (!net_device) 13 | return false; 14 | - 15 | -#if IS_ENABLED(CONFIG_CFG80211) 16 | +#if IS_ENABLED(CPTCFG_CFG80211) 17 | /* cfg80211 drivers have to set ieee80211_ptr */ 18 | if (net_device->ieee80211_ptr) 19 | return true; 20 | -------------------------------------------------------------------------------- /batman-adv/patches/0003-convert_NETIF_F_LLTX.patch: -------------------------------------------------------------------------------- 1 | From b6d2c16d1a5f90e1aff1ca55d73ba4e7be03c2a0 Mon Sep 17 00:00:00 2001 2 | From: Alexander Lobakin 3 | Date: Thu, 29 Aug 2024 14:33:37 +0200 4 | Subject: [PATCH] batman-adv: convert NETIF_F_LLTX to dev->lltx 5 | 6 | NETIF_F_LLTX can't be changed via Ethtool and is not a feature, 7 | rather an attribute, very similar to IFF_NO_QUEUE (and hot). 8 | Free one netdev_features_t bit and make it a "hot" private flag. 9 | 10 | Signed-off-by: Alexander Lobakin 11 | Signed-off-by: Paolo Abeni 12 | [sven@narfation.org: add compat code] 13 | Signed-off-by: Sven Eckelmann 14 | --- 15 | net/batman-adv/soft-interface.c | 6 +++++- 16 | 1 file changed, 5 insertions(+), 1 deletion(-) 17 | 18 | diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c 19 | index 30ecbc2e..48cf3bd9 100644 20 | --- a/net/batman-adv/soft-interface.c 21 | +++ b/net/batman-adv/soft-interface.c 22 | @@ -1021,8 +1021,12 @@ static void batadv_softif_init_early(struct net_device *dev) 23 | dev->needs_free_netdev = true; 24 | dev->priv_destructor = batadv_softif_free; 25 | dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_NETNS_LOCAL; 26 | - dev->features |= NETIF_F_LLTX; 27 | dev->priv_flags |= IFF_NO_QUEUE; 28 | +#if LINUX_VERSION_IS_GEQ(6, 12, 0) // UGLY_HACK_NEW 29 | + dev->lltx = true; 30 | +#else // UGLY_HACK_OLD 31 | + dev->features |= NETIF_F_LLTX; 32 | +#endif // UGLY_HACK_STOP 33 | 34 | /* can't call min_mtu, because the needed variables 35 | * have not been initialized yet 36 | -------------------------------------------------------------------------------- /batman-adv/patches/0004-convert_NETIF_F_NETNS_LOCAL.patch: -------------------------------------------------------------------------------- 1 | From b0405a97957978a0aa46dde55d590e1cf0f4309e Mon Sep 17 00:00:00 2001 2 | From: Alexander Lobakin 3 | Date: Thu, 29 Aug 2024 14:33:38 +0200 4 | Subject: [PATCH] batman-adv: convert NETIF_F_NETNS_LOCAL to dev->netns_local 5 | 6 | "Interface can't change network namespaces" is rather an attribute, 7 | not a feature, and it can't be changed via Ethtool. 8 | Make it a "cold" private flag instead of a netdev_feature and free 9 | one more bit. 10 | 11 | Signed-off-by: Alexander Lobakin 12 | Signed-off-by: Paolo Abeni 13 | [sven@narfation.org: add compat code] 14 | Signed-off-by: Sven Eckelmann 15 | --- 16 | net/batman-adv/soft-interface.c | 5 +++-- 17 | 1 file changed, 3 insertions(+), 2 deletions(-) 18 | 19 | diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c 20 | index 48cf3bd9..610bbaaa 100644 21 | --- a/net/batman-adv/soft-interface.c 22 | +++ b/net/batman-adv/soft-interface.c 23 | @@ -1020,12 +1020,13 @@ static void batadv_softif_init_early(struct net_device *dev) 24 | dev->netdev_ops = &batadv_netdev_ops; 25 | dev->needs_free_netdev = true; 26 | dev->priv_destructor = batadv_softif_free; 27 | - dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_NETNS_LOCAL; 28 | + dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; 29 | dev->priv_flags |= IFF_NO_QUEUE; 30 | #if LINUX_VERSION_IS_GEQ(6, 12, 0) // UGLY_HACK_NEW 31 | dev->lltx = true; 32 | + dev->netns_local = true; 33 | #else // UGLY_HACK_OLD 34 | - dev->features |= NETIF_F_LLTX; 35 | + dev->features |= NETIF_F_LLTX | NETIF_F_NETNS_LOCAL; 36 | #endif // UGLY_HACK_STOP 37 | 38 | /* can't call min_mtu, because the needed variables 39 | -------------------------------------------------------------------------------- /batmand/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2008-2011 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | 8 | include $(TOPDIR)/rules.mk 9 | 10 | PKG_NAME:=batmand 11 | 12 | PKG_SOURCE_PROTO:=git 13 | PKG_SOURCE_URL:=https://git.open-mesh.org/batmand.git 14 | PKG_REV:=b67a7087b51d7a5e90d27ac39116d1f57257c86e 15 | PKG_VERSION:=1440 16 | PKG_RELEASE:=1 17 | PKG_LICENSE:=GPL-2.0 18 | 19 | PKG_SOURCE_VERSION:=$(PKG_REV) 20 | PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) 21 | PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz 22 | PKG_MIRROR_HASH:=ceb8e0e399f79b1b663594fcf9642e1efc40e696a7604daf709c77da9b6ec52f 23 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) 24 | 25 | PKG_BUILD_PARALLEL:=1 26 | 27 | include $(INCLUDE_DIR)/package.mk 28 | 29 | define Package/batmand 30 | URL:=https://www.open-mesh.org/ 31 | MAINTAINER:=Corinna "Elektra" Aichele 32 | SECTION:=net 33 | CATEGORY:=Network 34 | SUBMENU:=Routing and Redirection 35 | DEPENDS:=+libpthread +kmod-tun 36 | TITLE:=B.A.T.M.A.N. layer 3 routing daemon 37 | endef 38 | 39 | define Package/batmand/description 40 | B.A.T.M.A.N. layer 3 routing daemon 41 | endef 42 | 43 | MAKE_FLAGS += \ 44 | EXTRA_CFLAGS='-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE' \ 45 | REVISION="$(PKG_REV)" \ 46 | CC="$(TARGET_CC)" \ 47 | UNAME="Linux" \ 48 | batmand 49 | 50 | define Package/batmand/install 51 | $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d 52 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/batmand $(1)/usr/sbin/ 53 | $(INSTALL_BIN) ./files/etc/init.d/batmand $(1)/etc/init.d 54 | $(INSTALL_DATA) ./files/etc/config/batmand $(1)/etc/config 55 | endef 56 | 57 | define Package/batmand/conffiles 58 | /etc/config/batmand 59 | endef 60 | 61 | $(eval $(call BuildPackage,batmand)) 62 | -------------------------------------------------------------------------------- /batmand/files/etc/config/batmand: -------------------------------------------------------------------------------- 1 | config batmand general 2 | option interface ath0 3 | option hna 4 | option gateway_class 5 | option originator_interval 6 | option preferred_gateway 7 | option routing_class 8 | option visualisation_srv 9 | option policy_routing_script 10 | option disable_client_nat 11 | option disable_aggregation 12 | -------------------------------------------------------------------------------- /batmand/files/etc/init.d/batmand: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | START=90 3 | USE_PROCD=1 4 | 5 | batmand_start() { 6 | local config="$1" 7 | local batman_args 8 | local interface 9 | local hnas 10 | local gateway_class 11 | local originator_interval 12 | local preferred_gateway 13 | local routing_class 14 | local visualisation_srv 15 | local local policy_routing_script 16 | local disable_client_nat 17 | local disable_aggregation 18 | 19 | [ "$config" = "general" ] || return 1 20 | 21 | config_get interface "$config" interface 22 | if [ "$interface" = "" ]; then 23 | echo $1 Error, you must specify at least a network interface 24 | return 1 25 | fi 26 | 27 | config_get hnas "$config" hna 28 | config_get gateway_class "$config" gateway_class 29 | config_get originator_interval "$config" originator_interval 30 | config_get preferred_gateway "$config" preferred_gateway 31 | config_get routing_class "$config" routing_class 32 | config_get visualisation_srv "$config" visualisation_srv 33 | config_get policy_routing_script "$config" policy_routing_script 34 | config_get disable_client_nat "$config" disable_client_nat 35 | config_get disable_aggregation "$config" disable_aggregation 36 | 37 | batman_args="" 38 | 39 | for hna in $hnas; do 40 | batman_args=${batman_args}'-a '$hna' ' 41 | done 42 | 43 | if [ $gateway_class ]; then 44 | batman_args=${batman_args}'-g '$gateway_class' ' 45 | fi 46 | 47 | if [ $originator_interval ]; then 48 | batman_args=${batman_args}'-o '$originator_interval' ' 49 | fi 50 | 51 | if [ $preferred_gateway ]; then 52 | batman_args=${batman_args}'-p '$preferred_gateway' ' 53 | fi 54 | 55 | if [ $routing_class ]; then 56 | batman_args=${batman_args}'-r '$routing_class' ' 57 | fi 58 | 59 | if [ $visualisation_srv ]; then 60 | batman_args=${batman_args}'-s '$visualisation_srv' ' 61 | fi 62 | 63 | if [ $policy_routing_script ]; then 64 | batman_args=${batman_args}'--policy-routing-script '$policy_routing_script' ' 65 | fi 66 | 67 | if [ $disable_client_nat ]; then 68 | batman_args=${batman_args}'--disable-client-nat ' 69 | fi 70 | 71 | if [ $disable_aggregation ]; then 72 | batman_args=${batman_args}'--disable-aggregation ' 73 | fi 74 | 75 | procd_open_instance "${config}" 76 | procd_set_param command /usr/sbin/batmand 77 | procd_append_param command --no-detach 78 | procd_append_param command ${batman_args} 79 | procd_append_param command ${interface} 80 | procd_set_param netdev ${interface} 81 | procd_close_instance 82 | } 83 | 84 | start_service() { 85 | config_load "batmand" 86 | config_foreach batmand_start batmand 87 | } 88 | 89 | service_triggers() { 90 | procd_add_reload_trigger "batmand" 91 | } 92 | -------------------------------------------------------------------------------- /batmand/patches/0001-Allow-one-to-disable-forking-to-background-in-debug_.patch: -------------------------------------------------------------------------------- 1 | From: Sven Eckelmann 2 | Date: Sun, 1 Dec 2013 14:39:00 +0100 3 | Subject: Allow one to disable forking to background in debug_mode 0 4 | 5 | --- 6 | posix/init.c | 19 ++++++++++++++----- 7 | 1 file changed, 14 insertions(+), 5 deletions(-) 8 | 9 | --- a/posix/init.c 10 | +++ b/posix/init.c 11 | @@ -44,6 +44,7 @@ 12 | #define IOCSETDEV 1 13 | 14 | int8_t stop; 15 | +int no_detach = 0; 16 | 17 | 18 | 19 | @@ -159,6 +160,7 @@ void apply_init_args( int argc, char *ar 20 | {"purge-timeout", required_argument, 0, 'q'}, 21 | {"disable-aggregation", no_argument, 0, 'x'}, 22 | {"disable-client-nat", no_argument, 0, 'z'}, 23 | + {"no-detach", no_argument, 0, 'D'}, 24 | {0, 0, 0, 0} 25 | }; 26 | 27 | @@ -169,7 +171,7 @@ void apply_init_args( int argc, char *ar 28 | if ( strstr( SOURCE_VERSION, "-" ) != NULL ) 29 | printf( "WARNING: You are using the unstable batman branch. If you are interested in *using* batman get the latest stable release !\n" ); 30 | 31 | - while ( ( optchar = getopt_long( argc, argv, "a:A:bcd:hHio:g:p:r:s:vV", long_options, &option_index ) ) != -1 ) { 32 | + while ( ( optchar = getopt_long( argc, argv, "a:A:bcd:hHio:g:p:r:s:vVD", long_options, &option_index ) ) != -1 ) { 33 | 34 | switch ( optchar ) { 35 | 36 | @@ -381,6 +383,11 @@ void apply_init_args( int argc, char *ar 37 | found_args++; 38 | break; 39 | 40 | + case 'D': 41 | + no_detach = 1; 42 | + found_args++; 43 | + break; 44 | + 45 | case 'h': 46 | default: 47 | usage(); 48 | @@ -539,12 +546,14 @@ void apply_init_args( int argc, char *ar 49 | /* daemonize */ 50 | if (debug_level == 0) { 51 | 52 | - if (my_daemon() < 0) { 53 | + if (!no_detach) { 54 | + if (my_daemon() < 0) { 55 | 56 | - printf("Error - can't fork to background: %s\n", strerror(errno)); 57 | - restore_defaults(); 58 | - exit(EXIT_FAILURE); 59 | + printf("Error - can't fork to background: %s\n", strerror(errno)); 60 | + restore_defaults(); 61 | + exit(EXIT_FAILURE); 62 | 63 | + } 64 | } 65 | 66 | openlog("batmand", LOG_PID, LOG_DAEMON); 67 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv4-openwrt/src/config/bird4: -------------------------------------------------------------------------------- 1 | config bird 'bird' 2 | option use_UCI_config '1' 3 | #Caution! Enabling this option, Bird will translate this 4 | #UCI file and use it instead of /etc/bird4.conf 5 | option UCI_config_file '/tmp/bird4.conf' 6 | #If you enable useUCIconfig, UCIconfigFile will be Bird's 7 | #configuration file location. 8 | 9 | config global 'global' 10 | option log_file '/tmp/bird4.log' 11 | option log 'all' 12 | option debug 'off' 13 | 14 | config table 15 | option name 'aux' 16 | 17 | config kernel kernel1 18 | option table 'aux' 19 | option import 'all' 20 | option export 'all' 21 | option kernel_table '100' 22 | option scan_time '10' 23 | option learn '1' 24 | option persist '0' 25 | option disabled '0' 26 | 27 | config device device1 28 | option scan_time '10' 29 | option disabled '0' 30 | 31 | config static static1 32 | option table 'aux' 33 | option disabled '0' 34 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv4-openwrt/src/controller/bird4.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014-2017 - Eloi Carbo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | --]] 17 | 18 | module("luci.controller.bird4", package.seeall) 19 | 20 | function index() 21 | entry({"admin", "network", "bird4",}, 22 | alias("admin", "network", "bird4", "status"), 23 | _("Bird4"), 0) 24 | 25 | entry({"admin", "network", "bird4", "status"}, 26 | cbi("bird4/status"), 27 | _("Status"), 0).leaf = true 28 | 29 | entry({"admin","network","bird4","log"}, 30 | template("bird4/log"), 31 | _("Log"), 1).leaf = true 32 | 33 | entry({"admin", "network", "bird4", "overview"}, 34 | cbi("bird4/overview"), 35 | _("Overview"), 2).leaf = true 36 | 37 | entry({"admin","network","bird4","proto_general"}, 38 | cbi("bird4/gen_proto"), 39 | _("General protocols"), 3).leaf = true 40 | 41 | entry({"admin","network","bird4","proto_bgp"}, 42 | cbi("bird4/bgp_proto"), 43 | _("BGP Protocol"), 4).leaf = true 44 | 45 | entry({"admin","network","bird4","filters"}, 46 | cbi("bird4/filters"), 47 | _("Filters"), 5).leaf = true 48 | 49 | entry({"admin","network","bird4","functions"}, 50 | cbi("bird4/functions"), 51 | _("Functions"), 6).leaf = true 52 | end 53 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv4-openwrt/src/model/filters.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014-2017 - Eloi Carbo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | ]]-- 17 | 18 | local fs = require "nixio.fs" 19 | local filters_dir = "/etc/bird4/filters/" 20 | local lock_file = "/etc/bird4/filter_lock" 21 | 22 | m = SimpleForm("bird4", "Bird4 Filters", "INFO: New files are created using Timestamps.
In order to make it easier to handle, use SSH to connect to your terminal and rename those files.
If your file is not correctly shown in the list, please, refresh your browser.") 23 | 24 | s = m:section(SimpleSection) 25 | files = s:option(ListValue, "Files", "Filter Files:") 26 | local new_filter = filters_dir .. os.date("filter-%Y%m%d-%H%M") 27 | 28 | -- New File Entry 29 | files:value(new_filter, "New File (".. new_filter .. ")") 30 | files.default = new_filter 31 | 32 | local i, file_list = 0, { } 33 | for filename in io.popen("find " .. filters_dir .. " -type f"):lines() do 34 | i = i + 1 35 | files:value(filename, filename) 36 | end 37 | 38 | ld = s:option(Button, "_load", "Load File") 39 | ld.inputstyle = "reload" 40 | 41 | st_file = s:option(DummyValue, "_stfile", "Editing file:") 42 | function st_file.cfgvalue(self, section) 43 | if ld:formvalue(section) then 44 | fs.writefile(lock_file, files:formvalue(section)) 45 | return files:formvalue(section) 46 | else 47 | fs.writefile(lock_file, "") 48 | return "" 49 | end 50 | end 51 | 52 | area = s:option(Value, "_filters") 53 | area.template = "bird4/tvalue" 54 | area.rows = 30 55 | function area.cfgvalue(self,section) 56 | if ld:formvalue(section) then 57 | local contents = fs.readfile(files:formvalue(section)) 58 | if contents then 59 | return contents 60 | else 61 | return "" 62 | end 63 | else 64 | return "" 65 | end 66 | end 67 | 68 | function area.write(self, section) 69 | local locked_file = fs.readfile(lock_file) 70 | if locked_file and not ld:formvalue(section) then 71 | local text = self:formvalue(section):gsub("\r\n?", "\n") 72 | fs.writefile(locked_file, text) 73 | fs.writefile(lock_file, "") 74 | end 75 | end 76 | 77 | return m 78 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv4-openwrt/src/model/functions.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014-2017 - Eloi Carbo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | ]]-- 17 | 18 | local fs = require "nixio.fs" 19 | local functions_dir = "/etc/bird4/functions/" 20 | local lock_file = "/etc/bird4/function_lock" 21 | 22 | m = SimpleForm("bird4", "Bird4 Functions", "INFO: New files are created using Timestamps.
In order to make it easier to handle, use SSH to connect to your terminal and rename those files.
If your file is not correctly shown in the list, please, refresh your browser.") 23 | 24 | s = m:section(SimpleSection) 25 | files = s:option(ListValue, "Files", "Function Files:") 26 | local new_function = functions_dir .. os.date("function-%Y%m%d-%H%M") 27 | 28 | -- New File Entry 29 | files:value(new_function, "New File (".. new_function .. ")") 30 | files.default = new_function 31 | 32 | local i, file_list = 0, { } 33 | for filename in io.popen("find " .. functions_dir .. " -type f"):lines() do 34 | i = i + 1 35 | files:value(filename, filename) 36 | end 37 | 38 | ld = s:option(Button, "_load", "Load File") 39 | ld.inputstyle = "reload" 40 | 41 | st_file = s:option(DummyValue, "_stfile", "Editing file:") 42 | function st_file.cfgvalue(self, section) 43 | if ld:formvalue(section) then 44 | fs.writefile(lock_file, files:formvalue(section)) 45 | return files:formvalue(section) 46 | else 47 | fs.writefile(lock_file, "") 48 | return "" 49 | end 50 | end 51 | 52 | area = s:option(Value, "_functions") 53 | area.template = "bird4/tvalue" 54 | area.rows = 30 55 | function area.cfgvalue(self,section) 56 | if ld:formvalue(section) then 57 | local contents = fs.readfile(files:formvalue(section)) 58 | if contents then 59 | return contents 60 | else 61 | return "" 62 | end 63 | else 64 | return "" 65 | end 66 | end 67 | 68 | function area.write(self, section) 69 | local locked_file = fs.readfile(lock_file) 70 | if locked_file and not ld:formvalue(section) then 71 | local text = self:formvalue(section):gsub("\r\n?", "\n") 72 | fs.writefile(locked_file, text) 73 | fs.writefile(lock_file, "") 74 | end 75 | end 76 | 77 | return m 78 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv4-openwrt/src/model/overview.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014-2017 - Eloi Carbo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | ]]-- 17 | 18 | require("luci.sys") 19 | local http = require "luci.http" 20 | local uci = require "luci.model.uci" 21 | local uciout = uci.cursor() 22 | 23 | m=Map("bird4", "Bird4 UCI configuration helper", "") 24 | 25 | -- Named section: "bird" 26 | 27 | s_bird_uci = m:section(NamedSection, "bird", "bird", "Bird4 file settings", "") 28 | s_bird_uci.addremove = False 29 | 30 | uuc = s_bird_uci:option(Flag, "use_UCI_config", "Use UCI configuration", "Use UCI configuration instead of the /etc/bird4.conf file") 31 | 32 | ucf = s_bird_uci:option(Value, "UCI_config_file", "UCI File", "Specify the file to place the UCI-translated configuration") 33 | ucf.default = "/tmp/bird4.conf" 34 | 35 | -- Named Section: "table" 36 | 37 | s_bird_table = m:section(TypedSection, "table", "Tables configuration", "Configuration of the tables used in the protocols") 38 | s_bird_table.addremove = true 39 | s_bird_table.anonymous = true 40 | 41 | name = s_bird_table:option(Value, "name", "Table name", "Descriptor ID of the table") 42 | 43 | -- Named section: "global" 44 | 45 | s_bird_global = m:section(NamedSection, "global", "global", "Global options", "Basic Bird4 settings") 46 | s_bird_global.addremove = False 47 | 48 | id = s_bird_global:option(Value, "router_id", "Router ID", "Identification number of the router. By default, is the router's IP.") 49 | 50 | lf = s_bird_global:option(Value, "log_file", "Log File", "File used to store log related data.") 51 | 52 | l = s_bird_global:option(MultiValue, "log", "Log", "Set which elements do you want to log.") 53 | l:value("all", "All") 54 | l:value("info", "Info") 55 | l:value("warning","Warning") 56 | l:value("error","Error") 57 | l:value("fatal","Fatal") 58 | l:value("debug","Debug") 59 | l:value("trace","Trace") 60 | l:value("remote","Remote") 61 | l:value("auth","Auth") 62 | 63 | d = s_bird_global:option(MultiValue, "debug", "Debug", "Set which elements do you want to debug.") 64 | d:value("all", "All") 65 | d:value("states","States") 66 | d:value("routes","Routes") 67 | d:value("filters","Filters") 68 | d:value("interfaces","Interfaces") 69 | d:value("events","Events") 70 | d:value("packets","Packets") 71 | 72 | function m.on_commit(self,map) 73 | luci.sys.exec('/etc/init.d/bird4 restart') 74 | end 75 | 76 | return m 77 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv4-openwrt/src/model/status.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014-2017 - Eloi Carbo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | ]]-- 17 | 18 | local sys = require "luci.sys" 19 | 20 | m = SimpleForm("bird4", "Bird4 Daemon Status Page", "This page let you Start, Stop, Restart and check Bird4 Service Status.") 21 | m.reset = false 22 | m.submit = false 23 | 24 | s = m:section(SimpleSection) 25 | 26 | start = s:option(Button, "_start", "Start Bird4 Daemon:") 27 | start.inputtitle = " Start " 28 | start.inputstyle = "apply" 29 | 30 | stop = s:option(Button, "_stop", "Stop Bird4 Daemon:") 31 | stop.inputtitle = " Stop " 32 | stop.inputstyle = "remove" 33 | 34 | restart = s:option(Button, "_restart", "Restart Bird4 Daemon:") 35 | restart.inputtitle = "Restart" 36 | restart.inputstyle = "reload" 37 | 38 | output = s:option(DummyValue, "_value", "Service Status") 39 | function output.cfgvalue(self, section) 40 | local ret = "" 41 | if start:formvalue(section) then 42 | ret = sys.exec("/etc/init.d/bird4 start_quiet") 43 | elseif stop:formvalue(section) then 44 | ret = sys.exec("/etc/init.d/bird4 stop_quiet") 45 | elseif restart:formvalue(section) then 46 | ret = sys.exec("/etc/init.d/bird4 restart_quiet") 47 | else 48 | ret = sys.exec("/etc/init.d/bird4 status_quiet") 49 | end 50 | return ret 51 | end 52 | 53 | return m 54 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv4-openwrt/src/uci-defaults/99-relocate-filters: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This UCI-Defaults script will MOVE any pre-existing filter 4 | # stored in a file and configured as an UCI item (deprecated) 5 | # The script will try to match any "filter" Section, get its 6 | # "file_path" property and move the file (if exists) to the 7 | # new (v0.3+) default location: /etc/bird{4|6}/filters 8 | 9 | [ $# -ne 1 ] && exit 1 10 | BIRD="$1" 11 | 12 | . /lib/functions.sh 13 | 14 | # This function will move an existing folder configured on 15 | # Bird as a "filter" to filters' folder. 16 | mv_filter() { 17 | local section="$1" 18 | local file_path 19 | config_get file_path ${section} file_path 20 | 21 | if [ -f ${file_path} ]; then 22 | mv ${file_path} /etc/${BIRD}/filters/ 23 | fi 24 | uci delete ${BIRD}.${section} 25 | } 26 | 27 | if [ -f /etc/config/${BIRD} ]; then 28 | config_load ${BIRD} 29 | config_foreach mv_filter 'filter' 30 | uci commit ${BIRD} 31 | fi 32 | 33 | exit 0 34 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv4-openwrt/src/uci-defaults/bird-uci-install-init.d: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | [ $# -ne 1 ] && exit 1 4 | 5 | BIRD=$1 6 | 7 | EXC=`mount -t overlayfs | grep overlayfs -c` 8 | 9 | [ $EXC > 0 ] && rm -r /etc/init.d/${BIRD} || mv /etc/init.d/${BIRD} /etc/${BIRD}/init.d/${BIRD}.orig 10 | 11 | ln -s /etc/${BIRD}/init.d/${BIRD} /etc/init.d/${BIRD} 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv4-openwrt/src/view/log.htm: -------------------------------------------------------------------------------- 1 | <%- 2 | -- Only populate textarea through XHR.poll 3 | -- "refresh" is present in the URL (.../log?refresh=1) 4 | if luci.http.formvalue("refresh") then 5 | 6 | -- Force HTTP Contents to be "text/plain" 7 | luci.http.prepare_content("text/plain") 8 | 9 | local sys = require("luci.sys") 10 | local uci = require "luci.model.uci".cursor() 11 | 12 | -- Get Log File from Bird's configuration or leave it empty. 13 | local log_file = uci:get("bird4", "global", "log_file") or "" 14 | local log_size = "" 15 | if log_file then 16 | log_size = sys.exec("du -h " .. log_file .. " | awk '{print $1}'") 17 | -- Gathering last 30 lines of the Log File. 18 | lf = sys.exec("tail -n30 " .. log_file):gsub("\r\n?", "\n") 19 | end 20 | 21 | -- Write File used and its contents. 22 | luci.http.write("Using Log File: " .. log_file .. " - File Size: " .. log_size .. "\n" .. lf) 23 | 24 | -- Avoid printing the rest of the page (return only text log data) 25 | return 26 | end 27 | -%> 28 | 29 | <%+header%> 30 | 31 | 38 | 39 | 40 | 41 | <%+footer%> 42 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv4-openwrt/src/view/tvalue.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | 5 | <%+cbi/valuefooter%> 6 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv6-openwrt/src/config/bird6: -------------------------------------------------------------------------------- 1 | config bird 'bird' 2 | option use_UCI_config '1' 3 | #Caution! Enabling this option, Bird will translate this 4 | #UCI file and use it instead of /etc/bird6.conf 5 | option UCI_config_file '/tmp/bird6.conf' 6 | #If you enable useUCIconfig, UCIconfigFile will be Bird's 7 | #configuration file location. 8 | 9 | config global 'global' 10 | option log_file '/tmp/bird6.log' 11 | option log 'all' 12 | option debug 'off' 13 | # This option is set up because is mandatory for Bird6. 14 | # Change it to your IPv4 Address or a HEX value. 15 | option router_id '0xCAFEBABE' 16 | 17 | config table 18 | option name 'aux' 19 | 20 | config kernel kernel1 21 | option table 'aux' 22 | option import 'all' 23 | option export 'all' 24 | option kernel_table '100' 25 | option scan_time '10' 26 | option learn '1' 27 | option persist '0' 28 | option disabled '0' 29 | 30 | config device device1 31 | option scan_time '10' 32 | option disabled '0' 33 | 34 | config static static1 35 | option table 'aux' 36 | option disabled '0' 37 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv6-openwrt/src/controller/bird6.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014-2017 - Eloi Carbo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | --]] 17 | 18 | module("luci.controller.bird6", package.seeall) 19 | 20 | function index() 21 | entry({"admin","network","bird6"}, 22 | alias("admin","network","bird6","status"), 23 | _("Bird6"), 0) 24 | 25 | entry({"admin", "network", "bird6", "status"}, 26 | cbi("bird6/status"), 27 | _("Status"), 0).leaf = true 28 | 29 | entry({"admin","network","bird6","log"}, 30 | template("bird6/log"), 31 | _("Log"), 1).leaf = true 32 | 33 | entry({"admin","network","bird6","overview"}, 34 | cbi("bird6/overview"), 35 | _("Overview"), 2).leaf = true 36 | 37 | entry({"admin","network","bird6","proto_general"}, 38 | cbi("bird6/gen_proto"), 39 | _("General protocols"), 3).leaf = true 40 | 41 | entry({"admin","network","bird6","proto_bgp"}, 42 | cbi("bird6/bgp_proto"), 43 | _("BGP Protocol"), 4).leaf = true 44 | 45 | entry({"admin","network","bird6","filters"}, 46 | cbi("bird6/filters"), 47 | _("Filters"), 5).leaf = true 48 | 49 | entry({"admin","network","bird6","functions"}, 50 | cbi("bird6/functions"), 51 | _("Functions"), 6).leaf = true 52 | end 53 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv6-openwrt/src/model/filters.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014-2017 - Eloi Carbo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | ]]-- 17 | 18 | local fs = require "nixio.fs" 19 | local filters_dir = "/etc/bird6/filters/" 20 | local lock_file = "/etc/bird6/filter_lock" 21 | 22 | m = SimpleForm("bird6", "Bird6 Filters", "INFO: New files are created using Timestamps.
In order to make it easier to handle, use SSH to connect to your terminal and rename those files.
If your file is not correctly shown in the list, please, refresh your browser.") 23 | 24 | s = m:section(SimpleSection) 25 | files = s:option(ListValue, "Files", "Filter Files:") 26 | local new_filter = filters_dir .. os.date("filter-%Y%m%d-%H%M") 27 | 28 | -- New File Entry 29 | files:value(new_filter, "New File (".. new_filter .. ")") 30 | files.default = new_filter 31 | 32 | local i, file_list = 0, { } 33 | for filename in io.popen("find " .. filters_dir .. " -type f"):lines() do 34 | i = i + 1 35 | files:value(filename, filename) 36 | end 37 | 38 | ld = s:option(Button, "_load", "Load File") 39 | ld.inputstyle = "reload" 40 | 41 | st_file = s:option(DummyValue, "_stfile", "Editing file:") 42 | function st_file.cfgvalue(self, section) 43 | if ld:formvalue(section) then 44 | fs.writefile(lock_file, files:formvalue(section)) 45 | return files:formvalue(section) 46 | else 47 | fs.writefile(lock_file, "") 48 | return "" 49 | end 50 | end 51 | 52 | area = s:option(Value, "_filters") 53 | area.template = "bird6/tvalue" 54 | area.rows = 30 55 | function area.cfgvalue(self,section) 56 | if ld:formvalue(section) then 57 | local contents = fs.readfile(files:formvalue(section)) 58 | if contents then 59 | return contents 60 | else 61 | return "" 62 | end 63 | else 64 | return "" 65 | end 66 | end 67 | 68 | function area.write(self, section) 69 | local locked_file = fs.readfile(lock_file) 70 | if locked_file and not ld:formvalue(section) then 71 | local text = self:formvalue(section):gsub("\r\n?", "\n") 72 | fs.writefile(locked_file, text) 73 | fs.writefile(lock_file, "") 74 | end 75 | end 76 | 77 | return m 78 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv6-openwrt/src/model/functions.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014-2017 - Eloi Carbo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | ]]-- 17 | 18 | local fs = require "nixio.fs" 19 | local functions_dir = "/etc/bird6/functions/" 20 | local lock_file = "/etc/bird6/function_lock" 21 | 22 | m = SimpleForm("bird6", "Bird6 Functions", "INFO: New files are created using Timestamps.
In order to make it easier to handle, use SSH to connect to your terminal and rename those files.
If your file is not correctly shown in the list, please, refresh your browser.") 23 | 24 | s = m:section(SimpleSection) 25 | files = s:option(ListValue, "Files", "Function Files:") 26 | local new_function = functions_dir .. os.date("function-%Y%m%d-%H%M") 27 | 28 | -- New File Entry 29 | files:value(new_function, "New File (".. new_function .. ")") 30 | files.default = new_function 31 | 32 | local i, file_list = 0, { } 33 | for filename in io.popen("find " .. functions_dir .. " -type f"):lines() do 34 | i = i + 1 35 | files:value(filename, filename) 36 | end 37 | 38 | ld = s:option(Button, "_load", "Load File") 39 | ld.inputstyle = "reload" 40 | 41 | st_file = s:option(DummyValue, "_stfile", "Editing file:") 42 | function st_file.cfgvalue(self, section) 43 | if ld:formvalue(section) then 44 | fs.writefile(lock_file, files:formvalue(section)) 45 | return files:formvalue(section) 46 | else 47 | fs.writefile(lock_file, "") 48 | return "" 49 | end 50 | end 51 | 52 | area = s:option(Value, "_functions") 53 | area.template = "bird6/tvalue" 54 | area.rows = 30 55 | function area.cfgvalue(self,section) 56 | if ld:formvalue(section) then 57 | local contents = fs.readfile(files:formvalue(section)) 58 | if contents then 59 | return contents 60 | else 61 | return "" 62 | end 63 | else 64 | return "" 65 | end 66 | end 67 | 68 | function area.write(self, section) 69 | local locked_file = fs.readfile(lock_file) 70 | if locked_file and not ld:formvalue(section) then 71 | local text = self:formvalue(section):gsub("\r\n?", "\n") 72 | fs.writefile(locked_file, text) 73 | fs.writefile(lock_file, "") 74 | end 75 | end 76 | 77 | return m 78 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv6-openwrt/src/model/status.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014-2017 - Eloi Carbo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | ]]-- 17 | 18 | local sys = require "luci.sys" 19 | 20 | m = SimpleForm("bird6", "Bird6 Daemon Status Page", "This page let you Start, Stop, Restart and check Bird6 Service Status.") 21 | m.reset = false 22 | m.submit = false 23 | 24 | s = m:section(SimpleSection) 25 | 26 | start = s:option(Button, "_start", "Start Bird4 Daemon:") 27 | start.inputtitle = " Start " 28 | start.inputstyle = "apply" 29 | 30 | stop = s:option(Button, "_stop", "Stop Bird4 Daemon:") 31 | stop.inputtitle = " Stop " 32 | stop.inputstyle = "remove" 33 | 34 | restart = s:option(Button, "_restart", "Restart Bird4 Daemon:") 35 | restart.inputtitle = "Restart" 36 | restart.inputstyle = "reload" 37 | 38 | output = s:option(DummyValue, "_value", "Service Status") 39 | function output.cfgvalue(self, section) 40 | local ret = "" 41 | if start:formvalue(section) then 42 | ret = sys.exec("/etc/init.d/bird6 start_quiet") 43 | elseif stop:formvalue(section) then 44 | ret = sys.exec("/etc/init.d/bird6 stop_quiet") 45 | elseif restart:formvalue(section) then 46 | ret = sys.exec("/etc/init.d/bird6 restart_quiet") 47 | else 48 | ret = sys.exec("/etc/init.d/bird6 status_quiet") 49 | end 50 | return ret 51 | end 52 | 53 | return m 54 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv6-openwrt/src/uci-defaults/99-relocate-filters: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This UCI-Defaults script will MOVE any pre-existing filter 4 | # stored in a file and configured as an UCI item (deprecated) 5 | # The script will try to match any "filter" Section, get its 6 | # "file_path" property and move the file (if exists) to the 7 | # new (v0.3+) default location: /etc/bird{4|6}/filters 8 | 9 | [ $# -ne 1 ] && exit 1 10 | BIRD="$1" 11 | 12 | . /lib/functions.sh 13 | 14 | # This function will move an existing folder configured on 15 | # Bird as a "filter" to filters' folder. 16 | mv_filter() { 17 | local section="$1" 18 | local file_path 19 | config_get file_path ${section} file_path 20 | 21 | if [ -f ${file_path} ]; then 22 | mv ${file_path} /etc/${BIRD}/filters/ 23 | fi 24 | uci delete ${BIRD}.${section} 25 | } 26 | 27 | if [ -f /etc/config/${BIRD} ]; then 28 | config_load ${BIRD} 29 | config_foreach mv_filter 'filter' 30 | uci commit ${BIRD} 31 | fi 32 | 33 | exit 0 34 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv6-openwrt/src/uci-defaults/bird-uci-install-init.d: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | [ $# -ne 1 ] && exit 1 4 | 5 | BIRD=$1 6 | 7 | EXC=`mount -t overlayfs | grep overlayfs -c` 8 | 9 | [ $EXC > 0 ] && rm -r /etc/init.d/${BIRD} || mv /etc/init.d/${BIRD} /etc/${BIRD}/init.d/${BIRD}.orig 10 | 11 | ln -s /etc/${BIRD}/init.d/${BIRD} /etc/init.d/${BIRD} 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv6-openwrt/src/view/log.htm: -------------------------------------------------------------------------------- 1 | <%- 2 | -- Only populate textarea through XHR.poll 3 | -- "refresh" is present in the URL (.../log?refresh=1) 4 | if luci.http.formvalue("refresh") then 5 | 6 | -- Force HTTP Contents to be "text/plain" 7 | luci.http.prepare_content("text/plain") 8 | 9 | local sys = require("luci.sys") 10 | local uci = require "luci.model.uci".cursor() 11 | 12 | -- Get Log File from Bird's configuration or leave it empty. 13 | local log_file = uci:get("bird6", "global", "log_file") or "" 14 | local log_size = "" 15 | if log_file then 16 | log_size = sys.exec("du -h " .. log_file .. " | awk '{print $1}'") 17 | -- Gathering last 30 lines of the Log File. 18 | lf = sys.exec("tail -n30 " .. log_file):gsub("\r\n?", "\n") 19 | end 20 | 21 | -- Write File used and its contents. 22 | luci.http.write("Using Log File: " .. log_file .. " - File Size: " .. log_size .. "\n" .. lf) 23 | 24 | -- Avoid printing the rest of the page (return only text log data) 25 | return 26 | end 27 | -%> 28 | 29 | <%+header%> 30 | 31 | 38 | 39 | 40 | 41 | <%+footer%> 42 | -------------------------------------------------------------------------------- /bird1-openwrt/bird1-ipv6-openwrt/src/view/tvalue.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | 5 | <%+cbi/valuefooter%> 6 | -------------------------------------------------------------------------------- /bird1/files/bird4.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2010-2014 OpenWrt.org 3 | 4 | BIRD="bird4" 5 | 6 | START=99 7 | STOP=10 8 | 9 | SERVICE_DAEMONIZE=1 10 | SERVICE_USE_PID=1 11 | SERVICE_PID_FILE="/var/run/$BIRD.pid" 12 | 13 | BIRD_BIN="/usr/sbin/$BIRD" 14 | BIRD_CONF="/etc/$BIRD.conf" 15 | 16 | start() { 17 | service_start $BIRD_BIN -d -c $BIRD_CONF -P $SERVICE_PID_FILE 18 | } 19 | 20 | stop() { 21 | service_stop $BIRD_BIN 22 | } 23 | 24 | reload() { 25 | service_reload $BIRD_BIN 26 | } 27 | -------------------------------------------------------------------------------- /bird1/files/bird6.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2010-2014 OpenWrt.org 3 | 4 | BIRD="bird6" 5 | 6 | START=99 7 | STOP=10 8 | 9 | SERVICE_DAEMONIZE=1 10 | SERVICE_USE_PID=1 11 | SERVICE_PID_FILE="/var/run/$BIRD.pid" 12 | 13 | BIRD_BIN="/usr/sbin/$BIRD" 14 | BIRD_CONF="/etc/$BIRD.conf" 15 | 16 | start() { 17 | service_start $BIRD_BIN -d -c $BIRD_CONF -P $SERVICE_PID_FILE 18 | } 19 | 20 | stop() { 21 | service_stop $BIRD_BIN 22 | } 23 | 24 | reload() { 25 | service_reload $BIRD_BIN 26 | } 27 | -------------------------------------------------------------------------------- /bird1/patches/010-gcc10.patch: -------------------------------------------------------------------------------- 1 | --- a/sysdep/unix/krt.h 2 | +++ b/sysdep/unix/krt.h 3 | @@ -112,7 +112,7 @@ struct kif_proto { 4 | struct kif_state sys; /* Sysdep state */ 5 | }; 6 | 7 | -struct kif_proto *kif_proto; 8 | +extern struct kif_proto *kif_proto; 9 | 10 | #define KIF_CF ((struct kif_config *)p->p.cf) 11 | 12 | -------------------------------------------------------------------------------- /bird2/files/bird.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2010-2017 OpenWrt.org 3 | 4 | USE_PROCD=1 5 | START=70 6 | STOP=10 7 | 8 | BIRD_BIN="/usr/sbin/bird" 9 | BIRD_CONF="/etc/bird.conf" 10 | BIRD_PID_FILE="/var/run/bird.pid" 11 | 12 | start_service() { 13 | mkdir -p /var/run 14 | procd_open_instance 15 | procd_set_param command $BIRD_BIN -f -c $BIRD_CONF -P $BIRD_PID_FILE 16 | procd_set_param file "$BIRD_CONF" 17 | procd_set_param stdout 1 18 | procd_set_param stderr 1 19 | procd_set_param respawn 20 | procd_close_instance 21 | } 22 | 23 | reload_service() { 24 | procd_send_signal bird 25 | } 26 | -------------------------------------------------------------------------------- /bird2/patches/000-ospf-bus-error.patch: -------------------------------------------------------------------------------- 1 | --- a/proto/ospf/topology.h 2 | +++ b/proto/ospf/topology.h 3 | @@ -41,7 +41,7 @@ struct top_hash_entry 4 | u8 mode; /* LSA generated during RT calculation (LSA_RTCALC or LSA_STALE)*/ 5 | u8 nhs_reuse; /* Whether nhs nodes can be reused during merging. 6 | See a note in rt.c:add_cand() */ 7 | -}; 8 | +} PACKED; 9 | 10 | 11 | /* Prevents ospf_hash_find() to ignore the entry, for p->lsrqh and p->lsrth */ 12 | -------------------------------------------------------------------------------- /bmx6/files/etc/config/bmx6: -------------------------------------------------------------------------------- 1 | 2 | # for more information: 3 | # http://bmx6.net/projects/bmx6/wiki 4 | # options execute: bmx6 --help 5 | 6 | config 'bmx6' 'general' 7 | # option 'runtimeDir' '/var/run/bmx6' 8 | # option 'tun4Address' '10.202.0.116/32' 9 | # option 'tun4Address' '10.254.10.0/32' 10 | # option 'tun6Address' '2012:0:0:1000::1/64' 11 | 12 | #config 'ipVersion' 'ipVersion' 13 | # option 'ipVersion' '6' # default is 4 14 | # option 'throwRules' '0' 15 | 16 | 17 | #config 'plugin' 18 | # option 'plugin' 'bmx6_config.so' 19 | 20 | 21 | 22 | #config 'plugin' 23 | # option 'plugin' 'bmx6_json.so' 24 | 25 | 26 | 27 | #config 'plugin' 28 | # option 'plugin' 'bmx6_sms.so' 29 | 30 | 31 | config 'dev' 'mesh_1' 32 | option 'dev' 'eth0.12' 33 | 34 | config 'dev' 'mesh_2' 35 | option 'dev' 'ath0.12' 36 | 37 | 38 | 39 | #config 'hna' 'my_global_prefix' 40 | # option 'hna' '2012:0:0:74:0:0:0:0/64' 41 | 42 | 43 | #config 'tunOut' 44 | # option 'tunOut' 'ip6' 45 | # option 'network' '2012::/16' 46 | # option 'exportDistance' '0' 47 | 48 | #config 'tunOut' 49 | # option 'tunOut' 'ip4' 50 | # option 'network' '10.254.0.0/16' 51 | # option 'exportDistance' '0' # requires quagga plugin ! 52 | # option 'minPrefixLen' '27' 53 | 54 | 55 | 56 | #config 'plugin' 57 | # option 'plugin' 'bmx6_quagga.so' 58 | 59 | 60 | 61 | #config 'redistribute' 62 | # option 'redistribute' 'ospf6' 63 | # option 'network' '10.0.0.0/8' 64 | # option 'minPrefixLen' '10' 65 | # option 'bandwidth' '10000000' 66 | # option 'ospf6' '1' 67 | # option 'aggregatePrefixLen' '16' 68 | 69 | #config 'redistribute' 70 | # option 'redistribute' 'bgp' 71 | # option 'network' '0.0.0.0/0' 72 | # option 'minPrefixLen' '0' 73 | # option 'maxPrefixLen' '24' 74 | # option 'bandwidth' '10000000' 75 | # option 'bgp' '1' 76 | # option 'aggregatePrefixLen' '8' 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /bmx6/files/etc/init.d/bmx6: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2017 Gui Iribarren 3 | # Copyright (C) 2011 Fundacio Privada per a la Xarxa Oberta, Lliure i Neutral guifi.net 4 | # 5 | # This is free software, licensed under the GNU General Public License v3. 6 | 7 | START=91 8 | STOP=91 9 | USE_PROCD=1 10 | 11 | NAME=bmx6 12 | BIN=/usr/sbin/bmx6 13 | CONF=/etc/config/bmx6 14 | PID=/var/run/bmx6/pid 15 | DEBUG=0 16 | 17 | start_service() { 18 | procd_open_instance "$NAME" 19 | procd_set_param command "$BIN" -f "$CONF" -d "$DEBUG" 20 | 21 | ### Respawn automatically when process dies, after waiting respawn_timeout seconds 22 | ### If respawn_retry consecutives respawns die before respawn_threshold seconds (i.e. they crash) 23 | ### it will stop trying and leave it dead. 24 | procd_set_param respawn ${respawn_threshold:-60} ${respawn_timeout:-3} ${respawn_retry:-5} 25 | 26 | procd_set_param limits core="20000" # Equivalent to 'ulimit -c 20000' 27 | procd_close_instance 28 | } 29 | 30 | reload_service() { 31 | "$BIN" -c configReload 32 | } 33 | 34 | service_triggers() 35 | { 36 | procd_add_reload_trigger "bmx6" # Call reload_service() when /etc/config/bmx6 changed and reload_config is run 37 | } 38 | -------------------------------------------------------------------------------- /bmx6/patches/010-siocgstamp.patch: -------------------------------------------------------------------------------- 1 | --- a/schedule.c 2 | +++ b/schedule.c 3 | @@ -356,7 +356,9 @@ loop4Event: 4 | continue; 5 | } 6 | 7 | +#ifdef SIOCGSTAMP 8 | ioctl(pb.i.iif->rx_mcast_sock, SIOCGSTAMP, &(pb.i.tv_stamp)) ; 9 | +#endif 10 | 11 | rx_packet( &pb ); 12 | 13 | @@ -381,8 +383,10 @@ loop4Event: 14 | 15 | continue; 16 | } 17 | - 18 | + 19 | +#ifdef SIOCGSTAMP 20 | ioctl(pb.i.iif->rx_fullbrc_sock, SIOCGSTAMP, &(pb.i.tv_stamp)) ; 21 | +#endif 22 | 23 | rx_packet( &pb ); 24 | 25 | @@ -432,10 +436,15 @@ loop4Event: 26 | } 27 | } 28 | #endif 29 | +#ifdef SIOCGSTAMP 30 | if ( tv_stamp == NULL ) 31 | ioctl( pb.i.iif->unicast_sock, SIOCGSTAMP, &(pb.i.tv_stamp) ); 32 | else 33 | timercpy( tv_stamp, &(pb.i.tv_stamp) ); 34 | +#else 35 | + if (tv_stamp) 36 | + timercpy( tv_stamp, &(pb.i.tv_stamp) ); 37 | +#endif 38 | 39 | rx_packet( &pb ); 40 | 41 | -------------------------------------------------------------------------------- /bmx7/files/etc/config/bmx7: -------------------------------------------------------------------------------- 1 | # for more information: 2 | # https://github.com/bmx-routing/bmx7/ 3 | # options execute: bmx7 --help 4 | 5 | config 'bmx7' 'general' 6 | # option 'runtimeDir' '/var/run/bmx7' 7 | # option 'trustedNodesDir' '/etc/bmx7/trustedNodes' 8 | 9 | #config 'plugin' 10 | # option 'plugin' 'bmx7_config.so' 11 | 12 | #config 'plugin' 13 | # option 'plugin' 'bmx7_json.so' 14 | 15 | #config 'plugin' 16 | # option 'plugin' 'bmx7_sms.so' 17 | 18 | #config 'plugin' 19 | # option 'plugin' 'bmx7_iwinfo.so' 20 | 21 | config 'dev' 'mesh_1' 22 | option 'dev' 'br-lan' 23 | 24 | config 'dev' 'mesh_2' 25 | option 'dev' 'wlan0' 26 | 27 | #config 'plugin' 28 | # option 'plugin' 'bmx7_tun.so' 29 | 30 | #config 'plugin' 31 | # option 'plugin' 'bmx7_table.so' 32 | 33 | #config 'tunDev' default 34 | # option 'tunDev' 'default' 35 | # option 'tun6Address' '2012:0:0:6666::1/64' 36 | # option 'tun4Address' '10.66.66.1/24' 37 | 38 | 39 | #config 'tunOut' 40 | # option 'tunOut' 'ip6' 41 | # option 'network' '2012::/16' 42 | # option 'exportDistance' '0' 43 | 44 | #config 'tunOut' 45 | # option 'tunOut' 'ip4' 46 | # option 'network' '10.0.0.0/9' 47 | # option 'minPrefixLen' '27' 48 | -------------------------------------------------------------------------------- /bmx7/files/etc/init.d/bmx7: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | START=91 3 | USE_PROCD=1 4 | 5 | BIN=/usr/sbin/bmx7 6 | CONF=/etc/config/bmx7 7 | 8 | start_service() { 9 | cd /root/ || return 10 | while pgrep -f mac80211.sh ; do sleep 1; done 11 | 12 | procd_open_instance "bmx7" 13 | procd_set_param command "$BIN" 14 | procd_append_param command -f "$CONF" -d0 15 | procd_set_param limits core=20000 16 | procd_set_param stdout 1 17 | procd_set_param stderr 1 18 | procd_set_param respawn 19 | procd_close_instance 20 | } 21 | 22 | reload_service() { 23 | "$BIN" -c configReload 24 | } 25 | 26 | service_triggers() { 27 | procd_add_reload_trigger "bmx7" 28 | } 29 | -------------------------------------------------------------------------------- /bmx7/patches/010-gcc10.patch: -------------------------------------------------------------------------------- 1 | --- a/src/bmx.h 2 | +++ b/src/bmx.h 3 | @@ -290,7 +290,7 @@ enum ADGSN { 4 | #define SUCCESS 0 5 | #define FAILURE -1 6 | 7 | -const void* FAILURE_PTR; 8 | +extern const void* FAILURE_PTR; 9 | 10 | 11 | #define MAX_SELECT_TIMEOUT_MS 1100 /* MUST be smaller than (1000/2) to fit into max tv_usec */ 12 | -------------------------------------------------------------------------------- /bmx7/patches/020-siocgstamp.patch: -------------------------------------------------------------------------------- 1 | --- a/src/schedule.c 2 | +++ b/src/schedule.c 3 | @@ -375,7 +375,9 @@ loop4Event: 4 | continue; 5 | } 6 | 7 | +#ifdef SIOCGSTAMP 8 | ioctl(pb.i.iif->rx_mcast_sock, SIOCGSTAMP, &(pb.i.tv_stamp)); 9 | +#endif 10 | 11 | rx_packet(&pb); 12 | 13 | @@ -401,7 +403,9 @@ loop4Event: 14 | continue; 15 | } 16 | 17 | +#ifdef SIOCGSTAMP 18 | ioctl(pb.i.iif->rx_fullbrc_sock, SIOCGSTAMP, &(pb.i.tv_stamp)); 19 | +#endif 20 | 21 | rx_packet(&pb); 22 | 23 | @@ -451,10 +455,15 @@ loop4Event: 24 | } 25 | } 26 | #endif 27 | +#ifdef SIOCGSTAMP 28 | if (tv_stamp == NULL) 29 | ioctl(pb.i.iif->unicast_sock, SIOCGSTAMP, &(pb.i.tv_stamp)); 30 | else 31 | timercpy(&(pb.i.tv_stamp), tv_stamp); 32 | +#else 33 | + if (tv_stamp) 34 | + timercpy(&(pb.i.tv_stamp), tv_stamp); 35 | +#endif 36 | 37 | rx_packet(&pb); 38 | 39 | -------------------------------------------------------------------------------- /cjdns/files/cjdns.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=90 4 | STOP=85 5 | 6 | USE_PROCD=1 7 | 8 | start_service() 9 | { 10 | [ -f /etc/uci-defaults/cjdns ] && ( . /etc/uci-defaults/cjdns ) 11 | 12 | procd_open_instance 13 | procd_set_param respawn 14 | procd_set_param command /bin/ash -c "cjdrouteconf get | tee /tmp/etc/cjdroute.conf | cjdroute --nobg | logger -t cjdns" 15 | procd_close_instance 16 | } 17 | 18 | stop_service() 19 | { 20 | killall cjdroute 21 | } 22 | 23 | reload_service() 24 | { 25 | # cat /tmp/etc/cjdroute.conf | cjdrouteconf reload 26 | restart 27 | } 28 | 29 | service_triggers() 30 | { 31 | procd_add_reload_trigger cjdns 32 | } 33 | -------------------------------------------------------------------------------- /cjdns/files/cjdrouteconf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env lua 2 | 3 | dkjson = require("dkjson") 4 | cjdns = require("cjdns") 5 | require("cjdns/uci") 6 | 7 | function help() 8 | print("JSON interface to /etc/config/cjdns\n\nExamples: \ 9 | cjdrouteconf get > /tmp/etc/cjdroute.conf \ 10 | cat /tmp/etc/cjdroute.conf | cjdrouteconf set \ 11 | uci changes \ 12 | cjdrouteconf get | cjdroute") 13 | end 14 | 15 | if arg[1] == "get" then 16 | local json = dkjson.encode(cjdns.uci.get(), { indent = true }) 17 | print(json) 18 | elseif arg[1] == "set" then 19 | local json = io.stdin:read("*a") 20 | local obj, pos, err = dkjson.decode(json, 1, nil) 21 | 22 | if obj then 23 | cjdns.uci.set(obj) 24 | else 25 | print("dkjson: " .. err .. " (try cjdroute --cleanconf)") 26 | os.exit(1) 27 | end 28 | else 29 | help() 30 | end 31 | -------------------------------------------------------------------------------- /cjdns/lua/cjdns/admin.lua: -------------------------------------------------------------------------------- 1 | -- Cjdns admin module for Lua 2 | -- Written by Philip Horger 3 | 4 | common = require 'cjdns/common' 5 | 6 | AdminInterface = {} 7 | AdminInterface.__index = AdminInterface 8 | common.AdminInterface = AdminInterface 9 | 10 | function AdminInterface.new(properties) 11 | properties = properties or {} 12 | 13 | properties.host = properties.host or "127.0.0.1" 14 | properties.port = properties.port or 11234 15 | properties.password = properties.password or nil 16 | properties.config = properties.config or common.ConfigFile.new("/etc/cjdroute.conf", false) 17 | properties.timeout = properties.timeout or 2 18 | 19 | properties.udp = common.UDPInterface.new(properties) 20 | 21 | return setmetatable(properties, AdminInterface) 22 | end 23 | 24 | function AdminInterface:send(object) 25 | local bencoded, err = bencode.encode(object) 26 | if err then 27 | return nil, err 28 | end 29 | 30 | local sock_obj = assert(socket.udp()) 31 | sock_obj:settimeout(self.timeout) 32 | 33 | local _, err = sock_obj:sendto(bencoded, self.host, self.port) 34 | if err then 35 | return nil, err 36 | end 37 | 38 | return sock_obj 39 | end 40 | 41 | function AdminInterface:recv(sock_obj) 42 | local retrieved, err = sock_obj:receive() 43 | if not retrieved then 44 | return nil, "ai:recv > " .. err 45 | end 46 | local bencoded, err = bencode.decode(retrieved) 47 | if bencoded then 48 | return bencoded 49 | else 50 | return nil, "ai:recv > " .. err 51 | end 52 | end 53 | 54 | function AdminInterface:call(request) 55 | local sock_obj, err = self:send(request) 56 | if err then 57 | return nil, "ai:call > " .. err 58 | end 59 | 60 | return self:recv(sock_obj) 61 | end 62 | 63 | function AdminInterface:getCookie() 64 | local cookie_response, err = self:call({ q = "cookie" }) 65 | if not cookie_response then 66 | return nil, "ai:getCookie > " .. err 67 | end 68 | return cookie_response.cookie 69 | end 70 | 71 | function AdminInterface:auth(request) 72 | local funcname = request.q 73 | local args = {} 74 | for k, v in pairs(request) do 75 | args[k] = v 76 | end 77 | 78 | -- Step 1: Get cookie 79 | local cookie, err = self:getCookie() 80 | if err then 81 | return nil, err 82 | end 83 | 84 | -- Step 2: Calculate hash1 (password + cookie) 85 | local plaintext1 = self.password .. cookie 86 | local hash1 = sha2.sha256hex(plaintext1) 87 | 88 | -- Step 3: Calculate hash2 (intermediate stage request) 89 | local request = { 90 | q = "auth", 91 | aq = funcname, 92 | args = args, 93 | hash = hash1, 94 | cookie = cookie 95 | } 96 | local plaintext2, err = bencode.encode(request) 97 | if err then 98 | return nil, err 99 | end 100 | local hash2 = sha2.sha256hex(plaintext2) 101 | 102 | -- Step 4: Update hash in request, then ship it out 103 | request.hash = hash2 104 | return self:call(request) 105 | end 106 | -------------------------------------------------------------------------------- /cjdns/lua/cjdns/common.lua: -------------------------------------------------------------------------------- 1 | -- Cjdns admin module for Lua 2 | -- Written by Philip Horger 3 | 4 | -- This table is preserved over multiple imports, and collects 5 | -- submodules import-by-import via init.lua. 6 | 7 | return {} 8 | -------------------------------------------------------------------------------- /cjdns/lua/cjdns/init.lua: -------------------------------------------------------------------------------- 1 | -- Cjdns admin module for Lua 2 | -- Written by Philip Horger 3 | 4 | bencode = require "bencode" -- https://bitbucket.org/wilhelmy/lua-bencode/ 5 | dkjson = require "dkjson" -- http://dkolf.de/src/dkjson-lua.fsl/home 6 | socket = require "socket" -- http://w3.impa.br/~diego/software/luasocket/ 7 | sha2 = require "sha2" -- https://code.google.com/p/sha2/ 8 | 9 | require "cjdns/admin" 10 | require "cjdns/udp" 11 | 12 | return require "cjdns/common" 13 | -------------------------------------------------------------------------------- /cjdns/lua/cjdns/udp.lua: -------------------------------------------------------------------------------- 1 | -- Cjdns admin module for Lua 2 | -- Written by Philip Horger 3 | 4 | common = require 'cjdns/common' 5 | 6 | UDPInterface = {} 7 | UDPInterface.__index = UDPInterface 8 | common.UDPInterface = UDPInterface 9 | 10 | function UDPInterface.new(ai, config, ptype) 11 | properties = { 12 | ai = ai, 13 | config = config or ai.config, 14 | ptype = ptype or "ai" 15 | } 16 | 17 | return setmetatable(properties, UDPInterface) 18 | end 19 | 20 | function UDPInterface:call(name, args) 21 | local func = self[name .. "_" .. self.ptype] 22 | return func(self, unpack(args)) 23 | end 24 | 25 | function UDPInterface:newBind(...) 26 | return self:call("newBind", arg) 27 | end 28 | 29 | function UDPInterface:beginConnection(...) 30 | return self:call("beginConnection", arg) 31 | end 32 | 33 | function UDPInterface:newBind_ai(address) 34 | local response, err = self.ai:auth({ 35 | q = "UDPInterface_new", 36 | bindAddress = address 37 | }) 38 | if not response then 39 | return nil, err 40 | elseif response.error ~= "none" then 41 | return nil, response.error 42 | elseif response.interfaceNumber then 43 | return response.interfaceNumber 44 | else 45 | return nil, "bad response format" 46 | end 47 | end 48 | 49 | function UDPInterface:newBind_config(address) 50 | local udpif = self.config.contents.interfaces.UDPInterface 51 | local new_interface = { 52 | bind = address, 53 | connectTo = {} 54 | } 55 | table.insert(udpif, new_interface) 56 | return (#udpif - 1), new_interface 57 | end 58 | 59 | function UDPInterface:newBind_perm(...) 60 | return 61 | self:newBind_config(unpack(arg)), 62 | self:newBind_ai(unpack(arg)) 63 | end 64 | 65 | function UDPInterface:beginConnection_ai(pubkey, addr, password, interface) 66 | local request = { 67 | q = "UDPInterface_beginConnection", 68 | publicKey = pubkey, 69 | address = addr, 70 | password = password 71 | } 72 | if interface then 73 | request.interfaceNumber = interface 74 | end 75 | 76 | local response, err = self.ai:auth(request) 77 | if not response then 78 | return nil, err 79 | elseif response.error == "none" then 80 | -- Unfortunately, no real success indicator either. 81 | return "No error" 82 | else 83 | return nil, response.error 84 | end 85 | end 86 | 87 | function UDPInterface:beginConnection_config(pubkey, addr, password, interface) 88 | local udpif = self.config.contents.interfaces.UDPInterface 89 | local connections = udpif[(interface or 0) + 1].connectTo 90 | local this_conn = { 91 | password = password, 92 | publicKey = pubkey 93 | } 94 | connections[addr] = this_conn 95 | return this_conn -- allows adding metadata fields afterwards 96 | end 97 | 98 | function UDPInterface:beginConnection_perm(...) 99 | return 100 | self:beginConnection_config(unpack(arg)), 101 | self:beginConnection_ai(unpack(arg)) 102 | end 103 | -------------------------------------------------------------------------------- /cjdns/patches/001-five-mins-builder-zonk.patch: -------------------------------------------------------------------------------- 1 | --- a/node_build/builder.js 2 | +++ b/node_build/builder.js 3 | @@ -277,8 +277,8 @@ const execJs = function (js, ctx, file, 4 | js = '"use strict";' + qs.join("'"); 5 | 6 | const to = setTimeout(function () { 7 | - throw new Error("Inline JS did not return after 120 seconds [" + js + "]"); 8 | - }, 120000); 9 | + throw new Error("Inline JS did not return after 5 minutes [" + js + "]"); 10 | + }, 300000); 11 | 12 | nThen(function (waitFor) { 13 | 14 | -------------------------------------------------------------------------------- /cjdns/patches/020-prefer-python2.patch: -------------------------------------------------------------------------------- 1 | --- a/node_build/FindPython.js 2 | +++ b/node_build/FindPython.js 3 | @@ -23,7 +23,7 @@ var Fs = require('fs'); 4 | // de-prioritize because the testing script accepts ANY python3 version 5 | // (as of this writing, we don't know what python3 versions actually work) 6 | // whereas we know that python2.7 is the only working python2 version. 7 | -var PYTHONS = ["python3.7", "python3", "python2.7", "python2", "python"]; 8 | +var PYTHONS = ["python2", "python2.7", "python3.7", "python3.8", "python3.9", "python3"] 9 | 10 | var SCRIPT = [ 11 | 'import sys', 12 | -------------------------------------------------------------------------------- /cjdns/patches/030-fix-invalid-pointer.patch: -------------------------------------------------------------------------------- 1 | --- a/net/SwitchPinger_admin.c 2 | +++ b/net/SwitchPinger_admin.c 3 | @@ -78,8 +78,10 @@ static void adminPing(Dict* args, void* 4 | uint32_t timeout = (timeoutPtr) ? *timeoutPtr : DEFAULT_TIMEOUT; 5 | uint64_t path; 6 | String* err = NULL; 7 | + String* pathNotParsable = String_CONST("path was not parsable."); 8 | + String* noOpenSlots = String_CONST("no open slots to store ping, try later."); 9 | if (pathStr->len != 19 || AddrTools_parsePath(&path, (uint8_t*) pathStr->bytes)) { 10 | - err = String_CONST("path was not parsable."); 11 | + err = pathNotParsable; 12 | } else { 13 | struct SwitchPinger_Ping* ping = SwitchPinger_newPing(path, 14 | data, 15 | @@ -89,7 +91,7 @@ static void adminPing(Dict* args, void* 16 | context->switchPinger); 17 | if (keyPing && *keyPing) { ping->type = SwitchPinger_Type_KEYPING; } 18 | if (!ping) { 19 | - err = String_CONST("no open slots to store ping, try later."); 20 | + err = noOpenSlots; 21 | } else { 22 | ping->onResponseContext = Allocator_clone(ping->pingAlloc, (&(struct Ping) { 23 | .context = context, 24 | -------------------------------------------------------------------------------- /hnetd/files/hnet.config: -------------------------------------------------------------------------------- 1 | config security security 2 | # Simplest security mode: 3 | # option password foo 4 | # Trust consensus and CA-based share these options: 5 | # option certificate_file /etc/hnetd-cert.pem 6 | # option private_key_file /etc/hnetd-key.pem 7 | # Then to enable trust consensus: 8 | # option trust_store /etc/hnetd-trust.dat 9 | # Or CA-based authentication: 10 | # option trust_certificate_file /etc/ca-cert.pem 11 | 12 | config pa pa 13 | # option ip4prefix 10.0.0.0/8 14 | # option ip4mode ifuplink 15 | # option ulaprefix fd12:3456:789A::/48 16 | # option ulamode off 17 | option persistent_store /etc/hnet-pa.store 18 | 19 | config sd sd 20 | # option router_name openwrt 21 | # option domain_name home. 22 | 23 | 24 | # Wifi allows for very basic wifi autoconfiguration 25 | # Warning: This feature is unstable 26 | config wifi wifi 27 | # option enable 0 28 | # option ssid ssidtest 29 | # option password test 30 | -------------------------------------------------------------------------------- /hnetd/files/hnetd.defaults: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Why we tune dnsmasq? 4 | # localservice=0 => other hnetd instances can query for local names 5 | # boguspriv=0 => allow reverse resolution of RFC1918 w/o local hosts entries 6 | 7 | uci batch <psk); 32 | d->psk = malloc(psk_len); 33 | if (!d->psk) 34 | @@ -1011,6 +1014,9 @@ bool dtls_set_psk(dtls d, const char *ps 35 | SSL_CTX_set_psk_client_callback(d->ssl_client_ctx, _client_psk); 36 | SSL_CTX_set_psk_server_callback(d->ssl_server_ctx, _server_psk); 37 | return true; 38 | +#else 39 | + return false; 40 | +#endif 41 | } 42 | 43 | bool dtls_cert_to_pem_buf(dtls_cert cert, char *buf, int buf_len) 44 | -------------------------------------------------------------------------------- /hnetd/patches/020-unused.patch: -------------------------------------------------------------------------------- 1 | --- a/src/hnetd.h 2 | +++ b/src/hnetd.h 3 | @@ -39,6 +39,7 @@ 4 | 5 | #endif /* __APPLE__ */ 6 | 7 | +#undef __unused 8 | #include 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/etc/config/luci-bmx6: -------------------------------------------------------------------------------- 1 | config 'bmx6' 'luci' 2 | option ignore '0' 3 | option place 'admin network BMX6' 4 | #option place 'qmp Mesh' 5 | option position '3' 6 | #option json 'http://127.0.0.1/cgi-bin/bmx6-info?' 7 | option json 'exec:/www/cgi-bin/bmx6-info -s' 8 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/usr/lib/lua/luci/model/cbi/bmx6/advanced.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2011 Pau Escrich 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License along 15 | with this program; if not, write to the Free Software Foundation, Inc., 16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | The full GNU General Public License is included in this distribution in 19 | the file called "COPYING". 20 | --]] 21 | 22 | m = Map("bmx6", "bmx6") 23 | 24 | local bmx6json = require("luci.model.bmx6json") 25 | local util = require("luci.util") 26 | local http = require("luci.http") 27 | local sys = require("luci.sys") 28 | 29 | local options = bmx6json.get("options") 30 | if options == nil or options.OPTIONS == nil then 31 | m.message = "bmx6-json plugin is not running or some mistake in luci-bmx6 configuration, check /etc/config/luci-bmx6" 32 | options = {} 33 | else 34 | options = options.OPTIONS 35 | end 36 | 37 | local general = m:section(NamedSection,"general","bmx6") 38 | general.addremove = true 39 | 40 | local name = "" 41 | local help = "" 42 | local value = nil 43 | local _,o 44 | 45 | for _,o in ipairs(options) do 46 | if o.name ~= nil and o.CHILD_OPTIONS == nil and o.configurable == 1 then 47 | help = "" 48 | name = o.name 49 | 50 | if o.help ~= nil then 51 | help = bmx6json.text2html(o.help) 52 | end 53 | 54 | if o.syntax ~= nil then 55 | help = help .. "
Syntax: " .. bmx6json.text2html(o.syntax) 56 | end 57 | 58 | if o.def ~= nil then 59 | help = help .. " Default: " .. o.def 60 | end 61 | 62 | value = general:option(Value,name,name,help) 63 | 64 | end 65 | end 66 | 67 | function m.on_commit(self,map) 68 | local err = sys.call('bmx6 -c --configReload > /tmp/bmx6-luci.err.tmp') 69 | if err ~= 0 then 70 | m.message = sys.exec("cat /tmp/bmx6-luci.err.tmp") 71 | end 72 | end 73 | 74 | return m 75 | 76 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/usr/lib/lua/luci/model/cbi/bmx6/hna.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2011 Pau Escrich 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License along 15 | with this program; if not, write to the Free Software Foundation, Inc., 16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | The full GNU General Public License is included in this distribution in 19 | the file called "COPYING". 20 | --]] 21 | 22 | local sys = require("luci.sys") 23 | 24 | m = Map("bmx6", "bmx6") 25 | 26 | local hna = m:section(TypedSection,"unicastHna","IPv6 HNA") 27 | hna.addremove = true 28 | hna.anonymous = true 29 | local hna_option = hna:option(Value,"unicastHna", "IPv6 Host Network Announcement. Syntax /") 30 | 31 | --function hna_option:validate(value) 32 | -- local err = sys.call('bmx6 -c --test -a ' .. value) 33 | -- if err ~= 0 then 34 | -- return nil 35 | -- end 36 | -- return value 37 | --end 38 | 39 | function m.on_commit(self,map) 40 | local err = sys.call('bmx6 -c --configReload > /tmp/bmx6-luci.err.tmp') 41 | if err ~= 0 then 42 | m.message = sys.exec("cat /tmp/bmx6-luci.err.tmp") 43 | end 44 | end 45 | 46 | return m 47 | 48 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/usr/lib/lua/luci/model/cbi/bmx6/interfaces.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2011 Pau Escrich 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License along 15 | with this program; if not, write to the Free Software Foundation, Inc., 16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | The full GNU General Public License is included in this distribution in 19 | the file called "COPYING". 20 | --]] 21 | 22 | local sys = require("luci.sys") 23 | local bmx6json = require("luci.model.bmx6json") 24 | local m = Map("bmx6", "bmx6") 25 | 26 | local eth_int = sys.net.devices() 27 | local interfaces = m:section(TypedSection,"dev","Devices","") 28 | interfaces.addremove = true 29 | interfaces.anonymous = true 30 | 31 | local intlv = interfaces:option(ListValue,"dev","Device") 32 | 33 | for _,i in ipairs(eth_int) do 34 | intlv:value(i,i) 35 | end 36 | 37 | -- Getting json and looking for device section 38 | local json = bmx6json.get("options") 39 | 40 | if json == nil or json.OPTIONS == nil then 41 | m.message = "bmx6-json plugin is not running or some mistake in luci-bmx6 configuration, check /etc/config/luci-bmx6" 42 | json = {} 43 | else 44 | json = json.OPTIONS 45 | end 46 | 47 | local dev = {} 48 | for _,j in ipairs(json) do 49 | if j.name == "dev" and j.CHILD_OPTIONS ~= nil then 50 | dev = j.CHILD_OPTIONS 51 | break 52 | end 53 | end 54 | 55 | local help = "" 56 | local name = "" 57 | 58 | for _,o in ipairs(dev) do 59 | if o.name ~= nil then 60 | help = "" 61 | name = o.name 62 | if o.help ~= nil then 63 | help = bmx6json.text2html(o.help) 64 | end 65 | 66 | if o.syntax ~= nil then 67 | help = help .. "
Syntax: " .. bmx6json.text2html(o.syntax) 68 | end 69 | 70 | value = interfaces:option(Value,name,name,help) 71 | value.optional = true 72 | end 73 | end 74 | 75 | 76 | return m 77 | 78 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/usr/lib/lua/luci/model/cbi/bmx6/plugins.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2011 Pau Escrich 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License along 15 | with this program; if not, write to the Free Software Foundation, Inc., 16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | The full GNU General Public License is included in this distribution in 19 | the file called "COPYING". 20 | --]] 21 | local sys = require("luci.sys") 22 | 23 | m = Map("bmx6", "bmx6") 24 | plugins_dir = {"/usr/lib/","/var/lib","/lib"} 25 | 26 | plugin = m:section(TypedSection,"plugin","Plugin") 27 | plugin.addremove = true 28 | plugin.anonymous = true 29 | plv = plugin:option(ListValue,"plugin", "Plugin") 30 | 31 | for _,d in ipairs(plugins_dir) do 32 | pl = luci.sys.exec("cd "..d..";ls bmx6_*") 33 | if #pl > 6 then 34 | for _,v in ipairs(luci.util.split(pl,"\n")) do 35 | plv:value(v,v) 36 | end 37 | end 38 | end 39 | 40 | 41 | function m.on_commit(self,map) 42 | local err = sys.call('/etc/init.d/bmx6 restart') 43 | if err ~= 0 then 44 | m.message = sys.exec("Cannot restart bmx6") 45 | end 46 | end 47 | 48 | 49 | return m 50 | 51 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/usr/lib/lua/luci/model/cbi/bmx6/tunnels.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2011 Pau Escrich 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License along 15 | with this program; if not, write to the Free Software Foundation, Inc., 16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | The full GNU General Public License is included in this distribution in 19 | the file called "COPYING". 20 | --]] 21 | 22 | local sys = require("luci.sys") 23 | local bmx6json = require("luci.model.bmx6json") 24 | 25 | m = Map("bmx6", "bmx6") 26 | 27 | -- tunOut 28 | local tunnelsOut = m:section(TypedSection,"tunOut",translate("Networks to fetch"),translate("Gateways announcements to fetch")) 29 | tunnelsOut.addremove = true 30 | tunnelsOut.anonymous = true 31 | tunnelsOut:option(Value,"tunOut","Name") 32 | tunnelsOut:option(Value,"network", translate("Network to fetch")) 33 | 34 | local tunoptions = bmx6json.getOptions("tunOut") 35 | local _,o 36 | for _,o in ipairs(tunoptions) do 37 | if o.name ~= nil and o.name ~= "network" then 38 | help = bmx6json.getHtmlHelp(o) 39 | value = tunnelsOut:option(Value,o.name,o.name,help) 40 | value.optional = true 41 | end 42 | end 43 | 44 | 45 | -- tunOut 46 | local tunnelsIn = m:section(TypedSection,"tunIn",translate("Networks to offer"),translate("Gateways to announce in the network")) 47 | tunnelsIn.addremove = true 48 | tunnelsIn.anonymous = true 49 | tunnelsIn:option(Value,"tunIn","Name") 50 | tunnelsIn:option(Value,"network", translate("Network to offer")) 51 | 52 | local tunInoptions = bmx6json.getOptions("tunIn") 53 | local _,o 54 | for _,o in ipairs(tunInoptions) do 55 | if o.name ~= nil and o.name ~= "network" then 56 | help = bmx6json.getHtmlHelp(o) 57 | value = tunnelsIn:option(Value,o.name,o.name,help) 58 | value.optional = true 59 | end 60 | end 61 | 62 | function m.on_commit(self,map) 63 | --Not working. If test returns error the changes are still commited 64 | local msg = bmx6json.testandreload() 65 | if msg ~= nil then 66 | m.message = msg 67 | end 68 | end 69 | 70 | return m 71 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/usr/lib/lua/luci/view/bmx6/chat.htm: -------------------------------------------------------------------------------- 1 | <%+header%> 2 | 3 |

<%:Chat%>

4 |

This is sms a chat where all bmx6 nodes can participate. The data is replayed using routing packets, so there is a limit of 2040 bytes. Use it only to send short messages.

5 |

Each participant can only send one sms at same time.

6 |
7 | 8 | Received SMS 9 |
10 |
11 | <% for orig,sms in pairs(chat) do %>
12 |          <%=orig%>:<%=sms%>
13 | <% end %>
14 | 
15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 | 25 |
26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 |
Your last sms:
<%=sent%>
34 | <%+footer%> 35 | 36 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/usr/lib/lua/luci/view/bmx6/error.htm: -------------------------------------------------------------------------------- 1 | <%+header%> 2 |

<%:ERROR%>

3 | Some error has occurred 4 |
5 |
 6 | 	<%=txt%>
 7 | 
8 |
9 | <%+footer%> 10 | 11 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/usr/lib/lua/luci/view/bmx6/graph.htm: -------------------------------------------------------------------------------- 1 | <%# 2 | Copyright (C) 2011 Pau Escrich 3 | Contributors Jo-Philip 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | The full GNU General Public License is included in this distribution in 20 | the file called "COPYING". 21 | -%> 22 | 23 | <% 24 | luci.http.prepare_content("text/html") 25 | 26 | local location = { unpack(luci.dispatcher.context.path) } 27 | location[#location] = "topology" 28 | %> 29 | 30 | <%+header%> 31 | 32 | 33 | 34 |
35 |

36 | 37 | <%:Collecting data...%> 38 | 39 |
40 | 41 |
42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | <%+footer%> 50 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/usr/lib/lua/luci/view/bmx6/links.htm: -------------------------------------------------------------------------------- 1 | <%+header%> 2 | 3 |

<%:Links%>

4 |
5 | 52 | 53 |
54 |
55 | <%+footer%> 56 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/usr/lib/lua/luci/view/bmx6/status_j.htm: -------------------------------------------------------------------------------- 1 | <%+header%> 2 | 3 | 4 | 5 | 6 | 32 |
33 |
34 | 35 |
36 |
37 | a mesh routing protocol for Linux devices.
38 | Visit bmx6.net for more info. 39 |
40 |
41 |
42 | 43 |

status

44 |
45 |
46 | <%:status%> 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
<%:Version%><%:Primary IP%><%:Tun6Address%><%:Tun4Address%><%:Uptime%><%:Cpu load%><%:Nodes seen%>

<%:Collecting data...%>
61 |
62 | 63 |
64 | 65 | 86 | 87 | <%+footer%> 88 | 89 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/bmx6logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coolsnowwolf/routing/d6138757432b18203f4a983c2392e948fc8b8941/luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/bmx6logo.png -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/js/polling.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Pau Escrich 3 | Contributors Lluis Esquerda 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | 19 | The full GNU General Public License is included in this distribution in 20 | the file called "COPYING". 21 | */ 22 | 23 | 24 | /* 25 | Table pooler is a function to easy call XHR poller. 26 | 27 | new TablePooler(5,"/cgi-bin/bmx6-info", {'status':''}, "status_table", function(st){ 28 | var table = Array() 29 | table.push(st.first,st.second) 30 | return table 31 | } 32 | Parameters are: 33 | polling_time: time between pollings 34 | json_url: the json url to fetch the data 35 | json_call: the json call 36 | output_table_id: the table where javascript will put the data 37 | callback_function: the function that will be executed each polling_time 38 | 39 | The callback_function must return an array of arrays (matrix). 40 | In the code st is the data obtained from the json call 41 | */ 42 | 43 | function TablePooler (time, jsonurl, getparams, table_id, callback) { 44 | this.table = document.getElementById(table_id); 45 | this.callback = callback; 46 | this.jsonurl = jsonurl; 47 | this.getparams = getparams; 48 | this.time = time; 49 | 50 | this.clear = function(){ 51 | /* clear all rows */ 52 | while( this.table.rows.length > 1 ) this.table.deleteRow(1); 53 | } 54 | this.start = function(){ 55 | XHR.poll(this.time, this.jsonurl, this.getparams, function(x, st){ 56 | var data = this.callback(st); 57 | var content, tr, td; 58 | this.clear(); 59 | for (var i = 0; i < data.length; i++){ 60 | tr = this.table.insertRow(-1); 61 | tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1); 62 | 63 | for (var j = 0; j < data[i].length; j++){ 64 | td = tr.insertCell(-1); 65 | if (data[i][j].length == 2) { 66 | td.colSpan = data[i][j][1]; 67 | content = data[i][j][0]; 68 | } 69 | else content = data[i][j]; 70 | td.innerHTML = content; 71 | } 72 | } 73 | }.bind(this)); 74 | } 75 | 76 | 77 | this.start(); 78 | } 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coolsnowwolf/routing/d6138757432b18203f4a983c2392e948fc8b8941/luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/link.png -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/style.css: -------------------------------------------------------------------------------- 1 | table { 2 | width:90%; 3 | border-top:1px solid #e5eaf8; 4 | border-right:1px solid #e5eaf8; 5 | margin:1em auto; 6 | border-collapse:collapse; 7 | } 8 | 9 | td { 10 | color:#678197; 11 | border-bottom:1px solid #e6eff8; 12 | border-left:1px solid #e6eff8; 13 | padding:.3em 1em; 14 | text-align:center; 15 | } 16 | th { 17 | background:#f4f9fe; 18 | text-align:center; 19 | font:bold 1.2em/2em Century Gothic,Trebuchet MS,Arial,Helvetica,sans-serif; 20 | color:#66a3d3; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/wifi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coolsnowwolf/routing/d6138757432b18203f4a983c2392e948fc8b8941/luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/wifi.png -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coolsnowwolf/routing/d6138757432b18203f4a983c2392e948fc8b8941/luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/world.png -------------------------------------------------------------------------------- /luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/world_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coolsnowwolf/routing/d6138757432b18203f4a983c2392e948fc8b8941/luci-app-bmx6/bmx6/www/luci-static/resources/bmx6/world_small.png -------------------------------------------------------------------------------- /luci-app-bmx6/dracula/dracula_graffle.js: -------------------------------------------------------------------------------- 1 | Raphael.fn.connection=function(a,b,c){var d=this,e={draw:function(){for(var f=a.getBBox(),g=b.getBBox(),h=0,i=0,j=[{x:f.x+f.width/2,y:f.y-h},{x:f.x+f.width/2,y:f.y+f.height+h},{x:f.x-h,y:f.y+f.height/2},{x:f.x+f.width+h,y:f.y+f.height/2},{x:g.x+g.width/2,y:g.y-i},{x:g.x+g.width/2,y:g.y+g.height+i},{x:g.x-i,y:g.y+g.height/2},{x:g.x+g.width+i,y:g.y+g.height/2}],k={},l=[],m=0;m<4;m++)for(var n=4;n<8;n++){var o=Math.abs(j[m].x-j[n].x),p=Math.abs(j[m].y-j[n].y);(m==n-4||(3!=m&&6!=n||j[m].xj[n].x)&&(0!=m&&5!=n||j[m].y>j[n].y)&&(1!=m&&4!=n||j[m].y. 15 | # 16 | 17 | include $(TOPDIR)/rules.mk 18 | 19 | PKG_NAME:=luci-app-cjdns 20 | PKG_VERSION:=1.3 21 | PKG_RELEASE:=8 22 | 23 | PKG_MAINTAINER:=William Fleurant 24 | PKG_LICENSE:=GPL-3.0-or-later 25 | 26 | include $(INCLUDE_DIR)/package.mk 27 | 28 | define Package/luci-app-cjdns 29 | SECTION:=luci 30 | CATEGORY:=LuCI 31 | SUBMENU:=3. Applications 32 | TITLE:=Encrypted near-zero-conf mesh routing protocol 33 | URL:=https://github.com/cjdelisle/cjdns 34 | DEPENDS:=+cjdns +luci-compat +luci-base 35 | endef 36 | 37 | define Package/luci-app-cjdns/description 38 | Cjdns implements an encrypted IPv6 network using public-key cryptography \ 39 | for address allocation and a distributed hash table for routing. \ 40 | This provides near-zero-configuration networking, and prevents many \ 41 | of the security and scalability issues that plague existing networks. 42 | endef 43 | 44 | define Build/Compile 45 | endef 46 | 47 | define Package/luci-app-cjdns/install 48 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci $(1)/usr/share/rpcd/acl.d 49 | $(CP) ./luasrc/* $(1)/usr/lib/lua/luci 50 | $(CP) ./files/luci-app-cjdns.json $(1)/usr/share/rpcd/acl.d 51 | endef 52 | 53 | $(eval $(call BuildPackage,luci-app-cjdns)) 54 | -------------------------------------------------------------------------------- /luci-app-cjdns/files/luci-app-cjdns.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-cjdns": { 3 | "description": "Grant access to LuCI app cjdns", 4 | "read": { 5 | "uci": [ "cjdns" ] 6 | }, 7 | "write": { 8 | "file": { 9 | "/usr/bin/cjdrouteconf": [ "exec" ] 10 | }, 11 | "uci": [ "cjdns" ] 12 | } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /luci-app-cjdns/luasrc/model/cbi/cjdns/cjdrouteconf.lua: -------------------------------------------------------------------------------- 1 | m = Map("cjdns", translate("cjdns"), 2 | translate("Implements an encrypted IPv6 network using public-key \ 3 | cryptography for address allocation and a distributed hash table for \ 4 | routing. This provides near-zero-configuration networking, and prevents \ 5 | many of the security and scalability issues that plague existing \ 6 | networks.")) 7 | 8 | dkjson = require("dkjson") 9 | cjdns = require("cjdns") 10 | require("cjdns/uci") 11 | 12 | local f = SimpleForm("cjdrouteconf", translate("Edit cjdroute.conf"), 13 | translate("JSON interface to what's /etc/cjdroute.conf on other systems. \ 14 | Will be parsed and written to UCI by cjdrouteconf set.")) 15 | 16 | local o = f:field(Value, "_cjdrouteconf") 17 | o.template = "cbi/tvalue" 18 | o.rows = 25 19 | 20 | function o.cfgvalue(self, section) 21 | return dkjson.encode(cjdns.uci.get(), { indent = true }) 22 | end 23 | 24 | function o.write(self, section, value) 25 | local obj, pos, err = dkjson.decode(value, 1, nil) 26 | 27 | if obj then 28 | cjdns.uci.set(obj) 29 | end 30 | end 31 | 32 | return f 33 | -------------------------------------------------------------------------------- /luci-app-cjdns/luasrc/model/cbi/cjdns/iptunnel.lua: -------------------------------------------------------------------------------- 1 | uci = require "luci.model.uci" 2 | cursor = uci:cursor_state() 3 | 4 | m = Map("cjdns", translate("cjdns"), 5 | translate("Implements an encrypted IPv6 network using public-key \ 6 | cryptography for address allocation and a distributed hash table for \ 7 | routing. This provides near-zero-configuration networking, and prevents \ 8 | many of the security and scalability issues that plague existing \ 9 | networks.")) 10 | 11 | m.on_after_commit = function(self) 12 | os.execute("/etc/init.d/cjdns restart") 13 | end 14 | 15 | -- Outgoing 16 | outgoing = m:section(TypedSection, "iptunnel_outgoing", translate("Outgoing IP Tunnel Connections"), 17 | translate("Enter the public keys of the nodes that will provide Internet access.")) 18 | outgoing.anonymous = true 19 | outgoing.addremove = true 20 | outgoing.template = "cbi/tblsection" 21 | 22 | outgoing:option(Value, "public_key", translate("Public Key")).size = 55 23 | 24 | -- Allowed 25 | allowed = m:section(TypedSection, "iptunnel_allowed", translate("Allowed IP Tunnel Connections"), 26 | translate("Enter the public key of the node you will provide Internet access to, along with the \ 27 | IPv4 and/or IPv6 address you will assign them.")) 28 | allowed.anonymous = true 29 | allowed.addremove = true 30 | 31 | public_key = allowed:option(Value, "public_key", translate("Public Key")) 32 | public_key.template = "cjdns/value" 33 | public_key.size = 55 34 | 35 | ipv4 = allowed:option(Value, "ipv4", translate("IPv4")) 36 | ipv4.template = "cjdns/value" 37 | ipv4.datatype = 'ipaddr' 38 | ipv4.size = 55 39 | 40 | ipv6 = allowed:option(Value, "ipv6", translate("IPv6"), 41 | translate("IPv6 addresses should be entered without brackets here, e.g. 2001:123:ab::10.")) 42 | ipv6.template = "cjdns/value" 43 | ipv6.datatype = 'ip6addr' 44 | ipv6.size = 55 45 | 46 | return m 47 | -------------------------------------------------------------------------------- /luci-app-cjdns/luasrc/model/cbi/cjdns/overview.lua: -------------------------------------------------------------------------------- 1 | m = Map("cjdns", translate("cjdns"), 2 | translate("Implements an encrypted IPv6 network using public-key \ 3 | cryptography for address allocation and a distributed hash table for \ 4 | routing. This provides near-zero-configuration networking, and prevents \ 5 | many of the security and scalability issues that plague existing \ 6 | networks.")) 7 | 8 | m:section(SimpleSection).template = "cjdns/status" 9 | 10 | return m 11 | -------------------------------------------------------------------------------- /luci-app-cjdns/luasrc/view/admin_status/index/cjdns.htm: -------------------------------------------------------------------------------- 1 | <%+cjdns/status%> 2 | -------------------------------------------------------------------------------- /luci-app-cjdns/luasrc/view/cjdns/status.htm: -------------------------------------------------------------------------------- 1 | 52 | 53 |
54 |
55 | <%:Active cjdns peers%> 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |
AddressIPv6VersionStatusRx / TxUser/Name
66 |
67 |
-------------------------------------------------------------------------------- /luci-app-cjdns/luasrc/view/cjdns/value.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | style="width: auto" /> 6 | <% if self.password then %><% end %> 7 | <% if #self.keylist > 0 or self.datatype then -%> 8 | 34 | <% end -%> 35 | <%+cbi/valuefooter%> 36 | -------------------------------------------------------------------------------- /mcproxy/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014-2017 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | 8 | include $(TOPDIR)/rules.mk 9 | 10 | PKG_NAME:=mcproxy 11 | PKG_RELEASE:=$(AUTORELEASE) 12 | 13 | PKG_SOURCE_PROTO:=git 14 | PKG_SOURCE_URL:=https://github.com/mcproxy/mcproxy.git 15 | PKG_SOURCE_DATE:=2017-08-24 16 | PKG_SOURCE_VERSION:=93b5ace42268160ebbfff4c61818fb15fa2d9b99 17 | PKG_MIRROR_HASH:=d9f41f93d471b3c92debffe734f48f03f5c6c6e90bb173993f44b33e699387f9 18 | 19 | PKG_MAINTAINER:=Steven Barth 20 | PKG_LICENSE:=GPL-2.0-or-later 21 | PKG_LICENSE_FILES:=COPYING 22 | 23 | include $(INCLUDE_DIR)/package.mk 24 | include $(INCLUDE_DIR)/cmake.mk 25 | 26 | define Package/mcproxy 27 | SECTION:=net 28 | CATEGORY:=Network 29 | SUBMENU:=Routing and Redirection 30 | TITLE:=Multicast Proxy for IGMP/MLD 31 | URL:=https://mcproxy.realmv6.org 32 | DEPENDS:=+libpthread +libstdcpp @(!GCC_VERSION_4_4&&!GCC_VERSION_4_6) 33 | endef 34 | 35 | define Package/mcproxy/description 36 | mcproxy is a free & open source implementation of the IGMP/MLD proxy function (see RFC 4605) for Linux systems. 37 | It operates on the kernel tables for multicast routing and allows for multiple instantiations, 38 | as well as dynamically changing downstream interfaces. 39 | endef 40 | 41 | define Package/mcproxy/conffiles 42 | /etc/mcproxy.conf 43 | /etc/config/mcproxy 44 | endef 45 | 46 | define Package/mcproxy/install 47 | $(INSTALL_DIR) $(1)/etc 48 | $(INSTALL_CONF) ./files/mcproxy.conf $(1)/etc/mcproxy.conf 49 | $(INSTALL_DIR) $(1)/etc/config 50 | $(INSTALL_CONF) ./files/mcproxy.config $(1)/etc/config/mcproxy 51 | $(INSTALL_DIR) $(1)/etc/init.d 52 | $(INSTALL_BIN) ./files/mcproxy.init $(1)/etc/init.d/mcproxy 53 | $(INSTALL_DIR) $(1)/usr/sbin 54 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/mcproxy-bin $(1)/usr/sbin/mcproxy 55 | endef 56 | 57 | $(eval $(call BuildPackage,mcproxy)) 58 | -------------------------------------------------------------------------------- /mcproxy/files/mcproxy.conf: -------------------------------------------------------------------------------- 1 | ###################################### 2 | ##-- mcproxy configuration script --## 3 | ###################################### 4 | 5 | # Protocol: IGMPv1|IGMPv2|IGMPv3 (IPv4) - MLDv1|MLDv2 (IPv6) 6 | protocol IGMPv3; 7 | 8 | ########################################### 9 | 10 | # Proxy Instance: upstream ==> downstream 11 | pinstance A: ap a1 ==> ap a2; 12 | pinstance B: bp b1 ==> bp b2; 13 | 14 | ########################################### 15 | 16 | # Tables 17 | table allways { 18 | (*|*) 19 | }; 20 | 21 | table piA_peering_ifs { 22 | ap(*|*) 23 | }; 24 | 25 | table piA_upstreams { 26 | a1(*|*) 27 | }; 28 | 29 | table piB_peering_ifs { 30 | bp(*|*) 31 | }; 32 | 33 | table piB_upstreams { 34 | b1(*|*) 35 | }; 36 | 37 | ########################################### 38 | 39 | # Instance Behaviour 40 | pinstance A upstream * in rulematching mutex 10; #or 25ms (u4) 41 | #pinstance A upstream * out rulematching all; #default 42 | 43 | pinstance A upstream ap out blacklist table allways; #(u1) 44 | #pinstance A upstream ap in whitelist table {(*|*)}; #default (u2, u3) 45 | 46 | pinstance A upstream a1 out blacklist table piA_peering_ifs; #(u3_1) 47 | #pinstance A upstream a1 in whitelist table {(*|*)}; #default 48 | 49 | pinstance A downstream ap in blacklist table allways; #(d1) 50 | pinstance A downstream ap out blacklist table piA_upstreams; #(d2, d2_1, d3, d4) 51 | 52 | #pinstance A downstream a2 in whitelist table {(*|*)}; #default 53 | #pinstance A downstream a2 out whitelist table {(*|*)}; #default 54 | 55 | pinstance B upstream * in rulematching mutex 10; #or 25ms (u4) 56 | #pinstance B upstream * out rulematching all; #default 57 | 58 | pinstance B upstream bp out blacklist table allways; #(u1) 59 | #pinstance B upstream bp in whitelist table {(*|*)}; #default (u2, u3) 60 | 61 | pinstance B upstream b1 out blacklist table piB_peering_ifs; #(u3_1) 62 | #pinstance b upstream b1 in whitelist table {(*|*)}; #default 63 | 64 | pinstance B downstream bp in blacklist table allways; #(d1) 65 | pinstance B downstream bp out blacklist table piB_upstreams; #(d2, d2_1, d3, d4) 66 | 67 | #pinstance B downstream b2 in whitelist table {(*|*)}; #default 68 | #pinstance B downstream b2 out whitelist table {(*|*)}; #default 69 | -------------------------------------------------------------------------------- /mcproxy/patches/0001-add-cmake.patch: -------------------------------------------------------------------------------- 1 | --- /dev/null 2 | +++ b/CMakeLists.txt 3 | @@ -0,0 +1,51 @@ 4 | +cmake_minimum_required(VERSION 2.8) 5 | + 6 | +# Project Definition 7 | +project(mcproxy CXX) 8 | +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") 9 | +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11") 10 | +add_definitions(-Wall -Wextra) 11 | +include_directories(${CMAKE_SOURCE_DIR}/mcproxy) 12 | + 13 | + 14 | +add_executable(mcproxy-bin mcproxy/src/main.cpp 15 | + mcproxy/src/hamcast_logging.cpp 16 | + #utils 17 | + mcproxy/src/utils/mc_socket.cpp 18 | + mcproxy/src/utils/addr_storage.cpp 19 | + mcproxy/src/utils/mroute_socket.cpp 20 | + mcproxy/src/utils/if_prop.cpp 21 | + mcproxy/src/utils/reverse_path_filter.cpp 22 | + #proxy 23 | + mcproxy/src/proxy/proxy.cpp 24 | + mcproxy/src/proxy/sender.cpp 25 | + mcproxy/src/proxy/receiver.cpp 26 | + mcproxy/src/proxy/mld_receiver.cpp 27 | + mcproxy/src/proxy/igmp_receiver.cpp 28 | + mcproxy/src/proxy/mld_sender.cpp 29 | + mcproxy/src/proxy/igmp_sender.cpp 30 | + mcproxy/src/proxy/proxy_instance.cpp 31 | + mcproxy/src/proxy/routing.cpp 32 | + mcproxy/src/proxy/worker.cpp 33 | + mcproxy/src/proxy/timing.cpp 34 | + mcproxy/src/proxy/check_if.cpp 35 | + mcproxy/src/proxy/check_kernel.cpp 36 | + mcproxy/src/proxy/membership_db.cpp 37 | + mcproxy/src/proxy/querier.cpp 38 | + mcproxy/src/proxy/timers_values.cpp 39 | + mcproxy/src/proxy/interfaces.cpp 40 | + mcproxy/src/proxy/def.cpp 41 | + mcproxy/src/proxy/simple_mc_proxy_routing.cpp 42 | + mcproxy/src/proxy/simple_routing_data.cpp 43 | + #parser 44 | + mcproxy/src/parser/scanner.cpp 45 | + mcproxy/src/parser/token.cpp 46 | + mcproxy/src/parser/configuration.cpp 47 | + mcproxy/src/parser/parser.cpp 48 | + mcproxy/src/parser/interface.cpp 49 | +) 50 | +target_link_libraries(mcproxy-bin pthread) 51 | + 52 | +# Installation 53 | +install(TARGETS mcproxy-bin DESTINATION bin/) 54 | + 55 | -------------------------------------------------------------------------------- /mcproxy/patches/0002-rm-stoi.patch: -------------------------------------------------------------------------------- 1 | --- a/mcproxy/src/parser/parser.cpp 2 | +++ b/mcproxy/src/parser/parser.cpp 3 | @@ -126,7 +126,7 @@ void parser::parse_instance_definition(i 4 | get_next_token(); 5 | if (m_current_token.get_type() == TT_STRING) { 6 | try { 7 | - table_number = std::stoi(m_current_token.get_string()); 8 | + table_number = atoi(m_current_token.get_string().c_str()); 9 | user_selected_table_number = true; 10 | } catch (std::logic_error e) { 11 | HC_LOG_ERROR("failed to parse line " << m_current_line << " table number: " << table_number << " is not a number"); 12 | @@ -299,7 +299,7 @@ std::unique_ptr parser::pars 13 | get_next_token(); 14 | if (m_current_token.get_type() == TT_STRING) { 15 | try { 16 | - unsigned int prefix = std::stoi(m_current_token.get_string()); 17 | + unsigned int prefix = atoi(m_current_token.get_string().c_str()); 18 | if (prefix > 128) { 19 | throw; 20 | } 21 | @@ -561,7 +561,7 @@ void parser::parse_interface_rule_match_ 22 | get_next_token(); 23 | if (m_current_token.get_type() == TT_STRING) { 24 | try { 25 | - int tmp_timeout = std::stoi(m_current_token.get_string()); 26 | + int tmp_timeout = atoi(m_current_token.get_string().c_str()); 27 | timeout = std::chrono::milliseconds(tmp_timeout); 28 | } catch (...) { 29 | error_notification(); 30 | --- a/mcproxy/src/utils/addr_storage.cpp 31 | +++ b/mcproxy/src/utils/addr_storage.cpp 32 | @@ -298,7 +298,7 @@ addr_storage& addr_storage::set_port(uin 33 | 34 | addr_storage& addr_storage::set_port(const std::string& port) 35 | { 36 | - set_port(std::stoi(port.c_str())); 37 | + set_port(atoi(port.c_str())); 38 | return *this; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /mcproxy/patches/0004-add-defs.patch: -------------------------------------------------------------------------------- 1 | --- a/mcproxy/src/utils/mc_socket.cpp 2 | +++ b/mcproxy/src/utils/mc_socket.cpp 3 | @@ -38,6 +38,8 @@ 4 | #include 5 | 6 | #if !defined(__GLIBC__) || defined(__UCLIBC__) 7 | +#define IP_MULTICAST_ALL 49 8 | + 9 | #include "sourcefilter.cpp" 10 | #endif /* __GLIBC__ */ 11 | 12 | -------------------------------------------------------------------------------- /mcproxy/patches/0005-fix-match-filter-calls.patch: -------------------------------------------------------------------------------- 1 | --- a/mcproxy/src/proxy/simple_mc_proxy_routing.cpp 2 | +++ b/mcproxy/src/proxy/simple_mc_proxy_routing.cpp 3 | @@ -118,13 +118,13 @@ void interface_memberships::process_upst 4 | for (auto source_it = cs.first.m_source_list.begin(); source_it != cs.first.m_source_list.end();) { 5 | 6 | //downstream out 7 | - if (!cs.second->match_output_filter(interfaces::get_if_name(upstr_e.m_if_index), gaddr, source_it->saddr)) { 8 | + if (!cs.second->match_output_filter(interfaces::get_if_name(upstr_e.m_if_index), source_it->saddr, gaddr)) { 9 | source_it = cs.first.m_source_list.erase(source_it); 10 | continue; 11 | } 12 | 13 | //upstream in 14 | - if (!upstr_e.m_interface->match_input_filter(interfaces::get_if_name(upstr_e.m_if_index), gaddr, source_it->saddr)) { 15 | + if (!upstr_e.m_interface->match_input_filter(interfaces::get_if_name(upstr_e.m_if_index), source_it->saddr, gaddr)) { 16 | tmp_sstate.m_source_list.insert(*source_it); 17 | source_it = cs.first.m_source_list.erase(source_it); 18 | continue; 19 | @@ -175,13 +175,13 @@ void interface_memberships::process_upst 20 | for (auto source_it = cs_it->first.m_source_list.begin(); source_it != cs_it->first.m_source_list.end();) { 21 | 22 | //downstream out 23 | - if (!cs_it->second->match_output_filter(interfaces::get_if_name(upstr_e.m_if_index), gaddr, source_it->saddr)) { 24 | + if (!cs_it->second->match_output_filter(interfaces::get_if_name(upstr_e.m_if_index), source_it->saddr, gaddr)) { 25 | ++source_it; 26 | continue; 27 | } 28 | 29 | //upstream in 30 | - if (!upstr_e.m_interface->match_input_filter(interfaces::get_if_name(upstr_e.m_if_index), gaddr, source_it->saddr)) { 31 | + if (!upstr_e.m_interface->match_input_filter(interfaces::get_if_name(upstr_e.m_if_index), source_it->saddr, gaddr)) { 32 | ++source_it; 33 | continue; 34 | } 35 | @@ -619,9 +619,9 @@ bool simple_mc_proxy_routing::check_inte 36 | std::string input_if_index_name = interfaces::get_if_name(input_if_index); 37 | if (!input_if_index_name.empty()) { 38 | if (interface_direction == ID_IN) { 39 | - return interf->match_input_filter(input_if_index_name, gaddr, saddr); 40 | + return interf->match_input_filter(input_if_index_name, saddr, gaddr); 41 | } else if (interface_direction == ID_OUT) { 42 | - return interf->match_output_filter(input_if_index_name, gaddr, saddr); 43 | + return interf->match_output_filter(input_if_index_name, saddr, gaddr); 44 | } else { 45 | HC_LOG_ERROR("unkown interface direction"); 46 | return false; 47 | -------------------------------------------------------------------------------- /mesh11sd/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # This is free software, licensed under the GNU General Public License v2. 4 | # See /LICENSE for more information. 5 | # Copyright (C) 2022 BlueWave Projects and Services 6 | # 7 | 8 | include $(TOPDIR)/rules.mk 9 | 10 | PKG_NAME:=mesh11sd 11 | PKG_VERSION:=1.0.0 12 | PKG_RELEASE:=$(AUTORELEASE) 13 | 14 | PKG_MAINTAINER:=Rob White 15 | PKG_LICENSE:=GPL-2.0-or-later 16 | PKG_LICENSE_FILES:=LICENSE 17 | 18 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 19 | PKG_SOURCE_URL:=https://codeload.github.com/opennds/mesh11sd/tar.gz/v$(PKG_VERSION)? 20 | PKG_HASH:=a9f2ac4e1cdf5c4fe933ad68adf7c62d6d4a5e20a7f61f79dfa26a309f97049e 21 | PKG_BUILD_DIR:=$(BUILD_DIR)/mesh11sd-$(PKG_VERSION) 22 | 23 | include $(INCLUDE_DIR)/package.mk 24 | 25 | define Package/mesh11sd 26 | SUBMENU:=Captive Portals 27 | SECTION:=net 28 | CATEGORY:=Network 29 | TITLE:=Dynamic 802.11s Mesh Configuration Daemon 30 | PKGARCH:=all 31 | URL:=https://github.com/opennds/mesh11sd 32 | endef 33 | 34 | define Package/mesh11sd/description 35 | Mesh11sd is a dynamic parameter configuration daemon for 802.11s mesh networks. 36 | It was originally designed to leverage 802.11s mesh networking at Captive Portal venues. 37 | This is the open source version and it enables easy and automated mesh network operation with multiple mesh nodes. 38 | It allows all mesh parameters supported by the wireless driver to be set in the uci config file. 39 | Settings take effect immediately without having to restart the wireless network. 40 | Default settings give rapid and reliable layer 2 mesh convergence. 41 | Without mesh11sd, many mesh parameters cannot be set in the uci wireless config file as the mesh interface must be up before the parameters can be set. 42 | Some of those that are supported, would fail to be implemented when the network is (re)started resulting in errors or dropped nodes. 43 | The mesh11sd daemon dynamically checks configured parameters and sets them as required. 44 | This version does not require a Captive Portal to be running. 45 | endef 46 | 47 | define Package/mesh11sd/install 48 | $(INSTALL_DIR) $(1)/usr/sbin 49 | $(INSTALL_DIR) $(1)/etc/config 50 | $(INSTALL_DIR) $(1)/etc/init.d 51 | $(CP) $(PKG_BUILD_DIR)/src/mesh11sd $(1)/usr/sbin 52 | $(CP) $(PKG_BUILD_DIR)/linux_openwrt/mesh11sd/files/etc/config/mesh11sd $(1)/etc/config/ 53 | $(CP) $(PKG_BUILD_DIR)/linux_openwrt/mesh11sd/files/etc/init.d/mesh11sd $(1)/etc/init.d/ 54 | endef 55 | 56 | define Package/mesh11sd/conffiles 57 | /etc/config/mesh11sd 58 | endef 59 | 60 | define Build/Compile 61 | endef 62 | 63 | $(eval $(call BuildPackage,mesh11sd)) 64 | -------------------------------------------------------------------------------- /minimalist-pcproxy/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | 7 | include $(TOPDIR)/rules.mk 8 | 9 | PKG_NAME:=minimalist-pcproxy 10 | PKG_RELEASE:=$(AUTORELEASE) 11 | 12 | PKG_SOURCE_PROTO:=git 13 | PKG_SOURCE_URL:=https://github.com/fingon/minimalist-pcproxy.git 14 | PKG_SOURCE_DATE:=2014-12-12 15 | PKG_SOURCE_VERSION:=2d6d1b0b0a3b79a9b4a9b0a7606a84600a967bcb 16 | PKG_MIRROR_HASH:=0065015e8063a20ee79f1ade4ac2e173a5ff6cffe762521271ec7b849bb956a7 17 | 18 | PKG_MAINTAINER:=Markus Stenberg 19 | PKG_LICENSE:=BSD-3-Clause 20 | PKG_LICENSE_FILES:=LICENSE 21 | 22 | include $(INCLUDE_DIR)/package.mk 23 | include $(INCLUDE_DIR)/cmake.mk 24 | 25 | define Package/minimalist-pcproxy 26 | SECTION:=net 27 | CATEGORY:=Network 28 | TITLE:=Lightweight PCP proxy 29 | URL:=https://github.com/fingon/minimalist-pcproxy 30 | DEPENDS:=+libubox @IPV6 31 | endef 32 | 33 | define Package/minimalist-pcproxy/description 34 | This package contains a daemon which can be used to forward 35 | PCP (Port Control Protocol - RFC6887) requests requests to PCP remote servers. 36 | 37 | In and of itself, it is not very useful, but combined with hnetd+miniupnpd 38 | it allows for control of NAT forwarding and firewall pinholes from multiple 39 | hops away. 40 | endef 41 | 42 | define Package/minimalist-pcproxy/install 43 | $(INSTALL_DIR) $(1)/usr/sbin/ 44 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/minimalist-pcproxy $(1)/usr/sbin/ 45 | $(INSTALL_DIR) $(1)/etc/uci-defaults 46 | $(INSTALL_BIN) ./files/minimalist-pcproxy.defaults $(1)/etc/uci-defaults/x-minimalist-pcproxy.defaults 47 | endef 48 | 49 | define Package/minimalist-pcproxy/postinst 50 | #!/bin/sh 51 | [ -n "$${IPKG_INSTROOT}" ] || { 52 | (. /etc/uci-defaults/x-minimalist-pcproxy.defaults) && rm -f /etc/uci-defaults/x-minimalist-pcproxy.defaults 53 | } 54 | exit 0 55 | endef 56 | 57 | $(eval $(call BuildPackage,minimalist-pcproxy)) 58 | -------------------------------------------------------------------------------- /minimalist-pcproxy/files/minimalist-pcproxy.defaults: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "`uci -q get upnpd.config._pcproxy_configured`" = "1" ] 4 | then 5 | exit 6 | fi 7 | 8 | uci batch < 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | PKG_NAME:=naywatch 9 | PKG_VERSION:=1 10 | PKG_RELEASE:=$(AUTORELEASE) 11 | 12 | PKG_MAINTAINER:=Nick Hainke 13 | PKG_LICENSE:=GPL-2.0-only 14 | 15 | include $(INCLUDE_DIR)/package.mk 16 | 17 | define Package/naywatch 18 | SECTION:=utils 19 | CATEGORY:=Utilities 20 | TITLE:=Watchdog for IPv6 links 21 | PKGARCH:=all 22 | DEPENDS:=@IPV6 +owipcalc 23 | endef 24 | 25 | define Package/naywatch/description 26 | Reboots or triggers watchdog if no link-local neighbor is available. 27 | 28 | Important: 29 | Be careful when you do a sysupgrade. Stop naywatch first, and make 30 | sure procd took control again of the watchdog. 31 | You can do this using 'ubus call system watchdog'. Status should be "running". 32 | endef 33 | 34 | define Package/naywatch/conffiles 35 | /etc/config/naywatch 36 | endef 37 | 38 | define Build/Compile 39 | endef 40 | 41 | define Package/naywatch/install 42 | $(INSTALL_DIR) $(1)/etc/init.d 43 | $(INSTALL_BIN) ./files/naywatch.init $(1)/etc/init.d/naywatch 44 | $(INSTALL_DIR) $(1)/usr/bin 45 | $(INSTALL_BIN) ./files/naywatch.sh $(1)/usr/bin/naywatch 46 | $(INSTALL_DIR) $(1)/etc/config 47 | $(INSTALL_DATA) ./files/naywatch.config $(1)/etc/config/naywatch 48 | endef 49 | 50 | $(eval $(call BuildPackage,naywatch)) 51 | -------------------------------------------------------------------------------- /naywatch/files/naywatch.config: -------------------------------------------------------------------------------- 1 | config naywatch general 2 | option check_interval '50' 3 | option watchdog_timeout '60' 4 | option use_watchdog '0' 5 | option save_logs '1' 6 | list interface 'lan' 7 | list interface 'wan' 8 | list save_cmd 'dmesg' 9 | -------------------------------------------------------------------------------- /naywatch/files/naywatch.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | . /usr/share/libubox/jshn.sh 4 | 5 | USE_PROCD=1 6 | START=95 7 | STOP=01 8 | 9 | log() { 10 | local msg="$1" 11 | logger -t naywatch "$msg" 12 | } 13 | 14 | wait_for_network() 15 | { 16 | ubus -t 15 wait_for network.interface.$1 2>/dev/null 17 | } 18 | 19 | boot() 20 | { 21 | local _interfaces 22 | config_load naywatch 23 | config_get _interfaces general interface 24 | 25 | for interface in $_interfaces; do 26 | wait_for_network interface 27 | done 28 | 29 | rc_procd start_service 30 | } 31 | 32 | start_service() { 33 | procd_open_instance 34 | 35 | config_load naywatch 36 | local _check_interval 37 | local _watchdog_timeout 38 | local _use_watchdog 39 | local _save_logs 40 | local _interfaces 41 | 42 | config_get _check_interval general "check_interval" 43 | config_get _watchdog_timeout general "watchdog_timeout" 44 | config_get _use_watchdog general "use_watchdog" 45 | config_get _save_logs general "save_logs" 46 | config_get _interfaces general "interface" 47 | 48 | procd_set_param command /usr/bin/naywatch "$_check_interval" "$_watchdog_timeout" "$_use_watchdog" "$_save_logs" "$_interfaces" 49 | 50 | procd_set_param respawn 3600 15 0 51 | 52 | procd_set_param stdout 1 53 | procd_set_param stderr 1 54 | 55 | procd_close_instance 56 | } 57 | 58 | stop_service() { 59 | exec 3>&- # close file again 60 | sync && wait 61 | } 62 | 63 | watchdog_procd_runnig() { 64 | watch=$(ubus call system watchdog) 65 | json_load "$watch" 66 | json_get_var watchdogstatus status 67 | if [[ "$watchdogstatus" == "running" ]] ; then 68 | echo "1" 69 | return 70 | fi 71 | echo "0" 72 | } 73 | 74 | service_stopped() { 75 | log "Naywatch Stopped!" 76 | log "Try to handover watchdog to procd again." 77 | for i in 1 2 3 4 5 6 7 8 9 10 ; do 78 | sleep 5 79 | ubus call system watchdog '{"stop":false}' > /dev/null 80 | if [[ $(watchdog_procd_runnig) == "1" ]] ; then 81 | break 82 | fi 83 | done 84 | if [[ $(watchdog_procd_runnig) == "1" ]] ; then 85 | log "Handover sucessfully!" 86 | else 87 | log "Handover to procd failed! Device can reboot!" 88 | fi 89 | } 90 | -------------------------------------------------------------------------------- /naywatch/files/naywatch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /lib/functions.sh 4 | . /lib/functions/network.sh 5 | 6 | CHECK_INTERVAL=$1 7 | shift 8 | WATCHDOG_TIMEOUT=$1 9 | shift 10 | USE_WATCHDOG=$1 11 | shift 12 | SAVE_LOGS=$1 13 | shift 14 | INTERFACES="$*" 15 | 16 | ACTIVE=0 17 | NO_NEIGHBORS_COUNT=0 18 | MIN_KICK=5 19 | 20 | log() { 21 | local msg="$1" 22 | logger -t naywatch "$msg" 23 | } 24 | 25 | write_logs() { 26 | save_log() { 27 | eval $1 > /root/$(date +%s)-"$1".log 28 | } 29 | config_load naywatch 30 | config_list_foreach general save_cmd save_log 31 | sync 32 | } 33 | 34 | neighbors_available() { 35 | local phy 36 | 37 | for interface in $INTERFACES; do 38 | network_get_physdev phy $interface > /dev/null 2>&1 39 | linklocal=$(ip -6 a list dev $phy | grep "scope link" | awk '{print $2}' | sed 's/\/64//') 2> /dev/null 40 | ips=$(ping ff02::1%$phy -w5 -W5 -c2 | awk '/from/{print($4)}' | sed 's/.$//') 2> /dev/null 41 | for ip in $ips; do 42 | if [ $ip != $linklocal ] && [ $(owipcalc $ip linklocal) -eq 1 ]; then 43 | echo 1 44 | return 0 45 | fi 46 | done 47 | done 48 | 49 | echo 0 50 | } 51 | 52 | activate_watchdog() { 53 | # disable openwrt instrumentation: 54 | ubus call system watchdog '{"magicclose":true,"stop":true,"timeout":'${WATCHDOG_TIMEOUT}'}' > /dev/null 55 | exec 3>/dev/watchdog 56 | } 57 | 58 | reboot_now() { 59 | # copied from watch-cat 60 | reboot & 61 | 62 | [ "$1" -ge 1 ] && { 63 | sleep "$1" 64 | echo 1 >/proc/sys/kernel/sysrq 65 | echo b >/proc/sysrq-trigger 66 | } 67 | } 68 | 69 | no_neighbors() { 70 | log "No Neighbors Available!" 71 | 72 | NO_NEIGHBORS_COUNT=$(($NO_NEIGHBORS_COUNT+1)) 73 | 74 | if [ $ACTIVE -eq 0 ]; then 75 | return 0 76 | fi 77 | 78 | if [ $SAVE_LOGS -eq 1 ]; then 79 | log "Saving Logs!" 80 | write_logs 81 | fi 82 | 83 | if [ $USE_WATCHDOG -eq 0 ] && [ $NO_NEIGHBORS_COUNT -gt $MIN_KICK ]; then 84 | reboot_now 10 85 | fi 86 | } 87 | 88 | log "Naywatch Started!" 89 | 90 | neighbors() { 91 | ACTIVE=1 92 | NO_NEIGHBORS_COUNT=0 93 | if [ $USE_WATCHDOG -eq 1 ]; then 94 | echo 1 >&3 95 | fi 96 | } 97 | 98 | not_active() { 99 | if [ $USE_WATCHDOG -eq 1 ]; then 100 | echo 1 >&3 101 | fi 102 | } 103 | 104 | if [ $USE_WATCHDOG -eq 1 ]; then 105 | activate_watchdog 106 | fi 107 | 108 | while [ 1 ]; do 109 | # first sleep 110 | sleep $CHECK_INTERVAL 111 | 112 | has_neighbor=$(neighbors_available) 113 | if [ $has_neighbor -eq 0 ] && [ $ACTIVE -eq 1 ]; then 114 | no_neighbors 115 | elif [ $has_neighbor -eq 1 ]; then 116 | neighbors 117 | else 118 | not_active 119 | fi 120 | done 121 | 122 | exit 0 123 | -------------------------------------------------------------------------------- /ndppd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2007-2011 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | 8 | include $(TOPDIR)/rules.mk 9 | 10 | PKG_NAME:=ndppd 11 | PKG_VERSION:=0.2.5 12 | PKG_RELEASE:=2 13 | 14 | # Latest release 15 | PKG_SOURCE_URL:=https://codeload.github.com/DanielAdolfsson/ndppd/tar.gz/$(PKG_VERSION)? 16 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 17 | PKG_HASH:=ee934167f8357f0bd0015e201a77fbe4d028c59e89dc98113805c6855e1c3992 18 | PKG_LICENSE:=GPL-3.0-or-later 19 | 20 | # Development snapshot 21 | #PKG_SOURCE_URL=git://github.com/Tuhox/ndppd.git 22 | #PKG_SOURCE_VERSION=master 23 | #PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION) 24 | 25 | include $(INCLUDE_DIR)/package.mk 26 | 27 | define Package/ndppd 28 | SECTION:=net 29 | CATEGORY:=Network 30 | TITLE:=NDP Proxy Daemon 31 | URL:=http://www.priv.nu/projects/ndppd/ 32 | MAINTAINER:=Gabriel Kerneis 33 | DEPENDS:=@IPV6 +libstdcpp 34 | endef 35 | 36 | define Package/ndppd/description 37 | ndppd, or NDP Proxy Daemon, is a daemon that proxies NDP (Neighbor Discovery 38 | Protocol) messages between interfaces. ndppd currently only supports Neighbor 39 | Solicitation Messages and Neighbor Advertisement Messages. 40 | 41 | The ndp_proxy provided by Linux doesn't support listing proxies, and only hosts 42 | are supported. No subnets. ndppd solves this by listening for Neighbor 43 | Solicitation messages on an interface, then query the internal interfaces for 44 | that target IP before finally sending a Neighbor Advertisement message. 45 | endef 46 | 47 | define Package/ndppd/conffiles 48 | /etc/ndppd.conf 49 | endef 50 | 51 | define Build/Compile 52 | $(MAKE) -C $(PKG_BUILD_DIR) \ 53 | CXX="$(TARGET_CXX)" \ 54 | CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++0x -fno-rtti" \ 55 | LDFLAGS="$(TARGET_LDFLAGS)" \ 56 | LIBS="-lc" \ 57 | ndppd 58 | endef 59 | 60 | define Package/ndppd/install 61 | $(INSTALL_DIR) $(1)/usr/sbin 62 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/ndppd $(1)/usr/sbin/ 63 | $(INSTALL_DIR) $(1)/etc/init.d 64 | $(INSTALL_BIN) ./files/ndppd.init $(1)/etc/init.d/ndppd 65 | $(INSTALL_CONF) $(PKG_BUILD_DIR)/ndppd.conf-dist $(1)/etc/ndppd.conf 66 | endef 67 | 68 | $(eval $(call BuildPackage,ndppd)) 69 | -------------------------------------------------------------------------------- /ndppd/files/ndppd.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2007-2011 OpenWrt.org 3 | 4 | START=90 5 | 6 | SERVICE_USE_PID=1 7 | SERVICE_PID_FILE=/var/run/ndppd.pid 8 | 9 | start() { 10 | mkdir -p /var/run 11 | service_start /usr/sbin/ndppd -p $SERVICE_PID_FILE -d 12 | } 13 | 14 | stop() { 15 | service_stop /usr/sbin/ndppd 16 | } 17 | -------------------------------------------------------------------------------- /ndppd/patches/0001-Version-bump.patch: -------------------------------------------------------------------------------- 1 | From 715f9f330d8606d4a7b68900325f9b1455dd5368 Mon Sep 17 00:00:00 2001 2 | From: Rafael Cossovan 3 | Date: Tue, 3 Apr 2018 17:06:16 -0300 4 | Subject: [PATCH 1/3] Forgot to bump the version. 5 | 6 | --- 7 | src/ndppd.h | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/src/ndppd.h b/src/ndppd.h 11 | index 57ba829..3e11221 100644 12 | --- a/src/ndppd.h 13 | +++ b/src/ndppd.h 14 | @@ -21,7 +21,7 @@ 15 | #define NDPPD_NS_BEGIN namespace ndppd { 16 | #define NDPPD_NS_END } 17 | 18 | -#define NDPPD_VERSION "0.2.4" 19 | +#define NDPPD_VERSION "0.2.5" 20 | 21 | #include 22 | 23 | -------------------------------------------------------------------------------- /ndppd/patches/0002-Fixes-strerror_r-GNU-XSI.patch: -------------------------------------------------------------------------------- 1 | From 1f610129b475b417509b251e022ad46d2210ff50 Mon Sep 17 00:00:00 2001 2 | From: Rafael Cossovan 3 | Date: Tue, 3 Apr 2018 17:04:35 -0300 4 | Subject: [PATCH 2/3] Fixes strerror_r GNU/XSI issue #40. 5 | http://www.zverovich.net/2015/03/13/reliable-detection-of-strerror-variants.html 6 | 7 | --- 8 | src/logger.cc | 14 ++++++++++++- 9 | src/logger.h | 3 +++ 10 | 2 files changed, 15 insertions(+), 1 deletions(-) 11 | 12 | diff --git a/src/logger.cc b/src/logger.cc 13 | index 6ddbea9..6ccb2a0 100644 14 | --- a/src/logger.cc 15 | +++ b/src/logger.cc 16 | @@ -84,6 +84,6 @@ std::string logger::err() 17 | { 18 | char buf[2048]; 19 | - return strerror_r(errno, buf, sizeof(buf)); 20 | + return strerror_r_wrapper(strerror_r(errno, buf, sizeof(buf)), buf); 21 | } 22 | 23 | logger logger::error() 24 | @@ -221,4 +221,16 @@ 25 | return false; 26 | } 27 | 28 | +// XSI-compliant: int 29 | +std::string logger::strerror_r_wrapper(int, char* s) 30 | +{ 31 | + return s; 32 | +} 33 | + 34 | +// GNU-specific: char * 35 | +std::string logger::strerror_r_wrapper(char* s, char*) 36 | +{ 37 | + return s; 38 | +} 39 | + 40 | NDPPD_NS_END 41 | diff --git a/src/logger.h b/src/logger.h 42 | index 7d3d7db..0446595 100644 43 | --- a/src/logger.h 44 | +++ b/src/logger.h 45 | @@ -91,6 +91,9 @@ class logger { 46 | 47 | static int _max_pri; 48 | 49 | + // helpers for strerror_r 50 | + static std::string strerror_r_wrapper(int, char* s); 51 | + static std::string strerror_r_wrapper(char* s, char*); 52 | 53 | }; 54 | 55 | 56 | -------------------------------------------------------------------------------- /ndppd/patches/0003-fix-poll-header.patch: -------------------------------------------------------------------------------- 1 | From 88b9bc561ce42f2eb97ea041cd8920797b44dd53 Mon Sep 17 00:00:00 2001 2 | From: Rafael Cossovan 3 | Date: Tue, 3 Apr 2018 17:05:42 -0300 4 | Subject: [PATCH 3/3] Fixes a compile warning when building with musl: #warning 5 | redirecting incorrect #include to 6 | 7 | --- 8 | src/iface.cc | 2 +- 9 | src/iface.h | 2 +- 10 | src/proxy.h | 2 +- 11 | src/rule.h | 2 +- 12 | 4 files changed, 4 insertions(+), 4 deletions(-) 13 | 14 | diff --git a/src/iface.cc b/src/iface.cc 15 | index f569d3c..7cbb57f 100644 16 | --- a/src/iface.cc 17 | +++ b/src/iface.cc 18 | @@ -30,7 +30,7 @@ 19 | #include 20 | #include 21 | #include 22 | -#include 23 | +#include 24 | 25 | #include 26 | 27 | diff --git a/src/iface.h b/src/iface.h 28 | index 9db59ab..df7ff35 100644 29 | --- a/src/iface.h 30 | +++ b/src/iface.h 31 | @@ -20,7 +20,7 @@ 32 | #include 33 | #include 34 | 35 | -#include 36 | +#include 37 | #include 38 | 39 | #include "ndppd.h" 40 | diff --git a/src/proxy.h b/src/proxy.h 41 | index 8141b2a..9299d9a 100644 42 | --- a/src/proxy.h 43 | +++ b/src/proxy.h 44 | @@ -19,7 +19,7 @@ 45 | #include 46 | #include 47 | 48 | -#include 49 | +#include 50 | 51 | #include "ndppd.h" 52 | 53 | diff --git a/src/rule.h b/src/rule.h 54 | index 0c2f79a..23086e6 100644 55 | --- a/src/rule.h 56 | +++ b/src/rule.h 57 | @@ -20,6 +20,6 @@ 58 | #include 59 | 60 | -#include 61 | +#include 62 | 63 | #include "ndppd.h" 64 | 65 | -------------------------------------------------------------------------------- /nodogsplash/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # This is free software, licensed under the GNU General Public License v2. 3 | # See /LICENSE for more information. 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | PKG_NAME:=nodogsplash 9 | PKG_VERSION:=5.0.0 10 | PKG_RELEASE:=1 11 | 12 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 13 | PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)? 14 | PKG_HASH:=a7665f4a42997746a31e9217f2f54e360aa7fc4bc72bd89faa08f1ccf7875b5e 15 | 16 | PKG_MAINTAINER:=Moritz Warning 17 | PKG_LICENSE:=GPL-2.0-or-later 18 | PKG_LICENSE_FILES:=COPYING 19 | 20 | PKG_FIXUP:=autoreconf 21 | PKG_BUILD_PARALLEL:=1 22 | 23 | include $(INCLUDE_DIR)/package.mk 24 | 25 | define Package/nodogsplash 26 | SUBMENU:=Captive Portals 27 | SECTION:=net 28 | CATEGORY:=Network 29 | DEPENDS:=+libpthread +iptables-mod-ipopt +libmicrohttpd-no-ssl 30 | TITLE:=Open public network gateway daemon 31 | URL:=https://github.com/nodogsplash/nodogsplash 32 | CONFLICTS:=nodogsplash2 33 | endef 34 | 35 | define Package/nodogsplash/description 36 | Nodogsplash is a Captive Portal that offers a simple way to 37 | provide restricted access to the Internet by showing a splash 38 | page to the user before Internet access is granted. 39 | It also incorporates an API that allows the creation of 40 | sophisticated authentication applications. 41 | endef 42 | 43 | define Package/nodogsplash/install 44 | 45 | $(INSTALL_DIR) $(1)/usr/bin 46 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/nodogsplash $(1)/usr/bin/ 47 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/ndsctl $(1)/usr/bin/ 48 | 49 | $(INSTALL_DIR) $(1)/etc/nodogsplash/htdocs/images 50 | $(INSTALL_DIR) $(1)/etc/config 51 | $(INSTALL_DIR) $(1)/etc/init.d 52 | $(INSTALL_DIR) $(1)/etc/uci-defaults 53 | $(INSTALL_DIR) $(1)/usr/lib/nodogsplash 54 | $(CP) $(PKG_BUILD_DIR)/resources/splash.html $(1)/etc/nodogsplash/htdocs/ 55 | $(CP) $(PKG_BUILD_DIR)/resources/splash.css $(1)/etc/nodogsplash/htdocs/ 56 | $(CP) $(PKG_BUILD_DIR)/resources/status.html $(1)/etc/nodogsplash/htdocs/ 57 | $(CP) $(PKG_BUILD_DIR)/resources/splash.jpg $(1)/etc/nodogsplash/htdocs/images/ 58 | $(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/etc/config/nodogsplash $(1)/etc/config/ 59 | $(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/etc/init.d/nodogsplash $(1)/etc/init.d/ 60 | $(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/etc/uci-defaults/40_nodogsplash $(1)/etc/uci-defaults/ 61 | $(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/usr/lib/nodogsplash/restart.sh $(1)/usr/lib/nodogsplash/ 62 | endef 63 | 64 | define Package/nodogsplash/postrm 65 | #!/bin/sh 66 | uci delete firewall.nodogsplash 67 | uci commit firewall 68 | endef 69 | 70 | define Package/nodogsplash/conffiles 71 | /etc/config/nodogsplash 72 | endef 73 | 74 | $(eval $(call BuildPackage,nodogsplash)) 75 | -------------------------------------------------------------------------------- /ohybridproxy/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012-2013 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | 7 | include $(TOPDIR)/rules.mk 8 | 9 | PKG_NAME:=ohybridproxy 10 | PKG_SOURCE_VERSION:=0dfef1eb5f067250a5f24a899536879ea4fdc4c5 11 | PKG_SOURCE_DATE:=2020-05-22 12 | PKG_RELEASE:=3 13 | 14 | PKG_SOURCE_PROTO:=git 15 | PKG_SOURCE_URL:=https://github.com/sbyx/ohybridproxy.git 16 | PKG_MIRROR_HASH:=f47904d8ac860b8b80cb9f99e094cd74e95464b5ed011a7adbfc3445dab598b3 17 | 18 | PKG_MAINTAINER:=Steven Barth 19 | PKG_LICENSE:=GPL-2.0-only 20 | PKG_LICENSE_FILES:=LICENSE 21 | 22 | PKG_BUILD_PARALLEL:=1 23 | 24 | include $(INCLUDE_DIR)/package.mk 25 | include $(INCLUDE_DIR)/cmake.mk 26 | 27 | define Package/ohybridproxy 28 | SECTION:=net 29 | CATEGORY:=Network 30 | SUBMENU:=IP Addresses and Names 31 | TITLE:=mdns/dns hybrid-proxy 32 | URL:=https://github.com/sbyx/ohybridproxy 33 | DEPENDS+=+libubox +mdnsd 34 | endef 35 | 36 | define Package/ohybridproxy/description 37 | This package provides a statically configured daemon for translating DNS 38 | requests to Multicast DNS and back again. 39 | endef 40 | 41 | define Package/ohybridproxy/install 42 | $(INSTALL_DIR) $(1)/usr/sbin/ 43 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/ohybridproxy $(1)/usr/sbin/ 44 | $(INSTALL_DIR) $(1)/etc/config/ 45 | $(INSTALL_DATA) ./files/ohybridproxy.config $(1)/etc/config/ohybridproxy 46 | $(INSTALL_DIR) $(1)/etc/init.d/ 47 | $(INSTALL_BIN) ./files/ohybridproxy.init $(1)/etc/init.d/ohybridproxy 48 | $(INSTALL_DIR) $(1)/etc/hotplug.d/iface 49 | $(INSTALL_DATA) ./files/ohybridproxy.hotplug $(1)/etc/hotplug.d/iface/ohybridproxy 50 | endef 51 | 52 | $(eval $(call BuildPackage,ohybridproxy)) 53 | 54 | define Package/zonestitcher 55 | SECTION:=net 56 | CATEGORY:=Network 57 | SUBMENU:=IP Addresses and Names 58 | TITLE:=dynamically combine multiple DNS zones into one 59 | URL:=https://github.com/sbyx/ohybridproxy 60 | DEPENDS+=+libubox 61 | endef 62 | 63 | define Package/zonestitcher/description 64 | This package provides a statically configured daemon for translating DNS 65 | requests to Multicast DNS and back again. 66 | endef 67 | 68 | define Package/zonestitcher/install 69 | $(INSTALL_DIR) $(1)/usr/sbin/ 70 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/zonestitcher $(1)/usr/sbin/ 71 | endef 72 | 73 | $(eval $(call BuildPackage,zonestitcher)) 74 | -------------------------------------------------------------------------------- /ohybridproxy/files/ohybridproxy.config: -------------------------------------------------------------------------------- 1 | config main main 2 | option host '::' 3 | option port '53' 4 | 5 | #config interface 6 | # option interface lan 7 | # option domain lan.home. 8 | -------------------------------------------------------------------------------- /ohybridproxy/files/ohybridproxy.hotplug: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | /etc/init.d/ohybridproxy enabled || exit 0 3 | [ "$ACTION" = ifupdate ] && exit 0 4 | /etc/init.d/ohybridproxy restart 5 | -------------------------------------------------------------------------------- /ohybridproxy/files/ohybridproxy.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2009-2014 OpenWrt.org 3 | 4 | START=60 5 | STOP=10 6 | USE_PROCD=1 7 | 8 | HAS_IFACES= 9 | 10 | service_triggers() 11 | { 12 | procd_add_reload_trigger "ohybridproxy" 13 | } 14 | 15 | ohp_interface() 16 | { 17 | local section="$1" 18 | config_get interface "$section" interface 19 | config_get domain "$section" domain 20 | 21 | [ -n "$interface" ] && network_get_device interface "$interface" 22 | if [ -n "$interface" -a -n "$domain" ]; then 23 | procd_append_param command "$interface=$domain" 24 | HAS_IFACES=1 25 | fi 26 | } 27 | 28 | start_service() 29 | { 30 | . /lib/functions.sh 31 | . /lib/functions/network.sh 32 | 33 | procd_open_instance 34 | procd_set_param command /usr/sbin/ohybridproxy 35 | 36 | config_load ohybridproxy 37 | 38 | config_get val main host 39 | [ -n "$val" ] && procd_append_param command -a "${val}" 40 | 41 | config_get val main port 42 | [ -n "$val" ] && procd_append_param command -p "${val}" 43 | 44 | config_foreach ohp_interface interface 45 | 46 | [ "$HAS_IFACES" = 1 ] || return 0 47 | 48 | procd_close_instance 49 | } 50 | 51 | -------------------------------------------------------------------------------- /olsrd/files/olsrd-neigh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /usr/share/libubox/jshn.sh 4 | 5 | hostsfile_getname() 6 | { 7 | local config="$1" 8 | local i=0 9 | local value file 10 | 11 | while value="$( uci -q get $config.@LoadPlugin[$i].library )"; do { 12 | case "$value" in 13 | 'olsrd_nameservice'*) 14 | file="$( uci -q get $config.@LoadPlugin[$i].hosts_file )" 15 | break 16 | ;; 17 | esac 18 | 19 | i=$(( i + 1 )) 20 | } done 21 | 22 | echo "${file:-/var/run/hosts_olsr}" 23 | } 24 | 25 | read_hostnames() 26 | { 27 | local file_list=" $( hostsfile_getname 'olsrd' ) $(hostsfile_getname 'olsrd6' ) " 28 | local line ip hostname file file_list_uniq 29 | 30 | for file in $file_list; do { 31 | case " $file_list_uniq " in 32 | *" $file "*) 33 | ;; 34 | *) 35 | file_list_uniq="$file_list_uniq $file" 36 | ;; 37 | esac 38 | } done 39 | 40 | for file in $file_list_uniq; do { 41 | [ -e "$file" ] || continue 42 | 43 | while read -r line; do { 44 | case "$line" in 45 | [0-9]*) 46 | # 2001:ffff:ffff:ffff::1 SomeNode-core.olsr # myself 47 | # 10.0.0.1 SomeNode # 10.0.0.1 48 | set -f 49 | set +f -- $line 50 | ip="$1" 51 | hostname="$2" 52 | 53 | # global vars, e.g. 54 | # IP_1_2_3_4='foo' or IP_2001_ffff_ffff_ffff__1='bar' 55 | eval IP_${ip//[.:]/_}="$hostname" 56 | ;; 57 | esac 58 | } done <"$file" 59 | } done 60 | } 61 | 62 | read_hostnames 63 | 64 | VARS='localIP:Local remoteIP:Remote validityTime:vTime linkQuality:LQ' 65 | VARS="$VARS neighborLinkQuality:NLQ linkCost:Cost remoteHostname:Host" 66 | 67 | for HOST in '127.0.0.1' '::1';do 68 | # check for availability of HOST 69 | nc $HOST 9090 >/dev/null 2>&1 70 | if [ $? != 0 ]; then 71 | continue 72 | fi 73 | 74 | json_init 75 | json_load "$( echo /links | nc $HOST 9090 | sed -n '/^[}{ ]/p' )" # remove header/non-json 76 | 77 | if json_is_a links array;then 78 | json_select links 79 | for v in ${VARS};do 80 | eval _${v%:*}=0 81 | done 82 | for j in 0 1;do 83 | case ${j} in 1) 84 | for v in ${VARS};do 85 | eval printf \"%-\${_${v%:*}}s \" ${v#*:} 86 | done 87 | echo 88 | ;;esac 89 | i=1;while json_is_a ${i} object;do 90 | json_select ${i} 91 | json_get_vars $(for v in ${VARS};do echo ${v%:*};done) 92 | case ${j} in 0) 93 | for v in ${VARS};do 94 | eval "test \${_${v%:*}} -lt \${#${v%:*}} && _${v%:*}=\${#${v%:*}}" 95 | done 96 | ;;*) 97 | for v in ${VARS};do 98 | eval printf \"%-\${_${v%:*}}s \" \$${v%:*} 99 | eval remoteHostname="\$IP_${remoteIP//[.:]/_}" 100 | done 101 | echo 102 | ;;esac 103 | json_select .. 104 | i=$(( i + 1 )) 105 | done 106 | done 107 | fi 108 | echo 109 | done 110 | -------------------------------------------------------------------------------- /olsrd/files/olsrd.config: -------------------------------------------------------------------------------- 1 | config olsrd 2 | # uncomment the following line to use a custom config file instead: 3 | #option config_file '/etc/olsrd.conf' 4 | 5 | config LoadPlugin 6 | option library 'olsrd_arprefresh.so.0.1' 7 | 8 | config LoadPlugin 9 | option library 'olsrd_dyn_gw.so.0.5' 10 | 11 | config LoadPlugin 12 | option library 'olsrd_httpinfo.so.0.1' 13 | option port '1978' 14 | list Net '0.0.0.0 0.0.0.0' 15 | 16 | config LoadPlugin 17 | option library 'olsrd_nameservice.so.0.4' 18 | 19 | config LoadPlugin 20 | option library 'olsrd_txtinfo.so.1.1' 21 | option accept '0.0.0.0' 22 | 23 | config Interface 24 | list interface 'wlan' 25 | 26 | config procd procd 27 | option respawn_threshold '3600' 28 | option respawn_timeout '15' 29 | option respawn_retry '0' 30 | -------------------------------------------------------------------------------- /olsrd/files/olsrd.pud.position.conf: -------------------------------------------------------------------------------- 1 | # 2 | # OLSrd PUD plugin position configuration file 3 | # 4 | 5 | # GPS operating mode. 6 | # Values : bad, 2d, 3d 7 | # Default: bad 8 | # Note : a value of 'bad' will make the resulting position information invalid 9 | # (the mask will indicate that all other information is not present) 10 | #fix = bad 11 | 12 | # GPS quality indicator. 13 | # Values : bad, low, mid, high 14 | # Default: high 15 | #sig = high 16 | 17 | # HDOP (Horizontal Dilution Of Precision) 18 | # Values : floating point value 19 | # Default: 0.0 20 | # Note : From HDOP, VDOP and PDOP are determined: VDOP = HDOP, and PDOP = sqrt(2) * HDOP. 21 | #hdop = 0.0 22 | 23 | # Latitude 24 | # Values : floating point value 25 | # Unit is NMEA like latitude: ddmm.sssss (d=degrees, m=minutes, s=seconds) 26 | # Default: 0000.00000 27 | #lat = 0000.00000 28 | 29 | # Longitude 30 | # Values: floating point value 31 | # Unit is NMEA like longitude: dddmm.sssss (d=degrees, m=minutes, s=seconds) 32 | # Default: 00000.00000 33 | #lon = 00000.00000 34 | 35 | # Elevation 36 | # Values: floating point value 37 | # Unit is meters above the mean sea level (geoid) 38 | # Default: 0.0 39 | #elv = 0.0 40 | 41 | # Speed 42 | # Values: floating point value 43 | # Unit is over the ground in kph 44 | # Default: 0.0 45 | #speed = 0.0 46 | 47 | # Direction/Track 48 | # Values: floating point value 49 | # Unit is (compass) degrees 50 | # Default: 0.0 51 | #direction = 0.0 52 | -------------------------------------------------------------------------------- /olsrd/files/olsrd.sgw.speed.conf: -------------------------------------------------------------------------------- 1 | # 2 | # OLSrd Smart Gateway uplink speed configuration file 3 | # 4 | 5 | 6 | # 7 | # Upstream speed in kilobit/s 8 | # Default: 128 9 | #upstream=128 10 | 11 | # 12 | # Downstream speed in kilobit/s 13 | # Default: 1024 14 | #downstream=1024 15 | -------------------------------------------------------------------------------- /olsrd/files/olsrd4.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2008-2013 OpenWrt.org 3 | 4 | . $IPKG_INSTROOT/lib/functions/olsrd.sh 5 | 6 | START=65 7 | USE_PROCD=1 8 | BIN=/usr/sbin/olsrd 9 | OLSRD=olsrd 10 | CONF=/var/etc/$OLSRD.conf 11 | PID=/var/run/olsrd.pid 12 | 13 | wait_for_network() 14 | { 15 | ubus -t 15 wait_for network.interface.$1 2>/dev/null 16 | } 17 | 18 | wait_for_wireless() 19 | { 20 | local count=0 21 | ubus -t 15 wait_for network.wireless 2>/dev/null 22 | while [ $count -lt 30 ]; do 23 | if [ "$(ubus call network.wireless status | jsonfilter -e '@[*]["pending"]' | grep true | wc -l)" == "0" ]; then 24 | break 25 | fi 26 | count=$((count+1)) 27 | sleep 1 28 | done 29 | } 30 | 31 | boot() 32 | { 33 | config_load network 34 | config_foreach wait_for_network interface 35 | wait_for_wireless 36 | rc_procd start_service 37 | } 38 | 39 | start_service() { 40 | olsrd_generate_config $OLSRD 41 | 42 | procd_open_instance 43 | 44 | config_load olsrd 45 | local _respawn_threshold 46 | local _respawn_timeout 47 | local _respawn_retry 48 | 49 | config_get _respawn_threshold procd respawn_threshold 3600 50 | config_get _respawn_timeout procd respawn_timeout 15 51 | config_get _respawn_retry procd respawn_retry 0 52 | 53 | procd_set_param command "$BIN" 54 | procd_append_param command -f ${CONF} 55 | procd_append_param command -nofork 56 | procd_append_param command -pidfile ${PID} 57 | 58 | # restart if olsrd dies 59 | procd_set_param respawn $_respawn_threshold $_respawn_timeout $_respawn_retry 60 | 61 | # automatically restart olsrd if generated cfg has changed 62 | procd_set_param file $CONF 63 | 64 | procd_set_param pidfile $PID 65 | 66 | procd_close_instance 67 | 68 | olsrd_setup_smartgw_rules 69 | } 70 | 71 | service_triggers() { 72 | # reload if config changed via uci 73 | procd_add_reload_trigger "olsrd" 74 | 75 | # restart on ifup interface events 76 | for n in $(olsrd_list_configured_interfaces $OLSRD); do 77 | procd_add_reload_interface_trigger $n /etc/init.d/$OLSRD reload 78 | done 79 | } 80 | -------------------------------------------------------------------------------- /olsrd/files/olsrd6.config: -------------------------------------------------------------------------------- 1 | config olsrd 2 | # uncomment the following line to use a custom config file instead: 3 | #option config_file '/etc/olsrd6.conf' 4 | 5 | config LoadPlugin 6 | option library 'olsrd_txtinfo.so.1.1' 7 | option accept '::' 8 | option port '2007' 9 | 10 | config Interface 11 | list interface 'wlan' 12 | 13 | config procd procd 14 | option respawn_threshold '3600' 15 | option respawn_timeout '15' 16 | option respawn_retry '0' 17 | -------------------------------------------------------------------------------- /olsrd/files/olsrd6.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2008-2013 OpenWrt.org 3 | 4 | . $IPKG_INSTROOT/lib/functions/olsrd.sh 5 | 6 | START=65 7 | USE_PROCD=1 8 | BIN=/usr/sbin/olsrd 9 | OLSRD=olsrd6 10 | CONF=/var/etc/$OLSRD.conf 11 | PID=/var/run/olsrd6.pid 12 | 13 | wait_for_network() 14 | { 15 | ubus -t 15 wait_for network.interface.$1 2>/dev/null 16 | } 17 | 18 | wait_for_wireless() 19 | { 20 | local count=0 21 | ubus -t 15 wait_for network.wireless 2>/dev/null 22 | while [ $count -lt 30 ]; do 23 | if [ "$(ubus call network.wireless status | jsonfilter -e '@[*]["pending"]' | grep true | wc -l)" == "0" ]; then 24 | break 25 | fi 26 | count=$((count+1)) 27 | sleep 1 28 | done 29 | } 30 | 31 | boot() 32 | { 33 | config_load network 34 | config_foreach wait_for_network interface 35 | wait_for_wireless 36 | rc_procd start_service 37 | } 38 | 39 | start_service() { 40 | olsrd_generate_config $OLSRD 41 | 42 | procd_open_instance 43 | 44 | config_load olsrd6 45 | local _respawn_threshold 46 | local _respawn_timeout 47 | local _respawn_retry 48 | 49 | config_get _respawn_threshold procd _respawn_threshold 3600 50 | config_get _respawn_timeout procd respawn_timeout 15 51 | config_get _respawn_retry procd respawn_retry 0 52 | 53 | procd_set_param command "$BIN" 54 | procd_append_param command -f ${CONF} 55 | procd_append_param command -nofork 56 | procd_append_param command -pidfile ${PID} 57 | 58 | # restart if olsrd dies 59 | procd_set_param respawn $_respawn_threshold $_respawn_timeout $_respawn_retry 60 | 61 | # automatically restart olsrd if generated cfg has changed 62 | procd_set_param file $CONF 63 | 64 | procd_set_param pidfile $PID 65 | 66 | procd_close_instance 67 | 68 | olsrd_setup_smartgw_rules 69 | } 70 | 71 | service_triggers() { 72 | # reload if config changed via uci 73 | procd_add_reload_trigger "olsrd6" 74 | 75 | # restart on ifup interface events 76 | for n in $(olsrd_list_configured_interfaces $OLSRD); do 77 | procd_add_reload_interface_trigger $n /etc/init.d/$OLSRD reload 78 | done 79 | } 80 | -------------------------------------------------------------------------------- /olsrd/files/olsrd_secure_key: -------------------------------------------------------------------------------- 1 | 1234567890123456 -------------------------------------------------------------------------------- /olsrd/patches/600-add-ubus-support.patch: -------------------------------------------------------------------------------- 1 | --- a/src/scheduler.c 2 | +++ b/src/scheduler.c 3 | @@ -59,6 +59,8 @@ 4 | #include 5 | #include 6 | 7 | +#include "ubus.h" 8 | + 9 | #ifdef __MACH__ 10 | #include "mach/clock_gettime.h" 11 | #endif 12 | @@ -363,6 +365,8 @@ poll_sockets(void) 13 | } 14 | OLSR_FOR_ALL_SOCKETS_END(entry); 15 | 16 | + hfd = olsrd_ubus_add_read_sock(&ibits, hfd); 17 | + 18 | /* Running select on the FD set */ 19 | do { 20 | n = olsr_select(hfd, fdsets & SP_PR_READ ? &ibits : NULL, fdsets & SP_PR_WRITE ? &obits : NULL, NULL, &tvp); 21 | @@ -395,6 +399,7 @@ poll_sockets(void) 22 | } 23 | } 24 | OLSR_FOR_ALL_SOCKETS_END(entry); 25 | + olsrd_ubus_receive(&ibits); 26 | } 27 | 28 | static void 29 | --- a/src/main.c 30 | +++ b/src/main.c 31 | @@ -74,6 +74,8 @@ 32 | #include "lock_file.h" 33 | #include "cli.h" 34 | 35 | +#include "ubus.h" 36 | + 37 | #if defined(__GLIBC__) && defined(__linux__) && !defined(__ANDROID__) && !defined(__UCLIBC__) 38 | #define OLSR_HAVE_EXECINFO_H 39 | #endif 40 | @@ -771,6 +773,9 @@ int main(int argc, char *argv[]) { 41 | signal(SIGUSR2, SIG_IGN); 42 | #endif /* _WIN32 */ 43 | 44 | + /* Adding ubus */ 45 | + olsrd_add_ubus(); 46 | + 47 | /* Starting scheduler */ 48 | olsr_scheduler(); 49 | 50 | --- a/Makefile.inc 51 | +++ b/Makefile.inc 52 | @@ -252,7 +252,7 @@ else 53 | ifeq ($(OS),win32) 54 | LDFLAGS += -Wl,-export-all-symbols 55 | else 56 | - LDFLAGS += -Wl,-export-dynamic 57 | + LDFLAGS += -Wl,-export-dynamic,-lubus,-lubox 58 | endif 59 | ifeq ($(NORPATH),0) 60 | LDFLAGS += -Wl,-rpath,$(LIBDIR) 61 | -------------------------------------------------------------------------------- /olsrd/src/src/ubus.h: -------------------------------------------------------------------------------- 1 | /* 2 | IPC integration of olsrd with OpenWrt. 3 | 4 | The ubus interface offers following functions: 5 | - add_inteface '{"ifname":"wg_51820", "lqm": "0.5"}' 6 | - del_inteface '{"ifname":"wg_51820"}' 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | /** 13 | * Initialize ubus interface. 14 | * 15 | * Connect to the ubus daemon and expose the ubus functions. 16 | * 17 | * @return if initializing ubus was successful 18 | */ 19 | bool olsrd_add_ubus(); 20 | 21 | /** 22 | * Add ubus socket to given filedescriptor set. 23 | * 24 | * We need to check repeatedly if the ubus socket has something to read. 25 | * The functions allows to add the ubus socket to the normal while(1)-loop of 26 | * olsrd. 27 | * 28 | * @param readfs: the filedescriptor set 29 | * @param maxfd: the current maximum file descriptor 30 | * @return the maximum file descriptor 31 | */ 32 | int olsrd_ubus_add_read_sock(fd_set *readfds, int maxfd); 33 | 34 | /** 35 | * Check and process ubus socket. 36 | * 37 | * If the ubus-socket signals that data is available, the ubus_handle_event is 38 | * called. 39 | */ 40 | void olsrd_ubus_receive(fd_set *readfds); 41 | -------------------------------------------------------------------------------- /oonf-dlep-proxy/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/rules.mk 2 | 3 | PKG_NAME:=oonf-dlep-proxy 4 | PKG_VERSION:=v0.15.1 5 | PKG_REV:=bffb88b040659b237c4c91b6b42dbbb47431750e 6 | PKG_RELEASE:=$(PKG_REV) 7 | 8 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 9 | PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git 10 | PKG_SOURCE_PROTO:=git 11 | PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) 12 | PKG_SOURCE_VERSION:=$(PKG_REV) 13 | PKG_MIRROR_HASH:=a5413418b7ab1665758f883a652ff589de6a78ccf9201d29bc13f372cb9adeb0 14 | 15 | CMAKE_INSTALL:=1 16 | 17 | include $(INCLUDE_DIR)/package.mk 18 | include $(INCLUDE_DIR)/cmake.mk 19 | 20 | CMAKE_OPTIONS+=-D OONF_NO_WERROR:Bool=true \ 21 | -D OONF_LOGGING_LEVEL:String=debug \ 22 | -D OONF_NO_TESTING:Bool=true \ 23 | -D UCI:Bool=true \ 24 | -D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \ 25 | -D OONF_STATIC_PLUGINS:String="class;clock;layer2;packet_socket;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_system;nl80211_listener;layer2info;systeminfo;cfg_uciloader;cfg_compact;dlep_proxy" \ 26 | -D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \ 27 | -D OONF_VERSION:String=$(PKG_VERSION) \ 28 | -D INSTALL_LIB_DIR:Path=lib/oonf \ 29 | -D INSTALL_INCLUDE_DIR:Path=include/oonf \ 30 | -D INSTALL_CMAKE_DIR:Path=lib/oonf \ 31 | -D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr 32 | 33 | define Package/oonf-git/template 34 | SECTION:=net 35 | CATEGORY:=Network 36 | MAINTAINER:=Henning Rogge 37 | SUBMENU:=OLSR.org network framework 38 | URL:=http://www.olsr.org/ 39 | endef 40 | 41 | define Package/oonf-dlep-proxy 42 | $(call Package/oonf-git/template) 43 | TITLE:= Build DLEP Radio+Router Agent 44 | DEPENDS:=+librt +libnl-tiny +libuci +oonf-init-scripts 45 | VERSION:=$(PKG_VERSION) 46 | endef 47 | 48 | Build/Compile=$(call Build/Compile/Default,dlep_radio_static) 49 | Build/Install= 50 | 51 | define Build/Install 52 | $(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/dlep_radio_static $(PKG_INSTALL_DIR)/usr/sbin/dlep_proxy; 53 | endef 54 | 55 | TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny 56 | 57 | define Package/oonf-dlep-proxy/install 58 | $(INSTALL_BIN) -D $(PKG_BUILD_DIR)/dlep_radio_static $(1)/usr/sbin/dlep_proxy 59 | $(INSTALL_BIN) -D ./files/dlep_proxy.init $(1)/etc/init.d/dlep_proxy 60 | $(INSTALL_BIN) -D ./files/dlep_proxy.hotplug $(1)/etc/hotplug.d/iface/50-dlep_proxy 61 | $(INSTALL_DATA) -D ./files/dlep_proxy.uci $(1)/etc/config/dlep_proxy 62 | endef 63 | 64 | define Package/oonf-dlep-proxy/conffiles 65 | /etc/config/dlep_proxy 66 | endef 67 | 68 | $(eval $(call BuildPackage,oonf-dlep-proxy)) 69 | -------------------------------------------------------------------------------- /oonf-dlep-proxy/files/dlep_proxy.hotplug: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DAEMON='dlep_proxy' 4 | 5 | . /lib/functions/oonf_hotplug.sh 6 | -------------------------------------------------------------------------------- /oonf-dlep-proxy/files/dlep_proxy.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=82 4 | DAEMON='dlep_proxy' 5 | 6 | . /lib/functions/oonf_init.sh 7 | -------------------------------------------------------------------------------- /oonf-dlep-proxy/files/dlep_proxy.uci: -------------------------------------------------------------------------------- 1 | config global 2 | option 'failfast' 'no' 3 | option 'pidfile' '/var/run/dlep_proxy.pid' 4 | option 'lockfile' '/var/lock/dlep_proxy' 5 | 6 | config log 7 | option 'syslog' 'true' 8 | option 'stderr' 'true' 9 | # option 'file' '/var/log/dlep_proxy.log' 10 | # option 'info' 'all' 11 | # option 'debug' 'all' 12 | 13 | config telnet 14 | # option 'port' '2009' 15 | 16 | #config dlep_radio 17 | # list 'name' 'eth0' 18 | # option 'datapath_if' 'eth1' 19 | # option 'not_proxied' 'false' 20 | # option 'proxied' 'true' 21 | 22 | #config dlep-router 23 | # list 'name' 'eth0' 24 | # option 'datapath_if' 'eth0' 25 | -------------------------------------------------------------------------------- /oonf-dlep-proxy/patches/010-gcc10.patch: -------------------------------------------------------------------------------- 1 | --- a/src-plugins/generic/dlep/radio/dlep_radio_internal.h 2 | +++ b/src-plugins/generic/dlep/radio/dlep_radio_internal.h 3 | @@ -49,6 +49,6 @@ 4 | #include "core/oonf_logging.h" 5 | 6 | /* headers only for use inside the DLEP_RADIO subsystem */ 7 | -enum oonf_log_source LOG_DLEP_RADIO; 8 | +extern enum oonf_log_source LOG_DLEP_RADIO; 9 | 10 | #endif /* DLEP_RADIO_INTERNAL_H_ */ 11 | --- a/src-plugins/generic/dlep/router/dlep_router_internal.h 12 | +++ b/src-plugins/generic/dlep/router/dlep_router_internal.h 13 | @@ -49,6 +49,6 @@ 14 | #include "core/oonf_logging.h" 15 | 16 | /* headers only for use inside the DLEP_ROUTER subsystem */ 17 | -enum oonf_log_source LOG_DLEP_ROUTER; 18 | +extern enum oonf_log_source LOG_DLEP_ROUTER; 19 | 20 | #endif /* DLEP_ROUTER_INTERNAL_H_ */ 21 | --- a/src-plugins/generic/nl80211_listener/nl80211_internal.h 22 | +++ b/src-plugins/generic/nl80211_listener/nl80211_internal.h 23 | @@ -49,6 +49,6 @@ 24 | #include "core/oonf_logging.h" 25 | 26 | /* headers only for use inside the NL80211 subsystem */ 27 | -enum oonf_log_source LOG_NL80211; 28 | +extern enum oonf_log_source LOG_NL80211; 29 | 30 | #endif /* NL80211_INTERNAL_H_ */ 31 | -------------------------------------------------------------------------------- /oonf-dlep-radio/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/rules.mk 2 | 3 | PKG_NAME:=oonf-dlep-radio 4 | PKG_VERSION:=0.15.1 5 | PKG_RELEASE:=$(AUTORELEASE) 6 | 7 | PKG_SOURCE_PROTO:=git 8 | PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git 9 | PKG_SOURCE_DATE:=2018-03-19 10 | PKG_SOURCE_VERSION:=bffb88b040659b237c4c91b6b42dbbb47431750e 11 | PKG_MIRROR_HASH:=c85bf1e38483979f44486b6ad90800535fc7039a162c536c239d897b7c68ef70 12 | 13 | PKG_MAINTAINER:=Henning Rogge 14 | 15 | CMAKE_INSTALL:=1 16 | 17 | include $(INCLUDE_DIR)/package.mk 18 | include $(INCLUDE_DIR)/cmake.mk 19 | 20 | CMAKE_OPTIONS+=-D OONF_NO_WERROR:Bool=true \ 21 | -D OONF_LOGGING_LEVEL:String=debug \ 22 | -D OONF_NO_TESTING:Bool=true \ 23 | -D UCI:Bool=true \ 24 | -D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \ 25 | -D OONF_STATIC_PLUGINS:String="class;clock;layer2;packet_socket;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_system;nl80211_listener;layer2info;systeminfo;cfg_uciloader;cfg_compact;dlep_radio" \ 26 | -D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \ 27 | -D OONF_VERSION:String=$(PKG_VERSION) \ 28 | -D INSTALL_LIB_DIR:Path=lib/oonf \ 29 | -D INSTALL_INCLUDE_DIR:Path=include/oonf \ 30 | -D INSTALL_CMAKE_DIR:Path=lib/oonf \ 31 | -D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr 32 | 33 | define Package/oonf-dlep-radio 34 | SECTION:=net 35 | CATEGORY:=Network 36 | SUBMENU:=OLSR.org network framework 37 | URL:=http://www.olsr.org/ 38 | TITLE:=Build DLEP Radio Agent 39 | DEPENDS:=+librt +libnl-tiny +libuci +oonf-init-scripts 40 | endef 41 | 42 | Build/Compile=$(call Build/Compile/Default,dlep_radio_static) 43 | Build/Install= 44 | 45 | define Build/Install 46 | $(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/dlep_radio_static $(PKG_INSTALL_DIR)/usr/sbin/dlep_radio; 47 | endef 48 | 49 | TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny 50 | 51 | define Package/oonf-dlep-radio/install 52 | $(INSTALL_BIN) -D $(PKG_BUILD_DIR)/dlep_radio_static $(1)/usr/sbin/dlep_radio 53 | $(INSTALL_BIN) -D ./files/dlep_radio.init $(1)/etc/init.d/dlep_radio 54 | $(INSTALL_BIN) -D ./files/dlep_radio.hotplug $(1)/etc/hotplug.d/iface/50-dlep_radio 55 | $(INSTALL_DATA) -D ./files/dlep_radio.uci $(1)/etc/config/dlep_radio 56 | endef 57 | 58 | define Package/oonf-dlep-radio/conffiles 59 | /etc/config/dlep_radio 60 | endef 61 | 62 | $(eval $(call BuildPackage,oonf-dlep-radio)) 63 | -------------------------------------------------------------------------------- /oonf-dlep-radio/files/dlep_radio.hotplug: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DAEMON='dlep_radio' 4 | 5 | . /lib/functions/oonf_hotplug.sh 6 | -------------------------------------------------------------------------------- /oonf-dlep-radio/files/dlep_radio.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=82 4 | DAEMON='dlep_radio' 5 | 6 | . /lib/functions/oonf_init.sh 7 | -------------------------------------------------------------------------------- /oonf-dlep-radio/files/dlep_radio.uci: -------------------------------------------------------------------------------- 1 | config global 2 | option 'failfast' 'no' 3 | option 'pidfile' '/var/run/dlep_radio.pid' 4 | option 'lockfile' '/var/lock/dlep_radio' 5 | 6 | config log 7 | option 'syslog' 'true' 8 | option 'stderr' 'true' 9 | # option 'file' '/var/log/dlep_radio.log' 10 | # option 'info' 'all' 11 | # option 'debug' 'all' 12 | 13 | config telnet 14 | # option 'port' '2009' 15 | 16 | config dlep_radio 17 | list 'name' 'wlan0' 18 | option 'datapath_if' 'br-lan' 19 | option 'not_proxied' 'false' 20 | option 'proxied' 'true' 21 | 22 | config nl80211_listener 23 | option 'if' 'wlan0' 24 | option 'interval' '1.0' 25 | -------------------------------------------------------------------------------- /oonf-dlep-radio/patches/010-gcc10.patch: -------------------------------------------------------------------------------- 1 | --- a/src-plugins/generic/dlep/radio/dlep_radio_internal.h 2 | +++ b/src-plugins/generic/dlep/radio/dlep_radio_internal.h 3 | @@ -49,6 +49,6 @@ 4 | #include "core/oonf_logging.h" 5 | 6 | /* headers only for use inside the DLEP_RADIO subsystem */ 7 | -enum oonf_log_source LOG_DLEP_RADIO; 8 | +extern enum oonf_log_source LOG_DLEP_RADIO; 9 | 10 | #endif /* DLEP_RADIO_INTERNAL_H_ */ 11 | --- a/src-plugins/generic/nl80211_listener/nl80211_internal.h 12 | +++ b/src-plugins/generic/nl80211_listener/nl80211_internal.h 13 | @@ -49,6 +49,6 @@ 14 | #include "core/oonf_logging.h" 15 | 16 | /* headers only for use inside the NL80211 subsystem */ 17 | -enum oonf_log_source LOG_NL80211; 18 | +extern enum oonf_log_source LOG_NL80211; 19 | 20 | #endif /* NL80211_INTERNAL_H_ */ 21 | -------------------------------------------------------------------------------- /oonf-init-scripts/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/rules.mk 2 | include $(INCLUDE_DIR)/kernel.mk 3 | 4 | PKG_NAME:=oonf-init-scripts 5 | PKG_VERSION:=0.9.1-r3 6 | PKG_RELEASE:=1 7 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) 8 | 9 | include $(INCLUDE_DIR)/package.mk 10 | 11 | define Package/oonf-init-scripts 12 | SECTION:=net 13 | CATEGORY:=Network 14 | MAINTAINER:=Henning Rogge 15 | SUBMENU:=OLSR.org network framework 16 | URL:=http://www.olsr.org/ 17 | TITLE:= Common OONF startup scripts 18 | VERSION:=$(PKG_VERSION) 19 | endef 20 | 21 | define Build/Prepare 22 | mkdir -p $(PKG_BUILD_DIR) 23 | endef 24 | 25 | define Build/Configure 26 | endef 27 | 28 | define Build/Compile 29 | endef 30 | 31 | define Package/oonf-init-scripts/install 32 | $(INSTALL_BIN) -D ./files/oonf_init.sh $(1)/lib/functions/oonf_init.sh 33 | $(INSTALL_BIN) -D ./files/oonf_hotplug.sh $(1)/lib/functions/oonf_hotplug.sh 34 | endef 35 | 36 | $(eval $(call BuildPackage,oonf-init-scripts)) 37 | -------------------------------------------------------------------------------- /oonf-init-scripts/files/oonf_hotplug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | case "${ACTION}" in 4 | ifup) 5 | . /etc/rc.common /etc/init.d/${DAEMON} enabled && { 6 | logger -t "${DAEMON}[hotplug]" -p daemon.info 'reloading configuration' 7 | . /etc/rc.common /etc/init.d/${DAEMON} reload 8 | } 9 | ;; 10 | esac 11 | -------------------------------------------------------------------------------- /oonf-init-scripts/files/oonf_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /usr/share/libubox/jshn.sh 4 | 5 | oonf_log() 6 | { 7 | logger -s -t ${DAEMON} -p daemon.info "${1}" 8 | } 9 | 10 | oonf_get_layer3_device() 11 | { 12 | local interface="${1}" # e.g. 'mywifi' 13 | local status dev proto 14 | local query="{ \"interface\" : \"${interface}\" }" 15 | 16 | status="$( ubus -S call network.interface status "${query}" )" && { 17 | json_load "${status}" 18 | json_get_var 'dev' l3_device 19 | json_get_var 'proto' proto 20 | case "${proto}" in 21 | pppoe) 22 | # TODO: otherwise it segfaults 23 | oonf_log "refusing to add '$interface', because of proto '${proto}'" 24 | ;; 25 | *) 26 | echo "${dev}" # e.g. 'wlan0-1' 27 | ;; 28 | esac 29 | } 30 | } 31 | 32 | oonf_add_devices_to_configuration() 33 | { 34 | local i=0 35 | local device_name= section= interface= single_interface= 36 | 37 | # make a copy of configuration and 38 | # add a 'name' (physical name) for all 39 | # 'interface-names' (e.g. mywifi) 40 | # 41 | # olsrd2.@interface[2]=interface 42 | # olsrd2.@interface[2].ifname='wan lan wlanadhoc wlanadhocRADIO1' 43 | 44 | # /var is in ramdisc/tmpfs 45 | uci export ${DAEMON} >"/var/run/${DAEMON}_dev" 46 | 47 | while section="$( uci -q -c /etc/config get "${DAEMON}.@[${i}]" )"; do { 48 | echo "section: ${section}" 49 | 50 | interface="$( uci -q -c /etc/config get "${DAEMON}.@[${i}].ifname" )" || { 51 | i=$(( i + 1 )) 52 | continue 53 | } 54 | 55 | case "$( uci -q get "${DAEMON}.@[${i}].ignore" )" in 56 | 1|on|true|enabled|yes) 57 | oonf_log "removing/ignore section '$section'" 58 | uci -q -c /var/run delete "${DAEMON}_dev.@[${j}]" 59 | i=$(( i + 1 )) 60 | 61 | continue 62 | ;; 63 | esac 64 | 65 | for single_interface in ${interface}; do { 66 | device_name="$( oonf_get_layer3_device "${single_interface}" )" 67 | 68 | echo "Interface: ${single_interface} = ${device_name}" 69 | 70 | if [ ! -z "${device_name}" ] 71 | then 72 | # add option 'name' for 'ifname' (e.g. 'mywifi') 73 | uci -q -c /var/run add_list "${DAEMON}_dev.@[${i}].name=${device_name}" 74 | fi 75 | } done 76 | i=$(( $i + 1 )) 77 | } done 78 | 79 | uci -q -c /var/run commit "${DAEMON}_dev" 80 | 81 | oonf_log "wrote '/var/run/${DAEMON}_dev'" 82 | } 83 | 84 | oonf_reread_config() 85 | { 86 | local pid 87 | local pidfile="/var/run/${DAEMON}.pid" 88 | 89 | if [ -e "${pidfile}" ]; then 90 | read pid <"${pidfile}" 91 | elif pidfile="$( uci -q get "${DAEMON}.@global[0].pidfile" )"; then 92 | read pid <"${pidfile}" 93 | fi 94 | 95 | # if empty, ask kernel 96 | pid="${pid:-$( pidof ${DAEMON} )}" 97 | 98 | [ -n "${pid}" ] && kill -SIGHUP ${pid} 99 | } 100 | 101 | start() 102 | { 103 | oonf_add_devices_to_configuration 104 | 105 | # produce coredumps 106 | ulimit -c unlimited 107 | 108 | service_start /usr/sbin/${DAEMON} --set global.fork=true --load uci:///var/run/${DAEMON}_dev 109 | } 110 | 111 | stop() 112 | { 113 | service_stop /usr/sbin/${DAEMON} 114 | } 115 | 116 | reload() 117 | { 118 | oonf_add_devices_to_configuration 119 | oonf_reread_config 120 | } 121 | -------------------------------------------------------------------------------- /oonf-olsrd2/Config.in: -------------------------------------------------------------------------------- 1 | # OONF Olsrd2 configuration 2 | menu "Optional Plugins" 3 | depends on PACKAGE_oonf-olsrd2 4 | 5 | config OONF_NHDP_AUTOLL4 6 | bool "Auto_LL4 plugin enabled" 7 | help 8 | The auto_ll4 plugin automatically generates linklocal IPv4 addresses on interfaces that do not contain IPv4 addresses. 9 | default n 10 | 11 | config OONF_OLSRV2_LAN_IMPORT 12 | bool "Lan_import plugin enabled" 13 | help 14 | The lan_import plugin can read routing tables and automatically export them as locally attached networks in olsrd2. 15 | default n 16 | 17 | config OONF_OLSRV2_ROUTE_MODIFIER 18 | bool "route_modifier plugin enabled" 19 | help 20 | The route_modifier plugin allows you to overwrite aspects of routes (like table/protocol) for certain destinations. 21 | default n 22 | 23 | config OONF_GENERIC_DLEP_ROUTER 24 | bool "dlep_router plugin enabled" 25 | help 26 | The dlep_router plugin can receive linklayer metadata over the DLEP protocol. 27 | default n 28 | 29 | config OONF_GENERIC_REMOTECONTROL 30 | bool "remotecontrol plugin enabled" 31 | help 32 | The remotecontrol plugin allows you to control configuration and logging over the telnet plugin. Be careful not to open this functionality over the network without securing it. 33 | default n 34 | 35 | config OONF_GENERIC_HTTP 36 | bool "http plugin enabled" 37 | help 38 | The HTTP plugin allows HTTP access to all telnet commands. 39 | default n 40 | 41 | config OONF_OLSRV2_MPR 42 | bool "MPR plugin enabled" 43 | help 44 | The MPR plugin reduce the routing graph to limit the overhead of the OLSRv2 protocol 45 | default n 46 | 47 | endmenu 48 | -------------------------------------------------------------------------------- /oonf-olsrd2/files/olsrd2.hotplug: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DAEMON='olsrd2' 4 | 5 | . /lib/functions/oonf_hotplug.sh 6 | -------------------------------------------------------------------------------- /oonf-olsrd2/files/olsrd2.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=82 4 | DAEMON='olsrd2' 5 | 6 | . /lib/functions/oonf_init.sh 7 | -------------------------------------------------------------------------------- /oonf-olsrd2/files/olsrd2.uci: -------------------------------------------------------------------------------- 1 | config global 2 | option 'failfast' 'no' 3 | option 'pidfile' '/var/run/olsrd2.pid' 4 | option 'lockfile' '/var/lock/olsrd2' 5 | 6 | config log 7 | option 'syslog' 'true' 8 | option 'stderr' 'true' 9 | # option 'file' '/var/log/olsrd2.log' 10 | # option 'info' 'all' 11 | # option 'debug' 'all' 12 | 13 | config telnet 14 | # option 'port' '2009' 15 | 16 | config olsrv2 17 | # list 'lan' '::/0' 18 | # list 'lan' '0.0.0.0/0' 19 | 20 | config interface 21 | option 'ifname' 'loopback' 22 | 23 | config interface 24 | list 'ifname' 'WIFI' 25 | list 'ifname' 'wlanadhoc' 26 | list 'ifname' 'wlanadhocRADIO1' 27 | 28 | config interface 29 | list 'ifname' 'wan' 30 | option 'ignore' '1' 31 | # option 'rx_bitrate' '100M' 32 | # option 'tx_bitrate' '100M' 33 | # option 'signal' '-20' 34 | 35 | config interface 36 | list 'ifname' 'lan' 37 | option 'ignore' '1' 38 | # option 'rx_bitrate' '1G' 39 | # option 'tx_bitrate' '1G' 40 | # option 'signal' '-10' 41 | -------------------------------------------------------------------------------- /oonf-olsrd2/patches/010-gcc10.patch: -------------------------------------------------------------------------------- 1 | --- a/src-plugins/generic/nl80211_listener/nl80211_internal.h 2 | +++ b/src-plugins/generic/nl80211_listener/nl80211_internal.h 3 | @@ -49,6 +49,6 @@ 4 | #include "core/oonf_logging.h" 5 | 6 | /* headers only for use inside the NL80211 subsystem */ 7 | -enum oonf_log_source LOG_NL80211; 8 | +extern enum oonf_log_source LOG_NL80211; 9 | 10 | #endif /* NL80211_INTERNAL_H_ */ 11 | --- a/src-plugins/nhdp/nhdp/nhdp_internal.h 12 | +++ b/src-plugins/nhdp/nhdp/nhdp_internal.h 13 | @@ -49,8 +49,8 @@ 14 | #include "core/oonf_logging.h" 15 | 16 | /* headers only for use inside the NHDP subsystem */ 17 | -enum oonf_log_source LOG_NHDP; 18 | -enum oonf_log_source LOG_NHDP_R; 19 | -enum oonf_log_source LOG_NHDP_W; 20 | +extern enum oonf_log_source LOG_NHDP; 21 | +extern enum oonf_log_source LOG_NHDP_R; 22 | +extern enum oonf_log_source LOG_NHDP_W; 23 | 24 | #endif /* NHDP_INTERNAL_H_ */ 25 | --- a/src-plugins/olsrv2/olsrv2/olsrv2_internal.h 26 | +++ b/src-plugins/olsrv2/olsrv2/olsrv2_internal.h 27 | @@ -50,9 +50,9 @@ 28 | #include "core/oonf_logging.h" 29 | 30 | /* headers only for use inside the OLSRv2 subsystem */ 31 | -EXPORT enum oonf_log_source LOG_OLSRV2; 32 | -EXPORT enum oonf_log_source LOG_OLSRV2_R; 33 | -EXPORT enum oonf_log_source LOG_OLSRV2_ROUTING; 34 | -EXPORT enum oonf_log_source LOG_OLSRV2_W; 35 | +EXPORT extern enum oonf_log_source LOG_OLSRV2; 36 | +EXPORT extern enum oonf_log_source LOG_OLSRV2_R; 37 | +EXPORT extern enum oonf_log_source LOG_OLSRV2_ROUTING; 38 | +EXPORT extern enum oonf_log_source LOG_OLSRV2_W; 39 | 40 | #endif /* OLSRV2_INTERNAL_H_ */ 41 | -------------------------------------------------------------------------------- /oonf-olsrd2/patches/020-static.patch: -------------------------------------------------------------------------------- 1 | --- a/src-plugins/nhdp/nhdp/nhdp.c 2 | +++ b/src-plugins/nhdp/nhdp/nhdp.c 3 | @@ -187,9 +187,9 @@ static struct oonf_rfc5444_protocol *_pr 4 | static struct netaddr _originator_v4, _originator_v6; 5 | 6 | /* logging sources for NHDP subsystem */ 7 | -static enum oonf_log_source LOG_NHDP; 8 | -static enum oonf_log_source LOG_NHDP_R; 9 | -static enum oonf_log_source LOG_NHDP_W; 10 | +enum oonf_log_source LOG_NHDP; 11 | +enum oonf_log_source LOG_NHDP_R; 12 | +enum oonf_log_source LOG_NHDP_W; 13 | 14 | /** 15 | * Initialize additional logging sources for NHDP 16 | --- a/src-plugins/olsrv2/olsrv2/olsrv2.c 17 | +++ b/src-plugins/olsrv2/olsrv2/olsrv2.c 18 | @@ -255,10 +255,10 @@ static uint64_t _overwrite_tc_interval; 19 | static uint64_t _overwrite_tc_validity; 20 | 21 | /* Additional logging sources */ 22 | -static enum oonf_log_source LOG_OLSRV2; 23 | -static enum oonf_log_source LOG_OLSRV2_R; 24 | -static enum oonf_log_source LOG_OLSRV2_ROUTING; 25 | -static enum oonf_log_source LOG_OLSRV2_W; 26 | +enum oonf_log_source LOG_OLSRV2; 27 | +enum oonf_log_source LOG_OLSRV2_R; 28 | +enum oonf_log_source LOG_OLSRV2_ROUTING; 29 | +enum oonf_log_source LOG_OLSRV2_W; 30 | 31 | /** 32 | * Initialize additional logging sources for NHDP 33 | -------------------------------------------------------------------------------- /pimbd/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/rules.mk 2 | 3 | PKG_NAME:=pimbd 4 | PKG_RELEASE:=$(AUTORELEASE) 5 | 6 | PKG_SOURCE_PROTO:=git 7 | PKG_SOURCE_URL:=https://github.com/Oryon/pimbd.git 8 | PKG_SOURCE_DATE:=2018-06-19 9 | PKG_SOURCE_VERSION:=dbf4e5913b06e3160f506df15e6a047a403a5f21 10 | PKG_MIRROR_HASH:=943afce4f10036cbb479385a6ff48535da61d83c48512a10db8784677f492c1c 11 | 12 | PKG_MAINTAINER:=Pierre Pfister 13 | PKG_LICENSE:=Apache-2.0 14 | PKG_LICENSE_FILES:=LICENSE 15 | 16 | include $(INCLUDE_DIR)/package.mk 17 | include $(INCLUDE_DIR)/cmake.mk 18 | 19 | # Spammy debug builds for now 20 | CMAKE_OPTIONS += -DL_LEVEL=7 \ 21 | -DWITH_LIBUBOX=1 22 | 23 | define Package/pimbd 24 | SECTION:=net 25 | CATEGORY:=Network 26 | TITLE:=PIM BIDIR daemon 27 | URL:=https://github.com/Oryon/pimbd.git 28 | DEPENDS+=@IPV6 29 | DEPENDS+=netifd 30 | endef 31 | 32 | define Package/pimbd/description 33 | This package provides a daemon which implements the Protocol Independent 34 | Multicast BIDIR routing protocol. Note that a routing protocol must be 35 | installed and running in order for PIM to function. 36 | endef 37 | 38 | define Package/pimbd/install 39 | $(INSTALL_DIR) $(1)/usr/sbin/ 40 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/pimbd $(1)/usr/sbin/pimbd 41 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/pimbc.sh $(1)/usr/sbin/pimbc 42 | ln -s pimbd $(1)/usr/sbin/pimb-ipc 43 | $(INSTALL_DIR) $(1)/etc/init.d 44 | $(INSTALL_BIN) ./files/pimbd.init $(1)/etc/init.d/pimbd 45 | $(INSTALL_DIR) $(1)/etc/uci-defaults 46 | $(INSTALL_BIN) files/firewall-uci.sh $(1)/etc/uci-defaults/99_pimbd_firewall 47 | $(INSTALL_DIR) $(1)/etc/config 48 | $(INSTALL_CONF) ./files/pimb.config $(1)/etc/config/pimb 49 | endef 50 | 51 | $(eval $(call BuildPackage,pimbd)) 52 | -------------------------------------------------------------------------------- /pimbd/files/firewall-uci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | pim_rule () { 4 | uci -q batch <<-EOT 5 | delete firewall.$1 6 | set firewall.$1=rule 7 | set firewall.$1.name='$2 multicast forward for $3' 8 | set firewall.$1.src='*' 9 | set firewall.$1.dest='*' 10 | set firewall.$1.family='$2' 11 | set firewall.$1.proto='udp' 12 | set firewall.$1.dest_ip='$3' 13 | set firewall.$1.target='ACCEPT' 14 | EOT 15 | } 16 | 17 | pim_rule pimbd4 ipv4 224.0.0.0/4 18 | pim_rule pimbd6 ipv6 ff00::/8 19 | uci commit firewall 20 | 21 | exit 0 22 | 23 | -------------------------------------------------------------------------------- /pimbd/files/pimb.config: -------------------------------------------------------------------------------- 1 | # The interface section allows to enable pimb on an interface. 2 | # Several options can be enabled for the interface. 3 | # All options are disabled by default. 4 | # 5 | #config interface '' 6 | # option pim '' - enable or disable pim 7 | # option ssbidir '' - enable or disable ssbidir 8 | # option mld '' - enable or disable mld 9 | # option igmp '' - enable or disable igmp 10 | # option dev '' - set the device name 11 | 12 | # The rpa section allows to configure a rendevous point. 13 | # The interface and the networks must be configured for every rendevous. 14 | # 15 | #config rpa '' 16 | # option address '' - rendevous point address 17 | # list prefix '/' - prefix for the rpa 18 | 19 | 20 | 21 | # Uncomment the following following section to enable pimb on the interface eth1. 22 | #config interface 'ETH1' 23 | # option pim 'on' 24 | # option ssbidir 'on' 25 | # option mld 'on' 26 | # option igmp 'on' 27 | # option dev 'eth1' 28 | 29 | 30 | # Uncomment the following section to configure a rendevous point. 31 | #config rpa '172_16_0_1' 32 | # option address '172.16.0.1' 33 | # list prefix '224.0.0.0/4' 34 | 35 | -------------------------------------------------------------------------------- /prince/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009-2018 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | 8 | include $(TOPDIR)/rules.mk 9 | 10 | PKG_NAME:=prince 11 | PKG_VERSION:=0.4 12 | PKG_RELEASE:=$(AUTORELEASE) 13 | 14 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 15 | PKG_SOURCE_URL:=https://github.com/AdvancedNetworkingSystems/prince/archive/refs/tags/v$(PKG_VERSION).tar.gz? 16 | PKG_HASH:=9e3ce87343f5ea1d66757f8c704b62ff47d5eb245a191cf1e6a9ec106c5da90e 17 | 18 | PKG_MAINTAINER:=Gabriele Gemmi 19 | PKG_LICENSE:=MIT 20 | PKG_LICENSE_FILES:=LICENSE 21 | 22 | PKG_USE_MIPS16:=0 23 | 24 | # out of source build 25 | CMAKE_BINARY_SUBDIR:=build 26 | 27 | include $(INCLUDE_DIR)/package.mk 28 | include $(INCLUDE_DIR)/cmake.mk 29 | 30 | define Package/prince 31 | SECTION:=net 32 | CATEGORY:=Network 33 | SUBMENU:=Routing and Redirection 34 | TITLE:=Prince 35 | URL:=https://github.com/AdvancedNetworkingSystems/prince 36 | DEPENDS:=+libjson-c +libpthread 37 | endef 38 | 39 | define Package/prince/description 40 | Prince is an open source implementation of the PopRouting Algorithm. 41 | It has been developed as a Google Summer of Code Project in collaboration with Freifunk and the University of Trento. 42 | 43 | Prince fetches topology data from a Link State routing daemon (OONF, OLSR, OSPF, etc), 44 | calculates the betweenness centrality using the topology and then computes the 45 | the timers' optimal values using these data. At the end of the computation the timers are pushed back to the routing daemon. 46 | Since v0.4 it supports both OONF and OLSRd. 47 | endef 48 | 49 | define Package/prince/install 50 | $(INSTALL_DIR) $(1)/usr/bin 51 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/prince $(1)/usr/bin/prince 52 | 53 | $(INSTALL_DIR) $(1)/usr/lib 54 | $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/libprince_oonf.so $(1)/usr/lib 55 | $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/libprince_olsr.so $(1)/usr/lib 56 | 57 | $(INSTALL_DIR) $(1)/etc/init.d 58 | $(INSTALL_BIN) ./files/prince.init $(1)/etc/init.d/prince 59 | $(INSTALL_DATA) ./files/prince.conf $(1)/etc/prince.conf 60 | endef 61 | 62 | CFLAGS += $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) 63 | LDFLAGS += $(TARGET_LDFLAGS) 64 | 65 | $(eval $(call BuildPackage,prince)) 66 | -------------------------------------------------------------------------------- /prince/files/prince.conf: -------------------------------------------------------------------------------- 1 | { 2 | "proto": { 3 | "protocol": "oonf", 4 | "host": "127.0.0.1", 5 | "port": 2009 , 6 | "refresh": 10, 7 | "timer_port": 2009 8 | }, 9 | "graph-parser": { 10 | "heuristic": 1, 11 | "weights": 1, 12 | "recursive": 0, 13 | "stop_unchanged": 0, 14 | "multithreaded": 0 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /prince/files/prince.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Init script for Prince 3 | # Copyright (C) 2018 OpenWrt.org 4 | 5 | USE_PROCD=1 6 | START=99 7 | STOP=15 8 | 9 | PROG="/usr/bin/prince" 10 | CONF="/etc/prince.conf" 11 | 12 | start_service(){ 13 | procd_open_instance 14 | procd_set_param command $PROG $CONF 15 | procd_set_param stdout 1 16 | procd_set_param stderr 1 17 | procd_set_param user nobody 18 | procd_close_instance 19 | echo "Prince started" 20 | } 21 | -------------------------------------------------------------------------------- /prince/patches/010-gcc10.patch: -------------------------------------------------------------------------------- 1 | --- a/prince/include/common.h 2 | +++ b/prince/include/common.h 3 | @@ -35,12 +35,12 @@ typedef struct routing_plugin_ { 4 | 5 | } routing_plugin; 6 | 7 | -routing_plugin *(*new_plugin_p)(char *host, int port, int json_type, 8 | +static routing_plugin *(*new_plugin_p)(char *host, int port, int json_type, 9 | int timer_port); 10 | 11 | -int (*get_initial_timers_p)(routing_plugin *o, struct timers *t); 12 | -int (*get_topology_p)(routing_plugin *o); 13 | -int (*push_timers_p)(routing_plugin *o, struct timers t); 14 | -void (*delete_plugin_p)(routing_plugin *o); 15 | +static int (*get_initial_timers_p)(routing_plugin *o, struct timers *t); 16 | +static int (*get_topology_p)(routing_plugin *o); 17 | +static int (*push_timers_p)(routing_plugin *o, struct timers t); 18 | +static void (*delete_plugin_p)(routing_plugin *o); 19 | 20 | #endif /* SRC_COMMON_H_ */ 21 | -------------------------------------------------------------------------------- /quagga/files/quagga.conf: -------------------------------------------------------------------------------- 1 | password zebra 2 | ! 3 | access-list vty permit 127.0.0.0/8 4 | access-list vty deny any 5 | ! 6 | line vty 7 | access-class vty 8 | -------------------------------------------------------------------------------- /quagga/files/quagga.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2006 OpenWrt.org 3 | 4 | START=60 5 | start() { 6 | /usr/sbin/quagga.init start 7 | } 8 | 9 | stop() { 10 | /usr/sbin/quagga.init stop 11 | } 12 | -------------------------------------------------------------------------------- /quagga/patches/140-holdtimer-set.patch: -------------------------------------------------------------------------------- 1 | --- a/bgpd/bgp_network.c 2 | +++ b/bgpd/bgp_network.c 3 | @@ -255,8 +255,7 @@ bgp_accept (struct thread *thread) 4 | 5 | /* Config state that should affect OPEN packet must be copied over */ 6 | peer->local_id = peer1->local_id; 7 | - peer->v_holdtime = peer1->v_holdtime; 8 | - peer->v_keepalive = peer1->v_keepalive; 9 | + peer->v_holdtime = BGP_LARGE_HOLDTIME; 10 | peer->local_as = peer1->local_as; 11 | peer->change_local_as = peer1->change_local_as; 12 | peer->flags = peer1->flags; 13 | --- a/bgpd/bgpd.h 14 | +++ b/bgpd/bgpd.h 15 | @@ -754,6 +754,7 @@ struct bgp_nlri 16 | 17 | /* BGP timers default value. */ 18 | #define BGP_INIT_START_TIMER 1 19 | +#define BGP_LARGE_HOLDTIME 240 20 | #define BGP_DEFAULT_HOLDTIME 180 21 | #define BGP_DEFAULT_KEEPALIVE 60 22 | #define BGP_DEFAULT_EBGP_ROUTEADV 3 23 | -------------------------------------------------------------------------------- /quagga/patches/170-use-supported-pagers.patch: -------------------------------------------------------------------------------- 1 | --- a/vtysh/vtysh.c 2 | +++ b/vtysh/vtysh.c 3 | @@ -253,7 +253,7 @@ vtysh_pager_init (void) 4 | if (pager_defined) 5 | vtysh_pager_name = strdup (pager_defined); 6 | else 7 | - vtysh_pager_name = strdup ("more"); 8 | + vtysh_pager_name = strdup ("cat"); 9 | } 10 | 11 | /* Command execution over the vty interface. */ 12 | @@ -2214,7 +2214,7 @@ DEFUN (vtysh_terminal_length, 13 | { 14 | int lines; 15 | char *endptr = NULL; 16 | - char default_pager[10]; 17 | + char default_pager[12]; 18 | 19 | lines = strtol (argv[0], &endptr, 10); 20 | if (lines < 0 || lines > 512 || *endptr != '\0') 21 | @@ -2231,7 +2231,7 @@ DEFUN (vtysh_terminal_length, 22 | 23 | if (lines != 0) 24 | { 25 | - snprintf(default_pager, 10, "more -%i", lines); 26 | + snprintf(default_pager, 12, "head -n %i", lines); 27 | vtysh_pager_name = strdup (default_pager); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /vis/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2008-2011 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | 8 | include $(TOPDIR)/rules.mk 9 | 10 | PKG_NAME:=vis 11 | PKG_RELEASE:=$(AUTORELEASE) 12 | 13 | PKG_SOURCE_PROTO:=git 14 | PKG_SOURCE_DATE:=2013-04-07 15 | PKG_SOURCE_VERSION:=7710cce42e8d63ea114056a4a140835d4a452933 16 | PKG_SOURCE_URL:=https://git.open-mesh.org/vis.git 17 | PKG_MIRROR_HASH:=0ed79822a694f220ea44fc81d91ccdacae6ab8ef599810ecfd39acd34d68ae53 18 | 19 | PKG_MAINTAINER:=Corinna "Elektra" Aichele 20 | PKG_LICENSE:=GPL-2.0-only 21 | 22 | PKG_BUILD_PARALLEL:=1 23 | 24 | include $(INCLUDE_DIR)/package.mk 25 | 26 | define Package/vis 27 | SECTION:=net 28 | CATEGORY:=Network 29 | SUBMENU:=Routing and Redirection 30 | DEPENDS:=+libpthread 31 | TITLE:=visualization server for B.A.T.M.A.N. layer 3 32 | URL:=https://www.open-mesh.org/ 33 | endef 34 | 35 | define Package/vis/description 36 | visualization server for B.A.T.M.A.N. layer 3 37 | endef 38 | 39 | MAKE_FLAGS += \ 40 | EXTRA_CFLAGS='-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE' \ 41 | REVISION="$(PKG_REV)" \ 42 | CC="$(TARGET_CC)" \ 43 | vis 44 | 45 | define Package/vis/install 46 | $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d 47 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/vis $(1)/usr/sbin/ 48 | $(INSTALL_BIN) ./files/etc/init.d/vis $(1)/etc/init.d 49 | $(INSTALL_DATA) ./files/etc/config/vis $(1)/etc/config 50 | endef 51 | 52 | define Package/vis/conffiles 53 | /etc/config/vis 54 | endef 55 | 56 | $(eval $(call BuildPackage,vis)) 57 | -------------------------------------------------------------------------------- /vis/files/etc/config/vis: -------------------------------------------------------------------------------- 1 | config vis general 2 | option interface ath0 3 | 4 | -------------------------------------------------------------------------------- /vis/files/etc/init.d/vis: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | START=90 3 | USE_PROCD=1 4 | 5 | vis_start() { 6 | local config="$1" 7 | local interface 8 | 9 | [ "$config" = "general" ] || return 1 10 | 11 | config_get interface "$config" interface 12 | if [ "$interface" = "" ]; then 13 | echo $1 Error, you must specify at least a network interface 14 | return 1 15 | fi 16 | 17 | procd_open_instance "${config}" 18 | procd_set_param command /usr/sbin/vis 19 | procd_append_param command -D 20 | procd_append_param command ${interface} 21 | procd_set_param netdev $interface 22 | procd_close_instance 23 | } 24 | 25 | start_service() { 26 | config_load "vis" 27 | config_foreach vis_start vis 28 | } 29 | 30 | service_triggers() { 31 | procd_add_reload_trigger "vis" 32 | 33 | procd_open_trigger 34 | procd_add_raw_trigger "interface.*" 1000 /etc/init.d/vis reload 35 | procd_close_trigger 36 | } 37 | -------------------------------------------------------------------------------- /vis/patches/0001-Allow-one-to-disable-forking-to-background-in-debug_.patch: -------------------------------------------------------------------------------- 1 | From: Sven Eckelmann 2 | Date: Sun, 1 Dec 2013 14:39:00 +0100 3 | Subject: Allow one to disable forking to background in debug_mode 0 4 | 5 | --- 6 | posix/init.c | 19 ++++++++++++++----- 7 | 1 file changed, 14 insertions(+), 5 deletions(-) 8 | 9 | --- a/vis.c 10 | +++ b/vis.c 11 | @@ -58,6 +58,7 @@ buffer_t *fillme = NULL; 12 | 13 | static int8_t stop; 14 | uint8_t debug_level = 0; 15 | +static int no_detach = 0; 16 | 17 | formats selected_formats = dot_draw; 18 | 19 | @@ -718,6 +719,7 @@ void print_usage() { 20 | printf( "Usage: vis \n" ); 21 | printf( "\t-j output mesh topology as json on port %d\n", JSON_PORT ); 22 | printf( "\t-d debug level\n" ); 23 | + printf( "\t-D run in foreground\n" ); 24 | printf( "\t-h help\n" ); 25 | printf( "\t-v Version\n\n" ); 26 | printf( "Olsrs3d / Meshs3d is an application to visualize a mesh network.\nIt is a part of s3d, have a look at s3d.sourceforge.net\n\n" ); 27 | @@ -738,7 +740,7 @@ int main( int argc, char **argv ) { 28 | fd_set wait_sockets, tmp_wait_sockets; 29 | 30 | 31 | - while ( ( optchar = getopt ( argc, argv, "jd:hv" ) ) != -1 ) { 32 | + while ( ( optchar = getopt ( argc, argv, "jd:hvD" ) ) != -1 ) { 33 | 34 | switch( optchar ) { 35 | 36 | @@ -773,6 +775,11 @@ int main( int argc, char **argv ) { 37 | selected_formats |= json; 38 | found_args++; 39 | break; 40 | + 41 | + case 'D': 42 | + no_detach = 1; 43 | + found_args++; 44 | + break; 45 | 46 | default: 47 | print_usage(); 48 | @@ -891,7 +898,7 @@ int main( int argc, char **argv ) { 49 | 50 | 51 | /* daemonize */ 52 | - if ( debug_level == 0 ) { 53 | + if ( debug_level == 0 && !no_detach) { 54 | 55 | if ( my_daemon() < 0 ) 56 | exit_error( "Error - can't fork to background: %s\n", strerror(errno) ); 57 | --------------------------------------------------------------------------------