Compare commits

...

3 Commits

Author SHA1 Message Date
nevadita.chatterjee
872208c573 map-topology: Review comments incorporated 2022-05-09 11:27:18 +05:30
nevadita.chatterjee
9fe4bacc72 map-topology: 3.3.1 2022-05-06 12:44:48 +00:00
nevadita.chatterjee
9065ad8ef2 map-topology: Adding the topology multiap none mode 2022-05-06 12:44:48 +00:00
2 changed files with 46 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=map-topology
PKG_VERSION:=3.2.13
PKG_VERSION:=3.3.1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
@@ -26,6 +26,14 @@ define Package/map-topology
CATEGORY:=Utilities
DEPENDS:=+libubox +ubus +libpthread +libuci +libeasy \
+libieee1905 +map-plugin +libavahi-nodbus-support
SECTION:=utils
TITLE:=Utility to build topology of a multi-AP network
endef
define Package/topology
CATEGORY:=Utilities
DEPENDS:=+libubox +ubus +libpthread +libuci +libeasy
SECTION:=utils
TITLE:=Utility to build topology of a multi-AP network
endef
@@ -38,6 +46,10 @@ define Package/map-topology/description
Constructs network topology and show it as json structure over UBUS
endef
define Package/topology/description
Constructs network topology and show it as json structure over UBUS (without map dependency)
endef
MAKE_PATH:=src
ifeq ($(LOCAL_DEV),1)
@@ -46,10 +58,18 @@ define Build/Prepare
endef
endif
define Package/map-topology/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/topologyd $(1)/usr/sbin/
endef
define Package/topology/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/topologyd_singleap $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,map-topology))
$(eval $(call BuildPackage,topology))

View File

@@ -65,6 +65,16 @@ validate_hosts_config() {
}
start_service() {
FILE=/usr/sbin/topologyd
FILE_SINGLE_AP=/usr/sbin/topologyd_singleap
if test -f "$FILE"; then
start_topology
elif test -f "$FILE_SINGLE_AP"; then
start_topology_singleap
fi
}
start_topology() {
config_load "topology"
validate_topology_config || return 1;
@@ -79,6 +89,21 @@ start_service() {
procd_close_instance
}
start_topology_singleap() {
config_load "topology"
validate_topology_config || return 1;
config_load "hosts"
validate_hosts_config || return 1;
procd_open_instance
procd_set_param command "/usr/sbin/topologyd_singleap"
procd_set_param respawn
# procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
service_triggers()
{
procd_add_reload_trigger "network"