예제 #1
0
    def api_eor(self, command):
        tokens = formated(command).split(' ')[2:]
        number = len(tokens)

        if not number:
            return Family(1, 1)

        if number != 2:
            return False

        afi = AFI.fromString(tokens[0])
        if afi == AFI.undefined:
            return False

        safi = SAFI.fromString(tokens[1])
        if safi == SAFI.undefined:
            return False

        return Family(afi, safi)
예제 #2
0
	def parse_api_eor (self,command):
		tokens = formated(command).split(' ')[2:]
		lt = len(tokens)

		if not lt:
			return Family(1,1)

		if lt !=2:
			return False

		afi = AFI.fromString(tokens[0])
		if afi == AFI.undefined:
			return False

		safi = SAFI.fromString(tokens[1])
		if safi == SAFI.undefined:
			return False

		return Family(afi,safi)
예제 #3
0
 def index(self, negotiated=None):
     addpath = b'no-pi' if self.path_info is PathInfo.NOPATH else self.path_info.pack()
     mask = bytes([self.cidr.mask])
     return Family.index(self) + addpath + mask + self.cidr.pack_ip()
예제 #4
0
	def __init__ (self, afi, safi, nlris):
		Family.__init__(self,afi,safi)
		# all the routes must have the same next-hop
		self.nlris = nlris
예제 #5
0
 def __init__(self, afi, safi, nlris):
     Family.__init__(self, afi, safi)
     self.nlris = nlris
예제 #6
0
 def __init__(self, afi, safi, nlris):
     Family.__init__(self, afi, safi)
     # all the routes must have the same next-hop
     self.nlris = nlris
예제 #7
0
파일: nlri.py 프로젝트: cys3c/exabgp
	def __init__ (self, afi, safi, action=OUT.UNSET):
		Family.__init__(self,afi,safi)
		self.action = action
예제 #8
0
파일: mpurnlri.py 프로젝트: yokoi-h/exabgp
	def __init__ (self, afi, safi, nlris):
		Family.__init__(self,afi,safi)
		self.nlris = nlris
예제 #9
0
파일: nlri.py 프로젝트: CadeLaRen/exabgp
	def __init__ (self, afi, safi, action=OUT.UNSET):
		Family.__init__(self,afi,safi)
		self.action = action
예제 #10
0
파일: nlri.py 프로젝트: nnvai47/exabgp
 def index(self):
     return Family.index(self) + self.pack_nlri()
예제 #11
0
 def index(self):
     addpath = b'no-pi' if self.path_info is PathInfo.NOPATH else self.path_info.pack()
     return Family.index(self) + addpath + self.cidr.pack_nlri()