hostmngr: 0.16.0

This commit is contained in:
Anjan Chanda 2023-06-01 09:23:38 +02:00
parent 0d230c1d96
commit f77697fa15
5 changed files with 121 additions and 0 deletions

15
hostmngr/Config.in Normal file
View file

@ -0,0 +1,15 @@
if (PACKAGE_hostmngr)
menu "Configuration"
config HOSTMNGR_HOSTS_HISTORY
bool "Keep history of hosts"
default y
config HOSTMNGR_PLATFORM_HAS_WIFI
bool "Platform has WiFi"
default y if PACKAGE_libwifi
endmenu
endif

70
hostmngr/Makefile Normal file
View file

@ -0,0 +1,70 @@
#
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=hostmngr
PKG_VERSION:=0.16.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=8f8f5f6d29bf6bc9fe714b7dbf7caf5211b99c57
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/hostmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Show and manage hosts in the network
DEPENDS= +libubox +libuci +libubus +ubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +libnfnetlink +libmnl \
+libnetfilter-conntrack \
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi
endef
define Package/hostmngr/config
source "$(SOURCE)/Config.in"
endef
define Package/hostmngr/description
This package provides hostmngr that can detect and show host devices
present in the network.
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-I$(STAGING_DIR)/usr/include/libnetfilter_conntrack \
-D_GNU_SOURCE
ifeq ($(CONFIG_HOSTMNGR_PLATFORM_HAS_WIFI),y)
TARGET_CFLAGS += -DHAS_WIFI
endif
MAKE_PATH:=src
define Package/hostmngr/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/hostmngr/ $(PKG_BUILD_DIR)/
endef
endif
$(eval $(call BuildPackage,hostmngr))

View file

@ -0,0 +1,9 @@
config global 'global'
option enabled '1'
option history '1'
option history_file '/etc/hosts_history.json'
option history_timeout '604800'
config interface
list ifname 'br-lan'

View file

@ -0,0 +1,26 @@
#!/bin/sh /etc/rc.common
START=97
STOP=20
USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command "/usr/sbin/hostmngr" "--config hostmngr" "-o" "/tmp/hostmngr.log" "-f"
# procd_set_param respawn
procd_set_param limits core="unlimited"
# procd_set_param stdout 1
# procd_set_param stderr 1
procd_close_instance
}
service_triggers()
{
procd_add_reload_trigger "hostmngr"
}
reload_service() {
stop
start
}

View file

@ -59,6 +59,7 @@ CONFIG_PACKAGE_inbd=y
CONFIG_PACKAGE_qosmngr=y CONFIG_PACKAGE_qosmngr=y
CONFIG_PACKAGE_libwifiutils=y CONFIG_PACKAGE_libwifiutils=y
CONFIG_PACKAGE_wifimngr=y CONFIG_PACKAGE_wifimngr=y
CONFIG_PACKAGE_hostmngr=y
# Multi-AP # # Multi-AP #
CONFIG_PACKAGE_ieee1905=y CONFIG_PACKAGE_ieee1905=y