def _buildaddot(ad, drop_nodes=None):
    """Constructs a dotfile of a topology described by an advertisement rspec.  Only works on very basic GENIv3 advertisements,
  and probably has lots of broken edge cases."""
    if not drop_nodes:
        drop_nodes = []
    dot_data = []
    dda = dot_data.append
    dda('graph {')
    for node in ad.nodes:
        if node.name in drop_nodes:
            continue
        if node.available:
            dda('"%s"' % node.name)
        else:
            dda('"%s" [style=dashed]' % node.name)
    for link in ad.links:
        if not len(link.interface_refs) == 2:
            print('Link with more than 2 interfaces:')
            print(link.text)
        name_1 = link.interface_refs[0].split(':')[-2].split('+')[-1]
        name_2 = link.interface_refs[1].split(':')[-2].split('+')[-1]
        if name_1 in drop_nodes or name_2 in drop_nodes:
            continue
        dda('"%s" -- "%s"' % (name_1, name_2))
    dda('}')
    return '\n'.join(dot_data)
