def send_rev_notification(self, srev_info): # pragma: no cover req_id = self._req_id.inc() rev_not = SCIONDMsg(SCIONDRevNotification.from_values(srev_info), req_id) with closing(self._create_socket()) as socket: if not socket.send(rev_not.pack()): raise SCIONDRequestError response = self._get_response(socket, req_id, SMT.REVOCATIONREPLY) return response.p.result return None
def _handle_scmp(self, spkt): scmp_hdr = spkt.l4_hdr spkt.parse_payload() if (scmp_hdr.class_ == SCMPClass.PATH and scmp_hdr.type == SCMPPathClass.REVOKED_IF): scmp_pld = spkt.get_payload() rev_info = RevocationInfo.from_raw(scmp_pld.info.rev_info) logging.info("Received revocation for IF %d." % rev_info.p.ifID) rev_not = SCIONDRevNotification.from_values(rev_info) self.api_socket().send(rev_not.pack_full()) return ResponseRV.RETRY else: logging.error("Received SCMP error:\n%s", spkt) return ResponseRV.FAILURE
def send_rev_notification(self, rev_info): # pragma: no cover rev_not = SCIONDRevNotification.from_values(self._req_id.inc(), rev_info) with closing(self._create_socket()) as socket: if not socket.send(rev_not.pack_full()): raise SCIONDRequestError