def cli(self, interface='', output=None):
    if (output is None):
        if interface:
            cmd = self.cli_command[1].format(interface=interface)
        else:
            cmd = self.cli_command[0]
        out = self.device.execute(cmd)
    else:
        out = output
    p1 = re.compile('^(?P<interface>[\\w\\/\\.\\-]+) +is +(?P<enabled>[\\w\\s]+)(?: +\\S+)?, +line +protocol +is +(?P<line_protocol>\\w+)(?: *\\((?P<attribute>\\S+)\\)|( +\\, +Autostate +(?P<autostate>\\S+)))?.*$')
    p1_1 = re.compile('^(?P<interface>[\\w\\/\\.\\-]+) +is +(?P<enabled>[\\w\\s]+), +line +protocol +is +(?P<line_protocol>\\w+)( *, *(?P<attribute>[\\w\\s]+))?$')
    p2 = re.compile('^Hardware +is +(?P<type>[a-zA-Z0-9\\-\\/\\s\\+]+)(, *address +is +(?P<mac_address>[a-z0-9\\.]+) *\\(bia *(?P<phys_address>[a-z0-9\\.]+)\\))?$')
    p2_2 = re.compile('Hardware +is +(?P<type>[a-zA-Z0-9\\-\\/\\+ ]+)(?P<mac_address>.*)(?P<phys_address>.*)')
    p3 = re.compile('^Description: *(?P<description>.*)$')
    p4 = re.compile('^Secondary +Address +is +(?P<ipv4>(?P<ip>[0-9\\.]+)\\/(?P<prefix_length>[0-9]+))$')
    p5 = re.compile('^Internet +[A|a]ddress +is +(?P<ipv4>(?P<ip>[0-9\\.x]+)\\/(?P<prefix_length>[0-9]+))$')
    p6 = re.compile('^MTU +(?P<mtu>\\d+) +bytes(, +sub +MTU +(?P<sub_mtu>\\d+))?, +BW +(?P<bandwidth>[0-9]+) +Kbit(\\/sec)?(, +RxBW +[0-9]+ +Kbit(\\/sec)?)?, +DLY +(?P<delay>[0-9]+) +usec,$')
    p7 = re.compile('^reliability +(?P<reliability>[\\d\\/]+), +txload +(?P<txload>[\\d\\/]+), +rxload +(?P<rxload>[\\d\\/]+)$')
    p8 = re.compile('^Encapsulation(\\(s\\):)? +(?P<encapsulation>[\\w\\s\\.]+)(, +(?P<rest>.*))?$')
    p10 = re.compile('^Keepalive +set +\\((?P<keepalive>[0-9]+) +sec\\)$')
    p11 = re.compile('^(?P<duplex_mode>\\w+)[\\-\\s]+[d|D]uplex\\, +(?P<port_speed>[\\w\\s\\/]+|[a|A]uto-[S|s]peed|Auto (S|s)peed)(?:(?:\\, +link +type +is +(?P<link_type>\\S+))?(?:\\, *(media +type +is| )*(?P<media_type>[\\w\\/\\- ]+)?)(?: +media +type)?)?$')
    p12 = re.compile('^(input|output) +flow-control +is +(?P<receive>\\w+), +(output|input) +flow-control +is +(?P<send>\\w+)$')
    p13 = re.compile('^ARP +type: +(?P<arp_type>\\w+), +ARP +Timeout +(?P<arp_timeout>[\\w\\:\\.]+)$')
    p14 = re.compile('^Last +input +(?P<last_input>[\\w\\.\\:]+), +output +(?P<last_output>[\\w\\.\\:]+), output +hang +(?P<output_hang>[\\w\\.\\:]+)$')
    p15 = re.compile('^Members +in +this +channel: +(?P<port_channel_member_intfs>[\\w\\/\\.\\s\\,]+)$')
    p15_1 = re.compile('^No\\. +of +active +members +in +this +channel: +(?P<active_members>\\d+)$')
    p15_2 = re.compile('^Member +\\d+ +: +(?P<interface>\\S+) +, +\\S+, +\\S+$')
    p15_3 = re.compile('^No\\. +of +PF_JUMBO +supported +members +in +this +channel +: +(?P<number>\\d+)$')
    p16 = re.compile('^Last +clearing +of +\\"show +interface\\" +counters +(?P<last_clear>[\\w\\:\\.]+)$')
    p17 = re.compile('^Input +queue: +(?P<size>\\d+)\\/(?P<max>\\d+)\\/(?P<drops>\\d+)\\/(?P<flushes>\\d+) +\\(size\\/max\\/drops\\/flushes\\); +Total +output +drops: +(?P<output_drop>\\d+)$')
    p18 = re.compile('^Queueing +strategy: +(?P<queue_strategy>\\S+).*$')
    p19 = re.compile('^Output +queue: +(?P<size>\\d+)\\/(?P<max>\\d+)(?:\\/(?P<threshold>\\d+)\\/(?P<drops>\\d+))? +\\(size\\/max(?: +total\\/threshold\\/drops\\))?.*$')
    p20 = re.compile('^(?P<load_interval>[0-9\\#]+) *(?P<unit>(minute|second|minutes|seconds)) *input *rate *(?P<in_rate>[0-9]+) *bits/sec, *(?P<in_rate_pkts>[0-9]+) *packets/sec$')
    p21 = re.compile('^(?P<load_interval>[0-9\\#]+) *(minute|second|minutes|seconds) *output *rate *(?P<out_rate>[0-9]+) *bits/sec, *(?P<out_rate_pkts>[0-9]+) *packets/sec$')
    p22 = re.compile('^(?P<in_pkts>[0-9]+) +packets +input, +(?P<in_octets>[0-9]+) +bytes(?:, +(?P<in_no_buffer>[0-9]+) +no +buffer)?$')
    p23 = re.compile('^Received +(?P<in_broadcast_pkts>\\d+) +broadcasts +\\((?P<in_multicast_pkts>\\d+) *(IP)? *multicasts\\)$')
    p24 = re.compile('^(?P<in_runts>[0-9]+) *runts, *(?P<in_giants>[0-9]+) *giants, *(?P<in_throttles>[0-9]+) *throttles$')
    p25 = re.compile('^(?P<in_errors>[0-9]+) +input +errors, +(?P<in_crc_errors>[0-9]+) +CRC, +(?P<in_frame>[0-9]+) +frame, +(?P<in_overrun>[0-9]+) +overrun, +(?P<in_ignored>[0-9]+) +ignored(, *(?P<in_abort>[0-9]+) +abort)?$')
    p26 = re.compile('^(?P<in_watchdog>[0-9]+) +watchdog, +(?P<in_multicast_pkts>[0-9]+) +multicast, +(?P<in_pause_input>[0-9]+) +pause +input$')
    p27 = re.compile('^(?P<in_with_dribble>[0-9]+) +input +packets +with +dribble +condition +detected$')
    p28 = re.compile('^(?P<out_pkts>[0-9]+) +packets +output, +(?P<out_octets>[0-9]+) +bytes(?:\\, +(?P<out_underruns>[0-9]+) +underruns)?$')
    p29 = re.compile('^Received +(?P<out_broadcast_pkts>\\d+) +broadcasts +\\((?P<out_multicast_pkts>\\d+) *(IP)? *multicasts\\)$')
    p30 = re.compile('^(?P<out_errors>[0-9]+) +output +errors,( *(?P<out_collision>[0-9]+) +collisions,)? +(?P<out_interface_resets>[0-9]+) +interface +resets$')
    p31 = re.compile('^(?P<out_unknown_protocl_drops>[0-9]+) +unknown +protocol +drops$')
    p32 = re.compile('^(?P<out_babble>[0-9]+) +babbles, +(?P<out_late_collision>[0-9]+) +late +collision, +(?P<out_deferred>[0-9]+) +deferred$')
    p33 = re.compile('^(?P<out_lost_carrier>\\d+) +lost +carrier, +(?P<out_no_carrier>\\d+) +no +carrier(, +(?P<out_pause_output>\\d+) +pause +output)?$')
    p34 = re.compile('^(?P<out_buffer_failure>[0-9]+) +output +buffer +failures, +(?P<out_buffers_swapped>[0-9]+) +output +buffers +swapped +out$')
    p35 = re.compile('^Interface +is +unnumbered. +Using +address +of +(?P<unnumbered_intf>[\\w\\/\\.]+) +\\((?P<unnumbered_ip>[\\w\\.\\:]+)\\)$')
    p36 = re.compile('^(?P<maximum_active_vcs>\\d+) +maximum +active +VCs, +(?P<vcs_per_vp>\\d+) +VCs +per +VP, +(?P<current_vccs>\\d+) +current +VCCs$')
    p37 = re.compile('^VC +Auto +Creation +(?P<vc_auto_creation>\\S+)\\.$')
    p38 = re.compile('^VC +idle +disconnect +time: +(?P<vc_idle_disconnect_time>\\d+) +seconds$')
    p39 = re.compile('^(?P<key>\\S+ +CRC +errors) +: +(?P<val>\\d+)$')
    p40 = re.compile('^(?P<key>\\S+ +SAR +Timeouts) +: +(?P<val>\\d+)$')
    p41 = re.compile('^(?P<key>\\S+ +Oversized +SDUs) +: +(?P<val>\\d+)$')
    p42 = re.compile('^LCP\\s+(?P<state>\\S+)(,\\s+loopback\\s+(?P<loopback>[\\S\\s]+))?$')
    p43 = re.compile('^Base PPPoATM +(?P<base_pppoatm>\\S+)$')
    p44 = re.compile('^Vaccess\\s+status\\s+(?P<status>\\S+),\\s+loopback\\s+(?P<loopback>[\\S\\s]+)$')
    p45 = re.compile('^DTR +is +pulsed +for +(?P<dtr_pulsed>\\d+) +seconds +on +reset$')
    interface_dict = {}
    unnumbered_dict = {}
    for line in out.splitlines():
        line = line.strip()
        m = p1.match(line)
        m1 = p1_1.match(line)
        m = (m if m else m1)
        if m:
            interface = m.groupdict()['interface']
            enabled = m.groupdict()['enabled']
            line_protocol = m.groupdict()['line_protocol']
            connected = m.groupdict()['attribute']
            if m.groupdict()['autostate']:
                autostate = m.groupdict()['autostate'].lower()
            else:
                autostate = None
            if (interface not in interface_dict):
                interface_dict[interface] = {}
                interface_dict[interface]['port_channel'] = {}
                interface_dict[interface]['port_channel']['port_channel_member'] = False
            if (('administratively down' in enabled) or ('delete' in enabled)):
                interface_dict[interface]['enabled'] = False
            else:
                interface_dict[interface]['enabled'] = True
            if line_protocol:
                interface_dict[interface]['line_protocol'] = line_protocol
                interface_dict[interface]['oper_status'] = line_protocol
            if connected:
                interface_dict[interface]['connected'] = (True if (connected == 'connected') else False)
            if autostate:
                interface_dict[interface]['autostate'] = (True if (autostate == 'enabled') else False)
            continue
        m = p2.match(line)
        m1 = p2_2.match(line)
        m = (m if m else m1)
        if m:
            types = m.groupdict()['type']
            mac_address = m.groupdict()['mac_address']
            phys_address = m.groupdict()['phys_address']
            interface_dict[interface]['type'] = types
            if mac_address:
                interface_dict[interface]['mac_address'] = mac_address
            if phys_address:
                interface_dict[interface]['phys_address'] = phys_address
            continue
        m = p3.match(line)
        if m:
            description = m.groupdict()['description']
            interface_dict[interface]['description'] = description
            continue
        m = p4.match(line)
        if m:
            ip_sec = m.groupdict()['ip']
            prefix_length_sec = m.groupdict()['prefix_length']
            address_sec = m.groupdict()['ipv4']
            if ('ipv4' not in interface_dict[interface]):
                interface_dict[interface]['ipv4'] = {}
            if (address_sec not in interface_dict[interface]['ipv4']):
                interface_dict[interface]['ipv4'][address_sec] = {}
            interface_dict[interface]['ipv4'][address_sec]['ip'] = ip_sec
            interface_dict[interface]['ipv4'][address_sec]['prefix_length'] = prefix_length_sec
            interface_dict[interface]['ipv4'][address_sec]['secondary'] = True
            continue
        m = p5.match(line)
        if m:
            ip = m.groupdict()['ip']
            prefix_length = m.groupdict()['prefix_length']
            address = m.groupdict()['ipv4']
            if ('ipv4' not in interface_dict[interface]):
                interface_dict[interface]['ipv4'] = {}
            if (address not in interface_dict[interface]['ipv4']):
                interface_dict[interface]['ipv4'][address] = {}
            interface_dict[interface]['ipv4'][address]['ip'] = ip
            interface_dict[interface]['ipv4'][address]['prefix_length'] = prefix_length
            continue
        m = p6.match(line)
        if m:
            mtu = m.groupdict()['mtu']
            sub_mtu = m.groupdict().get('sub_mtu', None)
            bandwidth = m.groupdict()['bandwidth']
            if m.groupdict()['delay']:
                interface_dict[interface]['delay'] = int(m.groupdict()['delay'])
            if mtu:
                interface_dict[interface]['mtu'] = int(mtu)
            if sub_mtu:
                interface_dict[interface]['sub_mtu'] = int(sub_mtu)
            if bandwidth:
                interface_dict[interface]['bandwidth'] = int(bandwidth)
            continue
        m = p7.match(line)
        if m:
            reliability = m.groupdict()['reliability']
            txload = m.groupdict()['txload']
            rxload = m.groupdict()['rxload']
            interface_dict[interface]['reliability'] = reliability
            interface_dict[interface]['txload'] = txload
            interface_dict[interface]['rxload'] = rxload
            continue
        m = p8.match(line)
        if m:
            encapsulation = m.groupdict()['encapsulation']
            encapsulation = m.groupdict()['encapsulation'].lower()
            encapsulation = encapsulation.replace('802.1q virtual lan', 'dot1q')
            if ('encapsulations' not in interface_dict[interface]):
                interface_dict[interface]['encapsulations'] = {}
            interface_dict[interface]['encapsulations']['encapsulation'] = encapsulation
            rest = m.groupdict()['rest']
            if (not rest):
                continue
            m1 = re.compile('(Vlan +ID +(?P<first_dot1q>[0-9]+),)? *medium +is +(?P<medium>[a-z0-9]+)$').match(rest)
            m2 = re.compile('loopback +(?P<loopback>[\\w\\s]+)$').match(rest)
            m3 = re.compile('outer +ID +(?P<first>[0-9]+), +inner +ID (?P<second>[0-9]+)$').match(rest)
            m4 = re.compile('Vlan +ID +(?P<first_dot1q>\\d+).|(?:,(?P<rest>[\\s\\w]+))$').match(rest)
            if m1:
                first_dot1q = m1.groupdict()['first_dot1q']
                if first_dot1q:
                    interface_dict[interface]['encapsulations']['first_dot1q'] = first_dot1q
                interface_dict[interface]['medium'] = m.groupdict()['medium']
            elif m3:
                first_dot1q = m3.groupdict()['first']
                second_dot1q = m3.groupdict()['second']
                interface_dict[interface]['encapsulations']['first_dot1q'] = first_dot1q
                interface_dict[interface]['encapsulations']['second_dot1q'] = second_dot1q
            elif m4:
                first_dot1q = m4.groupdict()['first_dot1q']
                if first_dot1q:
                    interface_dict[interface]['encapsulations']['first_dot1q'] = first_dot1q
            continue
        m = p10.match(line)
        if m:
            keepalive = m.groupdict()['keepalive']
            if keepalive:
                interface_dict[interface]['keepalive'] = int(keepalive)
            continue
        m = p11.match(line)
        if m:
            duplex_mode = m.groupdict()['duplex_mode'].lower()
            port_speed = m.groupdict()['port_speed'].lower().replace('-speed', '')
            link_type = m.groupdict()['link_type']
            media_type = m.groupdict()['media_type']
            interface_dict[interface]['duplex_mode'] = duplex_mode
            interface_dict[interface]['port_speed'] = port_speed
            if link_type:
                interface_dict[interface]['link_type'] = link_type
                if ('auto' in link_type):
                    interface_dict[interface]['auto_negotiate'] = True
                else:
                    interface_dict[interface]['auto_negotiate'] = False
            if media_type:
                unknown = re.search('[U|u]nknown', media_type)
                if unknown:
                    interface_dict[interface]['media_type'] = 'unknown'
                else:
                    interface_dict[interface]['media_type'] = media_type
            continue
        m = p12.match(line)
        if m:
            receive = m.groupdict()['receive'].lower()
            send = m.groupdict()['send'].lower()
            if ('flow_control' not in interface_dict[interface]):
                interface_dict[interface]['flow_control'] = {}
            if ('on' in receive):
                interface_dict[interface]['flow_control']['receive'] = True
            elif (('off' in receive) or ('unsupported' in receive)):
                interface_dict[interface]['flow_control']['receive'] = False
            if ('on' in send):
                interface_dict[interface]['flow_control']['send'] = True
            elif (('off' in send) or ('unsupported' in send)):
                interface_dict[interface]['flow_control']['send'] = False
            continue
        p_cd = re.compile('^Carrier +delay +is +(?P<carrier_delay>\\d+).*$')
        m = p_cd.match(line)
        if m:
            group = m.groupdict()
            sub_dict = interface_dict.setdefault(interface, {})
            sub_dict['carrier_delay'] = int(group['carrier_delay'])
        p_cd_2 = re.compile('^Asymmetric +Carrier-Delay +(?P<type>Down|Up) +Timer +is +(?P<carrier_delay>\\d+).*$')
        m = p_cd_2.match(line)
        if m:
            group = m.groupdict()
            tp = group['type'].lower()
            sub_dict = interface_dict.setdefault(interface, {})
            if (tp == 'up'):
                sub_dict['carrier_delay_up'] = int(group['carrier_delay'])
            else:
                sub_dict['carrier_delay_down'] = int(group['carrier_delay'])
        m = p13.match(line)
        if m:
            arp_type = m.groupdict()['arp_type'].lower()
            arp_timeout = m.groupdict()['arp_timeout']
            interface_dict[interface]['arp_type'] = arp_type
            interface_dict[interface]['arp_timeout'] = arp_timeout
            continue
        m = p14.match(line)
        if m:
            last_input = m.groupdict()['last_input']
            last_output = m.groupdict()['last_output']
            output_hang = m.groupdict()['output_hang']
            interface_dict[interface]['last_input'] = last_input
            interface_dict[interface]['last_output'] = last_output
            interface_dict[interface]['output_hang'] = output_hang
            continue
        m = p15.match(line)
        if m:
            interface_dict[interface]['port_channel']['port_channel_member'] = True
            intfs = m.groupdict()['port_channel_member_intfs'].split(' ')
            intfs = [Common.convert_intf_name(i.strip()) for i in intfs]
            interface_dict[interface]['port_channel']['port_channel_member_intfs'] = intfs
            for intf in intfs:
                if (intf not in interface_dict):
                    interface_dict[intf] = {}
                if ('port_channel' not in interface_dict[intf]):
                    interface_dict[intf]['port_channel'] = {}
                interface_dict[intf]['port_channel']['port_channel_member'] = True
                interface_dict[intf]['port_channel']['port_channel_int'] = interface
            continue
        m = p15_1.match(line)
        if m:
            group = m.groupdict()
            active_members = int(group['active_members'])
            interface_dict[interface]['port_channel']['port_channel_member'] = True
            interface_dict[interface]['port_channel']['active_members'] = active_members
            continue
        m = p15_2.match(line)
        if m:
            group = m.groupdict()
            intf = group['interface']
            if ('port_channel_member_intfs' not in interface_dict[interface]['port_channel']):
                interface_dict[interface]['port_channel']['port_channel_member_intfs'] = []
            interface_dict[interface]['port_channel']['port_channel_member_intfs'].append(intf)
            continue
        m = p15_3.match(line)
        if m:
            group = m.groupdict()
            number = int(group['number'])
            interface_dict[interface]['port_channel']['num_of_pf_jumbo_supported_members'] = number
            continue
        m = p16.match(line)
        if m:
            last_clear = m.groupdict()['last_clear']
            continue
        m = p17.match(line)
        if m:
            if ('queues' not in interface_dict[interface]):
                interface_dict[interface]['queues'] = {}
            interface_dict[interface]['queues']['input_queue_size'] = int(m.groupdict()['size'])
            interface_dict[interface]['queues']['input_queue_max'] = int(m.groupdict()['max'])
            interface_dict[interface]['queues']['input_queue_drops'] = int(m.groupdict()['drops'])
            interface_dict[interface]['queues']['input_queue_flushes'] = int(m.groupdict()['flushes'])
            interface_dict[interface]['queues']['total_output_drop'] = int(m.groupdict()['output_drop'])
            continue
        m = p18.match(line)
        if m:
            if ('queues' not in interface_dict[interface]):
                interface_dict[interface]['queues'] = {}
            interface_dict[interface]['queues']['queue_strategy'] = m.groupdict()['queue_strategy']
            continue
        m = p19.match(line)
        if m:
            if ('queues' not in interface_dict[interface]):
                interface_dict[interface]['queues'] = {}
            interface_dict[interface]['queues']['output_queue_size'] = int(m.groupdict()['size'])
            interface_dict[interface]['queues']['output_queue_max'] = int(m.groupdict()['max'])
            if (m.groupdict()['threshold'] and m.groupdict()['drops']):
                interface_dict[interface]['queues']['threshold'] = int(m.groupdict()['threshold'])
                interface_dict[interface]['queues']['drops'] = int(m.groupdict()['drops'])
            continue
        m = p20.match(line)
        if m:
            load_interval = int(m.groupdict()['load_interval'])
            in_rate = int(m.groupdict()['in_rate'])
            in_rate_pkts = int(m.groupdict()['in_rate_pkts'])
            unit = m.groupdict()['unit']
            if ('minute' in unit):
                load_interval = (load_interval * 60)
            if ('counters' not in interface_dict[interface]):
                interface_dict[interface]['counters'] = {}
            if ('rate' not in interface_dict[interface]['counters']):
                interface_dict[interface]['counters']['rate'] = {}
            interface_dict[interface]['counters']['rate']['load_interval'] = load_interval
            interface_dict[interface]['counters']['rate']['in_rate'] = in_rate
            interface_dict[interface]['counters']['rate']['in_rate_pkts'] = in_rate_pkts
            if ('last_clear' not in interface_dict[interface]['counters']):
                try:
                    last_clear
                except Exception:
                    pass
                else:
                    interface_dict[interface]['counters']['last_clear'] = last_clear
            continue
        m = p21.match(line)
        if m:
            out_rate = int(m.groupdict()['out_rate'])
            out_rate_pkts = int(m.groupdict()['out_rate_pkts'])
            interface_dict[interface]['counters']['rate']['out_rate'] = out_rate
            interface_dict[interface]['counters']['rate']['out_rate_pkts'] = out_rate_pkts
            continue
        m = p22.match(line)
        if m:
            if ('counters' not in interface_dict[interface]):
                interface_dict[interface]['counters'] = {}
            interface_dict[interface]['counters']['in_pkts'] = int(m.groupdict()['in_pkts'])
            interface_dict[interface]['counters']['in_octets'] = int(m.groupdict()['in_octets'])
            if m.groupdict()['in_no_buffer']:
                interface_dict[interface]['counters']['in_no_buffer'] = int(m.groupdict()['in_no_buffer'])
            continue
        m = p23.match(line)
        if m:
            interface_dict[interface]['counters']['in_multicast_pkts'] = int(m.groupdict()['in_broadcast_pkts'])
            interface_dict[interface]['counters']['in_broadcast_pkts'] = int(m.groupdict()['in_multicast_pkts'])
            continue
        m = p24.match(line)
        if m:
            interface_dict[interface]['counters']['in_runts'] = int(m.groupdict()['in_runts'])
            interface_dict[interface]['counters']['in_giants'] = int(m.groupdict()['in_giants'])
            interface_dict[interface]['counters']['in_throttles'] = int(m.groupdict()['in_throttles'])
            continue
        m = p25.match(line)
        if m:
            interface_dict[interface]['counters']['in_errors'] = int(m.groupdict()['in_errors'])
            interface_dict[interface]['counters']['in_crc_errors'] = int(m.groupdict()['in_crc_errors'])
            interface_dict[interface]['counters']['in_frame'] = int(m.groupdict()['in_frame'])
            interface_dict[interface]['counters']['in_overrun'] = int(m.groupdict()['in_overrun'])
            interface_dict[interface]['counters']['in_ignored'] = int(m.groupdict()['in_ignored'])
            if m.groupdict()['in_abort']:
                interface_dict[interface]['counters']['in_abort'] = int(m.groupdict()['in_abort'])
            continue
        m = p26.match(line)
        if m:
            interface_dict[interface]['counters']['in_watchdog'] = int(m.groupdict()['in_watchdog'])
            interface_dict[interface]['counters']['in_multicast_pkts'] = int(m.groupdict()['in_multicast_pkts'])
            interface_dict[interface]['counters']['in_mac_pause_frames'] = int(m.groupdict()['in_pause_input'])
            continue
        m = p27.match(line)
        if m:
            interface_dict[interface]['counters']['in_with_dribble'] = int(m.groupdict()['in_with_dribble'])
            continue
        m = p28.match(line)
        if m:
            interface_dict[interface]['counters']['out_pkts'] = int(m.groupdict()['out_pkts'])
            interface_dict[interface]['counters']['out_octets'] = int(m.groupdict()['out_octets'])
            if m.groupdict()['out_underruns']:
                interface_dict[interface]['counters']['out_underruns'] = int(m.groupdict()['out_underruns'])
            continue
        m = p29.match(line)
        if m:
            interface_dict[interface]['counters']['out_broadcast_pkts'] = int(m.groupdict()['out_broadcast_pkts'])
            interface_dict[interface]['counters']['out_multicast_pkts'] = int(m.groupdict()['out_multicast_pkts'])
            continue
        m = p30.match(line)
        if m:
            interface_dict[interface]['counters']['out_errors'] = int(m.groupdict()['out_errors'])
            interface_dict[interface]['counters']['out_interface_resets'] = int(m.groupdict()['out_interface_resets'])
            if m.groupdict()['out_collision']:
                interface_dict[interface]['counters']['out_collision'] = int(m.groupdict()['out_collision'])
            continue
        m = p31.match(line)
        if m:
            interface_dict[interface]['counters']['out_unknown_protocl_drops'] = int(m.groupdict()['out_unknown_protocl_drops'])
            continue
        m = p32.match(line)
        if m:
            interface_dict[interface]['counters']['out_babble'] = int(m.groupdict()['out_babble'])
            interface_dict[interface]['counters']['out_late_collision'] = int(m.groupdict()['out_late_collision'])
            interface_dict[interface]['counters']['out_deferred'] = int(m.groupdict()['out_deferred'])
            continue
        m = p33.match(line)
        if m:
            interface_dict[interface]['counters']['out_lost_carrier'] = int(m.groupdict()['out_lost_carrier'])
            interface_dict[interface]['counters']['out_no_carrier'] = int(m.groupdict()['out_no_carrier'])
            out_pause_output = m.groupdict().get('out_pause_output', None)
            if out_pause_output:
                interface_dict[interface]['counters']['out_mac_pause_frames'] = int(m.groupdict()['out_pause_output'])
            continue
        m = p34.match(line)
        if m:
            interface_dict[interface]['counters']['out_buffer_failure'] = int(m.groupdict()['out_buffer_failure'])
            interface_dict[interface]['counters']['out_buffers_swapped'] = int(m.groupdict()['out_buffers_swapped'])
            continue
        m = p35.match(line)
        if m:
            unnumbered_dict[interface] = {}
            unnumbered_dict[interface]['unnumbered_intf'] = m.groupdict()['unnumbered_intf']
            unnumbered_dict[interface]['unnumbered_ip'] = m.groupdict()['unnumbered_ip']
            continue
        m = p36.match(line)
        if m:
            group = m.groupdict()
            maximum_active_vcs = group['maximum_active_vcs']
            vcs_per_vp = group['vcs_per_vp']
            current_vccs = group['current_vccs']
            interface_dict[interface].update({'maximum_active_vcs': maximum_active_vcs})
            interface_dict[interface].update({'vcs_per_vp': vcs_per_vp})
            interface_dict[interface].update({'current_vccs': current_vccs})
            continue
        m = p37.match(line)
        if m:
            group = m.groupdict()
            vc_auto_creation = group['vc_auto_creation']
            interface_dict[interface].update({'vc_auto_creation': vc_auto_creation})
            continue
        m = p38.match(line)
        if m:
            group = m.groupdict()
            vc_idle_disconnect_time = group['vc_idle_disconnect_time']
            interface_dict[interface].update({'vc_idle_disconnect_time': vc_idle_disconnect_time})
            continue
        m = p39.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'aal5_crc_errors': int(group['val'])})
            continue
        m = p40.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'aal5_oversized_sdus': int(group['val'])})
            continue
        m = p41.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'aal5_sar_timeouts': int(group['val'])})
            continue
        m = p42.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'lcp_state': group['state']})
            loopback = group.get('loopback', None)
            if loopback:
                interface_dict[interface].update({'lcp_loopack': loopback})
            continue
        m = p43.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'base_pppoatm': group['base_pppoatm']})
            continue
        m = p44.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'vaccess_status': group['status']})
            interface_dict[interface].update({'vaccess_loopback': group['loopback']})
            continue
        m = p45.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'dtr_pulsed': group['dtr_pulsed']})
            continue
    if (not unnumbered_dict):
        return interface_dict
    for intf in unnumbered_dict:
        unnumbered_intf = unnumbered_dict[intf]['unnumbered_intf']
        unnumbered_ip = unnumbered_dict[intf]['unnumbered_ip']
        if (unnumbered_intf in interface_dict):
            if ('ipv4' in interface_dict[unnumbered_intf]):
                for ip in interface_dict[unnumbered_intf]['ipv4']:
                    if (unnumbered_ip in ip):
                        if ('ipv4' not in interface_dict[intf]):
                            interface_dict[intf]['ipv4'] = {}
                        if (ip not in interface_dict[intf]['ipv4']):
                            interface_dict[intf]['ipv4'][ip] = {}
                        m = re.search('([\\w\\.\\:]+)\\/(\\d+)', ip)
                        interface_dict[intf]['ipv4'][ip]['ip'] = m.groups()[0]
                        interface_dict[intf]['ipv4'][ip]['prefix_length'] = m.groups()[1]
                        interface_dict[intf]['ipv4']['unnumbered'] = {}
                        interface_dict[intf]['ipv4']['unnumbered']['interface_ref'] = unnumbered_intf
    return interface_dict
def cli(self, interface=, output=None):
    if (output is None):
        if interface:
            cmd = self.cli_command[1].format(interface=interface)
        else:
            cmd = self.cli_command[0]
        out = self.device.execute(cmd)
    else:
        out = output
    p1 = re.compile('^(?P<interface>[\\w\\/\\.\\-]+) +is +(?P<enabled>[\\w\\s]+)(?: +\\S+)?, +line +protocol +is +(?P<line_protocol>\\w+)(?: *\\((?P<attribute>\\S+)\\)|( +\\, +Autostate +(?P<autostate>\\S+)))?.*$')
    p1_1 = re.compile('^(?P<interface>[\\w\\/\\.\\-]+) +is +(?P<enabled>[\\w\\s]+), +line +protocol +is +(?P<line_protocol>\\w+)( *, *(?P<attribute>[\\w\\s]+))?$')
    p2 = re.compile('^Hardware +is +(?P<type>[a-zA-Z0-9\\-\\/\\s\\+]+)(, *address +is +(?P<mac_address>[a-z0-9\\.]+) *\\(bia *(?P<phys_address>[a-z0-9\\.]+)\\))?$')
    p2_2 = re.compile('Hardware +is +(?P<type>[a-zA-Z0-9\\-\\/\\+ ]+)(?P<mac_address>.*)(?P<phys_address>.*)')
    p3 = re.compile('^Description: *(?P<description>.*)$')
    p4 = re.compile('^Secondary +Address +is +(?P<ipv4>(?P<ip>[0-9\\.]+)\\/(?P<prefix_length>[0-9]+))$')
    p5 = re.compile('^Internet +[A|a]ddress +is +(?P<ipv4>(?P<ip>[0-9\\.x]+)\\/(?P<prefix_length>[0-9]+))$')
    p6 = re.compile('^MTU +(?P<mtu>\\d+) +bytes(, +sub +MTU +(?P<sub_mtu>\\d+))?, +BW +(?P<bandwidth>[0-9]+) +Kbit(\\/sec)?(, +RxBW +[0-9]+ +Kbit(\\/sec)?)?, +DLY +(?P<delay>[0-9]+) +usec,$')
    p7 = re.compile('^reliability +(?P<reliability>[\\d\\/]+), +txload +(?P<txload>[\\d\\/]+), +rxload +(?P<rxload>[\\d\\/]+)$')
    p8 = re.compile('^Encapsulation(\\(s\\):)? +(?P<encapsulation>[\\w\\s\\.]+)(, +(?P<rest>.*))?$')
    p10 = re.compile('^Keepalive +set +\\((?P<keepalive>[0-9]+) +sec\\)$')
    p11 = re.compile('^(?P<duplex_mode>\\w+)[\\-\\s]+[d|D]uplex\\, +(?P<port_speed>[\\w\\s\\/]+|[a|A]uto-[S|s]peed|Auto (S|s)peed)(?:(?:\\, +link +type +is +(?P<link_type>\\S+))?(?:\\, *(media +type +is| )*(?P<media_type>[\\w\\/\\- ]+)?)(?: +media +type)?)?$')
    p12 = re.compile('^(input|output) +flow-control +is +(?P<receive>\\w+), +(output|input) +flow-control +is +(?P<send>\\w+)$')
    p13 = re.compile('^ARP +type: +(?P<arp_type>\\w+), +ARP +Timeout +(?P<arp_timeout>[\\w\\:\\.]+)$')
    p14 = re.compile('^Last +input +(?P<last_input>[\\w\\.\\:]+), +output +(?P<last_output>[\\w\\.\\:]+), output +hang +(?P<output_hang>[\\w\\.\\:]+)$')
    p15 = re.compile('^Members +in +this +channel: +(?P<port_channel_member_intfs>[\\w\\/\\.\\s\\,]+)$')
    p15_1 = re.compile('^No\\. +of +active +members +in +this +channel: +(?P<active_members>\\d+)$')
    p15_2 = re.compile('^Member +\\d+ +: +(?P<interface>\\S+) +, +\\S+, +\\S+$')
    p15_3 = re.compile('^No\\. +of +PF_JUMBO +supported +members +in +this +channel +: +(?P<number>\\d+)$')
    p16 = re.compile('^Last +clearing +of +\\"show +interface\\" +counters +(?P<last_clear>[\\w\\:\\.]+)$')
    p17 = re.compile('^Input +queue: +(?P<size>\\d+)\\/(?P<max>\\d+)\\/(?P<drops>\\d+)\\/(?P<flushes>\\d+) +\\(size\\/max\\/drops\\/flushes\\); +Total +output +drops: +(?P<output_drop>\\d+)$')
    p18 = re.compile('^Queueing +strategy: +(?P<queue_strategy>\\S+).*$')
    p19 = re.compile('^Output +queue: +(?P<size>\\d+)\\/(?P<max>\\d+)(?:\\/(?P<threshold>\\d+)\\/(?P<drops>\\d+))? +\\(size\\/max(?: +total\\/threshold\\/drops\\))?.*$')
    p20 = re.compile('^(?P<load_interval>[0-9\\#]+) *(?P<unit>(minute|second|minutes|seconds)) *input *rate *(?P<in_rate>[0-9]+) *bits/sec, *(?P<in_rate_pkts>[0-9]+) *packets/sec$')
    p21 = re.compile('^(?P<load_interval>[0-9\\#]+) *(minute|second|minutes|seconds) *output *rate *(?P<out_rate>[0-9]+) *bits/sec, *(?P<out_rate_pkts>[0-9]+) *packets/sec$')
    p22 = re.compile('^(?P<in_pkts>[0-9]+) +packets +input, +(?P<in_octets>[0-9]+) +bytes(?:, +(?P<in_no_buffer>[0-9]+) +no +buffer)?$')
    p23 = re.compile('^Received +(?P<in_broadcast_pkts>\\d+) +broadcasts +\\((?P<in_multicast_pkts>\\d+) *(IP)? *multicasts\\)$')
    p24 = re.compile('^(?P<in_runts>[0-9]+) *runts, *(?P<in_giants>[0-9]+) *giants, *(?P<in_throttles>[0-9]+) *throttles$')
    p25 = re.compile('^(?P<in_errors>[0-9]+) +input +errors, +(?P<in_crc_errors>[0-9]+) +CRC, +(?P<in_frame>[0-9]+) +frame, +(?P<in_overrun>[0-9]+) +overrun, +(?P<in_ignored>[0-9]+) +ignored(, *(?P<in_abort>[0-9]+) +abort)?$')
    p26 = re.compile('^(?P<in_watchdog>[0-9]+) +watchdog, +(?P<in_multicast_pkts>[0-9]+) +multicast, +(?P<in_pause_input>[0-9]+) +pause +input$')
    p27 = re.compile('^(?P<in_with_dribble>[0-9]+) +input +packets +with +dribble +condition +detected$')
    p28 = re.compile('^(?P<out_pkts>[0-9]+) +packets +output, +(?P<out_octets>[0-9]+) +bytes(?:\\, +(?P<out_underruns>[0-9]+) +underruns)?$')
    p29 = re.compile('^Received +(?P<out_broadcast_pkts>\\d+) +broadcasts +\\((?P<out_multicast_pkts>\\d+) *(IP)? *multicasts\\)$')
    p30 = re.compile('^(?P<out_errors>[0-9]+) +output +errors,( *(?P<out_collision>[0-9]+) +collisions,)? +(?P<out_interface_resets>[0-9]+) +interface +resets$')
    p31 = re.compile('^(?P<out_unknown_protocl_drops>[0-9]+) +unknown +protocol +drops$')
    p32 = re.compile('^(?P<out_babble>[0-9]+) +babbles, +(?P<out_late_collision>[0-9]+) +late +collision, +(?P<out_deferred>[0-9]+) +deferred$')
    p33 = re.compile('^(?P<out_lost_carrier>\\d+) +lost +carrier, +(?P<out_no_carrier>\\d+) +no +carrier(, +(?P<out_pause_output>\\d+) +pause +output)?$')
    p34 = re.compile('^(?P<out_buffer_failure>[0-9]+) +output +buffer +failures, +(?P<out_buffers_swapped>[0-9]+) +output +buffers +swapped +out$')
    p35 = re.compile('^Interface +is +unnumbered. +Using +address +of +(?P<unnumbered_intf>[\\w\\/\\.]+) +\\((?P<unnumbered_ip>[\\w\\.\\:]+)\\)$')
    p36 = re.compile('^(?P<maximum_active_vcs>\\d+) +maximum +active +VCs, +(?P<vcs_per_vp>\\d+) +VCs +per +VP, +(?P<current_vccs>\\d+) +current +VCCs$')
    p37 = re.compile('^VC +Auto +Creation +(?P<vc_auto_creation>\\S+)\\.$')
    p38 = re.compile('^VC +idle +disconnect +time: +(?P<vc_idle_disconnect_time>\\d+) +seconds$')
    p39 = re.compile('^(?P<key>\\S+ +CRC +errors) +: +(?P<val>\\d+)$')
    p40 = re.compile('^(?P<key>\\S+ +SAR +Timeouts) +: +(?P<val>\\d+)$')
    p41 = re.compile('^(?P<key>\\S+ +Oversized +SDUs) +: +(?P<val>\\d+)$')
    p42 = re.compile('^LCP\\s+(?P<state>\\S+)(,\\s+loopback\\s+(?P<loopback>[\\S\\s]+))?$')
    p43 = re.compile('^Base PPPoATM +(?P<base_pppoatm>\\S+)$')
    p44 = re.compile('^Vaccess\\s+status\\s+(?P<status>\\S+),\\s+loopback\\s+(?P<loopback>[\\S\\s]+)$')
    p45 = re.compile('^DTR +is +pulsed +for +(?P<dtr_pulsed>\\d+) +seconds +on +reset$')
    interface_dict = {}
    unnumbered_dict = {}
    for line in out.splitlines():
        line = line.strip()
        m = p1.match(line)
        m1 = p1_1.match(line)
        m = (m if m else m1)
        if m:
            interface = m.groupdict()['interface']
            enabled = m.groupdict()['enabled']
            line_protocol = m.groupdict()['line_protocol']
            connected = m.groupdict()['attribute']
            if m.groupdict()['autostate']:
                autostate = m.groupdict()['autostate'].lower()
            else:
                autostate = None
            if (interface not in interface_dict):
                interface_dict[interface] = {}
                interface_dict[interface]['port_channel'] = {}
                interface_dict[interface]['port_channel']['port_channel_member'] = False
            if (('administratively down' in enabled) or ('delete' in enabled)):
                interface_dict[interface]['enabled'] = False
            else:
                interface_dict[interface]['enabled'] = True
            if line_protocol:
                interface_dict[interface]['line_protocol'] = line_protocol
                interface_dict[interface]['oper_status'] = line_protocol
            if connected:
                interface_dict[interface]['connected'] = (True if (connected == 'connected') else False)
            if autostate:
                interface_dict[interface]['autostate'] = (True if (autostate == 'enabled') else False)
            continue
        m = p2.match(line)
        m1 = p2_2.match(line)
        m = (m if m else m1)
        if m:
            types = m.groupdict()['type']
            mac_address = m.groupdict()['mac_address']
            phys_address = m.groupdict()['phys_address']
            interface_dict[interface]['type'] = types
            if mac_address:
                interface_dict[interface]['mac_address'] = mac_address
            if phys_address:
                interface_dict[interface]['phys_address'] = phys_address
            continue
        m = p3.match(line)
        if m:
            description = m.groupdict()['description']
            interface_dict[interface]['description'] = description
            continue
        m = p4.match(line)
        if m:
            ip_sec = m.groupdict()['ip']
            prefix_length_sec = m.groupdict()['prefix_length']
            address_sec = m.groupdict()['ipv4']
            if ('ipv4' not in interface_dict[interface]):
                interface_dict[interface]['ipv4'] = {}
            if (address_sec not in interface_dict[interface]['ipv4']):
                interface_dict[interface]['ipv4'][address_sec] = {}
            interface_dict[interface]['ipv4'][address_sec]['ip'] = ip_sec
            interface_dict[interface]['ipv4'][address_sec]['prefix_length'] = prefix_length_sec
            interface_dict[interface]['ipv4'][address_sec]['secondary'] = True
            continue
        m = p5.match(line)
        if m:
            ip = m.groupdict()['ip']
            prefix_length = m.groupdict()['prefix_length']
            address = m.groupdict()['ipv4']
            if ('ipv4' not in interface_dict[interface]):
                interface_dict[interface]['ipv4'] = {}
            if (address not in interface_dict[interface]['ipv4']):
                interface_dict[interface]['ipv4'][address] = {}
            interface_dict[interface]['ipv4'][address]['ip'] = ip
            interface_dict[interface]['ipv4'][address]['prefix_length'] = prefix_length
            continue
        m = p6.match(line)
        if m:
            mtu = m.groupdict()['mtu']
            sub_mtu = m.groupdict().get('sub_mtu', None)
            bandwidth = m.groupdict()['bandwidth']
            if m.groupdict()['delay']:
                interface_dict[interface]['delay'] = int(m.groupdict()['delay'])
            if mtu:
                interface_dict[interface]['mtu'] = int(mtu)
            if sub_mtu:
                interface_dict[interface]['sub_mtu'] = int(sub_mtu)
            if bandwidth:
                interface_dict[interface]['bandwidth'] = int(bandwidth)
            continue
        m = p7.match(line)
        if m:
            reliability = m.groupdict()['reliability']
            txload = m.groupdict()['txload']
            rxload = m.groupdict()['rxload']
            interface_dict[interface]['reliability'] = reliability
            interface_dict[interface]['txload'] = txload
            interface_dict[interface]['rxload'] = rxload
            continue
        m = p8.match(line)
        if m:
            encapsulation = m.groupdict()['encapsulation']
            encapsulation = m.groupdict()['encapsulation'].lower()
            encapsulation = encapsulation.replace('802.1q virtual lan', 'dot1q')
            if ('encapsulations' not in interface_dict[interface]):
                interface_dict[interface]['encapsulations'] = {}
            interface_dict[interface]['encapsulations']['encapsulation'] = encapsulation
            rest = m.groupdict()['rest']
            if (not rest):
                continue
            m1 = re.compile('(Vlan +ID +(?P<first_dot1q>[0-9]+),)? *medium +is +(?P<medium>[a-z0-9]+)$').match(rest)
            m2 = re.compile('loopback +(?P<loopback>[\\w\\s]+)$').match(rest)
            m3 = re.compile('outer +ID +(?P<first>[0-9]+), +inner +ID (?P<second>[0-9]+)$').match(rest)
            m4 = re.compile('Vlan +ID +(?P<first_dot1q>\\d+).|(?:,(?P<rest>[\\s\\w]+))$').match(rest)
            if m1:
                first_dot1q = m1.groupdict()['first_dot1q']
                if first_dot1q:
                    interface_dict[interface]['encapsulations']['first_dot1q'] = first_dot1q
                interface_dict[interface]['medium'] = m.groupdict()['medium']
            elif m3:
                first_dot1q = m3.groupdict()['first']
                second_dot1q = m3.groupdict()['second']
                interface_dict[interface]['encapsulations']['first_dot1q'] = first_dot1q
                interface_dict[interface]['encapsulations']['second_dot1q'] = second_dot1q
            elif m4:
                first_dot1q = m4.groupdict()['first_dot1q']
                if first_dot1q:
                    interface_dict[interface]['encapsulations']['first_dot1q'] = first_dot1q
            continue
        m = p10.match(line)
        if m:
            keepalive = m.groupdict()['keepalive']
            if keepalive:
                interface_dict[interface]['keepalive'] = int(keepalive)
            continue
        m = p11.match(line)
        if m:
            duplex_mode = m.groupdict()['duplex_mode'].lower()
            port_speed = m.groupdict()['port_speed'].lower().replace('-speed', )
            link_type = m.groupdict()['link_type']
            media_type = m.groupdict()['media_type']
            interface_dict[interface]['duplex_mode'] = duplex_mode
            interface_dict[interface]['port_speed'] = port_speed
            if link_type:
                interface_dict[interface]['link_type'] = link_type
                if ('auto' in link_type):
                    interface_dict[interface]['auto_negotiate'] = True
                else:
                    interface_dict[interface]['auto_negotiate'] = False
            if media_type:
                unknown = re.search('[U|u]nknown', media_type)
                if unknown:
                    interface_dict[interface]['media_type'] = 'unknown'
                else:
                    interface_dict[interface]['media_type'] = media_type
            continue
        m = p12.match(line)
        if m:
            receive = m.groupdict()['receive'].lower()
            send = m.groupdict()['send'].lower()
            if ('flow_control' not in interface_dict[interface]):
                interface_dict[interface]['flow_control'] = {}
            if ('on' in receive):
                interface_dict[interface]['flow_control']['receive'] = True
            elif (('off' in receive) or ('unsupported' in receive)):
                interface_dict[interface]['flow_control']['receive'] = False
            if ('on' in send):
                interface_dict[interface]['flow_control']['send'] = True
            elif (('off' in send) or ('unsupported' in send)):
                interface_dict[interface]['flow_control']['send'] = False
            continue
        p_cd = re.compile('^Carrier +delay +is +(?P<carrier_delay>\\d+).*$')
        m = p_cd.match(line)
        if m:
            group = m.groupdict()
            sub_dict = interface_dict.setdefault(interface, {})
            sub_dict['carrier_delay'] = int(group['carrier_delay'])
        p_cd_2 = re.compile('^Asymmetric +Carrier-Delay +(?P<type>Down|Up) +Timer +is +(?P<carrier_delay>\\d+).*$')
        m = p_cd_2.match(line)
        if m:
            group = m.groupdict()
            tp = group['type'].lower()
            sub_dict = interface_dict.setdefault(interface, {})
            if (tp == 'up'):
                sub_dict['carrier_delay_up'] = int(group['carrier_delay'])
            else:
                sub_dict['carrier_delay_down'] = int(group['carrier_delay'])
        m = p13.match(line)
        if m:
            arp_type = m.groupdict()['arp_type'].lower()
            arp_timeout = m.groupdict()['arp_timeout']
            interface_dict[interface]['arp_type'] = arp_type
            interface_dict[interface]['arp_timeout'] = arp_timeout
            continue
        m = p14.match(line)
        if m:
            last_input = m.groupdict()['last_input']
            last_output = m.groupdict()['last_output']
            output_hang = m.groupdict()['output_hang']
            interface_dict[interface]['last_input'] = last_input
            interface_dict[interface]['last_output'] = last_output
            interface_dict[interface]['output_hang'] = output_hang
            continue
        m = p15.match(line)
        if m:
            interface_dict[interface]['port_channel']['port_channel_member'] = True
            intfs = m.groupdict()['port_channel_member_intfs'].split(' ')
            intfs = [Common.convert_intf_name(i.strip()) for i in intfs]
            interface_dict[interface]['port_channel']['port_channel_member_intfs'] = intfs
            for intf in intfs:
                if (intf not in interface_dict):
                    interface_dict[intf] = {}
                if ('port_channel' not in interface_dict[intf]):
                    interface_dict[intf]['port_channel'] = {}
                interface_dict[intf]['port_channel']['port_channel_member'] = True
                interface_dict[intf]['port_channel']['port_channel_int'] = interface
            continue
        m = p15_1.match(line)
        if m:
            group = m.groupdict()
            active_members = int(group['active_members'])
            interface_dict[interface]['port_channel']['port_channel_member'] = True
            interface_dict[interface]['port_channel']['active_members'] = active_members
            continue
        m = p15_2.match(line)
        if m:
            group = m.groupdict()
            intf = group['interface']
            if ('port_channel_member_intfs' not in interface_dict[interface]['port_channel']):
                interface_dict[interface]['port_channel']['port_channel_member_intfs'] = []
            interface_dict[interface]['port_channel']['port_channel_member_intfs'].append(intf)
            continue
        m = p15_3.match(line)
        if m:
            group = m.groupdict()
            number = int(group['number'])
            interface_dict[interface]['port_channel']['num_of_pf_jumbo_supported_members'] = number
            continue
        m = p16.match(line)
        if m:
            last_clear = m.groupdict()['last_clear']
            continue
        m = p17.match(line)
        if m:
            if ('queues' not in interface_dict[interface]):
                interface_dict[interface]['queues'] = {}
            interface_dict[interface]['queues']['input_queue_size'] = int(m.groupdict()['size'])
            interface_dict[interface]['queues']['input_queue_max'] = int(m.groupdict()['max'])
            interface_dict[interface]['queues']['input_queue_drops'] = int(m.groupdict()['drops'])
            interface_dict[interface]['queues']['input_queue_flushes'] = int(m.groupdict()['flushes'])
            interface_dict[interface]['queues']['total_output_drop'] = int(m.groupdict()['output_drop'])
            continue
        m = p18.match(line)
        if m:
            if ('queues' not in interface_dict[interface]):
                interface_dict[interface]['queues'] = {}
            interface_dict[interface]['queues']['queue_strategy'] = m.groupdict()['queue_strategy']
            continue
        m = p19.match(line)
        if m:
            if ('queues' not in interface_dict[interface]):
                interface_dict[interface]['queues'] = {}
            interface_dict[interface]['queues']['output_queue_size'] = int(m.groupdict()['size'])
            interface_dict[interface]['queues']['output_queue_max'] = int(m.groupdict()['max'])
            if (m.groupdict()['threshold'] and m.groupdict()['drops']):
                interface_dict[interface]['queues']['threshold'] = int(m.groupdict()['threshold'])
                interface_dict[interface]['queues']['drops'] = int(m.groupdict()['drops'])
            continue
        m = p20.match(line)
        if m:
            load_interval = int(m.groupdict()['load_interval'])
            in_rate = int(m.groupdict()['in_rate'])
            in_rate_pkts = int(m.groupdict()['in_rate_pkts'])
            unit = m.groupdict()['unit']
            if ('minute' in unit):
                load_interval = (load_interval * 60)
            if ('counters' not in interface_dict[interface]):
                interface_dict[interface]['counters'] = {}
            if ('rate' not in interface_dict[interface]['counters']):
                interface_dict[interface]['counters']['rate'] = {}
            interface_dict[interface]['counters']['rate']['load_interval'] = load_interval
            interface_dict[interface]['counters']['rate']['in_rate'] = in_rate
            interface_dict[interface]['counters']['rate']['in_rate_pkts'] = in_rate_pkts
            if ('last_clear' not in interface_dict[interface]['counters']):
                try:
                    last_clear
                except Exception:
                    pass
                else:
                    interface_dict[interface]['counters']['last_clear'] = last_clear
            continue
        m = p21.match(line)
        if m:
            out_rate = int(m.groupdict()['out_rate'])
            out_rate_pkts = int(m.groupdict()['out_rate_pkts'])
            interface_dict[interface]['counters']['rate']['out_rate'] = out_rate
            interface_dict[interface]['counters']['rate']['out_rate_pkts'] = out_rate_pkts
            continue
        m = p22.match(line)
        if m:
            if ('counters' not in interface_dict[interface]):
                interface_dict[interface]['counters'] = {}
            interface_dict[interface]['counters']['in_pkts'] = int(m.groupdict()['in_pkts'])
            interface_dict[interface]['counters']['in_octets'] = int(m.groupdict()['in_octets'])
            if m.groupdict()['in_no_buffer']:
                interface_dict[interface]['counters']['in_no_buffer'] = int(m.groupdict()['in_no_buffer'])
            continue
        m = p23.match(line)
        if m:
            interface_dict[interface]['counters']['in_multicast_pkts'] = int(m.groupdict()['in_broadcast_pkts'])
            interface_dict[interface]['counters']['in_broadcast_pkts'] = int(m.groupdict()['in_multicast_pkts'])
            continue
        m = p24.match(line)
        if m:
            interface_dict[interface]['counters']['in_runts'] = int(m.groupdict()['in_runts'])
            interface_dict[interface]['counters']['in_giants'] = int(m.groupdict()['in_giants'])
            interface_dict[interface]['counters']['in_throttles'] = int(m.groupdict()['in_throttles'])
            continue
        m = p25.match(line)
        if m:
            interface_dict[interface]['counters']['in_errors'] = int(m.groupdict()['in_errors'])
            interface_dict[interface]['counters']['in_crc_errors'] = int(m.groupdict()['in_crc_errors'])
            interface_dict[interface]['counters']['in_frame'] = int(m.groupdict()['in_frame'])
            interface_dict[interface]['counters']['in_overrun'] = int(m.groupdict()['in_overrun'])
            interface_dict[interface]['counters']['in_ignored'] = int(m.groupdict()['in_ignored'])
            if m.groupdict()['in_abort']:
                interface_dict[interface]['counters']['in_abort'] = int(m.groupdict()['in_abort'])
            continue
        m = p26.match(line)
        if m:
            interface_dict[interface]['counters']['in_watchdog'] = int(m.groupdict()['in_watchdog'])
            interface_dict[interface]['counters']['in_multicast_pkts'] = int(m.groupdict()['in_multicast_pkts'])
            interface_dict[interface]['counters']['in_mac_pause_frames'] = int(m.groupdict()['in_pause_input'])
            continue
        m = p27.match(line)
        if m:
            interface_dict[interface]['counters']['in_with_dribble'] = int(m.groupdict()['in_with_dribble'])
            continue
        m = p28.match(line)
        if m:
            interface_dict[interface]['counters']['out_pkts'] = int(m.groupdict()['out_pkts'])
            interface_dict[interface]['counters']['out_octets'] = int(m.groupdict()['out_octets'])
            if m.groupdict()['out_underruns']:
                interface_dict[interface]['counters']['out_underruns'] = int(m.groupdict()['out_underruns'])
            continue
        m = p29.match(line)
        if m:
            interface_dict[interface]['counters']['out_broadcast_pkts'] = int(m.groupdict()['out_broadcast_pkts'])
            interface_dict[interface]['counters']['out_multicast_pkts'] = int(m.groupdict()['out_multicast_pkts'])
            continue
        m = p30.match(line)
        if m:
            interface_dict[interface]['counters']['out_errors'] = int(m.groupdict()['out_errors'])
            interface_dict[interface]['counters']['out_interface_resets'] = int(m.groupdict()['out_interface_resets'])
            if m.groupdict()['out_collision']:
                interface_dict[interface]['counters']['out_collision'] = int(m.groupdict()['out_collision'])
            continue
        m = p31.match(line)
        if m:
            interface_dict[interface]['counters']['out_unknown_protocl_drops'] = int(m.groupdict()['out_unknown_protocl_drops'])
            continue
        m = p32.match(line)
        if m:
            interface_dict[interface]['counters']['out_babble'] = int(m.groupdict()['out_babble'])
            interface_dict[interface]['counters']['out_late_collision'] = int(m.groupdict()['out_late_collision'])
            interface_dict[interface]['counters']['out_deferred'] = int(m.groupdict()['out_deferred'])
            continue
        m = p33.match(line)
        if m:
            interface_dict[interface]['counters']['out_lost_carrier'] = int(m.groupdict()['out_lost_carrier'])
            interface_dict[interface]['counters']['out_no_carrier'] = int(m.groupdict()['out_no_carrier'])
            out_pause_output = m.groupdict().get('out_pause_output', None)
            if out_pause_output:
                interface_dict[interface]['counters']['out_mac_pause_frames'] = int(m.groupdict()['out_pause_output'])
            continue
        m = p34.match(line)
        if m:
            interface_dict[interface]['counters']['out_buffer_failure'] = int(m.groupdict()['out_buffer_failure'])
            interface_dict[interface]['counters']['out_buffers_swapped'] = int(m.groupdict()['out_buffers_swapped'])
            continue
        m = p35.match(line)
        if m:
            unnumbered_dict[interface] = {}
            unnumbered_dict[interface]['unnumbered_intf'] = m.groupdict()['unnumbered_intf']
            unnumbered_dict[interface]['unnumbered_ip'] = m.groupdict()['unnumbered_ip']
            continue
        m = p36.match(line)
        if m:
            group = m.groupdict()
            maximum_active_vcs = group['maximum_active_vcs']
            vcs_per_vp = group['vcs_per_vp']
            current_vccs = group['current_vccs']
            interface_dict[interface].update({'maximum_active_vcs': maximum_active_vcs})
            interface_dict[interface].update({'vcs_per_vp': vcs_per_vp})
            interface_dict[interface].update({'current_vccs': current_vccs})
            continue
        m = p37.match(line)
        if m:
            group = m.groupdict()
            vc_auto_creation = group['vc_auto_creation']
            interface_dict[interface].update({'vc_auto_creation': vc_auto_creation})
            continue
        m = p38.match(line)
        if m:
            group = m.groupdict()
            vc_idle_disconnect_time = group['vc_idle_disconnect_time']
            interface_dict[interface].update({'vc_idle_disconnect_time': vc_idle_disconnect_time})
            continue
        m = p39.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'aal5_crc_errors': int(group['val'])})
            continue
        m = p40.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'aal5_oversized_sdus': int(group['val'])})
            continue
        m = p41.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'aal5_sar_timeouts': int(group['val'])})
            continue
        m = p42.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'lcp_state': group['state']})
            loopback = group.get('loopback', None)
            if loopback:
                interface_dict[interface].update({'lcp_loopack': loopback})
            continue
        m = p43.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'base_pppoatm': group['base_pppoatm']})
            continue
        m = p44.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'vaccess_status': group['status']})
            interface_dict[interface].update({'vaccess_loopback': group['loopback']})
            continue
        m = p45.match(line)
        if m:
            group = m.groupdict()
            interface_dict[interface].update({'dtr_pulsed': group['dtr_pulsed']})
            continue
    if (not unnumbered_dict):
        return interface_dict
    for intf in unnumbered_dict:
        unnumbered_intf = unnumbered_dict[intf]['unnumbered_intf']
        unnumbered_ip = unnumbered_dict[intf]['unnumbered_ip']
        if (unnumbered_intf in interface_dict):
            if ('ipv4' in interface_dict[unnumbered_intf]):
                for ip in interface_dict[unnumbered_intf]['ipv4']:
                    if (unnumbered_ip in ip):
                        if ('ipv4' not in interface_dict[intf]):
                            interface_dict[intf]['ipv4'] = {}
                        if (ip not in interface_dict[intf]['ipv4']):
                            interface_dict[intf]['ipv4'][ip] = {}
                        m = re.search('([\\w\\.\\:]+)\\/(\\d+)', ip)
                        interface_dict[intf]['ipv4'][ip]['ip'] = m.groups()[0]
                        interface_dict[intf]['ipv4'][ip]['prefix_length'] = m.groups()[1]
                        interface_dict[intf]['ipv4']['unnumbered'] = {}
                        interface_dict[intf]['ipv4']['unnumbered']['interface_ref'] = unnumbered_intf
    return interface_dict