[PATCH v2 4/6] Use typing to reduce chances of IPv4 endianness errors