import re


def load_mac_vendors() :
   """ parses wireshark mac address db and returns dict of mac : vendor """

   entries = {}
   f = open('mac_vendors.db', 'r')

   for lines in f.readlines() :
      entry = lines.split()
      
      # match on first column being  first six bytes
      r = re.compile(r'^([0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2})$')
      if len(entry) > 0 and r.match(entry[0]) :
         
         # lowercase as convention
         entries[entry[0].lower()] = entry[1]

   return entries