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)
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)
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()
def __init__ (self, afi, safi, nlris): Family.__init__(self,afi,safi) # all the routes must have the same next-hop self.nlris = nlris
def __init__(self, afi, safi, nlris): Family.__init__(self, afi, safi) self.nlris = nlris
def __init__(self, afi, safi, nlris): Family.__init__(self, afi, safi) # all the routes must have the same next-hop self.nlris = nlris
def __init__ (self, afi, safi, action=OUT.UNSET): Family.__init__(self,afi,safi) self.action = action
def __init__ (self, afi, safi, nlris): Family.__init__(self,afi,safi) self.nlris = nlris
def index(self): return Family.index(self) + self.pack_nlri()
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()