From 362b02d489983a10fcf2f186fa7afb7050d22e70 Mon Sep 17 00:00:00 2001 From: ElonH Date: Wed, 12 Feb 2020 18:01:00 +0800 Subject: [PATCH] luci-app-airwhu: normalize makefile (#6) --- package/ctcgfw/luci-app-airwhu/Makefile | 50 +-- .../lua/luci => luasrc}/controller/airwhu.lua | 0 .../lua/luci => luasrc}/model/cbi/airwhu.lua | 0 .../luci-app-airwhu/po/zh_Hans/airwhu.po | 250 ------------- .../po/zh_Hans/luci-app-airwhu.po | 250 +++++++++++++ .../{files => }/root/bin/ipv6masq.sh | 0 .../{files => }/root/etc/config/airwhu | 0 .../root/etc/hotplug.d/iface/99-ipv6nat | 0 .../{files => }/root/etc/init.d/mentohust | 0 .../luci-app-airwhu/tools/po2lmo/Makefile | 12 - .../luci-app-airwhu/tools/po2lmo/src/po2lmo | Bin 18832 -> 0 bytes .../luci-app-airwhu/tools/po2lmo/src/po2lmo.c | 247 ------------- .../tools/po2lmo/src/template_lmo.c | 328 ------------------ .../tools/po2lmo/src/template_lmo.h | 92 ----- 14 files changed, 256 insertions(+), 973 deletions(-) rename package/ctcgfw/luci-app-airwhu/{files/root/usr/lib/lua/luci => luasrc}/controller/airwhu.lua (100%) rename package/ctcgfw/luci-app-airwhu/{files/root/usr/lib/lua/luci => luasrc}/model/cbi/airwhu.lua (100%) delete mode 100644 package/ctcgfw/luci-app-airwhu/po/zh_Hans/airwhu.po create mode 100644 package/ctcgfw/luci-app-airwhu/po/zh_Hans/luci-app-airwhu.po rename package/ctcgfw/luci-app-airwhu/{files => }/root/bin/ipv6masq.sh (100%) rename package/ctcgfw/luci-app-airwhu/{files => }/root/etc/config/airwhu (100%) rename package/ctcgfw/luci-app-airwhu/{files => }/root/etc/hotplug.d/iface/99-ipv6nat (100%) rename package/ctcgfw/luci-app-airwhu/{files => }/root/etc/init.d/mentohust (100%) delete mode 100644 package/ctcgfw/luci-app-airwhu/tools/po2lmo/Makefile delete mode 100755 package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/po2lmo delete mode 100644 package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/po2lmo.c delete mode 100644 package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/template_lmo.c delete mode 100644 package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/template_lmo.h diff --git a/package/ctcgfw/luci-app-airwhu/Makefile b/package/ctcgfw/luci-app-airwhu/Makefile index 99637d2fa7..1e07ecea21 100644 --- a/package/ctcgfw/luci-app-airwhu/Makefile +++ b/package/ctcgfw/luci-app-airwhu/Makefile @@ -3,49 +3,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-airwhu PKG_VERSION=1.0 PKG_RELEASE:=1 +LUCI_TITLE:=luci-app-airwhu +LUCI_PKGARCH:=all +LUCI_DEPENDS:=+mentohust +kmod-ipt-nat6 +LUCI_DESCRIPTION:=LuCI web-interface for Ruijie 802.1X Client with IPv6 NAT. -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +include $(TOPDIR)/feeds/luci/luci.mk -include $(INCLUDE_DIR)/package.mk - -define Package/luci-app-airwhu - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=3. Applications - DEPENDS:=+mentohust +kmod-ipt-nat6 - TITLE:=luci-app-airwhu - PKGARCH:=all -endef - -define Package/luci-app-airwhu/description - LuCI web-interface for Ruijie 802.1X Client with IPv6 NAT. -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) - $(CP) ./* $(PKG_BUILD_DIR)/ - po2lmo $(PKG_BUILD_DIR)/po/airwhu.zh_Hans.po $(PKG_BUILD_DIR)/po/airwhu.zh-cn.lmo -endef - -define Build/Compile -endef - -define Package/luci-app-airwhu/install - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_DIR) $(1)/bin - $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi - $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller - $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n - - $(INSTALL_CONF) ./files/root/etc/config/airwhu $(1)/etc/config/airwhu - $(INSTALL_BIN) ./files/root/etc/init.d/mentohust $(1)/etc/init.d/mentohust - $(INSTALL_BIN) ./files/root/etc/hotplug.d/iface/99-ipv6nat $(1)/etc/hotplug.d/iface/99-ipv6nat - $(INSTALL_BIN) ./files/root/bin/ipv6masq.sh $(1)/bin/ipv6masq.sh - $(INSTALL_DATA) ./files/root/usr/lib/lua/luci/model/cbi/airwhu.lua $(1)/usr/lib/lua/luci/model/cbi/airwhu.lua - $(INSTALL_DATA) ./files/root/usr/lib/lua/luci/controller/airwhu.lua $(1)/usr/lib/lua/luci/controller/airwhu.lua - $(INSTALL_DATA) $(PKG_BUILD_DIR)/po/airwhu.zh-cn.lmo $(1)/usr/lib/lua/luci/i18n/airwhu.zh-cn.lmo -endef - -$(eval $(call BuildPackage,luci-app-airwhu)) +# call BuildPackage - OpenWrt buildroot signature diff --git a/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/controller/airwhu.lua b/package/ctcgfw/luci-app-airwhu/luasrc/controller/airwhu.lua similarity index 100% rename from package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/controller/airwhu.lua rename to package/ctcgfw/luci-app-airwhu/luasrc/controller/airwhu.lua diff --git a/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua b/package/ctcgfw/luci-app-airwhu/luasrc/model/cbi/airwhu.lua similarity index 100% rename from package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua rename to package/ctcgfw/luci-app-airwhu/luasrc/model/cbi/airwhu.lua diff --git a/package/ctcgfw/luci-app-airwhu/po/zh_Hans/airwhu.po b/package/ctcgfw/luci-app-airwhu/po/zh_Hans/airwhu.po deleted file mode 100644 index cd6d8942fa..0000000000 --- a/package/ctcgfw/luci-app-airwhu/po/zh_Hans/airwhu.po +++ /dev/null @@ -1,250 +0,0 @@ -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Project-Id-Version: PACKAGE VERSION\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" -"Language: zh_Hans\n" -"MIME-Version: 1.0\n" -"Content-Transfer-Encoding: 8bit\n" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:62 -msgid "0 means no limit,default to 8" -msgstr "0表示无限制,默认为8" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:78 -msgid "0(no)" -msgstr "0(不使用后台模式)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:84 -msgid "0(no),1-20(yes),default to 0" -msgstr "0(不使用),1-20(使用),默认为0" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:71 -msgid "0(not in used)" -msgstr "0(不使用)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:65 -msgid "0(standard)" -msgstr "0(标准)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:66 -msgid "1(ruijjie)" -msgstr "1(锐捷)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:72 -msgid "1(secondary authenticate)" -msgstr "1(二次认证)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:79 -msgid "1(yes,turn off output)" -msgstr "1(后台模式,关闭输出)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:73 -msgid "2(post authenticate)" -msgstr "3(认证后)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:67 -msgid "2(saier)" -msgstr "2(赛尔)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:80 -msgid "2(yes,persevere output)" -msgstr "2(后台模式,保留输出)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:74 -msgid "3(pre authenticate)" -msgstr "3(认证前)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:81 -msgid "3(yes,output to file)" -msgstr "3(后台模式,输出到日志文件)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/controller/airwhu.lua:4 -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:19 -msgid "AirWHU" -msgstr "AirWHU" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:56 -msgid "Authenticate timeout(s)" -msgstr "认证超时(秒)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:30 -msgid "Config Authentication" -msgstr "配置认证参数" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:19 -msgid "Configure Ruijie 802.1X client with IPv6 NAT based on Masquerade." -msgstr "配置基于IPv6 Masquerade技术的锐捷802.1X认证网络。" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:21 -msgid "Configure global 802.1X Authentication and IPv6-NAT on-off." -msgstr "配置全局802.1X认证与IPv6 NAT开关。" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:91 -msgid "DHCP script" -msgstr "DHCP脚本" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:70 -msgid "DHCP type" -msgstr "DHCP方式" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:52 -msgid "DNS" -msgstr "DNS服务器" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:25 -msgid "Enable 802.1X Auth" -msgstr "开启锐捷认证" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:28 -msgid "Enable IPv6 NAT" -msgstr "开启IPv6 NAT" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:28 -msgid "Enable IPv6 NAT pass-through based on ip6tables MASQUERADE." -msgstr "开启基于ip6tables Masquerade技术的IPv6 NAT穿透。" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:25 -msgid "Enable or disable Ruijie 802.1X authentication." -msgstr "打开或关闭锐捷802.1X认证。" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:50 -msgid "Gateway" -msgstr "网关" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:21 -msgid "Global Switch" -msgstr "全局开关" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:58 -msgid "Heartbeat timeout(s)" -msgstr "心跳包超时(秒)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:46 -msgid "IP" -msgstr "IP地址" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:43 -msgid "Interfaces" -msgstr "网卡" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:62 -msgid "Max failure times" -msgstr "允许失败次数" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:48 -msgid "Netmask" -msgstr "掩码" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:16 -msgid "Not Running" -msgstr "未运行" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:37 -msgid "Password" -msgstr "密码" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:54 -msgid "Ping host" -msgstr "Ping主机" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:14 -msgid "Running" -msgstr "运行中" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:26 -msgid "" -"Start Ruijie 802.1X Authentication based on MentoHUST when the router is " -"booting." -msgstr "开机自动启动基于MentoHUST的锐捷802.1X认证客户端。" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:26 -msgid "Start with boot" -msgstr "开机启动" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:19 -msgid "Status" -msgstr "状态" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:30 -msgid "The options below are all of MentoHUST's arguments." -msgstr "以下是全部的MentoHUST认证参数。" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:60 -msgid "Timeout on failure(s)" -msgstr "失败等待(秒)" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:34 -msgid "Username" -msgstr "用户名" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:86 -msgid "client version" -msgstr "客户端版本号" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:88 -msgid "customized data file" -msgstr "自定义数据文件" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:50 -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:52 -msgid "default to 0.0.0.0" -msgstr "默认为0.0.0.0" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:54 -msgid "default to 0.0.0.0,i.e. disable this function" -msgstr "默认为0.0.0.0,即关闭该功能" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:86 -msgid "default to 0.00,compatible with xrgsu" -msgstr "默认为0.00,表示兼容xrgsu" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:64 -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:70 -msgid "default to 1" -msgstr "默认为1" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:60 -msgid "default to 15s" -msgstr "默认为15秒" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:77 -msgid "default to 3" -msgstr "默认为3" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:58 -msgid "default to 30s" -msgstr "默认为30秒" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:56 -msgid "default to 8s" -msgstr "默认为8秒" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:46 -msgid "default to localhost's IP" -msgstr "默认为localhost的IP地址" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:48 -msgid "default to localhost's netmask" -msgstr "默认为localhost的掩码" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:84 -msgid "display notification" -msgstr "显示通知" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:64 -msgid "mulcast address" -msgstr "多播地址" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:88 -msgid "not in used by default" -msgstr "默认不使用" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:77 -msgid "run in daemon mode" -msgstr "后台运行模式" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-airwhu/files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:91 -msgid "use dhclient by default" -msgstr "默认使用dhclient" diff --git a/package/ctcgfw/luci-app-airwhu/po/zh_Hans/luci-app-airwhu.po b/package/ctcgfw/luci-app-airwhu/po/zh_Hans/luci-app-airwhu.po new file mode 100644 index 0000000000..ca2454ff40 --- /dev/null +++ b/package/ctcgfw/luci-app-airwhu/po/zh_Hans/luci-app-airwhu.po @@ -0,0 +1,250 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: PACKAGE VERSION\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: zh-Hans\n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:62 +msgid "0 means no limit,default to 8" +msgstr "0表示无限制,默认为8" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:78 +msgid "0(no)" +msgstr "0(不使用后台模式)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:84 +msgid "0(no),1-20(yes),default to 0" +msgstr "0(不使用),1-20(使用),默认为0" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:71 +msgid "0(not in used)" +msgstr "0(不使用)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:65 +msgid "0(standard)" +msgstr "0(标准)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:66 +msgid "1(ruijjie)" +msgstr "1(锐捷)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:72 +msgid "1(secondary authenticate)" +msgstr "1(二次认证)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:79 +msgid "1(yes,turn off output)" +msgstr "1(后台模式,关闭输出)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:73 +msgid "2(post authenticate)" +msgstr "3(认证后)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:67 +msgid "2(saier)" +msgstr "2(赛尔)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:80 +msgid "2(yes,persevere output)" +msgstr "2(后台模式,保留输出)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:74 +msgid "3(pre authenticate)" +msgstr "3(认证前)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:81 +msgid "3(yes,output to file)" +msgstr "3(后台模式,输出到日志文件)" + +#: files/root/usr/lib/lua/luci/controller/airwhu.lua:4 +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:19 +msgid "AirWHU" +msgstr "AirWHU" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:56 +msgid "Authenticate timeout(s)" +msgstr "认证超时(秒)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:30 +msgid "Config Authentication" +msgstr "配置认证参数" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:19 +msgid "Configure Ruijie 802.1X client with IPv6 NAT based on Masquerade." +msgstr "配置基于IPv6 Masquerade技术的锐捷802.1X认证网络。" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:21 +msgid "Configure global 802.1X Authentication and IPv6-NAT on-off." +msgstr "配置全局802.1X认证与IPv6 NAT开关。" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:91 +msgid "DHCP script" +msgstr "DHCP脚本" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:70 +msgid "DHCP type" +msgstr "DHCP方式" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:52 +msgid "DNS" +msgstr "DNS服务器" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:25 +msgid "Enable 802.1X Auth" +msgstr "开启锐捷认证" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:28 +msgid "Enable IPv6 NAT" +msgstr "开启IPv6 NAT" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:28 +msgid "Enable IPv6 NAT pass-through based on ip6tables MASQUERADE." +msgstr "开启基于ip6tables Masquerade技术的IPv6 NAT穿透。" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:25 +msgid "Enable or disable Ruijie 802.1X authentication." +msgstr "打开或关闭锐捷802.1X认证。" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:50 +msgid "Gateway" +msgstr "网关" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:21 +msgid "Global Switch" +msgstr "全局开关" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:58 +msgid "Heartbeat timeout(s)" +msgstr "心跳包超时(秒)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:46 +msgid "IP" +msgstr "IP地址" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:43 +msgid "Interfaces" +msgstr "网卡" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:62 +msgid "Max failure times" +msgstr "允许失败次数" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:48 +msgid "Netmask" +msgstr "掩码" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:16 +msgid "Not Running" +msgstr "未运行" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:37 +msgid "Password" +msgstr "密码" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:54 +msgid "Ping host" +msgstr "Ping主机" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:14 +msgid "Running" +msgstr "运行中" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:26 +msgid "" +"Start Ruijie 802.1X Authentication based on MentoHUST when the router is " +"booting." +msgstr "开机自动启动基于MentoHUST的锐捷802.1X认证客户端。" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:26 +msgid "Start with boot" +msgstr "开机启动" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:19 +msgid "Status" +msgstr "状态" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:30 +msgid "The options below are all of MentoHUST's arguments." +msgstr "以下是全部的MentoHUST认证参数。" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:60 +msgid "Timeout on failure(s)" +msgstr "失败等待(秒)" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:34 +msgid "Username" +msgstr "用户名" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:86 +msgid "client version" +msgstr "客户端版本号" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:88 +msgid "customized data file" +msgstr "自定义数据文件" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:50 +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:52 +msgid "default to 0.0.0.0" +msgstr "默认为0.0.0.0" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:54 +msgid "default to 0.0.0.0,i.e. disable this function" +msgstr "默认为0.0.0.0,即关闭该功能" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:86 +msgid "default to 0.00,compatible with xrgsu" +msgstr "默认为0.00,表示兼容xrgsu" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:64 +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:70 +msgid "default to 1" +msgstr "默认为1" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:60 +msgid "default to 15s" +msgstr "默认为15秒" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:77 +msgid "default to 3" +msgstr "默认为3" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:58 +msgid "default to 30s" +msgstr "默认为30秒" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:56 +msgid "default to 8s" +msgstr "默认为8秒" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:46 +msgid "default to localhost's IP" +msgstr "默认为localhost的IP地址" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:48 +msgid "default to localhost's netmask" +msgstr "默认为localhost的掩码" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:84 +msgid "display notification" +msgstr "显示通知" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:64 +msgid "mulcast address" +msgstr "多播地址" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:88 +msgid "not in used by default" +msgstr "默认不使用" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:77 +msgid "run in daemon mode" +msgstr "后台运行模式" + +#: files/root/usr/lib/lua/luci/model/cbi/airwhu.lua:91 +msgid "use dhclient by default" +msgstr "默认使用dhclient" diff --git a/package/ctcgfw/luci-app-airwhu/files/root/bin/ipv6masq.sh b/package/ctcgfw/luci-app-airwhu/root/bin/ipv6masq.sh similarity index 100% rename from package/ctcgfw/luci-app-airwhu/files/root/bin/ipv6masq.sh rename to package/ctcgfw/luci-app-airwhu/root/bin/ipv6masq.sh diff --git a/package/ctcgfw/luci-app-airwhu/files/root/etc/config/airwhu b/package/ctcgfw/luci-app-airwhu/root/etc/config/airwhu similarity index 100% rename from package/ctcgfw/luci-app-airwhu/files/root/etc/config/airwhu rename to package/ctcgfw/luci-app-airwhu/root/etc/config/airwhu diff --git a/package/ctcgfw/luci-app-airwhu/files/root/etc/hotplug.d/iface/99-ipv6nat b/package/ctcgfw/luci-app-airwhu/root/etc/hotplug.d/iface/99-ipv6nat similarity index 100% rename from package/ctcgfw/luci-app-airwhu/files/root/etc/hotplug.d/iface/99-ipv6nat rename to package/ctcgfw/luci-app-airwhu/root/etc/hotplug.d/iface/99-ipv6nat diff --git a/package/ctcgfw/luci-app-airwhu/files/root/etc/init.d/mentohust b/package/ctcgfw/luci-app-airwhu/root/etc/init.d/mentohust similarity index 100% rename from package/ctcgfw/luci-app-airwhu/files/root/etc/init.d/mentohust rename to package/ctcgfw/luci-app-airwhu/root/etc/init.d/mentohust diff --git a/package/ctcgfw/luci-app-airwhu/tools/po2lmo/Makefile b/package/ctcgfw/luci-app-airwhu/tools/po2lmo/Makefile deleted file mode 100644 index ad2c133207..0000000000 --- a/package/ctcgfw/luci-app-airwhu/tools/po2lmo/Makefile +++ /dev/null @@ -1,12 +0,0 @@ - -INSTALL = install -PREFIX = /usr/bin - -po2lmo: src/po2lmo.o src/template_lmo.o - $(CC) $(LDFLAGS) -o src/po2lmo src/po2lmo.o src/template_lmo.o - -install: - $(INSTALL) -m 755 src/po2lmo $(PREFIX) - -clean: - $(RM) src/po2lmo src/*.o diff --git a/package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/po2lmo b/package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/po2lmo deleted file mode 100755 index 74c9146dc7974be8cd8ddde99f2cf603153c8274..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18832 zcmeHPeRxz?nLm?BAcZ6oC{)_gc0{oBgK2<3p@2;wLoaM-BLqbyoes(5!zMFv<_?8! zY0FNgayvw`TDG6M)TizC@#!j$Ybl~YC`jUNTZ5}^TekB$NEKVfF2V0r zY(ATYbP>k{ze*5rMVOGL6)l#y8?+FAs|o~=OXo{DMU{s{DL<$1%5{RHC}Um@kRJIu za3fEGdU-_ADsl*+Q&Ocz?vY+v>ZPTgqP@~FMOFEzZ1h(z%a==Qz@wlj$x^8Mh1o>$ zR~GT)6na*`Oi`uxVd#;ce{Lw3f?H*NPW4hD>qAjlTy|4?+pd+BH?=n{X>SY1_bl17 zYUPrZmA+WSw~UvY?33(mw{Pb;se1GxMLy5LADJfp(TYbOZmoXgopW7({khBbK2!Ph zsZ&EFPfe-XjYk;cwMqEuw^OQXAT>2y3dPw|VRk#Pd^k04KHLjC-aK~x%|U+50YBh? zf58EdIpFIY@J0uGhC@AE<{(e)maiV}b-*nLywU-G+X3%zz`yH&w>sc!9op-(gZw;) z`nlRc{<97^_40i6cH9APaKNv1z(44K|CK{||IR^vrU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%oVzZhoMj4?03P zMlGu@>Dfj2{XIJ*F51~Kb%oE4PPrOqXY=cOb_fFn6(z2~smphE3A*@aM{=*t1)5?J zRB*V7uGDS11IC)#!htxh7|P3ix$698o*k4I740BZS9>Jbl<8brH>AESZyQck5_b_} z&8?!{<#k58Tp+M37Lx@RR}t-eezTBwAi6D?ae-fnv`f+u4PbP)?bgJoU*(A9yI#mM z5JQJwti&*~Ytf}nJ0fmM+Oa^Oe#-_m8_A{PJIvrN=7SwUTU87*UMSkheBp>0@>Q?jw8RXy$W%)>?%Ne_!&UmW zCg!6QAHBY&yex#^6XO(O&tKvjydqZcTN?)BbDe47J4_L-+VJT9&zB-RmbfHa}o;~fM z21&f4im3b_lMzLgK9+qR)V@k4`M*ya$NrH5ogY&@DSdUW`w?IyqV&~y zv!d#J86rH84L#h61fBINeRW=@XuT9x{wp~}?*^aFj#XNnt0`I~^>h7~Fr#x5s#B$} z&fgUE$_iKc=a#<P2z&jTL0bxQBX^&rh6jWN#&*tc>b3aA( zcg$o%`LFCfmZPtp6BHf5H99@0d=>UZL~Q;q5*+njL%j!3^10=IM(V5jSLcn2(#J7+ z$o2mPFe!hfpZo8aoYj>P&&~gMj=nm-RFu9U&_iziWS@@ol$biVQUAV4uDnVsIsjcd zI#c@UoM`YyfCx%Xq_Sy+zYYeKU+Js!$e}->uk8H{5$d~2U!AY2e}ATzj3cQ2t@2g< z;Pc?=`Kxo-=jmV*VTaTgsj2?I35KqpIS;518Y-V$eU% - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "template_lmo.h" - -static void die(const char *msg) -{ - fprintf(stderr, "Error: %s\n", msg); - exit(1); -} - -static void usage(const char *name) -{ - fprintf(stderr, "Usage: %s input.po output.lmo\n", name); - exit(1); -} - -static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - if( fwrite(ptr, size, nmemb, stream) == 0 ) - die("Failed to write stdout"); -} - -static int extract_string(const char *src, char *dest, int len) -{ - int pos = 0; - int esc = 0; - int off = -1; - - for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ ) - { - if( (off == -1) && (src[pos] == '"') ) - { - off = pos + 1; - } - else if( off >= 0 ) - { - if( esc == 1 ) - { - switch (src[pos]) - { - case '"': - case '\\': - off++; - break; - } - dest[pos-off] = src[pos]; - esc = 0; - } - else if( src[pos] == '\\' ) - { - dest[pos-off] = src[pos]; - esc = 1; - } - else if( src[pos] != '"' ) - { - dest[pos-off] = src[pos]; - } - else - { - dest[pos-off] = '\0'; - break; - } - } - } - - return (off > -1) ? strlen(dest) : -1; -} - -static int cmp_index(const void *a, const void *b) -{ - uint32_t x = ((const lmo_entry_t *)a)->key_id; - uint32_t y = ((const lmo_entry_t *)b)->key_id; - - if (x < y) - return -1; - else if (x > y) - return 1; - - return 0; -} - -static void print_uint32(uint32_t x, FILE *out) -{ - uint32_t y = htonl(x); - print(&y, sizeof(uint32_t), 1, out); -} - -static void print_index(void *array, int n, FILE *out) -{ - lmo_entry_t *e; - - qsort(array, n, sizeof(*e), cmp_index); - - for (e = array; n > 0; n--, e++) - { - print_uint32(e->key_id, out); - print_uint32(e->val_id, out); - print_uint32(e->offset, out); - print_uint32(e->length, out); - } -} - -int main(int argc, char *argv[]) -{ - char line[4096]; - char key[4096]; - char val[4096]; - char tmp[4096]; - int state = 0; - int offset = 0; - int length = 0; - int n_entries = 0; - void *array = NULL; - lmo_entry_t *entry = NULL; - uint32_t key_id, val_id; - - FILE *in; - FILE *out; - - if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) ) - usage(argv[0]); - - memset(line, 0, sizeof(key)); - memset(key, 0, sizeof(val)); - memset(val, 0, sizeof(val)); - - while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) ) - { - if( state == 0 && strstr(line, "msgid \"") == line ) - { - switch(extract_string(line, key, sizeof(key))) - { - case -1: - die("Syntax error in msgid"); - case 0: - state = 1; - break; - default: - state = 2; - } - } - else if( state == 1 || state == 2 ) - { - if( strstr(line, "msgstr \"") == line || state == 2 ) - { - switch(extract_string(line, val, sizeof(val))) - { - case -1: - state = 4; - break; - default: - state = 3; - } - } - else - { - switch(extract_string(line, tmp, sizeof(tmp))) - { - case -1: - state = 2; - break; - default: - strcat(key, tmp); - } - } - } - else if( state == 3 ) - { - switch(extract_string(line, tmp, sizeof(tmp))) - { - case -1: - state = 4; - break; - default: - strcat(val, tmp); - } - } - - if( state == 4 ) - { - if( strlen(key) > 0 && strlen(val) > 0 ) - { - key_id = sfh_hash(key, strlen(key)); - val_id = sfh_hash(val, strlen(val)); - - if( key_id != val_id ) - { - n_entries++; - array = realloc(array, n_entries * sizeof(lmo_entry_t)); - entry = (lmo_entry_t *)array + n_entries - 1; - - if (!array) - die("Out of memory"); - - entry->key_id = key_id; - entry->val_id = val_id; - entry->offset = offset; - entry->length = strlen(val); - - length = strlen(val) + ((4 - (strlen(val) % 4)) % 4); - - print(val, length, 1, out); - offset += length; - } - } - - state = 0; - memset(key, 0, sizeof(key)); - memset(val, 0, sizeof(val)); - } - - memset(line, 0, sizeof(line)); - } - - print_index(array, n_entries, out); - - if( offset > 0 ) - { - print_uint32(offset, out); - fsync(fileno(out)); - fclose(out); - } - else - { - fclose(out); - unlink(argv[2]); - } - - fclose(in); - return(0); -} diff --git a/package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/template_lmo.c b/package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/template_lmo.c deleted file mode 100644 index 27205a7228..0000000000 --- a/package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/template_lmo.c +++ /dev/null @@ -1,328 +0,0 @@ -/* - * lmo - Lua Machine Objects - Base functions - * - * Copyright (C) 2009-2010 Jo-Philipp Wich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "template_lmo.h" - -/* - * Hash function from http://www.azillionmonkeys.com/qed/hash.html - * Copyright (C) 2004-2008 by Paul Hsieh - */ - -uint32_t sfh_hash(const char *data, int len) -{ - uint32_t hash = len, tmp; - int rem; - - if (len <= 0 || data == NULL) return 0; - - rem = len & 3; - len >>= 2; - - /* Main loop */ - for (;len > 0; len--) { - hash += sfh_get16(data); - tmp = (sfh_get16(data+2) << 11) ^ hash; - hash = (hash << 16) ^ tmp; - data += 2*sizeof(uint16_t); - hash += hash >> 11; - } - - /* Handle end cases */ - switch (rem) { - case 3: hash += sfh_get16(data); - hash ^= hash << 16; - hash ^= data[sizeof(uint16_t)] << 18; - hash += hash >> 11; - break; - case 2: hash += sfh_get16(data); - hash ^= hash << 11; - hash += hash >> 17; - break; - case 1: hash += *data; - hash ^= hash << 10; - hash += hash >> 1; - } - - /* Force "avalanching" of final 127 bits */ - hash ^= hash << 3; - hash += hash >> 5; - hash ^= hash << 4; - hash += hash >> 17; - hash ^= hash << 25; - hash += hash >> 6; - - return hash; -} - -uint32_t lmo_canon_hash(const char *str, int len) -{ - char res[4096]; - char *ptr, prev; - int off; - - if (!str || len >= sizeof(res)) - return 0; - - for (prev = ' ', ptr = res, off = 0; off < len; prev = *str, off++, str++) - { - if (isspace(*str)) - { - if (!isspace(prev)) - *ptr++ = ' '; - } - else - { - *ptr++ = *str; - } - } - - if ((ptr > res) && isspace(*(ptr-1))) - ptr--; - - return sfh_hash(res, ptr - res); -} - -lmo_archive_t * lmo_open(const char *file) -{ - int in = -1; - uint32_t idx_offset = 0; - struct stat s; - - lmo_archive_t *ar = NULL; - - if (stat(file, &s) == -1) - goto err; - - if ((in = open(file, O_RDONLY)) == -1) - goto err; - - if ((ar = (lmo_archive_t *)malloc(sizeof(*ar))) != NULL) - { - memset(ar, 0, sizeof(*ar)); - - ar->fd = in; - ar->size = s.st_size; - - fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC); - - if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED) - goto err; - - idx_offset = ntohl(*((const uint32_t *) - (ar->mmap + ar->size - sizeof(uint32_t)))); - - if (idx_offset >= ar->size) - goto err; - - ar->index = (lmo_entry_t *)(ar->mmap + idx_offset); - ar->length = (ar->size - idx_offset - sizeof(uint32_t)) / sizeof(lmo_entry_t); - ar->end = ar->mmap + ar->size; - - return ar; - } - -err: - if (in > -1) - close(in); - - if (ar != NULL) - { - if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) - munmap(ar->mmap, ar->size); - - free(ar); - } - - return NULL; -} - -void lmo_close(lmo_archive_t *ar) -{ - if (ar != NULL) - { - if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) - munmap(ar->mmap, ar->size); - - close(ar->fd); - free(ar); - - ar = NULL; - } -} - - -lmo_catalog_t *_lmo_catalogs = NULL; -lmo_catalog_t *_lmo_active_catalog = NULL; - -int lmo_load_catalog(const char *lang, const char *dir) -{ - DIR *dh = NULL; - char pattern[16]; - char path[PATH_MAX]; - struct dirent *de = NULL; - - lmo_archive_t *ar = NULL; - lmo_catalog_t *cat = NULL; - - if (!lmo_change_catalog(lang)) - return 0; - - if (!dir || !(dh = opendir(dir))) - goto err; - - if (!(cat = malloc(sizeof(*cat)))) - goto err; - - memset(cat, 0, sizeof(*cat)); - - snprintf(cat->lang, sizeof(cat->lang), "%s", lang); - snprintf(pattern, sizeof(pattern), "*.%s.lmo", lang); - - while ((de = readdir(dh)) != NULL) - { - if (!fnmatch(pattern, de->d_name, 0)) - { - snprintf(path, sizeof(path), "%s/%s", dir, de->d_name); - ar = lmo_open(path); - - if (ar) - { - ar->next = cat->archives; - cat->archives = ar; - } - } - } - - closedir(dh); - - cat->next = _lmo_catalogs; - _lmo_catalogs = cat; - - if (!_lmo_active_catalog) - _lmo_active_catalog = cat; - - return 0; - -err: - if (dh) closedir(dh); - if (cat) free(cat); - - return -1; -} - -int lmo_change_catalog(const char *lang) -{ - lmo_catalog_t *cat; - - for (cat = _lmo_catalogs; cat; cat = cat->next) - { - if (!strncmp(cat->lang, lang, sizeof(cat->lang))) - { - _lmo_active_catalog = cat; - return 0; - } - } - - return -1; -} - -static lmo_entry_t * lmo_find_entry(lmo_archive_t *ar, uint32_t hash) -{ - unsigned int m, l, r; - uint32_t k; - - l = 0; - r = ar->length - 1; - - while (1) - { - m = l + ((r - l) / 2); - - if (r < l) - break; - - k = ntohl(ar->index[m].key_id); - - if (k == hash) - return &ar->index[m]; - - if (k > hash) - { - if (!m) - break; - - r = m - 1; - } - else - { - l = m + 1; - } - } - - return NULL; -} - -int lmo_translate(const char *key, int keylen, char **out, int *outlen) -{ - uint32_t hash; - lmo_entry_t *e; - lmo_archive_t *ar; - - if (!key || !_lmo_active_catalog) - return -2; - - hash = lmo_canon_hash(key, keylen); - - for (ar = _lmo_active_catalog->archives; ar; ar = ar->next) - { - if ((e = lmo_find_entry(ar, hash)) != NULL) - { - *out = ar->mmap + ntohl(e->offset); - *outlen = ntohl(e->length); - return 0; - } - } - - return -1; -} - -void lmo_close_catalog(const char *lang) -{ - lmo_archive_t *ar, *next; - lmo_catalog_t *cat, *prev; - - for (prev = NULL, cat = _lmo_catalogs; cat; prev = cat, cat = cat->next) - { - if (!strncmp(cat->lang, lang, sizeof(cat->lang))) - { - if (prev) - prev->next = cat->next; - else - _lmo_catalogs = cat->next; - - for (ar = cat->archives; ar; ar = next) - { - next = ar->next; - lmo_close(ar); - } - - free(cat); - break; - } - } -} diff --git a/package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/template_lmo.h b/package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/template_lmo.h deleted file mode 100644 index 57f59aa56b..0000000000 --- a/package/ctcgfw/luci-app-airwhu/tools/po2lmo/src/template_lmo.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * lmo - Lua Machine Objects - General header - * - * Copyright (C) 2009-2012 Jo-Philipp Wich - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _TEMPLATE_LMO_H_ -#define _TEMPLATE_LMO_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if (defined(__GNUC__) && defined(__i386__)) -#define sfh_get16(d) (*((const uint16_t *) (d))) -#else -#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ - +(uint32_t)(((const uint8_t *)(d))[0]) ) -#endif - - -struct lmo_entry { - uint32_t key_id; - uint32_t val_id; - uint32_t offset; - uint32_t length; -} __attribute__((packed)); - -typedef struct lmo_entry lmo_entry_t; - - -struct lmo_archive { - int fd; - int length; - uint32_t size; - lmo_entry_t *index; - char *mmap; - char *end; - struct lmo_archive *next; -}; - -typedef struct lmo_archive lmo_archive_t; - - -struct lmo_catalog { - char lang[6]; - struct lmo_archive *archives; - struct lmo_catalog *next; -}; - -typedef struct lmo_catalog lmo_catalog_t; - - -uint32_t sfh_hash(const char *data, int len); -uint32_t lmo_canon_hash(const char *data, int len); - -lmo_archive_t * lmo_open(const char *file); -void lmo_close(lmo_archive_t *ar); - - -extern lmo_catalog_t *_lmo_catalogs; -extern lmo_catalog_t *_lmo_active_catalog; - -int lmo_load_catalog(const char *lang, const char *dir); -int lmo_change_catalog(const char *lang); -int lmo_translate(const char *key, int keylen, char **out, int *outlen); -void lmo_close_catalog(const char *lang); - -#endif