diff --git a/configuration/tcp_request_rule.go b/configuration/tcp_request_rule.go index e8dd9691..71e21b94 100644 --- a/configuration/tcp_request_rule.go +++ b/configuration/tcp_request_rule.go @@ -26,6 +26,7 @@ import ( "github.com/haproxytech/config-parser/v5/common" parser_errors "github.com/haproxytech/config-parser/v5/errors" "github.com/haproxytech/config-parser/v5/parsers/actions" + http_actions "github.com/haproxytech/config-parser/v5/parsers/http/actions" tcp_actions "github.com/haproxytech/config-parser/v5/parsers/tcp/actions" tcp_types "github.com/haproxytech/config-parser/v5/parsers/tcp/types" "github.com/haproxytech/config-parser/v5/types" @@ -784,6 +785,22 @@ func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err e CondTest: f.CondTest, }, }, nil + case models.TCPRequestRuleActionSetDashSrc: + return &tcp_types.Connection{ + Action: &http_actions.SetSrc{ + Expr: common.Expression{Expr: strings.Split(f.Expr, " ")}, + Cond: f.Cond, + CondTest: f.CondTest, + }, + }, nil + case models.TCPRequestRuleActionSetDashDst: + return &tcp_types.Connection{ + Action: &actions.SetDst{ + Expr: common.Expression{Expr: strings.Split(f.Expr, " ")}, + Cond: f.Cond, + CondTest: f.CondTest, + }, + }, nil } return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Action)) case models.TCPRequestRuleTypeContent: