Example #1
0
 def __gen_bgpobj(self, rem):
     assert rem
     n, m, hop, met, lcprf, w, p, f = rem.groups()
     path = p.rstrip().split(' ') if p else []
     options = f.split(' ') if f else []
     return BGPRecord(
         prefix = n,
         prefix_length = m,
         next_hop_str = n,
         next_hop = ip4.str_to_int(n),
         metric = met,
         loc_prf = lcprf,
         weight = w,
         path = path,
         origin_asn = path[-1] if path else None
     )
Example #2
0
 def __get_begin_address(self):
     return ip4.str_to_int(self.prefix)