Skip to content

Commit 1e157ec

Browse files
committed
Added arp flood mode option in global config
1 parent 1f3a715 commit 1e157ec

5 files changed

+30
-9
lines changed

client/contivModel.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ var GlobalSummaryView = React.createClass({
378378
<ModalTrigger modal={<GlobalModalView global={ global }/>}>
379379
<tr key={ global.key } className="info">
380380

381-
381+
382382
</tr>
383383
</ModalTrigger>
384384
);
@@ -390,7 +390,7 @@ var GlobalSummaryView = React.createClass({
390390
<thead>
391391
<tr>
392392

393-
393+
394394
</tr>
395395
</thead>
396396
<tbody>
@@ -410,6 +410,8 @@ var GlobalModalView = React.createClass({
410410
<div className='modal-body' style={ {margin: '5%',} }>
411411

412412

413+
<Input type='text' label='ARP Mode' ref='arpMode' defaultValue={obj.arpMode} placeholder='ARP Mode' />
414+
413415
<Input type='text' label='Forwarding Mode' ref='fwdMode' defaultValue={obj.fwdMode} placeholder='Forwarding Mode' />
414416

415417
<Input type='text' label='name of this block(must be 'global')' ref='name' defaultValue={obj.name} placeholder='name of this block(must be 'global')' />

client/contivModelClient.go

+1
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ type Global struct {
310310
// every object has a key
311311
Key string `json:"key,omitempty"`
312312

313+
ArpMode string `json:"arpMode,omitempty"` // ARP Mode
313314
FwdMode string `json:"fwdMode,omitempty"` // Forwarding Mode
314315
Name string `json:"name,omitempty"` // name of this block(must be 'global')
315316
NetworkInfraType string `json:"networkInfraType,omitempty"` // Network infrastructure type

client/contivModelClient.py

+1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ def createGlobal(self, obj):
315315
postUrl = self.baseUrl + '/api/v1/globals/' + obj.name + '/'
316316

317317
jdata = json.dumps({
318+
"arpMode": obj.arpMode,
318319
"fwdMode": obj.fwdMode,
319320
"name": obj.name,
320321
"networkInfraType": obj.networkInfraType,

contivModel.go

+10
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ type Global struct {
191191
// every object has a key
192192
Key string `json:"key,omitempty"`
193193

194+
ArpMode string `json:"arpMode,omitempty"` // ARP Mode
194195
FwdMode string `json:"fwdMode,omitempty"` // Forwarding Mode
195196
Name string `json:"name,omitempty"` // name of this block(must be 'global')
196197
NetworkInfraType string `json:"networkInfraType,omitempty"` // Network infrastructure type
@@ -3075,6 +3076,15 @@ func ValidateGlobal(obj *Global) error {
30753076

30763077
// Validate each field
30773078

3079+
if len(obj.ArpMode) > 64 {
3080+
return errors.New("arpMode string too long")
3081+
}
3082+
3083+
arpModeMatch := regexp.MustCompile("^(proxy|flood)?$")
3084+
if arpModeMatch.MatchString(obj.ArpMode) == false {
3085+
return errors.New("arpMode string invalid format")
3086+
}
3087+
30783088
if len(obj.FwdMode) > 64 {
30793089
return errors.New("fwdMode string too long")
30803090
}

global.json

+14-7
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,20 @@
3131
"title": "Allwed vxlan range",
3232
"format": "^([0-9]{1,8}?-[0-9]{1,8}?)$"
3333
},
34-
"fwdMode": {
35-
"type": "string",
36-
"title": "Forwarding Mode",
37-
"length": 64,
38-
"format": "^(bridge|routing)?$",
39-
"ShowSummary": true
40-
}
34+
"fwdMode": {
35+
"type": "string",
36+
"title": "Forwarding Mode",
37+
"length": 64,
38+
"format": "^(bridge|routing)?$",
39+
"ShowSummary": true
40+
},
41+
"arpMode": {
42+
"type": "string",
43+
"title": "ARP Mode",
44+
"length": 64,
45+
"format": "^(proxy|flood)?$",
46+
"ShowSummary": true
47+
}
4148
},
4249
"operProperties": {
4350
"numNetworks": {

0 commit comments

Comments
 (0)