How to use the pythonping.icmp.checksum function in pythonping

To help you get started, we’ve selected a few pythonping examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alessandromaggio / pythonping / test / test_icmp.py View on Github external
def test_checksum(self):
        """Verifies that checksum calculation is correct"""
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x00*\x01\x009TPM'),
            13421,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x01*\x01\x001PJ2'),
            21370,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x02*\x01\x006K3J'),
            16523,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x03*\x01\x00COSA'),
            17757,
github alessandromaggio / pythonping / test / test_icmp.py View on Github external
icmp.checksum(b'\x08\x00\x00\x00\x02*\x01\x006K3J'),
            16523,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x03*\x01\x00COSA'),
            17757,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\xb4$\x01\x0012344'),
            29866,
            "Checksum validation failed (odd length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00$F\x01\x00fag'),
            22533,
            "Checksum validation failed (odd length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x8cH\x01\x00random text goes here'),
            47464,
            "Checksum validation failed (odd length)"
        )
github alessandromaggio / pythonping / test / test_icmp.py View on Github external
def test_checksum(self):
        """Verifies that checksum calculation is correct"""
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x00*\x01\x009TPM'),
            13421,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x01*\x01\x001PJ2'),
            21370,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x02*\x01\x006K3J'),
            16523,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x03*\x01\x00COSA'),
            17757,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\xb4$\x01\x0012344'),
            29866,
            "Checksum validation failed (odd length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00$F\x01\x00fag'),
            22533,
github alessandromaggio / pythonping / test / test_icmp.py View on Github external
icmp.checksum(b'\x08\x00\x00\x00\x03*\x01\x00COSA'),
            17757,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\xb4$\x01\x0012344'),
            29866,
            "Checksum validation failed (odd length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00$F\x01\x00fag'),
            22533,
            "Checksum validation failed (odd length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x8cH\x01\x00random text goes here'),
            47464,
            "Checksum validation failed (odd length)"
        )
github alessandromaggio / pythonping / test / test_icmp.py View on Github external
icmp.checksum(b'\x08\x00\x00\x00\x00*\x01\x009TPM'),
            13421,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x01*\x01\x001PJ2'),
            21370,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x02*\x01\x006K3J'),
            16523,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x03*\x01\x00COSA'),
            17757,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\xb4$\x01\x0012344'),
            29866,
            "Checksum validation failed (odd length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00$F\x01\x00fag'),
            22533,
            "Checksum validation failed (odd length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x8cH\x01\x00random text goes here'),
            47464,
github alessandromaggio / pythonping / test / test_icmp.py View on Github external
icmp.checksum(b'\x08\x00\x00\x00\x01*\x01\x001PJ2'),
            21370,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x02*\x01\x006K3J'),
            16523,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x03*\x01\x00COSA'),
            17757,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\xb4$\x01\x0012344'),
            29866,
            "Checksum validation failed (odd length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00$F\x01\x00fag'),
            22533,
            "Checksum validation failed (odd length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x8cH\x01\x00random text goes here'),
            47464,
            "Checksum validation failed (odd length)"
        )
github alessandromaggio / pythonping / test / test_icmp.py View on Github external
def test_checksum(self):
        """Verifies that checksum calculation is correct"""
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x00*\x01\x009TPM'),
            13421,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x01*\x01\x001PJ2'),
            21370,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x02*\x01\x006K3J'),
            16523,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\x03*\x01\x00COSA'),
            17757,
            "Checksum validation failed (even length)"
        )
        self.assertEqual(
            icmp.checksum(b'\x08\x00\x00\x00\xb4$\x01\x0012344'),
            29866,