as20766.epy.out 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. aut-num: AS20766
  2. as-name: GITOYEN-MAIN-AS
  3. descr: The main Autonomous System of Gitoyen (Paris, France).
  4. import: from AS1299
  5. action pref=100;
  6. accept ANY
  7. import: from AS6461
  8. action pref=100;
  9. accept ANY
  10. export: to AS1299
  11. announce AS-GITOYEN
  12. export: to AS6461
  13. announce AS-GITOYEN
  14. admin-c: SB4267-RIPE
  15. admin-c: FC2409-RIPE
  16. admin-c: PB401
  17. tech-c: GI1036-RIPE
  18. notify: noc@gitoyen.net
  19. mnt-by: Gitoyen-NCC
  20. remarks: --
  21. remarks: Open peering policy: just ask peering@gitoyen.net
  22. remarks: --
  23. remarks: Technical problems or questions: noc@gitoyen.net
  24. remarks: --
  25. remarks: Looking Glass: http://lookinglass.gitoyen.net/
  26. remarks: --
  27. changed: noc@gitoyen.net 20020122
  28. 1011734868.7.
  29. <python>
  30. from xml.dom.ext.reader import Sax
  31. from xml.dom import Node
  32. peersfile = "/usr/local/gitoyen-peers/peers.xml"
  33. neighbors = {}
  34. def visit(node):
  35. if node.nodeType == Node.ELEMENT_NODE:
  36. if node.nodeName == "peer":
  37. neighbor = {}
  38. for element in node.childNodes:
  39. if element.nodeName == "name":
  40. neighbor["name"] = element.childNodes[0].nodeValue
  41. elif element.nodeName == "as":
  42. neighbor["as"] = element.childNodes[0].nodeValue
  43. elif element.nodeName == "as-set":
  44. neighbor["as-set"] = element.childNodes[0].nodeValue
  45. if (not neighbors.has_key(neighbor["name"])):
  46. neighbors[neighbor["name"]] = neighbor
  47. return None
  48. if __name__ == '__main__':
  49. tree = Sax.FromXmlFile(peersfile)
  50. for peer in tree.documentElement.childNodes:
  51. visit(peer)
  52. for name in neighbors.keys():
  53. peer = neighbors[name]
  54. print "import: from AS" + str(peer["as"])
  55. print " action pref=100;"
  56. if (peer.has_key("as-set")):
  57. print " accept AS-" + str(peer["as-set"])
  58. else:
  59. print " accept AS" + str(peer["as"])
  60. print "export: to AS" + str(peer["as"])
  61. print " announce AS-GITOYEN"
  62. </python>