From d57b711ae8361e29d6a172fd9a8516ceb5a9b945 Mon Sep 17 00:00:00 2001 From: bergware Date: Sun, 22 Oct 2017 23:10:29 +0200 Subject: [PATCH 1/5] Improved selection of DHCP ranges for macvlan networks --- .../DockerSettings.page | 158 ++++++++++++++++-- 1 file changed, 145 insertions(+), 13 deletions(-) diff --git a/plugins/dynamix.docker.manager/DockerSettings.page b/plugins/dynamix.docker.manager/DockerSettings.page index e617006d4..3ccad6d7c 100644 --- a/plugins/dynamix.docker.manager/DockerSettings.page +++ b/plugins/dynamix.docker.manager/DockerSettings.page @@ -7,7 +7,7 @@ Tag="docker" /* Copyright 2005-2017, Lime Technology * Copyright 2014-2017, Guilherme Jardim, Eric Schultz, Jon Panozzo. * - * Additional updates by Bergware International (July 2017) + * Additional updates by Bergware International (October 2017) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2, @@ -56,18 +56,42 @@ foreach ($custom as $network) { if ($route = exec("ip -4 route show dev $network|grep -Po '^[12]\S+'")) $include[$network] = $route; if ($route6 = exec("ip -6 route show dev $network|grep -Po '^[1-9]\S+'")) $include6[$network] = $route6; } +function base_min($route) { + list($net,$mask) = explode('/',$route); + $mask = 32-$mask; + return explode('.',long2ip((ip2long($net)>>$mask)<<$mask)); +} +function base_max($route) { + list($net,$mask) = explode('/',$route); + $mask = 32-$mask; + return explode('.',long2ip(((ip2long($net)>>$mask)<<$mask)+pow(2,$mask)-1)); +} +function base_net($route) { + return substr(explode('/',$route)[0],0,-2); +} ?> - + -
+ Enable Docker: @@ -197,7 +221,40 @@ Template Authoring Mode: DHCPv4 pool of custom network (optional): -: Subnet: + +: > + ."; + for ($n=$net[$b]; $n<=$max[$b]; $n++) echo mk_option($net_user[$b],$n,$n,$n%$step==0?'':'class="hide"'); + echo ""; + } + echo "/"; + echo "(".($size-2)." hosts)"; + echo ""; +?> DHCPv4 pool of custom network : : @@ -211,7 +268,21 @@ DHCPv4 pool of custom network : DHCPv6 pool of custom network (optional): -: Subnet: + +: > + :/"; + echo ""; +?> DHCPv6 pool of custom network : : @@ -268,6 +339,67 @@ btrfs scrub status: