Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 328254 Details for
Bug 441652
dev-python/pybird-1.0.8 - class for talking to bird bgp daemon
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
patch for upstream-module to add functionallity for pulling info for specific prefixes
get_prefix_info.diff (text/plain), 1.69 KB, created by
Jens Ott
on 2012-11-03 23:07:51 UTC
(
hide
)
Description:
patch for upstream-module to add functionallity for pulling info for specific prefixes
Filename:
MIME Type:
Creator:
Jens Ott
Created:
2012-11-03 23:07:51 UTC
Size:
1.69 KB
patch
obsolete
>diff -Nur pybird-1.0.8.orig/pybird.py pybird-1.0.8/pybird.py >--- pybird-1.0.8.orig/pybird.py 2012-10-30 19:57:55.899768325 +0100 >+++ pybird-1.0.8/pybird.py 2012-10-31 10:56:08.016966188 +0100 >@@ -139,6 +139,17 @@ > rejected_routes = [item for item in announced if item['prefix'] in rejected_prefixes] > return rejected_routes > >+ def get_prefix_info(self, prefix, peer_name=None): >+ """Get route-info for specified prefix""" >+ if self.dummy: >+ return [ >+ {'prefix': '2001:db8:/32', 'as_path': '65520', 'community': '65520:79 65521:421'}, >+ ] >+ query = "show route for %s all" % prefix >+ if ( peer_name is not None): query+=" protocol %s" % peer_name >+ data = self._send_query(query) >+ return self._parse_route_data(data) >+ > > def _parse_route_data(self, data): > """Parse a blob like: >@@ -192,7 +203,9 @@ > routes.append(route_detail) > # Do not use this summary again on the next run > route_summary = None >- >+ if field_number == 8001: >+ # network not in table >+ return [] > return routes > > >@@ -495,7 +508,7 @@ > data = '' > prev_data = None > >- while (data.find("\n0000") == -1) and (data.find("\n8003") == -1) and (data.find("\n0013") == -1) and (data.find("\n9001") == -1): >+ while (data.find("\n0000") == -1) and (data.find("\n8003") == -1) and (data.find("\n0013") == -1) and (data.find("\n9001") == -1) and (data.find("\n8001") == -1): > data += sock.recv(1024) > if data == prev_data: > raise ValueError("Could not read additional data from BIRD")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 441652
:
328252
| 328254