usr bin env python coding utf-8 ASN 49373 LPREF_TO_COMMUNITY_M AP 200

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
# -*- coding: utf-8 -*-
ASN = 49373
LPREF_TO_COMMUNITY_MAP = {200: 'FT_CUSTOMER', 190: 'FT_PEER_MSK', 180: 'FT_PEER_RUSSIA', 175: 'FT_PEER_UKRAINE', 170: 'FT_UPLINK_RUSSIA', 160: 'FT_PEER_INT', 150: 'FT_UPLINK_INT', 140: 'FT_BACKUP'}
import os
import re
import sys
RPSL = '^(import|export): (?:from|to) AS([0-9]+) ((?:[0-9]+\.){3}[0-9]+) at ((?:[0-9]+\.){3}[0-9]+)(?: action pref=([0-9]+);)? (?:accept|announce) ([\w-]+)$'
AS_SET = {}
AS_NUM = {}
def as_set_to_as_nums(as_set, as_list, as_set_list):
as_set_list.append(as_set)
for child in os.popen('whois -h whois.ripe.net %s | grep ^members:' % as_set):
child = child.strip()