def get_mac_address_table(self):
<EOL>RE_MACTABLE_FORMAT1 = r"<STR_LIT>".format(VLAN_REGEX,<EOL>MAC_REGEX)<EOL>RE_MACTABLE_FORMAT2 = r"<STR_LIT>".format('<STR_LIT:->',<EOL>MAC_REGEX)<EOL>mac_address_table = []<EOL>command = '<STR_LIT>'<EOL>output = self.device.send_command(command) <EOL>def remove_prefix(s, prefix):<EOL><INDENT>return s[len(prefix):] if s.startswith(prefix) else s<EOL><DEDENT>def process_mac_fields(vlan, mac, mac_type, interface):<EOL><INDENT>"""<STR_LIT>"""<EOL>if mac_type.lower() in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>static = True<EOL>if vlan.lower() == '<STR_LIT:all>':<EOL><INDENT>vlan = <NUM_LIT:0><EOL><DEDENT>elif vlan == '<STR_LIT:->':<EOL><INDENT>vlan = <NUM_LIT:0><EOL><DEDENT>if interface.lower() == '<STR_LIT>' or re.search(r'<STR_LIT>', interface.lower()) orre.search(r'<STR_LIT>', interface.lower()):<EOL><INDENT>interface = '<STR_LIT>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>static = False<EOL><DEDENT>if mac_type.lower() in ['<STR_LIT>']:<EOL><INDENT>active = True<EOL><DEDENT>else:<EOL><INDENT>active = False<EOL><DEDENT>return {<EOL>'<STR_LIT>': napalm_base.helpers.mac(mac),<EOL>'<STR_LIT>': interface,<EOL>'<STR_LIT>': int(vlan),<EOL>'<STR_LIT>': static,<EOL>'<STR_LIT>': active,<EOL>'<STR_LIT>': -<NUM_LIT:1>,<EOL>'<STR_LIT>': -<NUM_LIT:1.0><EOL>}<EOL><DEDENT>output = re.split(r'<STR_LIT>', output, flags=re.M)[<NUM_LIT:1>:]<EOL>output = "<STR_LIT:\n>".join(output).strip()<EOL>output = re.sub(r"<STR_LIT>", "<STR_LIT>", output, flags=re.M)<EOL>for line in output.splitlines():<EOL><INDENT>if re.search('<STR_LIT>', line):<EOL><INDENT>continue<EOL><DEDENT>elif re.search('<STR_LIT>', line):<EOL><INDENT>continue<EOL><DEDENT>elif re.search('<STR_LIT>', line):<EOL><INDENT>continue<EOL><DEDENT>elif re.search('<STR_LIT>', line):<EOL><INDENT>continue<EOL><DEDENT>elif re.search('<STR_LIT>', line):<EOL><INDENT>continue<EOL><DEDENT>elif re.search('<STR_LIT>', line):<EOL><INDENT>continue<EOL><DEDENT>for pattern in [RE_MACTABLE_FORMAT1, RE_MACTABLE_FORMAT2]:<EOL><INDENT>if re.search(pattern, line):<EOL><INDENT>if len(line.split()) == <NUM_LIT:7>:<EOL><INDENT>vlan, mac, mac_type, _, _, _, interface = line.split()<EOL>mac_address_table.append(process_mac_fields(vlan, mac, mac_type, interface))<EOL>break<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>".format(repr(line)))<EOL><DEDENT><DEDENT>return mac_address_table<EOL>
Returns a lists of dictionaries. Each dictionary represents an entry in the MAC Address
Table, having the following keys
    * mac (string)
    * interface (string)
    * vlan (int)
    * active (boolean)
    * static (boolean)
    * moves (int)
    * last_move (float)
Format1:

Legend:
* - primary entry, G - Gateway MAC, (R) - Routed MAC, O - Overlay MAC
age - seconds since last seen,+ - primary entry using vPC Peer-Link,
(T) - True, (F) - False
   VLAN     MAC Address      Type      age     Secure NTFY Ports/SWID.SSID.LID
---------+-----------------+--------+---------+------+----+------------------
* 27       0026.f064.0000    dynamic      -       F    F    po1
* 27       001b.54c2.2644    dynamic      -       F    F    po1
* 27       0000.0c9f.f2bc    dynamic      -       F    F    po1
* 27       0026.980a.df44    dynamic      -       F    F    po1
* 16       0050.56bb.0164    dynamic      -       F    F    po2
* 13       90e2.ba5a.9f30    dynamic      -       F    F    eth1/2
* 13       90e2.ba4b.fc78    dynamic      -       F    F    eth1/1