def get_iftable(snmp_data):
    """ Gets the interface table (if_index and interface) for a given device
        for further snmp lookups

        Args:
            snmp_data - snmp data returned by cmdgen.nextCmd() for mib = .1.3.6.1.2.1.2.2.1.2

        Returns:
            if_table - dict formatted as if:if_index
            inverse_if_table - dict formated as if_index:if

        Sample Output:
            inverse_if_table = {u'719: u'Ethernet4/29/3', u'718':u'Ethernet4/29/2'}
            if_table = {u'Ethernet4/29/3':u'719', u'Ethernet4/29/2': u'718'}
    """
    if_table = dict()
    inverse_if_table = dict()

    # Populate the if_table dict with parsed output
    for if_tuple in snmp_data:
        if_table[str(if_tuple[0][1])] = str(if_tuple[0][0]).split(".")[-1]
        inverse_if_table[str(if_tuple[0][0]).split(".")[-1]] = str(if_tuple[0][1])

    return (if_table, inverse_if_table)