{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "create_ipv6_nat_rule",
  "type": "object",
  "properties": {
    "chain": {
      "type": "string",
      "enum": ["srcnat", "dstnat"]
    },
    "action": {
      "type": "string",
      "enum": [
        "accept",
        "drop",
        "masquerade",
        "src-nat",
        "dst-nat",
        "netmap",
        "redirect",
        "return",
        "jump",
        "passthrough",
        "log",
        "add-src-to-address-list",
        "add-dst-to-address-list"
      ]
    },
    "src_address": {
      "type": "string"
    },
    "dst_address": {
      "type": "string"
    },
    "src_port": {
      "type": "string"
    },
    "dst_port": {
      "type": "string"
    },
    "protocol": {
      "type": "string"
    },
    "in_interface": {
      "type": "string"
    },
    "out_interface": {
      "type": "string"
    },
    "to_address": {
      "type": "string"
    },
    "to_ports": {
      "type": "string"
    },
    "src_address_list": {
      "type": "string"
    },
    "dst_address_list": {
      "type": "string"
    },
    "in_interface_list": {
      "description": "Ingress interface list, e.g. \"WAN\" or \"!LAN\"",
      "type": "string"
    },
    "out_interface_list": {
      "description": "Egress interface list",
      "type": "string"
    },
    "src_address_type": {
      "description": "\"unicast\" / \"local\" / \"multicast\" / etc.",
      "type": "string"
    },
    "dst_address_type": {
      "description": "\"unicast\" / \"local\" / \"multicast\" / etc.",
      "type": "string"
    },
    "src_mac_address": {
      "description": "Source MAC, negate \"!AA:BB:..\"",
      "type": "string"
    },
    "port": {
      "description": "Match src OR dst port (any protocol with ports)",
      "type": "string"
    },
    "connection_mark": {
      "description": "Match a connection mark set in mangle",
      "type": "string"
    },
    "connection_state": {
      "description": "e.g. \"new\" / \"established,related\" / \"!invalid\"",
      "type": "string"
    },
    "connection_type": {
      "description": "Helper-detected conn type, e.g. \"ftp\" / \"sip\"",
      "type": "string"
    },
    "connection_bytes": {
      "description": "Total conn bytes range, e.g. \"1000000-\"",
      "type": "string"
    },
    "connection_limit": {
      "description": "Per-address conn limit, e.g. \"100,64\"",
      "type": "string"
    },
    "connection_rate": {
      "description": "Conn rate range, e.g. \"0-100k\"",
      "type": "string"
    },
    "packet_mark": {
      "description": "Match a packet mark set in mangle",
      "type": "string"
    },
    "routing_mark": {
      "description": "Match a routing mark set in mangle",
      "type": "string"
    },
    "icmp_options": {
      "description": "ICMPv6 type:code, e.g. \"128:0\"",
      "type": "string"
    },
    "ipsec_policy": {
      "description": "e.g. \"in,ipsec\" / \"out,none\"",
      "type": "string"
    },
    "content": {
      "description": "Match a literal string in the packet payload",
      "type": "string"
    },
    "dscp": {
      "description": "DSCP value 0-63",
      "type": "string"
    },
    "priority": {
      "description": "Match packet priority (queue/VLAN)",
      "type": "string"
    },
    "tcp_flags": {
      "description": "e.g. \"syn,!ack\"",
      "type": "string"
    },
    "tcp_mss": {
      "description": "TCP MSS range, e.g. \"1440-1500\"",
      "type": "string"
    },
    "packet_size": {
      "description": "Packet size range, e.g. \"1500\" or \"0-500\"",
      "type": "string"
    },
    "hop_limit": {
      "description": "IPv6 hop-limit matcher, e.g. \"equal:64\"",
      "type": "string"
    },
    "headers": {
      "description": "Match IPv6 extension headers",
      "type": "string"
    },
    "limit": {
      "description": "Rate limit, e.g. \"10,5:packet\"",
      "type": "string"
    },
    "dst_limit": {
      "description": "Per-dst rate limit, e.g. \"10,5,dst-address/1m\"",
      "type": "string"
    },
    "nth": {
      "description": "Every Nth packet, e.g. \"2,0\"",
      "type": "string"
    },
    "random": {
      "description": "Match packet randomly with given probability % (1-99)",
      "type": "string"
    },
    "per_connection_classifier": {
      "description": "PCC classifier, e.g. \"both-addresses:2/0\"",
      "type": "string"
    },
    "time": {
      "description": "Time/day matcher, e.g. \"8h-16h,mon,tue,wed,thu,fri\"",
      "type": "string"
    },
    "jump_target": {
      "description": "Target chain name when action=jump",
      "type": "string"
    },
    "address_list": {
      "description": "List name for add-src-to-address-list / add-dst-to-address-list",
      "type": "string"
    },
    "address_list_timeout": {
      "description": "Timeout for the address-list entry, e.g. \"1h\" or \"none\"",
      "type": "string"
    },
    "comment": {
      "type": "string"
    },
    "disabled": {
      "default": false,
      "type": "boolean"
    },
    "log": {
      "default": false,
      "type": "boolean"
    },
    "log_prefix": {
      "type": "string"
    },
    "place_before": {
      "description": "Rule number or ID (*N) to insert before",
      "type": "string"
    }
  },
  "required": ["chain", "action", "disabled", "log"],
  "additionalProperties": false
}
