mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-07-31 11:04:14 +03:00
Update sing-box core
This commit is contained in:
@@ -18,6 +18,7 @@ type _RuleAction struct {
|
||||
RouteOptions RouteActionOptions `json:"-"`
|
||||
RouteOptionsOptions RouteOptionsActionOptions `json:"-"`
|
||||
DirectOptions DirectActionOptions `json:"-"`
|
||||
BypassOptions RouteActionOptions `json:"-"`
|
||||
RejectOptions RejectActionOptions `json:"-"`
|
||||
SniffOptions RouteActionSniff `json:"-"`
|
||||
ResolveOptions RouteActionResolve `json:"-"`
|
||||
@@ -38,6 +39,8 @@ func (r RuleAction) MarshalJSON() ([]byte, error) {
|
||||
v = r.RouteOptionsOptions
|
||||
case C.RuleActionTypeDirect:
|
||||
v = r.DirectOptions
|
||||
case C.RuleActionTypeBypass:
|
||||
v = r.BypassOptions
|
||||
case C.RuleActionTypeReject:
|
||||
v = r.RejectOptions
|
||||
case C.RuleActionTypeHijackDNS:
|
||||
@@ -69,6 +72,8 @@ func (r *RuleAction) UnmarshalJSON(data []byte) error {
|
||||
v = &r.RouteOptionsOptions
|
||||
case C.RuleActionTypeDirect:
|
||||
v = &r.DirectOptions
|
||||
case C.RuleActionTypeBypass:
|
||||
v = &r.BypassOptions
|
||||
case C.RuleActionTypeReject:
|
||||
v = &r.RejectOptions
|
||||
case C.RuleActionTypeHijackDNS:
|
||||
@@ -84,7 +89,11 @@ func (r *RuleAction) UnmarshalJSON(data []byte) error {
|
||||
// check unknown fields
|
||||
return json.UnmarshalDisallowUnknownFields(data, &_RuleAction{})
|
||||
}
|
||||
return badjson.UnmarshallExcluded(data, (*_RuleAction)(r), v)
|
||||
err = badjson.UnmarshallExcluded(data, (*_RuleAction)(r), v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type _DNSRuleAction struct {
|
||||
@@ -283,6 +292,7 @@ func (r *RejectActionOptions) UnmarshalJSON(bytes []byte) error {
|
||||
case "", C.RuleActionRejectMethodDefault:
|
||||
r.Method = C.RuleActionRejectMethodDefault
|
||||
case C.RuleActionRejectMethodDrop:
|
||||
case C.RuleActionRejectMethodReply:
|
||||
default:
|
||||
return E.New("unknown reject method: " + r.Method)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user