diff --git a/loxinet/dpbroker.go b/loxinet/dpbroker.go index c29285ee7..410b2390e 100644 --- a/loxinet/dpbroker.go +++ b/loxinet/dpbroker.go @@ -23,8 +23,9 @@ import ( "sync" "time" - cmn "github.com/loxilb-io/loxilb/common" tk "github.com/loxilb-io/loxilib" + + cmn "github.com/loxilb-io/loxilb/common" ) // man names constants @@ -43,7 +44,7 @@ const ( // error codes const ( - DpErrBase = iota - L3ErrBase - 1000 + DpErrBase = iota - 103000 DpWqUnkErr ) @@ -311,7 +312,7 @@ type DpCtInfo struct { ServProto string `json:"servproto"` L4ServPort uint16 `json:"l4servproto"` BlockNum uint16 `json:"blocknum"` - RuleID uint32 `json:"ruleid"` + RuleID uint32 `json:"ruleid"` } const ( @@ -817,7 +818,7 @@ func (dp *DpH) DpMapGetCt4() []cmn.CtInfo { switch r := ret.(type) { case map[string]*DpCtInfo: for _, dCti := range r { - + mh.mtx.Lock() rule := mh.zr.Rules.GetNatLbRuleByID(dCti.RuleID) mh.mtx.Unlock() diff --git a/loxinet/layer3.go b/loxinet/layer3.go index 0c378785d..99dcc577b 100644 --- a/loxinet/layer3.go +++ b/loxinet/layer3.go @@ -21,13 +21,14 @@ import ( "fmt" "net" - cmn "github.com/loxilb-io/loxilb/common" tk "github.com/loxilb-io/loxilib" + + cmn "github.com/loxilb-io/loxilb/common" ) // constants const ( - L3ErrBase = iota - RtErrBase - 1000 + L3ErrBase = iota - 8000 L3AddrErr L3ObjErr ) diff --git a/loxinet/rules.go b/loxinet/rules.go index c0f9de542..2fdabcf94 100644 --- a/loxinet/rules.go +++ b/loxinet/rules.go @@ -40,7 +40,7 @@ import ( // error codes const ( - RuleErrBase = iota - ZoneBaseErr - 1000 + RuleErrBase = iota - 7000 RuleUnknownServiceErr RuleUnknownEpErr RuleExistsErr @@ -272,7 +272,7 @@ type ruleEnt struct { act ruleAct secIP []ruleNatSIP stat ruleStat - name string + name string } type ruleTable struct { diff --git a/loxinet/session.go b/loxinet/session.go index 25c5ff470..14ad213c5 100644 --- a/loxinet/session.go +++ b/loxinet/session.go @@ -21,13 +21,14 @@ import ( "fmt" "net" - cmn "github.com/loxilb-io/loxilb/common" tk "github.com/loxilb-io/loxilib" + + cmn "github.com/loxilb-io/loxilb/common" ) // error codes for session api const ( - SessErrBase = iota - 90000 + SessErrBase = iota - 102000 SessModErr SessNoExistErr SessExistsErr diff --git a/loxinet/zones.go b/loxinet/zones.go index 92133c04e..ec9d0daea 100644 --- a/loxinet/zones.go +++ b/loxinet/zones.go @@ -28,7 +28,7 @@ import ( // error codes for zone const ( - ZoneBaseErr = iota - RtErrBase - 1000 + ZoneBaseErr = iota - 6000 ZoneExistsErr ZoneNotExistErr ZoneNumberErr