MCPcopy Index your code
hub / github.com/archlinux/archinstall / build_icmp

Function build_icmp

archinstall/lib/networking.py:157–163  ·  view source on GitHub ↗
(payload: bytes)

Source from the content-addressed store, hash-verified

155
156
157def build_icmp(payload: bytes) -> bytes:
158 # Define the ICMP Echo Request packet
159 icmp_packet = struct.pack('!BBHHH', 8, 0, 0, 0, 1) + payload
160
161 checksum = calc_checksum(icmp_packet)
162
163 return struct.pack('!BBHHH', 8, 0, checksum, 0, 1) + payload
164
165
166def ping(hostname: str, timeout: int = 5) -> int:

Callers 1

pingFunction · 0.85

Calls 1

calc_checksumFunction · 0.85

Tested by

no test coverage detected