@@ -30,22 +30,22 @@ var (
3030 errWrongZoneArgument = errors .New ("wrong argument while setting zone ct limits" )
3131)
3232
33- // Zone defines the type used to store a zone as it is returned
33+ // CTLimit defines the type used to store a zone as it is returned
3434// by ovs-dpctl ct-*-limits commands
35- type Zone map [string ]uint64
35+ type CTLimit map [string ]uint64
3636
37- // ConnTrackOutput is a type defined to store the output
37+ // ConntrackOutput is a type defined to store the output
3838// of ovs-dpctl ct-*-limits commands. For example it stores
3939// such a cli output:
4040// # ovs-dpctl ct-get-limits system@ovs-system zone=2,3
4141// default limit=0
4242// zone=2,limit=0,count=0
4343// zone=3,limit=0,count=0
44- type ConnTrackOutput struct {
45- // defaulCT is used to store the global setting: default
46- defaultLimit Zone
44+ type ConntrackOutput struct {
45+ // defaultLimit is used to store the global setting: default
46+ defaultLimit CTLimit
4747 // zones stores all remaning zone's settings
48- zones []Zone
48+ zoneLimits []CTLimit
4949}
5050
5151// DataPathReader is the interface defining the read operations
@@ -72,7 +72,7 @@ type DataPathWriter interface {
7272type ConnTrackReader interface {
7373 // GetCTLimits is the method used to querying conntrack limits for a
7474 // datapath on a switch
75- GetCTLimits (string , []uint64 ) (ConnTrackOutput , error )
75+ GetCTLimits (string , []uint64 ) (ConntrackOutput , error )
7676}
7777
7878// ConnTrackWriter is the interface defining the write operations
@@ -149,7 +149,7 @@ func (dp *DataPathService) DelDataPath(dpName string) error {
149149
150150// GetCTLimits returns the conntrack limits for a given datapath
151151// equivalent to running: 'sudo ovs-dpctl ct-get-limits <datapath_name> zone=<#1>,<#2>,...'
152- func (dp * DataPathService ) GetCTLimits (dpName string , zones []uint64 ) (* ConnTrackOutput , error ) {
152+ func (dp * DataPathService ) GetCTLimits (dpName string , zones []uint64 ) (* ConntrackOutput , error ) {
153153 // Start by building the args
154154 if dpName == "" {
155155 return nil , errMissingMandatoryDataPathName
@@ -170,7 +170,7 @@ func (dp *DataPathService) GetCTLimits(dpName string, zones []uint64) (*ConnTrac
170170
171171 // Process the results
172172 entries := strings .Split (string (results ), "\n " )
173- ctOut := & ConnTrackOutput {}
173+ ctOut := & ConntrackOutput {}
174174
175175 r , err := regexp .Compile (`default` )
176176 if err != nil {
@@ -181,7 +181,7 @@ func (dp *DataPathService) GetCTLimits(dpName string, zones []uint64) (*ConnTrac
181181 // If found the default value is removed from the entries
182182 for i , entry := range entries {
183183 if r .MatchString (entry ) {
184- ctOut .defaultLimit = make (Zone )
184+ ctOut .defaultLimit = make (CTLimit )
185185 limit , err := strconv .Atoi (strings .Split (entry , "=" )[1 ])
186186 if err != nil {
187187 return nil , err
@@ -195,13 +195,13 @@ func (dp *DataPathService) GetCTLimits(dpName string, zones []uint64) (*ConnTrac
195195 // Now process the zones setup
196196 for _ , entry := range entries {
197197 fields := strings .Split (entry , "," )
198- z := make (Zone )
198+ z := make (CTLimit )
199199 for _ , field := range fields {
200200 buf := strings .Split (field , "=" )
201201 val , _ := strconv .Atoi (buf [1 ])
202202 z [buf [0 ]] = uint64 (val )
203203 }
204- ctOut .zones = append (ctOut .zones , z )
204+ ctOut .zoneLimits = append (ctOut .zoneLimits , z )
205205 }
206206
207207 return ctOut , nil
0 commit comments