コード例 #1
0
ファイル: test_stun.py プロジェクト: konomae/stunpy
 def test_read_mapped_address_xor(self):
     attr_type = '\x00\x20'
     attr_body = '\x00\x01%\xc0\xe1\xba\xafC'
     attr_len = 8
     mapped_address = stun.read_mapped_address(attr_type, attr_body, attr_len)
     self.assertEqual(
         dict(ip='192.168.11.1', port=1234, family='IPv4', name='XOR-MAPPED-ADDRESS'),
         mapped_address
     )
コード例 #2
0
ファイル: test_stun.py プロジェクト: konomae/stunpy
 def test_read_mapped_address(self):
     attr_type = '\x00\x01'
     attr_body = '\x00\x01\x04\xd2\xc0\xa8\x0b\x01'
     attr_len = 8
     mapped_address = stun.read_mapped_address(attr_type, attr_body, attr_len)
     self.assertEqual(
         dict(ip='192.168.11.1', port=1234, family='IPv4', name='MAPPED-ADDRESS'),
         mapped_address
     )
コード例 #3
0
ファイル: test_stun.py プロジェクト: klachhani/stunpy
 def test_read_mapped_address_xor(self):
     attr_type = '\x00\x20'
     attr_body = '\x00\x01%\xc0\xe1\xba\xafC'
     attr_len = 8
     mapped_address = stun.read_mapped_address(attr_type, attr_body,
                                               attr_len)
     self.assertEqual(
         dict(ip='192.168.11.1',
              port=1234,
              family='IPv4',
              name='XOR-MAPPED-ADDRESS'), mapped_address)
コード例 #4
0
ファイル: test_stun.py プロジェクト: klachhani/stunpy
 def test_read_mapped_address(self):
     attr_type = '\x00\x01'
     attr_body = '\x00\x01\x04\xd2\xc0\xa8\x0b\x01'
     attr_len = 8
     mapped_address = stun.read_mapped_address(attr_type, attr_body,
                                               attr_len)
     self.assertEqual(
         dict(ip='192.168.11.1',
              port=1234,
              family='IPv4',
              name='MAPPED-ADDRESS'), mapped_address)