decoding of IPv6 fixed

This commit is contained in:
Matej Sekoranja
2014-09-02 01:23:57 +02:00
parent 45b14f1455
commit 6bd1efa313
5 changed files with 30 additions and 53 deletions

View File

@@ -17,23 +17,6 @@ using namespace epics::pvAccess;
using namespace epics::pvData;
using namespace std;
void decodeFromIPv6Address(ByteBuffer* buffer, osiSockAddr* address)
{
// IPv4 compatible IPv6 address
// first 80-bit are 0
buffer->getLong();
buffer->getShort();
// next 16-bits are 1
buffer->getShort();
// following IPv4 address in big-endian (network) byte order
in_addr_t ipv4Addr = 0;
ipv4Addr |= (uint32)buffer->getByte() << 24;
ipv4Addr |= (uint32)buffer->getByte() << 16;
ipv4Addr |= (uint32)buffer->getByte() << 8;
ipv4Addr |= (uint32)buffer->getByte() << 0;
address->ia.sin_addr.s_addr = ipv4Addr;
}
class BeaconResponseHandler : public ResponseHandler
{
public: