~ubuntu-branches/ubuntu/raring/exabgp/raring

« back to all changes in this revision

Viewing changes to lib/exabgp/bgp/message/update/eor.py

  • Committer: Package Import Robot
  • Author(s): Henry-Nicolas Tourneur
  • Date: 2013-01-02 11:42:00 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20130102114200-heowva4yrqiiukc5
Tags: 3.1.1-1

* New upstream release
* Closes: #687134 debconf abuse, notice of software behavior take places under
  NEWS.Debian, not in a debconf screen, information moved accordingly.
* Closes: #693338 Japanese translation removed since debconf template is out.
* Closes: #697178 Russian translation removed since debconf template is out.
* Closes: #689533 UCF-based conf added. 
  No more manual changes to exabgp.env, thanks to Federico Ceratto.
          

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# encoding: utf-8
 
2
"""
 
3
eor.py
 
4
 
 
5
Created by Thomas Mangin on 2010-01-16.
 
6
Copyright (c) 2010-2012 Exa Networks. All rights reserved.
 
7
"""
 
8
 
 
9
from exabgp.bgp.message import Message
 
10
from exabgp.bgp.message.update.nlri.eor import RouteEOR,announcedRouteEOR
 
11
 
 
12
# =================================================================== End-Of-RIB
 
13
# not technically a different message type but easier to treat as one
 
14
 
 
15
class EOR (Message):
 
16
        TYPE = chr(0x02)  # it is an update
 
17
        PREFIX = RouteEOR.PREFIX
 
18
 
 
19
        def __init__ (self):
 
20
                self.routes = []
 
21
 
 
22
        def new (self,families):
 
23
                for afi,safi in families:
 
24
                        self.routes.append(RouteEOR(afi,safi,'announce'))
 
25
                return self
 
26
 
 
27
        def factory(self,data):
 
28
                self.routes.append(announcedRouteEOR(data))
 
29
                return self
 
30
 
 
31
        def updates (self,negociated):
 
32
                for eor in self.routes:
 
33
                        yield self._message(eor.pack())
 
34
 
 
35
        def __str__ (self):
 
36
                return 'EOR'