@@ -30,22 +30,22 @@ var (
30
30
errWrongZoneArgument = errors .New ("wrong argument while setting zone ct limits" )
31
31
)
32
32
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
34
34
// by ovs-dpctl ct-*-limits commands
35
- type Zone map [string ]uint64
35
+ type CTLimit map [string ]uint64
36
36
37
- // ConnTrackOutput is a type defined to store the output
37
+ // ConntrackOutput is a type defined to store the output
38
38
// of ovs-dpctl ct-*-limits commands. For example it stores
39
39
// such a cli output:
40
40
// # ovs-dpctl ct-get-limits system@ovs-system zone=2,3
41
41
// default limit=0
42
42
// zone=2,limit=0,count=0
43
43
// 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
47
47
// zones stores all remaning zone's settings
48
- zones []Zone
48
+ zoneLimits []CTLimit
49
49
}
50
50
51
51
// DataPathReader is the interface defining the read operations
@@ -72,7 +72,7 @@ type DataPathWriter interface {
72
72
type ConnTrackReader interface {
73
73
// GetCTLimits is the method used to querying conntrack limits for a
74
74
// datapath on a switch
75
- GetCTLimits (string , []uint64 ) (ConnTrackOutput , error )
75
+ GetCTLimits (string , []uint64 ) (ConntrackOutput , error )
76
76
}
77
77
78
78
// ConnTrackWriter is the interface defining the write operations
@@ -149,7 +149,7 @@ func (dp *DataPathService) DelDataPath(dpName string) error {
149
149
150
150
// GetCTLimits returns the conntrack limits for a given datapath
151
151
// 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 ) {
153
153
// Start by building the args
154
154
if dpName == "" {
155
155
return nil , errMissingMandatoryDataPathName
@@ -170,7 +170,7 @@ func (dp *DataPathService) GetCTLimits(dpName string, zones []uint64) (*ConnTrac
170
170
171
171
// Process the results
172
172
entries := strings .Split (string (results ), "\n " )
173
- ctOut := & ConnTrackOutput {}
173
+ ctOut := & ConntrackOutput {}
174
174
175
175
r , err := regexp .Compile (`default` )
176
176
if err != nil {
@@ -181,7 +181,7 @@ func (dp *DataPathService) GetCTLimits(dpName string, zones []uint64) (*ConnTrac
181
181
// If found the default value is removed from the entries
182
182
for i , entry := range entries {
183
183
if r .MatchString (entry ) {
184
- ctOut .defaultLimit = make (Zone )
184
+ ctOut .defaultLimit = make (CTLimit )
185
185
limit , err := strconv .Atoi (strings .Split (entry , "=" )[1 ])
186
186
if err != nil {
187
187
return nil , err
@@ -195,13 +195,13 @@ func (dp *DataPathService) GetCTLimits(dpName string, zones []uint64) (*ConnTrac
195
195
// Now process the zones setup
196
196
for _ , entry := range entries {
197
197
fields := strings .Split (entry , "," )
198
- z := make (Zone )
198
+ z := make (CTLimit )
199
199
for _ , field := range fields {
200
200
buf := strings .Split (field , "=" )
201
201
val , _ := strconv .Atoi (buf [1 ])
202
202
z [buf [0 ]] = uint64 (val )
203
203
}
204
- ctOut .zones = append (ctOut .zones , z )
204
+ ctOut .zoneLimits = append (ctOut .zoneLimits , z )
205
205
}
206
206
207
207
return ctOut , nil
0 commit comments