--- /dev/null
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pimbd
+PKG_SOURCE_VERSION:=68f5fc803119e4b33a88b35c096f4d6ac28b6de5
+PKG_VERSION:=2015-08-18-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/Oryon/pimbd.git
+PKG_MAINTAINER:=Pierre Pfister <pierre.pfister@darou.fr>
+PKG_LICENSE:=Apache-2.0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+# Spammy debug builds for now
+CMAKE_OPTIONS += -DL_LEVEL=7
+
+define Package/pimbd
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=PIM BIDIR daemon
+ URL:=https://github.com/Oryon/pimbd.git
+ DEPENDS+=+@IPV6
+ DEPENDS+=netifd
+endef
+
+define Package/pimbd/description
+This package provides a daemon which implements the Protocol Independent
+Multicast BIDIR routing protocol. Note that a routing protocol must be
+installed and running in order for PIM to function.
+endef
+
+define Package/pimbd/install
+ $(INSTALL_DIR) $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/pimbd $(1)/usr/sbin/pimbd
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/pimbc.sh $(1)/usr/sbin/pimbc
+ ln -s pimbd $(1)/usr/sbin/pimb-ipc
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/pimbd.init $(1)/etc/init.d/pimbd
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_BIN) files/firewall-uci.sh $(1)/etc/uci-defaults/99_pimbd_firewall
+endef
+
+$(eval $(call BuildPackage,pimbd))
--- /dev/null
+#!/bin/sh
+
+pim_rule () {
+uci -q batch <<-EOT
+ delete firewall.$1
+ set firewall.$1=rule
+ set firewall.$1.name='$2 multicast forward for $3'
+ set firewall.$1.src='*'
+ set firewall.$1.dest='*'
+ set firewall.$1.family='$2'
+ set firewall.$1.proto='udp'
+ set firewall.$1.dest_ip='$3'
+ set firewall.$1.target='ACCEPT'
+EOT
+}
+
+pim_rule pimbd4 ipv4 224.0.0.0/4
+pim_rule pimbd6 ipv6 ff00::/8
+uci commit firewall
+
+exit 0
+
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=90
+STOP=10
+USE_PROCD=1
+
+start_service() {
+ . /lib/functions.sh
+ . /lib/functions/network.sh
+ config_load pimb
+
+ procd_open_instance
+ procd_set_param command /usr/sbin/pimbd
+ procd_append_param command -S
+ procd_append_param command -L 6
+
+ procd_set_param respawn
+ procd_close_instance
+}
+
+