MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / stop

Method stop

traffic_analyzer.py:552–572  ·  view source on GitHub ↗

Stop traffic capture and analysis

(self)

Source from the content-addressed store, hash-verified

550 gateways.add(match.group(1))
551 except Exception as e:
552 logger.debug(f"Gateway detection error: {e}")
553 if gateways:
554 logger.info(f"Default gateway(s) (port-scan exempt): {gateways}")
555 return gateways
556
557 def _derive_lan_networks(self) -> List[ipaddress.IPv4Network]:
558 nets: set = set()
559 candidates: set = set()
560 candidates.update(getattr(self, '_local_ips', set()) or set())
561 candidates.update(getattr(self, '_gateway_ips', set()) or set())
562 for ip in candidates:
563 try:
564 addr = ipaddress.IPv4Address(ip)
565 except (ValueError, ipaddress.AddressValueError):
566 continue
567 if addr.is_loopback or addr.is_link_local or addr.is_multicast:
568 continue
569 try:
570 net = ipaddress.IPv4Network(
571 f"{ip}/{self.PASSIVE_LAN_PREFIX}", strict=False)
572 nets.add(net)
573 except (ValueError, ipaddress.NetmaskValueError):
574 continue
575 result = sorted(nets, key=lambda n: int(n.network_address))

Callers 1

_stop_sidecarsMethod · 0.45

Calls 6

_stop_sidecarsMethod · 0.95
debugMethod · 0.80
errorMethod · 0.80
killMethod · 0.80
infoMethod · 0.80
waitMethod · 0.45

Tested by

no test coverage detected