From 66bd5d59276748b06eecebbdc5814b1e1527f3ef Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 1 Dec 2020 18:38:57 +0000 Subject: [PATCH] Added getNetConfig() --- includes/functions.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index 9ed854e7..e7508ded 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -234,6 +234,19 @@ function ParseConfig($arrConfig) return $config; } +/** + * Fetches DHCP configuration for an interface, returned as JSON data + * + * @param string $interface + * @return json $jsonData + */ +function getNetConfig($interface) +{ + $URI = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME'] .'/ajax/networking/get_netcfg.php?iface='.$interface; + $jsonData = file_get_contents($URI); + return $jsonData; +} + /** * * @param string $freq