Skip to content

Commit

Permalink
Added arp flood mode option in global config
Browse files Browse the repository at this point in the history
  • Loading branch information
gkvijay committed Dec 1, 2016
1 parent 1f3a715 commit 1e157ec
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
6 changes: 4 additions & 2 deletions client/contivModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ var GlobalSummaryView = React.createClass({
<ModalTrigger modal={<GlobalModalView global={ global }/>}>
<tr key={ global.key } className="info">


</tr>
</ModalTrigger>
);
Expand All @@ -390,7 +390,7 @@ var GlobalSummaryView = React.createClass({
<thead>
<tr>


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


<Input type='text' label='ARP Mode' ref='arpMode' defaultValue={obj.arpMode} placeholder='ARP Mode' />

<Input type='text' label='Forwarding Mode' ref='fwdMode' defaultValue={obj.fwdMode} placeholder='Forwarding Mode' />

<Input type='text' label='name of this block(must be 'global')' ref='name' defaultValue={obj.name} placeholder='name of this block(must be 'global')' />
Expand Down
1 change: 1 addition & 0 deletions client/contivModelClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ type Global struct {
// every object has a key
Key string `json:"key,omitempty"`

ArpMode string `json:"arpMode,omitempty"` // ARP Mode
FwdMode string `json:"fwdMode,omitempty"` // Forwarding Mode
Name string `json:"name,omitempty"` // name of this block(must be 'global')
NetworkInfraType string `json:"networkInfraType,omitempty"` // Network infrastructure type
Expand Down
1 change: 1 addition & 0 deletions client/contivModelClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def createGlobal(self, obj):
postUrl = self.baseUrl + '/api/v1/globals/' + obj.name + '/'

jdata = json.dumps({
"arpMode": obj.arpMode,
"fwdMode": obj.fwdMode,
"name": obj.name,
"networkInfraType": obj.networkInfraType,
Expand Down
10 changes: 10 additions & 0 deletions contivModel.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ type Global struct {
// every object has a key
Key string `json:"key,omitempty"`

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

// Validate each field

if len(obj.ArpMode) > 64 {
return errors.New("arpMode string too long")
}

arpModeMatch := regexp.MustCompile("^(proxy|flood)?$")
if arpModeMatch.MatchString(obj.ArpMode) == false {
return errors.New("arpMode string invalid format")
}

if len(obj.FwdMode) > 64 {
return errors.New("fwdMode string too long")
}
Expand Down
21 changes: 14 additions & 7 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@
"title": "Allwed vxlan range",
"format": "^([0-9]{1,8}?-[0-9]{1,8}?)$"
},
"fwdMode": {
"type": "string",
"title": "Forwarding Mode",
"length": 64,
"format": "^(bridge|routing)?$",
"ShowSummary": true
}
"fwdMode": {
"type": "string",
"title": "Forwarding Mode",
"length": 64,
"format": "^(bridge|routing)?$",
"ShowSummary": true
},
"arpMode": {
"type": "string",
"title": "ARP Mode",
"length": 64,
"format": "^(proxy|flood)?$",
"ShowSummary": true
}
},
"operProperties": {
"numNetworks": {
Expand Down

0 comments on commit 1e157ec

Please sign in to comment.