From fc546ce94f5f1a61a8d85ca304b36f698c7601b9 Mon Sep 17 00:00:00 2001 From: saramach Date: Sun, 8 May 2016 11:58:14 -0700 Subject: [PATCH] Relay (protocol,port) information to aci-gw for creating filter rules. (#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. --- netmaster/objApi/infraproxy.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/netmaster/objApi/infraproxy.go b/netmaster/objApi/infraproxy.go index a8c59d3c6..162b75043 100755 --- a/netmaster/objApi/infraproxy.go +++ b/netmaster/objApi/infraproxy.go @@ -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 { @@ -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)