Multiple ponsimONU support - template updates

Change-Id: I1b4c79f61e0d0f9b566c09517c939bee890b41a3
diff --git a/mininet/Chart.yaml b/mininet/Chart.yaml
index fdc6e9b..9619440 100644
--- a/mininet/Chart.yaml
+++ b/mininet/Chart.yaml
@@ -17,4 +17,4 @@
 appVersion: "1.0"
 description: A Helm chart for Mininet
 name: mininet
-version: 0.5.0
+version: 0.5.1
diff --git a/mininet/templates/_helpers.tpl b/mininet/templates/_helpers.tpl
index 8396f02..4719e95 100644
--- a/mininet/templates/_helpers.tpl
+++ b/mininet/templates/_helpers.tpl
@@ -61,7 +61,10 @@
 Generate the DHCP subnets depending on number of OLTs
 */}}
 {{- define "mininet.dhcp_range" -}}
+{{- $onucount := .Values.numOnus|int}}
 {{- range $i, $junk := until (.Values.numOlts|int) -}}
-{{- printf " --dhcp-range=172.18.%d.50,172.18.%d.150,12h" $i $i -}}
+{{- range $j, $junk1 := until ($onucount) -}}
+{{- printf " --dhcp-range=172.%d.%d.50,172.%d.%d.150,12h" (add $i 18) $j (add $i 18) $j -}}
 {{- end -}}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+{{- end -}}
diff --git a/mininet/toposcripts/topo.py b/mininet/toposcripts/topo.py
index 8e8b6c4..121bb38 100644
--- a/mininet/toposcripts/topo.py
+++ b/mininet/toposcripts/topo.py
@@ -72,17 +72,18 @@
     info( '*** Adding VLAN interface to host h1\n')
     h1.cmd( 'ifconfig h1-eth1 10.1.0.1/24 up')
 
+    {{- $onucount := .Values.numOnus|int}}
 {{- range $i, $junk := until (.Values.numOlts|int) -}}
 {{- $stag := add 222 $i }}
-{{- $ctag := 111 }}
-
+{{- range $j, $junk1 := until ($onucount) -}}
+{{- $ctag := add 111 $j }}
     h1.cmd( 'ip link add link h1-eth0 name h1-eth0.{{ $stag }} type vlan proto 802.1Q id {{ $stag }}' )
     h1.cmd( 'ip link add link h1-eth0.{{ $stag }} name h1-eth0.{{ $stag }}.{{ $ctag }} type vlan proto 802.1Q id {{ $ctag }}' )
     h1.cmd( 'ifconfig h1-eth0.{{ $stag }} up' )
     h1.cmd( 'ifconfig h1-eth0.{{ $stag }}.{{ $ctag }} up' )
-    h1.cmd( 'ifconfig h1-eth0.{{ $stag }}.{{ $ctag }} 172.18.{{ $i }}.10/24' )
+    h1.cmd( 'ifconfig h1-eth0.{{ $stag }}.{{ $ctag }} 172.{{ add $i 18  }}.{{ $j }}.10/24' )
 {{- end }}
-
+{{- end }}
     h1.cmd( 'dnsmasq {{ template "mininet.dhcp_range" . }}' )
 
 {{- if .Values.enableMulticast }}
diff --git a/mininet/values.yaml b/mininet/values.yaml
index 2a049d4..9bab69a 100644
--- a/mininet/values.yaml
+++ b/mininet/values.yaml
@@ -49,3 +49,4 @@
 vlanMatchDepth: 1
 enableMulticast: false
 numOlts: 1
+numOnus: 1