From be3701c55807336b9145994e621680f384090cbf Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Thu, 23 Mar 2023 07:35:02 +0300 Subject: openwrt utils upd --- localwebsite/classes/MyOpenWrtUtils.php | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'localwebsite') diff --git a/localwebsite/classes/MyOpenWrtUtils.php b/localwebsite/classes/MyOpenWrtUtils.php index f83800a..ea467db 100644 --- a/localwebsite/classes/MyOpenWrtUtils.php +++ b/localwebsite/classes/MyOpenWrtUtils.php @@ -2,23 +2,23 @@ class MyOpenWrtUtils { - public static function getRoutingTable($table = null) { - $arguments = ['route-show']; - if ($table) - $arguments[] = $table; - - return self::toList(self::run($arguments)); - } - - public static function getRoutingRules() { - return self::toList(self::run(['rule-show'])); - } - - public static function ipsetList($set_name) { - return self::toList(self::run(['ipset-list', $set_name])); - } + // public static function getRoutingTable(?string $table = null): array { + // $arguments = ['route-show']; + // if ($table) + // $arguments[] = $table; + // + // return self::toList(self::run($arguments)); + // } + // + // public static function getRoutingRules(): array { + // return self::toList(self::run(['rule-show'])); + // } + // + // public static function ipsetList(string $set_name): array { + // return self::toList(self::run(['ipset-list', $set_name])); + // } - public static function ipsetListAll() { + public static function ipsetListAll(): array { global $config; $args = ['ipset-list-all']; @@ -47,15 +47,15 @@ class MyOpenWrtUtils { return $sets; } - public static function ipsetAdd($set_name, $ip) { + public static function ipsetAdd(string $set_name, string $ip) { return self::run(['ipset-add', $set_name, $ip]); } - public static function ipsetDel($set_name, $ip) { + public static function ipsetDel(string $set_name, string $ip) { return self::run(['ipset-del', $set_name, $ip]); } - public static function getDHCPLeases() { + public static function getDHCPLeases(): array { $list = self::toList(self::run(['dhcp-leases'])); $list = array_map('self::toDHCPLease', $list); return $list; -- cgit v1.2.3