""" Cisco_IOS_XR_fib_common_cfg 

This module contains a collection of YANG definitions
for Cisco IOS\-XR fib\-common package configuration.

This module contains definitions
for the following management objects\:
  fib\: CEF configuration

Copyright (c) 2013\-2018 by Cisco Systems, Inc.
All rights reserved.

"""
from collections import OrderedDict

from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YModelError
from ydk.errors.error_handler import handle_type_error as _handle_type_error



class FibPbtsFallback(Enum):
    """
    FibPbtsFallback (Enum Class)

    Fib pbts fallback

    .. data:: list = 1

    	Fallback to class number list

    .. data:: any = 2

    	Fallback to any class

    .. data:: drop = 3

    	Fallback to drop

    """

    list = Enum.YLeaf(1, "list")

    any = Enum.YLeaf(2, "any")

    drop = Enum.YLeaf(3, "drop")


class FibPbtsForwardClass(Enum):
    """
    FibPbtsForwardClass (Enum Class)

    Fib pbts forward class

    .. data:: any = 8

    	Any class

    """

    any = Enum.YLeaf(8, "any")



class Fib(Entity):
    """
    CEF configuration
    
    .. attribute:: pbts_forward_class_fallbacks
    
    	PBTS class configuration
    	**type**\:  :py:class:`PbtsForwardClassFallbacks <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.Fib.PbtsForwardClassFallbacks>`
    
    .. attribute:: platform
    
    	FIB platform parameters
    	**type**\:  :py:class:`Platform <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.Fib.Platform>`
    
    .. attribute:: auto_hash_recover
    
    	Set option for automatcially recovering consistent\-hashing state on interface up
    	**type**\: bool
    
    .. attribute:: prefer_aib_routes
    
    	Set options for adjacency routes overriding RIB routes
    	**type**\: bool
    
    .. attribute:: encap_sharing_disable
    
    	Set true to disable encapsulation sharing
    	**type**\: bool
    
    .. attribute:: frr_follow_bgp_pic
    
    	Set option for fast\-reroute to follow BGP PIC update, not to wait for timeout
    	**type**\: bool
    
    

    """

    _prefix = 'fib-common-cfg'
    _revision = '2017-05-01'

    def __init__(self):
        super(Fib, self).__init__()
        self._top_entity = None

        self.yang_name = "fib"
        self.yang_parent_name = "Cisco-IOS-XR-fib-common-cfg"
        self.is_top_level_class = True
        self.has_list_ancestor = False
        self.ylist_key_names = []
        self._child_classes = OrderedDict([("pbts-forward-class-fallbacks", ("pbts_forward_class_fallbacks", Fib.PbtsForwardClassFallbacks)), ("platform", ("platform", Fib.Platform))])
        self._leafs = OrderedDict([
            ('auto_hash_recover', (YLeaf(YType.boolean, 'auto-hash-recover'), ['bool'])),
            ('prefer_aib_routes', (YLeaf(YType.boolean, 'prefer-aib-routes'), ['bool'])),
            ('encap_sharing_disable', (YLeaf(YType.boolean, 'encap-sharing-disable'), ['bool'])),
            ('frr_follow_bgp_pic', (YLeaf(YType.boolean, 'frr-follow-bgp-pic'), ['bool'])),
        ])
        self.auto_hash_recover = None
        self.prefer_aib_routes = None
        self.encap_sharing_disable = None
        self.frr_follow_bgp_pic = None

        self.pbts_forward_class_fallbacks = Fib.PbtsForwardClassFallbacks()
        self.pbts_forward_class_fallbacks.parent = self
        self._children_name_map["pbts_forward_class_fallbacks"] = "pbts-forward-class-fallbacks"

        self.platform = Fib.Platform()
        self.platform.parent = self
        self._children_name_map["platform"] = "platform"
        self._segment_path = lambda: "Cisco-IOS-XR-fib-common-cfg:fib"
        self._is_frozen = True

    def __setattr__(self, name, value):
        self._perform_setattr(Fib, ['auto_hash_recover', 'prefer_aib_routes', 'encap_sharing_disable', 'frr_follow_bgp_pic'], name, value)


    class PbtsForwardClassFallbacks(Entity):
        """
        PBTS class configuration
        
        .. attribute:: pbts_forward_class_fallback
        
        	Set PBTS class for fallback
        	**type**\: list of  		 :py:class:`PbtsForwardClassFallback <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.Fib.PbtsForwardClassFallbacks.PbtsForwardClassFallback>`
        
        

        """

        _prefix = 'fib-common-cfg'
        _revision = '2017-05-01'

        def __init__(self):
            super(Fib.PbtsForwardClassFallbacks, self).__init__()

            self.yang_name = "pbts-forward-class-fallbacks"
            self.yang_parent_name = "fib"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self.ylist_key_names = []
            self._child_classes = OrderedDict([("pbts-forward-class-fallback", ("pbts_forward_class_fallback", Fib.PbtsForwardClassFallbacks.PbtsForwardClassFallback))])
            self._leafs = OrderedDict()

            self.pbts_forward_class_fallback = YList(self)
            self._segment_path = lambda: "pbts-forward-class-fallbacks"
            self._absolute_path = lambda: "Cisco-IOS-XR-fib-common-cfg:fib/%s" % self._segment_path()
            self._is_frozen = True

        def __setattr__(self, name, value):
            self._perform_setattr(Fib.PbtsForwardClassFallbacks, [], name, value)


        class PbtsForwardClassFallback(Entity):
            """
            Set PBTS class for fallback
            
            .. attribute:: forward_class_number  (key)
            
            	PBTS forward class number
            	**type**\: union of the below types:
            
            		**type**\:  :py:class:`FibPbtsForwardClass <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.FibPbtsForwardClass>`
            
            		**type**\: int
            
            			**range:** 0..8
            
            .. attribute:: fallback_type
            
            	Set PBTS fallback type
            	**type**\:  :py:class:`FibPbtsFallback <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.FibPbtsFallback>`
            
            	**mandatory**\: True
            
            .. attribute:: fallback_class_number_array
            
            	Set PBTS fallback class number array
            	**type**\: list of int
            
            	**range:** 0..7
            
            

            """

            _prefix = 'fib-common-cfg'
            _revision = '2017-05-01'

            def __init__(self):
                super(Fib.PbtsForwardClassFallbacks.PbtsForwardClassFallback, self).__init__()

                self.yang_name = "pbts-forward-class-fallback"
                self.yang_parent_name = "pbts-forward-class-fallbacks"
                self.is_top_level_class = False
                self.has_list_ancestor = False
                self.ylist_key_names = ['forward_class_number']
                self._child_classes = OrderedDict([])
                self._leafs = OrderedDict([
                    ('forward_class_number', (YLeaf(YType.str, 'forward-class-number'), [('ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg', 'FibPbtsForwardClass', ''),'int'])),
                    ('fallback_type', (YLeaf(YType.enumeration, 'fallback-type'), [('ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg', 'FibPbtsFallback', '')])),
                    ('fallback_class_number_array', (YLeafList(YType.uint32, 'fallback-class-number-array'), ['int'])),
                ])
                self.forward_class_number = None
                self.fallback_type = None
                self.fallback_class_number_array = []
                self._segment_path = lambda: "pbts-forward-class-fallback" + "[forward-class-number='" + str(self.forward_class_number) + "']"
                self._absolute_path = lambda: "Cisco-IOS-XR-fib-common-cfg:fib/pbts-forward-class-fallbacks/%s" % self._segment_path()
                self._is_frozen = True

            def __setattr__(self, name, value):
                self._perform_setattr(Fib.PbtsForwardClassFallbacks.PbtsForwardClassFallback, ['forward_class_number', 'fallback_type', 'fallback_class_number_array'], name, value)


    class Platform(Entity):
        """
        FIB platform parameters
        
        .. attribute:: label_switched_multicast
        
        	Options for label\-switched\-multicast parameters
        	**type**\:  :py:class:`LabelSwitchedMulticast <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.Fib.Platform.LabelSwitchedMulticast>`
        
        

        """

        _prefix = 'fib-common-cfg'
        _revision = '2017-05-01'

        def __init__(self):
            super(Fib.Platform, self).__init__()

            self.yang_name = "platform"
            self.yang_parent_name = "fib"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self.ylist_key_names = []
            self._child_classes = OrderedDict([("label-switched-multicast", ("label_switched_multicast", Fib.Platform.LabelSwitchedMulticast))])
            self._leafs = OrderedDict()

            self.label_switched_multicast = Fib.Platform.LabelSwitchedMulticast()
            self.label_switched_multicast.parent = self
            self._children_name_map["label_switched_multicast"] = "label-switched-multicast"
            self._segment_path = lambda: "platform"
            self._absolute_path = lambda: "Cisco-IOS-XR-fib-common-cfg:fib/%s" % self._segment_path()
            self._is_frozen = True

        def __setattr__(self, name, value):
            self._perform_setattr(Fib.Platform, [], name, value)


        class LabelSwitchedMulticast(Entity):
            """
            Options for label\-switched\-multicast parameters
            
            .. attribute:: frr_holdtime
            
            	Set time to keep FRR slots programmed post FRR
            	**type**\: int
            
            	**range:** 3..180
            
            	**units**\: second
            
            

            """

            _prefix = 'fib-common-cfg'
            _revision = '2017-05-01'

            def __init__(self):
                super(Fib.Platform.LabelSwitchedMulticast, self).__init__()

                self.yang_name = "label-switched-multicast"
                self.yang_parent_name = "platform"
                self.is_top_level_class = False
                self.has_list_ancestor = False
                self.ylist_key_names = []
                self._child_classes = OrderedDict([])
                self._leafs = OrderedDict([
                    ('frr_holdtime', (YLeaf(YType.uint32, 'frr-holdtime'), ['int'])),
                ])
                self.frr_holdtime = None
                self._segment_path = lambda: "label-switched-multicast"
                self._absolute_path = lambda: "Cisco-IOS-XR-fib-common-cfg:fib/platform/%s" % self._segment_path()
                self._is_frozen = True

            def __setattr__(self, name, value):
                self._perform_setattr(Fib.Platform.LabelSwitchedMulticast, ['frr_holdtime'], name, value)

    def clone_ptr(self):
        self._top_entity = Fib()
        return self._top_entity


[((43, 11, 43, 32), 'ydk.types.Enum.YLeaf', 'Enum.YLeaf', ({(43, 22, 43, 23): '1', (43, 25, 43, 31): '"""list"""'}, {}), "(1, 'list')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((45, 10, 45, 30), 'ydk.types.Enum.YLeaf', 'Enum.YLeaf', ({(45, 21, 45, 22): '2', (45, 24, 45, 29): '"""any"""'}, {}), "(2, 'any')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((47, 11, 47, 32), 'ydk.types.Enum.YLeaf', 'Enum.YLeaf', ({(47, 22, 47, 23): '3', (47, 25, 47, 31): '"""drop"""'}, {}), "(3, 'drop')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((62, 10, 62, 30), 'ydk.types.Enum.YLeaf', 'Enum.YLeaf', ({(62, 21, 62, 22): '8', (62, 24, 62, 29): '"""any"""'}, {}), "(8, 'any')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((116, 30, 116, 184), 'collections.OrderedDict', 'OrderedDict', ({(116, 42, 116, 183): "[('pbts-forward-class-fallbacks', ('pbts_forward_class_fallbacks', Fib.\n    PbtsForwardClassFallbacks)), ('platform', ('platform', Fib.Platform))]"}, {}), "([('pbts-forward-class-fallbacks', (\n    'pbts_forward_class_fallbacks', Fib.PbtsForwardClassFallbacks)), (\n    'platform', ('platform', Fib.Platform))])", False, 'from collections import OrderedDict\n'), ((166, 34, 166, 169), 'collections.OrderedDict', 'OrderedDict', ({(166, 46, 166, 168): "[('pbts-forward-class-fallback', ('pbts_forward_class_fallback', Fib.\n    PbtsForwardClassFallbacks.PbtsForwardClassFallback))]"}, {}), "([('pbts-forward-class-fallback', ('pbts_forward_class_fallback',\n    Fib.PbtsForwardClassFallbacks.PbtsForwardClassFallback))])", False, 'from collections import OrderedDict\n'), ((167, 26, 167, 39), 'collections.OrderedDict', 'OrderedDict', ({}, {}), '()', False, 'from collections import OrderedDict\n'), ((169, 47, 169, 58), 'ydk.types.YList', 'YList', ({(169, 53, 169, 57): 'self'}, {}), '(self)', False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((263, 34, 263, 144), 'collections.OrderedDict', 'OrderedDict', ({(263, 46, 263, 143): "[('label-switched-multicast', ('label_switched_multicast', Fib.Platform.\n    LabelSwitchedMulticast))]"}, {}), "([('label-switched-multicast', ('label_switched_multicast', Fib.\n    Platform.LabelSwitchedMulticast))])", False, 'from collections import OrderedDict\n'), ((264, 26, 264, 39), 'collections.OrderedDict', 'OrderedDict', ({}, {}), '()', False, 'from collections import OrderedDict\n'), ((222, 38, 222, 53), 'collections.OrderedDict', 'OrderedDict', ({(222, 50, 222, 52): '[]'}, {}), '([])', False, 'from collections import OrderedDict\n'), ((305, 38, 305, 53), 'collections.OrderedDict', 'OrderedDict', ({(305, 50, 305, 52): '[]'}, {}), '([])', False, 'from collections import OrderedDict\n'), ((118, 35, 118, 76), 'ydk.types.YLeaf', 'YLeaf', ({(118, 41, 118, 54): 'YType.boolean', (118, 56, 118, 75): '"""auto-hash-recover"""'}, {}), "(YType.boolean, 'auto-hash-recover')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((119, 35, 119, 76), 'ydk.types.YLeaf', 'YLeaf', ({(119, 41, 119, 54): 'YType.boolean', (119, 56, 119, 75): '"""prefer-aib-routes"""'}, {}), "(YType.boolean, 'prefer-aib-routes')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((120, 39, 120, 84), 'ydk.types.YLeaf', 'YLeaf', ({(120, 45, 120, 58): 'YType.boolean', (120, 60, 120, 83): '"""encap-sharing-disable"""'}, {}), "(YType.boolean, 'encap-sharing-disable')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((121, 36, 121, 78), 'ydk.types.YLeaf', 'YLeaf', ({(121, 42, 121, 55): 'YType.boolean', (121, 57, 121, 77): '"""frr-follow-bgp-pic"""'}, {}), "(YType.boolean, 'frr-follow-bgp-pic')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((224, 46, 224, 86), 'ydk.types.YLeaf', 'YLeaf', ({(224, 52, 224, 61): 'YType.str', (224, 63, 224, 85): '"""forward-class-number"""'}, {}), "(YType.str, 'forward-class-number')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((225, 39, 225, 80), 'ydk.types.YLeaf', 'YLeaf', ({(225, 45, 225, 62): 'YType.enumeration', (225, 64, 225, 79): '"""fallback-type"""'}, {}), "(YType.enumeration, 'fallback-type')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((226, 53, 226, 107), 'ydk.types.YLeafList', 'YLeafList', ({(226, 63, 226, 75): 'YType.uint32', (226, 77, 226, 106): '"""fallback-class-number-array"""'}, {}), "(YType.uint32, 'fallback-class-number-array')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((307, 38, 307, 73), 'ydk.types.YLeaf', 'YLeaf', ({(307, 44, 307, 56): 'YType.uint32', (307, 58, 307, 72): '"""frr-holdtime"""'}, {}), "(YType.uint32, 'frr-holdtime')", False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n')]