Skip to content

Commit

Permalink
Merge pull request #30 from loxilb-io/n3
Browse files Browse the repository at this point in the history
n3: initial support
  • Loading branch information
UltraInstinct14 authored Nov 13, 2024
2 parents 093f2ba + c54834d commit ea95f28
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/create/create_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ func SelectToNum(sel string) int {
ret = 4
case "n2":
ret = 5
case "n3":
ret = 6
default:
ret = 0
}
Expand Down Expand Up @@ -146,6 +148,7 @@ func NewCreateLoadBalancerCmd(restOptions *api.RESTOptions) *cobra.Command {
priority - select the lb based on weighted round-robin
persist - select the lb end-point based on sender
n2 - select the lb end-point base on N2 interface params (only available with fullproxy mode)
n3 - select the lb end-point base on N3 interface params
--mode value options
onearm - LB put LB-IP as srcIP
fullnat - LB put Service IP as scrIP
Expand Down
3 changes: 2 additions & 1 deletion cmd/get/get_conntrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func PrintGetCTResult(resp *http.Response, o api.RESTOptions) {

// Table Init
table := TableInit()
table.SetHeader([]string{"Service Name", "destIP", "srcIP", "dport", "sport", "proto", "state", "act", "packets", "bytes"})
table.SetHeader([]string{"Service Name", "destIP", "srcIP", "dport", "sport", "proto", "ident", "state", "act", "packets", "bytes"})
// Making load balance data
data = makeConntrackData(o, ctresp)

Expand All @@ -104,6 +104,7 @@ func makeConntrackData(o api.RESTOptions, ctresp api.CtInformationGet) (data [][
fmt.Sprintf("%d", conntrack.Dport),
fmt.Sprintf("%d", conntrack.Sport),
conntrack.Proto,
conntrack.Ident,
conntrack.CState,
conntrack.CAct,
fmt.Sprintf("%v", conntrack.Pkts),
Expand Down
2 changes: 2 additions & 0 deletions cmd/get/get_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ func NumToSelect(sel int) string {
ret = "lc"
case 5:
ret = "n2"
case 6:
ret = "n3"
default:
ret = "rr"
}
Expand Down
1 change: 1 addition & 0 deletions pkg/api/conntrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type ConntrackInformation struct {
Dport uint16 `json:"destinationPort"`
Sport uint16 `json:"sourcePort"`
Proto string `json:"protocol"`
Ident string `json:"ident"`
CState string `json:"conntrackState"`
CAct string `json:"conntrackAct"`
Pkts uint64 `json:"packets"`
Expand Down

0 comments on commit ea95f28

Please sign in to comment.