Beispiel #1
0
 def _handle_pcbs_from_zk(self, pcbs):
     """
     Handles cached pcbs through ZK, passed as a list.
     """
     for pcb in pcbs:
         try:
             pcb = PathSegment.from_raw(pcb)
         except SCIONParseError as e:
             logging.error("Unable to parse raw pcb: %s", e)
             continue
         self.handle_pcb(pcb)
     logging.debug("Processed %s PCBs from ZK", len(pcbs))
Beispiel #2
0
 def process_pcbs(self, pcbs, raw=True):
     """
     Process new beacons and appends them to beacon list.
     """
     for pcb in pcbs:
         if raw:
             try:
                 pcb = PathSegment.from_raw(pcb)
             except SCIONParseError as e:
                 logging.error("Unable to parse raw pcb: %s", e)
                 continue
         if self.path_policy.check_filters(pcb):
             self._try_to_verify_beacon(pcb)
             self.handle_ext(pcb)
Beispiel #3
0
 def process_pcbs(self, pcbs, raw=True):
     """
     Process new beacons and appends them to beacon list.
     """
     count = 0
     for pcb in pcbs:
         if raw:
             try:
                 pcb = PathSegment.from_raw(pcb)
             except SCIONParseError as e:
                 logging.error("Unable to parse raw pcb: %s", e)
                 continue
         if not self._filter_pcb(pcb):
             count += 1
             continue
         self._try_to_verify_beacon(pcb)
         self.handle_ext(pcb)
     if count:
         logging.debug("Dropped %d looping Core Segment PCBs", count)