Skip to content

Commit

Permalink
BUG/MINOR: add missing rst-ttl option to relevant keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
amelhusic committed Sep 23, 2024
1 parent 718fbc5 commit 4949065
Show file tree
Hide file tree
Showing 23 changed files with 135 additions and 11 deletions.
2 changes: 2 additions & 0 deletions configuration/http_request_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ func ParseHTTPRequestRule(f types.Action) (rule *models.HTTPRequestRule, err err
}
case *actions.SilentDrop:
rule = &models.HTTPRequestRule{
RstTTL: v.RstTTL,
Type: "silent-drop",
Cond: v.Cond,
CondTest: v.CondTest,
Expand Down Expand Up @@ -1138,6 +1139,7 @@ func SerializeHTTPRequestRule(f models.HTTPRequestRule) (rule types.Action, err
}
case "silent-drop":
rule = &actions.SilentDrop{
RstTTL: f.RstTTL,
Cond: f.Cond,
CondTest: f.CondTest,
}
Expand Down
2 changes: 2 additions & 0 deletions configuration/http_response_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ func ParseHTTPResponseRule(f types.Action) *models.HTTPResponseRule { //nolint:m
}
case *actions.SilentDrop:
return &models.HTTPResponseRule{
RstTTL: v.RstTTL,
Type: "silent-drop",
Cond: v.Cond,
CondTest: v.CondTest,
Expand Down Expand Up @@ -817,6 +818,7 @@ func SerializeHTTPResponseRule(f models.HTTPResponseRule) (rule types.Action, er
}
case "silent-drop":
rule = &actions.SilentDrop{
RstTTL: f.RstTTL,
Cond: f.Cond,
CondTest: f.CondTest,
}
Expand Down
6 changes: 6 additions & 0 deletions configuration/tcp_request_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err erro
rule.CondTest = a.CondTest
case *actions.SilentDrop:
rule.Action = models.TCPRequestRuleActionSilentDashDrop
rule.RstTTL = a.RstTTL
rule.Cond = a.Cond
rule.CondTest = a.CondTest
case *actions.Lua:
Expand Down Expand Up @@ -494,6 +495,7 @@ func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err erro
rule.CondTest = a.CondTest
case *actions.SilentDrop:
rule.Action = models.TCPRequestRuleActionSilentDashDrop
rule.RstTTL = a.RstTTL
rule.Cond = a.Cond
rule.CondTest = a.CondTest
case *actions.SendSpoeGroup:
Expand Down Expand Up @@ -677,6 +679,7 @@ func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err erro
rule.CondTest = a.CondTest
case *actions.SilentDrop:
rule.Action = models.TCPRequestRuleActionSilentDashDrop
rule.RstTTL = a.RstTTL
rule.Cond = a.Cond
rule.CondTest = a.CondTest
default:
Expand Down Expand Up @@ -836,6 +839,7 @@ func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err e
case models.TCPRequestRuleActionSilentDashDrop:
return &tcp_types.Connection{
Action: &actions.SilentDrop{
RstTTL: f.RstTTL,
Cond: f.Cond,
CondTest: f.CondTest,
},
Expand Down Expand Up @@ -1130,6 +1134,7 @@ func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err e
case models.TCPRequestRuleActionSilentDashDrop:
return &tcp_types.Content{
Action: &actions.SilentDrop{
RstTTL: f.RstTTL,
Cond: f.Cond,
CondTest: f.CondTest,
},
Expand Down Expand Up @@ -1427,6 +1432,7 @@ func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err e
case models.TCPRequestRuleActionSilentDashDrop:
return &tcp_types.Session{
Action: &actions.SilentDrop{
RstTTL: f.RstTTL,
Cond: f.Cond,
CondTest: f.CondTest,
},
Expand Down
2 changes: 2 additions & 0 deletions configuration/tcp_response_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ func ParseTCPResponseRule(t types.TCPType) (*models.TCPResponseRule, error) {
return &models.TCPResponseRule{
Type: models.TCPResponseRuleTypeContent,
Action: models.TCPResponseRuleActionSilentDashDrop,
RstTTL: a.RstTTL,
Cond: a.Cond,
CondTest: a.CondTest,
}, nil
Expand Down Expand Up @@ -570,6 +571,7 @@ func SerializeTCPResponseRule(t models.TCPResponseRule) (types.TCPType, error) {
case models.TCPResponseRuleActionSilentDashDrop:
return &tcp_types.Content{
Action: &actions.SilentDrop{
RstTTL: t.RstTTL,
Cond: t.Cond,
CondTest: t.CondTest,
},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/renameio v1.0.1
github.com/google/uuid v1.6.0
github.com/haproxytech/config-parser/v5 v5.1.5
github.com/haproxytech/config-parser/v5 v5.1.6-0.20240923121611-21c538dab47a
github.com/json-iterator/go v1.1.12
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/mitchellh/mapstructure v1.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ github.com/google/renameio v1.0.1 h1:Lh/jXZmvZxb0BBeSY5VKEfidcbcbenKjZFzM/q0fSeU
github.com/google/renameio v1.0.1/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/haproxytech/config-parser/v5 v5.1.5 h1:wZZ7z62Q5xbRQCoyEejli3unj0/Eo+ixJrwe9ZBdzvI=
github.com/haproxytech/config-parser/v5 v5.1.5/go.mod h1:16+1AbS+AvMZkDScIhergz2dqecQuEmjwV4Xt5ncS9s=
github.com/haproxytech/config-parser/v5 v5.1.6-0.20240923121611-21c538dab47a h1:zrHz2vatWGa6lHVSt+daH8erytvuKhre2EFpXXopJa0=
github.com/haproxytech/config-parser/v5 v5.1.6-0.20240923121611-21c538dab47a/go.mod h1:16+1AbS+AvMZkDScIhergz2dqecQuEmjwV4Xt5ncS9s=
github.com/haproxytech/go-logger v1.1.0 h1:HgGtYaI1ApkvbQdsm7f9AzQQoxTB7w37criTflh7IQE=
github.com/haproxytech/go-logger v1.1.0/go.mod h1:OekUd8HCb7ubxMplzHUPBTHNxZmddOWfOjWclZsqIeM=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
Expand Down
3 changes: 3 additions & 0 deletions models/http_request_rule.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions models/http_request_rule_compare.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions models/http_request_rule_compare_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions models/http_response_rule.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions models/http_response_rule_compare.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions models/http_response_rule_compare_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions models/tcp_request_rule.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions models/tcp_request_rule_compare.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions models/tcp_request_rule_compare_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions models/tcp_response_rule.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions models/tcp_response_rule_compare.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions models/tcp_response_rule_compare_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4949065

Please sign in to comment.