# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.yangtypes import YANGDynClass
from pyangbind.lib.yangtypes import ReferenceType
from pyangbind.lib.base import PybindBase
from collections import OrderedDict
from decimal import Decimal
from bitarray import bitarray
import six

# PY3 support of some PY2 keywords (needs improved)
if six.PY3:
    import builtins as __builtin__

    long = int
elif six.PY2:
    import __builtin__


class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/afts/aft/entries/entry/match/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Operational state parameters for match criteria of the
AFT entry
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__ip_prefix",
        "__mac_address",
        "__mpls_label",
        "__mpls_tc",
        "__ip_dscp",
        "__ip_protocol",
        "__l4_src_port",
        "__l4_dst_port",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__ip_prefix = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))"
                    },
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))"
                    },
                ),
            ],
            is_leaf=True,
            yang_name="ip-prefix",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:ip-prefix",
            is_config=False,
        )
        self.__mac_address = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={"pattern": "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}"},
            ),
            is_leaf=True,
            yang_name="mac-address",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:mac-address",
            is_config=False,
        )
        self.__mpls_label = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=long,
                        restriction_dict={"range": ["0..4294967295"]},
                        int_size=32,
                    ),
                    restriction_dict={"range": ["16..1048575"]},
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "IPV4_EXPLICIT_NULL": {"value": 0},
                        "ROUTER_ALERT": {"value": 1},
                        "IPV6_EXPLICIT_NULL": {"value": 2},
                        "IMPLICIT_NULL": {"value": 3},
                        "ENTROPY_LABEL_INDICATOR": {"value": 7},
                        "NO_LABEL": {},
                    },
                ),
            ],
            is_leaf=True,
            yang_name="mpls-label",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-mplst:mpls-label",
            is_config=False,
        )
        self.__mpls_tc = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["0..7"]},
            ),
            is_leaf=True,
            yang_name="mpls-tc",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=False,
        )
        self.__ip_dscp = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["0..63"]},
            ),
            is_leaf=True,
            yang_name="ip-dscp",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:dscp",
            is_config=False,
        )
        self.__ip_protocol = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["0..254"]},
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "IP_TCP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_TCP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_UDP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_UDP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_ICMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_ICMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_IGMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_IGMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_PIM": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_PIM": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_RSVP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_RSVP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_GRE": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_GRE": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_AUTH": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_AUTH": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_L2TP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_L2TP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                    },
                ),
            ],
            is_leaf=True,
            yang_name="ip-protocol",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-pkt-match-types:ip-protocol-type",
            is_config=False,
        )
        self.__l4_src_port = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..65535"]}, int_size=16
                ),
                restriction_dict={"range": ["0..65535"]},
            ),
            is_leaf=True,
            yang_name="l4-src-port",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:port-number",
            is_config=False,
        )
        self.__l4_dst_port = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..65535"]}, int_size=16
                ),
                restriction_dict={"range": ["0..65535"]},
            ),
            is_leaf=True,
            yang_name="l4-dst-port",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:port-number",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "afts",
                "aft",
                "entries",
                "entry",
                "match",
                "state",
            ]

    def _get_ip_prefix(self):
        """
    Getter method for ip_prefix, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_prefix (inet:ip-prefix)

    YANG Description: The IP prefix that the forwarding entry matches. Used for
Layer 3 forwarding entries.
    """
        return self.__ip_prefix

    def _set_ip_prefix(self, v, load=False):
        """
    Setter method for ip_prefix, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_prefix (inet:ip-prefix)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip_prefix is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip_prefix() directly.

    YANG Description: The IP prefix that the forwarding entry matches. Used for
Layer 3 forwarding entries.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=[
                    RestrictedClassType(
                        base_type=six.text_type,
                        restriction_dict={
                            "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))"
                        },
                    ),
                    RestrictedClassType(
                        base_type=six.text_type,
                        restriction_dict={
                            "pattern": "((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))"
                        },
                    ),
                ],
                is_leaf=True,
                yang_name="ip-prefix",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="inet:ip-prefix",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """ip_prefix must be of a type compatible with inet:ip-prefix""",
                    "defined-type": "inet:ip-prefix",
                    "generated-type": """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="ip-prefix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='inet:ip-prefix', is_config=False)""",
                }
            )

        self.__ip_prefix = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ip_prefix(self):
        self.__ip_prefix = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))"
                    },
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))"
                    },
                ),
            ],
            is_leaf=True,
            yang_name="ip-prefix",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:ip-prefix",
            is_config=False,
        )

    def _get_mac_address(self):
        """
    Getter method for mac_address, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mac_address (yang:mac-address)

    YANG Description: The MAC address that the forwarding entry matches. Used for
Layer 2 forwarding entries, e.g., within a VSI instance.
    """
        return self.__mac_address

    def _set_mac_address(self, v, load=False):
        """
    Setter method for mac_address, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mac_address (yang:mac-address)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mac_address is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mac_address() directly.

    YANG Description: The MAC address that the forwarding entry matches. Used for
Layer 2 forwarding entries, e.g., within a VSI instance.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={"pattern": "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}"},
                ),
                is_leaf=True,
                yang_name="mac-address",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="yang:mac-address",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """mac_address must be of a type compatible with yang:mac-address""",
                    "defined-type": "yang:mac-address",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='yang:mac-address', is_config=False)""",
                }
            )

        self.__mac_address = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_mac_address(self):
        self.__mac_address = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={"pattern": "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}"},
            ),
            is_leaf=True,
            yang_name="mac-address",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:mac-address",
            is_config=False,
        )

    def _get_mpls_label(self):
        """
    Getter method for mpls_label, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mpls_label (oc-mplst:mpls-label)

    YANG Description: The MPLS label that the forwarding entry matches. Used for
MPLS forwarding entries, whereby the local device acts as an
LSR.
    """
        return self.__mpls_label

    def _set_mpls_label(self, v, load=False):
        """
    Setter method for mpls_label, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mpls_label (oc-mplst:mpls-label)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mpls_label is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mpls_label() directly.

    YANG Description: The MPLS label that the forwarding entry matches. Used for
MPLS forwarding entries, whereby the local device acts as an
LSR.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=[
                    RestrictedClassType(
                        base_type=RestrictedClassType(
                            base_type=long,
                            restriction_dict={"range": ["0..4294967295"]},
                            int_size=32,
                        ),
                        restriction_dict={"range": ["16..1048575"]},
                    ),
                    RestrictedClassType(
                        base_type=six.text_type,
                        restriction_type="dict_key",
                        restriction_arg={
                            "IPV4_EXPLICIT_NULL": {"value": 0},
                            "ROUTER_ALERT": {"value": 1},
                            "IPV6_EXPLICIT_NULL": {"value": 2},
                            "IMPLICIT_NULL": {"value": 3},
                            "ENTROPY_LABEL_INDICATOR": {"value": 7},
                            "NO_LABEL": {},
                        },
                    ),
                ],
                is_leaf=True,
                yang_name="mpls-label",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-mplst:mpls-label",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """mpls_label must be of a type compatible with oc-mplst:mpls-label""",
                    "defined-type": "oc-mplst:mpls-label",
                    "generated-type": """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['16..1048575']}),RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'IPV4_EXPLICIT_NULL': {'value': 0}, 'ROUTER_ALERT': {'value': 1}, 'IPV6_EXPLICIT_NULL': {'value': 2}, 'IMPLICIT_NULL': {'value': 3}, 'ENTROPY_LABEL_INDICATOR': {'value': 7}, 'NO_LABEL': {}},),], is_leaf=True, yang_name="mpls-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-mplst:mpls-label', is_config=False)""",
                }
            )

        self.__mpls_label = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_mpls_label(self):
        self.__mpls_label = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=long,
                        restriction_dict={"range": ["0..4294967295"]},
                        int_size=32,
                    ),
                    restriction_dict={"range": ["16..1048575"]},
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "IPV4_EXPLICIT_NULL": {"value": 0},
                        "ROUTER_ALERT": {"value": 1},
                        "IPV6_EXPLICIT_NULL": {"value": 2},
                        "IMPLICIT_NULL": {"value": 3},
                        "ENTROPY_LABEL_INDICATOR": {"value": 7},
                        "NO_LABEL": {},
                    },
                ),
            ],
            is_leaf=True,
            yang_name="mpls-label",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-mplst:mpls-label",
            is_config=False,
        )

    def _get_mpls_tc(self):
        """
    Getter method for mpls_tc, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mpls_tc (uint8)

    YANG Description: The value of the MPLS Traffic Class bits (formerly known as
the MPLS experimental bits) that are to be matched by the AFT
entry.
    """
        return self.__mpls_tc

    def _set_mpls_tc(self, v, load=False):
        """
    Setter method for mpls_tc, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mpls_tc (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mpls_tc is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mpls_tc() directly.

    YANG Description: The value of the MPLS Traffic Class bits (formerly known as
the MPLS experimental bits) that are to be matched by the AFT
entry.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["0..7"]},
                ),
                is_leaf=True,
                yang_name="mpls-tc",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint8",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """mpls_tc must be of a type compatible with uint8""",
                    "defined-type": "uint8",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="mpls-tc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)""",
                }
            )

        self.__mpls_tc = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_mpls_tc(self):
        self.__mpls_tc = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["0..7"]},
            ),
            is_leaf=True,
            yang_name="mpls-tc",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=False,
        )

    def _get_ip_dscp(self):
        """
    Getter method for ip_dscp, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_dscp (inet:dscp)

    YANG Description: The value of the differentiated services code point (DSCP) to
be matched for the forwarding entry. The value is specified in
cases where specific class-based forwarding based on IP is
implemented by the device.
    """
        return self.__ip_dscp

    def _set_ip_dscp(self, v, load=False):
        """
    Setter method for ip_dscp, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_dscp (inet:dscp)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip_dscp is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip_dscp() directly.

    YANG Description: The value of the differentiated services code point (DSCP) to
be matched for the forwarding entry. The value is specified in
cases where specific class-based forwarding based on IP is
implemented by the device.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["0..63"]},
                ),
                is_leaf=True,
                yang_name="ip-dscp",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="inet:dscp",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """ip_dscp must be of a type compatible with inet:dscp""",
                    "defined-type": "inet:dscp",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="ip-dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='inet:dscp', is_config=False)""",
                }
            )

        self.__ip_dscp = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ip_dscp(self):
        self.__ip_dscp = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["0..63"]},
            ),
            is_leaf=True,
            yang_name="ip-dscp",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:dscp",
            is_config=False,
        )

    def _get_ip_protocol(self):
        """
    Getter method for ip_protocol, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_protocol (oc-pkt-match-types:ip-protocol-type)

    YANG Description: The value of the IP protocol field of an IPv4 packet, or the
next-header field of an IPv6 packet which is to be matched by
the AFT entry. This field is utilised where forwarding is
performed based on L4 information.
    """
        return self.__ip_protocol

    def _set_ip_protocol(self, v, load=False):
        """
    Setter method for ip_protocol, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_protocol (oc-pkt-match-types:ip-protocol-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip_protocol is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip_protocol() directly.

    YANG Description: The value of the IP protocol field of an IPv4 packet, or the
next-header field of an IPv6 packet which is to be matched by
the AFT entry. This field is utilised where forwarding is
performed based on L4 information.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=[
                    RestrictedClassType(
                        base_type=RestrictedClassType(
                            base_type=int,
                            restriction_dict={"range": ["0..255"]},
                            int_size=8,
                        ),
                        restriction_dict={"range": ["0..254"]},
                    ),
                    RestrictedClassType(
                        base_type=six.text_type,
                        restriction_type="dict_key",
                        restriction_arg={
                            "IP_TCP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_TCP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_UDP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_UDP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_ICMP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_ICMP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_IGMP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_IGMP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_PIM": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_PIM": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_RSVP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_RSVP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_GRE": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_GRE": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_AUTH": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_AUTH": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_L2TP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_L2TP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                        },
                    ),
                ],
                is_leaf=True,
                yang_name="ip-protocol",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-pkt-match-types:ip-protocol-type",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """ip_protocol must be of a type compatible with oc-pkt-match-types:ip-protocol-type""",
                    "defined-type": "oc-pkt-match-types:ip-protocol-type",
                    "generated-type": """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'IP_TCP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_TCP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_UDP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_ICMP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_IGMP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_PIM': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_RSVP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_GRE': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_AUTH': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_L2TP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}},),], is_leaf=True, yang_name="ip-protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False)""",
                }
            )

        self.__ip_protocol = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ip_protocol(self):
        self.__ip_protocol = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["0..254"]},
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "IP_TCP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_TCP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_UDP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_UDP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_ICMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_ICMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_IGMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_IGMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_PIM": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_PIM": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_RSVP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_RSVP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_GRE": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_GRE": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_AUTH": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_AUTH": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_L2TP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_L2TP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                    },
                ),
            ],
            is_leaf=True,
            yang_name="ip-protocol",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-pkt-match-types:ip-protocol-type",
            is_config=False,
        )

    def _get_l4_src_port(self):
        """
    Getter method for l4_src_port, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/l4_src_port (inet:port-number)

    YANG Description: The value of the source port field of the transport header
that is to be matched by the AFT entry.
    """
        return self.__l4_src_port

    def _set_l4_src_port(self, v, load=False):
        """
    Setter method for l4_src_port, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/l4_src_port (inet:port-number)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_l4_src_port is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_l4_src_port() directly.

    YANG Description: The value of the source port field of the transport header
that is to be matched by the AFT entry.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..65535"]},
                        int_size=16,
                    ),
                    restriction_dict={"range": ["0..65535"]},
                ),
                is_leaf=True,
                yang_name="l4-src-port",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="inet:port-number",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """l4_src_port must be of a type compatible with inet:port-number""",
                    "defined-type": "inet:port-number",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}), is_leaf=True, yang_name="l4-src-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='inet:port-number', is_config=False)""",
                }
            )

        self.__l4_src_port = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_l4_src_port(self):
        self.__l4_src_port = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..65535"]}, int_size=16
                ),
                restriction_dict={"range": ["0..65535"]},
            ),
            is_leaf=True,
            yang_name="l4-src-port",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:port-number",
            is_config=False,
        )

    def _get_l4_dst_port(self):
        """
    Getter method for l4_dst_port, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/l4_dst_port (inet:port-number)

    YANG Description: The value of the destination port field of the transport
header that is to be matched by the AFT entry.
    """
        return self.__l4_dst_port

    def _set_l4_dst_port(self, v, load=False):
        """
    Setter method for l4_dst_port, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/l4_dst_port (inet:port-number)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_l4_dst_port is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_l4_dst_port() directly.

    YANG Description: The value of the destination port field of the transport
header that is to be matched by the AFT entry.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..65535"]},
                        int_size=16,
                    ),
                    restriction_dict={"range": ["0..65535"]},
                ),
                is_leaf=True,
                yang_name="l4-dst-port",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="inet:port-number",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """l4_dst_port must be of a type compatible with inet:port-number""",
                    "defined-type": "inet:port-number",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}), is_leaf=True, yang_name="l4-dst-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='inet:port-number', is_config=False)""",
                }
            )

        self.__l4_dst_port = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_l4_dst_port(self):
        self.__l4_dst_port = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..65535"]}, int_size=16
                ),
                restriction_dict={"range": ["0..65535"]},
            ),
            is_leaf=True,
            yang_name="l4-dst-port",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:port-number",
            is_config=False,
        )

    ip_prefix = __builtin__.property(_get_ip_prefix)
    mac_address = __builtin__.property(_get_mac_address)
    mpls_label = __builtin__.property(_get_mpls_label)
    mpls_tc = __builtin__.property(_get_mpls_tc)
    ip_dscp = __builtin__.property(_get_ip_dscp)
    ip_protocol = __builtin__.property(_get_ip_protocol)
    l4_src_port = __builtin__.property(_get_l4_src_port)
    l4_dst_port = __builtin__.property(_get_l4_dst_port)

    _pyangbind_elements = OrderedDict(
        [
            ("ip_prefix", ip_prefix),
            ("mac_address", mac_address),
            ("mpls_label", mpls_label),
            ("mpls_tc", mpls_tc),
            ("ip_dscp", ip_dscp),
            ("ip_protocol", ip_protocol),
            ("l4_src_port", l4_src_port),
            ("l4_dst_port", l4_dst_port),
        ]
    )


class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/afts/aft/entries/entry/match/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Operational state parameters for match criteria of the
AFT entry
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__ip_prefix",
        "__mac_address",
        "__mpls_label",
        "__mpls_tc",
        "__ip_dscp",
        "__ip_protocol",
        "__l4_src_port",
        "__l4_dst_port",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__ip_prefix = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))"
                    },
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))"
                    },
                ),
            ],
            is_leaf=True,
            yang_name="ip-prefix",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:ip-prefix",
            is_config=False,
        )
        self.__mac_address = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={"pattern": "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}"},
            ),
            is_leaf=True,
            yang_name="mac-address",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:mac-address",
            is_config=False,
        )
        self.__mpls_label = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=long,
                        restriction_dict={"range": ["0..4294967295"]},
                        int_size=32,
                    ),
                    restriction_dict={"range": ["16..1048575"]},
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "IPV4_EXPLICIT_NULL": {"value": 0},
                        "ROUTER_ALERT": {"value": 1},
                        "IPV6_EXPLICIT_NULL": {"value": 2},
                        "IMPLICIT_NULL": {"value": 3},
                        "ENTROPY_LABEL_INDICATOR": {"value": 7},
                        "NO_LABEL": {},
                    },
                ),
            ],
            is_leaf=True,
            yang_name="mpls-label",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-mplst:mpls-label",
            is_config=False,
        )
        self.__mpls_tc = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["0..7"]},
            ),
            is_leaf=True,
            yang_name="mpls-tc",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=False,
        )
        self.__ip_dscp = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["0..63"]},
            ),
            is_leaf=True,
            yang_name="ip-dscp",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:dscp",
            is_config=False,
        )
        self.__ip_protocol = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["0..254"]},
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "IP_TCP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_TCP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_UDP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_UDP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_ICMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_ICMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_IGMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_IGMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_PIM": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_PIM": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_RSVP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_RSVP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_GRE": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_GRE": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_AUTH": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_AUTH": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_L2TP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_L2TP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                    },
                ),
            ],
            is_leaf=True,
            yang_name="ip-protocol",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-pkt-match-types:ip-protocol-type",
            is_config=False,
        )
        self.__l4_src_port = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..65535"]}, int_size=16
                ),
                restriction_dict={"range": ["0..65535"]},
            ),
            is_leaf=True,
            yang_name="l4-src-port",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:port-number",
            is_config=False,
        )
        self.__l4_dst_port = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..65535"]}, int_size=16
                ),
                restriction_dict={"range": ["0..65535"]},
            ),
            is_leaf=True,
            yang_name="l4-dst-port",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:port-number",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "afts",
                "aft",
                "entries",
                "entry",
                "match",
                "state",
            ]

    def _get_ip_prefix(self):
        """
    Getter method for ip_prefix, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_prefix (inet:ip-prefix)

    YANG Description: The IP prefix that the forwarding entry matches. Used for
Layer 3 forwarding entries.
    """
        return self.__ip_prefix

    def _set_ip_prefix(self, v, load=False):
        """
    Setter method for ip_prefix, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_prefix (inet:ip-prefix)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip_prefix is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip_prefix() directly.

    YANG Description: The IP prefix that the forwarding entry matches. Used for
Layer 3 forwarding entries.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=[
                    RestrictedClassType(
                        base_type=six.text_type,
                        restriction_dict={
                            "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))"
                        },
                    ),
                    RestrictedClassType(
                        base_type=six.text_type,
                        restriction_dict={
                            "pattern": "((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))"
                        },
                    ),
                ],
                is_leaf=True,
                yang_name="ip-prefix",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="inet:ip-prefix",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """ip_prefix must be of a type compatible with inet:ip-prefix""",
                    "defined-type": "inet:ip-prefix",
                    "generated-type": """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="ip-prefix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='inet:ip-prefix', is_config=False)""",
                }
            )

        self.__ip_prefix = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ip_prefix(self):
        self.__ip_prefix = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))"
                    },
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))"
                    },
                ),
            ],
            is_leaf=True,
            yang_name="ip-prefix",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:ip-prefix",
            is_config=False,
        )

    def _get_mac_address(self):
        """
    Getter method for mac_address, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mac_address (yang:mac-address)

    YANG Description: The MAC address that the forwarding entry matches. Used for
Layer 2 forwarding entries, e.g., within a VSI instance.
    """
        return self.__mac_address

    def _set_mac_address(self, v, load=False):
        """
    Setter method for mac_address, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mac_address (yang:mac-address)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mac_address is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mac_address() directly.

    YANG Description: The MAC address that the forwarding entry matches. Used for
Layer 2 forwarding entries, e.g., within a VSI instance.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={"pattern": "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}"},
                ),
                is_leaf=True,
                yang_name="mac-address",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="yang:mac-address",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """mac_address must be of a type compatible with yang:mac-address""",
                    "defined-type": "yang:mac-address",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='yang:mac-address', is_config=False)""",
                }
            )

        self.__mac_address = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_mac_address(self):
        self.__mac_address = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={"pattern": "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}"},
            ),
            is_leaf=True,
            yang_name="mac-address",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="yang:mac-address",
            is_config=False,
        )

    def _get_mpls_label(self):
        """
    Getter method for mpls_label, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mpls_label (oc-mplst:mpls-label)

    YANG Description: The MPLS label that the forwarding entry matches. Used for
MPLS forwarding entries, whereby the local device acts as an
LSR.
    """
        return self.__mpls_label

    def _set_mpls_label(self, v, load=False):
        """
    Setter method for mpls_label, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mpls_label (oc-mplst:mpls-label)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mpls_label is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mpls_label() directly.

    YANG Description: The MPLS label that the forwarding entry matches. Used for
MPLS forwarding entries, whereby the local device acts as an
LSR.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=[
                    RestrictedClassType(
                        base_type=RestrictedClassType(
                            base_type=long,
                            restriction_dict={"range": ["0..4294967295"]},
                            int_size=32,
                        ),
                        restriction_dict={"range": ["16..1048575"]},
                    ),
                    RestrictedClassType(
                        base_type=six.text_type,
                        restriction_type="dict_key",
                        restriction_arg={
                            "IPV4_EXPLICIT_NULL": {"value": 0},
                            "ROUTER_ALERT": {"value": 1},
                            "IPV6_EXPLICIT_NULL": {"value": 2},
                            "IMPLICIT_NULL": {"value": 3},
                            "ENTROPY_LABEL_INDICATOR": {"value": 7},
                            "NO_LABEL": {},
                        },
                    ),
                ],
                is_leaf=True,
                yang_name="mpls-label",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-mplst:mpls-label",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """mpls_label must be of a type compatible with oc-mplst:mpls-label""",
                    "defined-type": "oc-mplst:mpls-label",
                    "generated-type": """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['16..1048575']}),RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'IPV4_EXPLICIT_NULL': {'value': 0}, 'ROUTER_ALERT': {'value': 1}, 'IPV6_EXPLICIT_NULL': {'value': 2}, 'IMPLICIT_NULL': {'value': 3}, 'ENTROPY_LABEL_INDICATOR': {'value': 7}, 'NO_LABEL': {}},),], is_leaf=True, yang_name="mpls-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-mplst:mpls-label', is_config=False)""",
                }
            )

        self.__mpls_label = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_mpls_label(self):
        self.__mpls_label = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=long,
                        restriction_dict={"range": ["0..4294967295"]},
                        int_size=32,
                    ),
                    restriction_dict={"range": ["16..1048575"]},
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "IPV4_EXPLICIT_NULL": {"value": 0},
                        "ROUTER_ALERT": {"value": 1},
                        "IPV6_EXPLICIT_NULL": {"value": 2},
                        "IMPLICIT_NULL": {"value": 3},
                        "ENTROPY_LABEL_INDICATOR": {"value": 7},
                        "NO_LABEL": {},
                    },
                ),
            ],
            is_leaf=True,
            yang_name="mpls-label",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-mplst:mpls-label",
            is_config=False,
        )

    def _get_mpls_tc(self):
        """
    Getter method for mpls_tc, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mpls_tc (uint8)

    YANG Description: The value of the MPLS Traffic Class bits (formerly known as
the MPLS experimental bits) that are to be matched by the AFT
entry.
    """
        return self.__mpls_tc

    def _set_mpls_tc(self, v, load=False):
        """
    Setter method for mpls_tc, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/mpls_tc (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mpls_tc is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mpls_tc() directly.

    YANG Description: The value of the MPLS Traffic Class bits (formerly known as
the MPLS experimental bits) that are to be matched by the AFT
entry.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["0..7"]},
                ),
                is_leaf=True,
                yang_name="mpls-tc",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint8",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """mpls_tc must be of a type compatible with uint8""",
                    "defined-type": "uint8",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="mpls-tc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)""",
                }
            )

        self.__mpls_tc = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_mpls_tc(self):
        self.__mpls_tc = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["0..7"]},
            ),
            is_leaf=True,
            yang_name="mpls-tc",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=False,
        )

    def _get_ip_dscp(self):
        """
    Getter method for ip_dscp, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_dscp (inet:dscp)

    YANG Description: The value of the differentiated services code point (DSCP) to
be matched for the forwarding entry. The value is specified in
cases where specific class-based forwarding based on IP is
implemented by the device.
    """
        return self.__ip_dscp

    def _set_ip_dscp(self, v, load=False):
        """
    Setter method for ip_dscp, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_dscp (inet:dscp)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip_dscp is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip_dscp() directly.

    YANG Description: The value of the differentiated services code point (DSCP) to
be matched for the forwarding entry. The value is specified in
cases where specific class-based forwarding based on IP is
implemented by the device.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["0..63"]},
                ),
                is_leaf=True,
                yang_name="ip-dscp",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="inet:dscp",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """ip_dscp must be of a type compatible with inet:dscp""",
                    "defined-type": "inet:dscp",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="ip-dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='inet:dscp', is_config=False)""",
                }
            )

        self.__ip_dscp = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ip_dscp(self):
        self.__ip_dscp = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["0..63"]},
            ),
            is_leaf=True,
            yang_name="ip-dscp",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:dscp",
            is_config=False,
        )

    def _get_ip_protocol(self):
        """
    Getter method for ip_protocol, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_protocol (oc-pkt-match-types:ip-protocol-type)

    YANG Description: The value of the IP protocol field of an IPv4 packet, or the
next-header field of an IPv6 packet which is to be matched by
the AFT entry. This field is utilised where forwarding is
performed based on L4 information.
    """
        return self.__ip_protocol

    def _set_ip_protocol(self, v, load=False):
        """
    Setter method for ip_protocol, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/ip_protocol (oc-pkt-match-types:ip-protocol-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip_protocol is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip_protocol() directly.

    YANG Description: The value of the IP protocol field of an IPv4 packet, or the
next-header field of an IPv6 packet which is to be matched by
the AFT entry. This field is utilised where forwarding is
performed based on L4 information.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=[
                    RestrictedClassType(
                        base_type=RestrictedClassType(
                            base_type=int,
                            restriction_dict={"range": ["0..255"]},
                            int_size=8,
                        ),
                        restriction_dict={"range": ["0..254"]},
                    ),
                    RestrictedClassType(
                        base_type=six.text_type,
                        restriction_type="dict_key",
                        restriction_arg={
                            "IP_TCP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_TCP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_UDP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_UDP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_ICMP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_ICMP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_IGMP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_IGMP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_PIM": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_PIM": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_RSVP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_RSVP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_GRE": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_GRE": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_AUTH": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_AUTH": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "IP_L2TP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                            "oc-pkt-match-types:IP_L2TP": {
                                "@module": "openconfig-packet-match-types",
                                "@namespace": "http://openconfig.net/yang/packet-match-types",
                            },
                        },
                    ),
                ],
                is_leaf=True,
                yang_name="ip-protocol",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-pkt-match-types:ip-protocol-type",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """ip_protocol must be of a type compatible with oc-pkt-match-types:ip-protocol-type""",
                    "defined-type": "oc-pkt-match-types:ip-protocol-type",
                    "generated-type": """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'IP_TCP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_TCP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_UDP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_ICMP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_IGMP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_PIM': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_RSVP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_GRE': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_AUTH': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'IP_L2TP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@module': 'openconfig-packet-match-types', '@namespace': 'http://openconfig.net/yang/packet-match-types'}},),], is_leaf=True, yang_name="ip-protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False)""",
                }
            )

        self.__ip_protocol = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ip_protocol(self):
        self.__ip_protocol = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["0..254"]},
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "IP_TCP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_TCP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_UDP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_UDP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_ICMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_ICMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_IGMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_IGMP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_PIM": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_PIM": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_RSVP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_RSVP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_GRE": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_GRE": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_AUTH": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_AUTH": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "IP_L2TP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                        "oc-pkt-match-types:IP_L2TP": {
                            "@module": "openconfig-packet-match-types",
                            "@namespace": "http://openconfig.net/yang/packet-match-types",
                        },
                    },
                ),
            ],
            is_leaf=True,
            yang_name="ip-protocol",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-pkt-match-types:ip-protocol-type",
            is_config=False,
        )

    def _get_l4_src_port(self):
        """
    Getter method for l4_src_port, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/l4_src_port (inet:port-number)

    YANG Description: The value of the source port field of the transport header
that is to be matched by the AFT entry.
    """
        return self.__l4_src_port

    def _set_l4_src_port(self, v, load=False):
        """
    Setter method for l4_src_port, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/l4_src_port (inet:port-number)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_l4_src_port is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_l4_src_port() directly.

    YANG Description: The value of the source port field of the transport header
that is to be matched by the AFT entry.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..65535"]},
                        int_size=16,
                    ),
                    restriction_dict={"range": ["0..65535"]},
                ),
                is_leaf=True,
                yang_name="l4-src-port",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="inet:port-number",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """l4_src_port must be of a type compatible with inet:port-number""",
                    "defined-type": "inet:port-number",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}), is_leaf=True, yang_name="l4-src-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='inet:port-number', is_config=False)""",
                }
            )

        self.__l4_src_port = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_l4_src_port(self):
        self.__l4_src_port = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..65535"]}, int_size=16
                ),
                restriction_dict={"range": ["0..65535"]},
            ),
            is_leaf=True,
            yang_name="l4-src-port",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:port-number",
            is_config=False,
        )

    def _get_l4_dst_port(self):
        """
    Getter method for l4_dst_port, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/l4_dst_port (inet:port-number)

    YANG Description: The value of the destination port field of the transport
header that is to be matched by the AFT entry.
    """
        return self.__l4_dst_port

    def _set_l4_dst_port(self, v, load=False):
        """
    Setter method for l4_dst_port, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/match/state/l4_dst_port (inet:port-number)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_l4_dst_port is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_l4_dst_port() directly.

    YANG Description: The value of the destination port field of the transport
header that is to be matched by the AFT entry.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..65535"]},
                        int_size=16,
                    ),
                    restriction_dict={"range": ["0..65535"]},
                ),
                is_leaf=True,
                yang_name="l4-dst-port",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="inet:port-number",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """l4_dst_port must be of a type compatible with inet:port-number""",
                    "defined-type": "inet:port-number",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}), is_leaf=True, yang_name="l4-dst-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='inet:port-number', is_config=False)""",
                }
            )

        self.__l4_dst_port = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_l4_dst_port(self):
        self.__l4_dst_port = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..65535"]}, int_size=16
                ),
                restriction_dict={"range": ["0..65535"]},
            ),
            is_leaf=True,
            yang_name="l4-dst-port",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="inet:port-number",
            is_config=False,
        )

    ip_prefix = __builtin__.property(_get_ip_prefix)
    mac_address = __builtin__.property(_get_mac_address)
    mpls_label = __builtin__.property(_get_mpls_label)
    mpls_tc = __builtin__.property(_get_mpls_tc)
    ip_dscp = __builtin__.property(_get_ip_dscp)
    ip_protocol = __builtin__.property(_get_ip_protocol)
    l4_src_port = __builtin__.property(_get_l4_src_port)
    l4_dst_port = __builtin__.property(_get_l4_dst_port)

    _pyangbind_elements = OrderedDict(
        [
            ("ip_prefix", ip_prefix),
            ("mac_address", mac_address),
            ("mpls_label", mpls_label),
            ("mpls_tc", mpls_tc),
            ("ip_dscp", ip_dscp),
            ("ip_protocol", ip_protocol),
            ("l4_src_port", l4_src_port),
            ("l4_dst_port", l4_dst_port),
        ]
    )
