3 \�me�[ � @ s� d dl Z d dlZd dlZd dlmZmZ d dlmZ d dlmZm Z d dl mZ d dlm Z eje�Zg g ddd �Zd d� Ze jdd d�dd� �Zdd� Zdd� Zd$dd�Zdd� Zdd� Zdd� Zdd� Zdd � Zd%d"d#�ZdS )&� N)�copy�deepcopy)�IPv4Network)�subp�util)�net_prefix_to_ipv4_mask)�SimpleTable� F)�ipv4�ipv6�hwaddr�upc C s\ t j| �}i }�xF|D �]<}d|kr,|d ng }|jd�dkrF|d nd}|td|ko\d|k�g g d�}x�|jd g �D ]�}|jd �dkr�d|kr�ttd |d � ��j�nd}|jdd�||jdd�|jdd�d�} |d j| � qv|d dkrv|jdd�} | �r$|jd� �r$| � d|jdd�� �} | |jdd�d�} |d j| � qvW |||d <