as20766.epy 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. aut-num: AS20766
  2. as-name: GITOYEN-MAIN-AS
  3. descr: The main Autonomous System of Gitoyen (Paris, France).
  4. admin-c: GI1036-RIPE
  5. tech-c: GI1036-RIPE
  6. notify: noc@gitoyen.net
  7. mnt-by: Gitoyen-NCC
  8. remarks: --
  9. remarks: Open peering policy: just ask peering@gitoyen.net
  10. remarks: --
  11. remarks: Technical problems or questions: noc@gitoyen.net
  12. remarks: --
  13. remarks: Looking Glass: http://lookinglass.gitoyen.net/
  14. remarks: --
  15. <:from time import *:>changed: noc@gitoyen.net <:strftime("%Y%m%d", localtime(time())):>
  16. source: RIPE
  17. import: from AS6461
  18. action pref=100;
  19. accept ANY
  20. export: to AS6461
  21. announce AS-GITOYEN
  22. remarks: IELO
  23. import: from AS29075
  24. action pref=1400;
  25. accept AS-IELO
  26. export: to AS29075
  27. announce ANY
  28. remarks: INFOCLIP
  29. import: from AS24776
  30. action pref=1400;
  31. accept AS-INFOCLIP
  32. export: to AS24776
  33. announce ANY
  34. remarks: MWSP
  35. import: from AS39180
  36. action pref=1400;
  37. accept AS-MWSP
  38. export: to AS39180
  39. announce ANY
  40. remarks: TALESSA
  41. import: from AS31553
  42. action pref=1400;
  43. accept AS-TALESSA
  44. export: to AS31553
  45. announce ANY
  46. remarks: CURSYS
  47. import: from AS39389
  48. action pref=1400;
  49. accept ANY
  50. export: to AS39389
  51. announce ANY
  52. remarks: DRI
  53. import: from AS6738
  54. action pref=1400;
  55. accept ANY
  56. export: to AS6738
  57. announce ANY
  58. remarks: NOMOTECH
  59. import: from AS39886
  60. action pref=1400;
  61. accept ANY
  62. export: to AS39886
  63. announce ANY
  64. remarks: LINAGORA
  65. import: from AS50665
  66. action pref=1400;
  67. accept ANY
  68. export: to AS50665
  69. announce ANY
  70. <:
  71. from xml.dom.minidom import parse
  72. from xml.dom import Node
  73. peersfile = "/usr/local/gitoyen-peers/peers.xml"
  74. neighbors = {}
  75. def visit(node):
  76. if node.nodeType == Node.ELEMENT_NODE:
  77. if node.nodeName == "peer":
  78. neighbor = {}
  79. for element in node.childNodes:
  80. if element.nodeName == "name":
  81. neighbor["name"] = element.childNodes[0].nodeValue
  82. elif element.nodeName == "as":
  83. neighbor["as"] = element.childNodes[0].nodeValue
  84. elif element.nodeName == "as-set":
  85. neighbor["as-set"] = element.childNodes[0].nodeValue
  86. if (not neighbors.has_key(neighbor["name"])):
  87. neighbors[neighbor["name"]] = neighbor
  88. return None
  89. tree = parse(peersfile)
  90. for peer in tree.documentElement.childNodes:
  91. visit(peer)
  92. for name in neighbors.keys():
  93. peer = neighbors[name]
  94. print "import: from AS" + str(peer["as"])
  95. print " action pref=100;"
  96. if (peer.has_key("as-set")):
  97. print " accept AS-" + str(peer["as-set"])
  98. else:
  99. print " accept AS" + str(peer["as"])
  100. print "export: to AS" + str(peer["as"])
  101. print " announce AS-GITOYEN"
  102. :>