Exemple #1
0
    0x75, 0x18, 0x67, 0x5, 0x74, 0x18, 0x67, 0x3, 0x10, 0x13, 0x65, 0x37, 0xc0,
    0x11, 0x65, 0x32, 0x80, 0x18, 0x65, 0x0, 0x1f, 0x18, 0x65, 0x0, 0x1e, 0x18,
    0x65, 0x0, 0x1d, 0x18, 0x65, 0x0, 0x1c, 0xf, 0x24, 0x2, 0x11, 0x1b, 0x79,
    0x80, 0x13, 0x1b, 0x60, 0x20, 0x15, 0x1b, 0x60, 0x10, 0x10, 0x1, 0x15,
    0x16, 0x1, 0x0, 0x1c, 0x17, 0x1, 0x0, 0x1a
]

route = header + body

from StringIO import StringIO
from exabgp.reactor.protocol import Protocol
from exabgp.reactor.peer import Peer
from exabgp.bgp.neighbor import Neighbor


class Connection(StringIO):
    def pending(self, **argv):
        return True


cnx = Connection(''.join([chr(_) for _ in route]))
neibor = Neighbor()
peer = Peer(neibor, None)

#import pdb
#pdb.set_trace()

proto = Protocol(peer, cnx)
proto._asn4 = True
print proto.UpdateFactory(body)