Skip to content

Commit

Permalink
Relay (protocol,port) information to aci-gw for creating filter rules. (
Browse files Browse the repository at this point in the history
#353)

* Relay (protocol,port) information to aci-gw for creating filter rules.

* Change names - Relay (protocol,port) information to aci-gw for creating filter rules.
  • Loading branch information
saramach authored and shaleman committed May 8, 2016
1 parent cf0482d commit fc546ce
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions netmaster/objApi/infraproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ type appNwSpec struct {
}

type epgSpec struct {
Name string `json:"name,omitempty"`
VlanTag string `json:"vlantag,omitempty"`
ServPort []string `json:"servport,omitempty"`
Uses []string `json:"uses,omitempty"`
Name string `json:"name,omitempty"`
VlanTag string `json:"vlantag,omitempty"`
Filters []filterInfo `json:"filterinfo,omitempty"`
Uses []string `json:"uses,omitempty"`
}

type filterInfo struct {
Protocol string `json:"protocol,omitempty"`
ServPort string `json:"servport,omitempty"`
}

type epgMap struct {
Expand Down Expand Up @@ -134,10 +139,9 @@ func appendEpgInfo(eMap *epgMap, epgObj *contivModel.EndpointGroup, stateDriver
log.Debugf("==Ignoring deny rule %v", ruleName)
continue
}

//TODO: make this a list and add protocol
epg.ServPort = append(epg.ServPort, strconv.Itoa(rule.Port))
log.Debugf("Service port: %v", strconv.Itoa(rule.Port))
singleFilter := filterInfo{Protocol: rule.Protocol, ServPort: strconv.Itoa(rule.Port)}
epg.Filters = append(epg.Filters, singleFilter)
log.Debugf("Filter information: %v", singleFilter)

if rule.FromEndpointGroup == "" {
log.Debugf("User unspecified %v == exposed contract", ruleName)
Expand Down

0 comments on commit fc546ce

Please sign in to comment.