mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:09:52 +02:00
fix use of htonl in constant outside function
This commit is contained in:
parent
90e189b425
commit
4bbb59be72
1 changed files with 5 additions and 1 deletions
|
@ -309,7 +309,7 @@ void NodeList::setNodeTypesOfInterest(const char* nodeTypesOfInterest, int numNo
|
||||||
_nodeTypesOfInterest[numNodeTypesOfInterest] = '\0';
|
_nodeTypesOfInterest[numNodeTypesOfInterest] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t RFC_5389_MAGIC_COOKIE_NETWORK_ORDER = htonl(0x2112A442);
|
const uint32_t RFC_5389_MAGIC_COOKIE = 0x2112A442;
|
||||||
const int NUM_BYTES_STUN_HEADER = 20;
|
const int NUM_BYTES_STUN_HEADER = 20;
|
||||||
|
|
||||||
void NodeList::sendSTUNRequest() {
|
void NodeList::sendSTUNRequest() {
|
||||||
|
@ -320,6 +320,8 @@ void NodeList::sendSTUNRequest() {
|
||||||
|
|
||||||
int packetIndex = 0;
|
int packetIndex = 0;
|
||||||
|
|
||||||
|
const uint32_t RFC_5389_MAGIC_COOKIE_NETWORK_ORDER = htonl(RFC_5389_MAGIC_COOKIE);
|
||||||
|
|
||||||
// leading zeros + message type
|
// leading zeros + message type
|
||||||
const uint16_t REQUEST_MESSAGE_TYPE = htons(0x0001);
|
const uint16_t REQUEST_MESSAGE_TYPE = htons(0x0001);
|
||||||
memcpy(stunRequestPacket + packetIndex, &REQUEST_MESSAGE_TYPE, sizeof(REQUEST_MESSAGE_TYPE));
|
memcpy(stunRequestPacket + packetIndex, &REQUEST_MESSAGE_TYPE, sizeof(REQUEST_MESSAGE_TYPE));
|
||||||
|
@ -364,6 +366,8 @@ void NodeList::processSTUNResponse(unsigned char* packetData, size_t dataBytes)
|
||||||
const int NUM_BYTES_MESSAGE_TYPE_AND_LENGTH = 4;
|
const int NUM_BYTES_MESSAGE_TYPE_AND_LENGTH = 4;
|
||||||
const uint16_t XOR_MAPPED_ADDRESS_TYPE = htons(0x0020);
|
const uint16_t XOR_MAPPED_ADDRESS_TYPE = htons(0x0020);
|
||||||
|
|
||||||
|
const uint32_t RFC_5389_MAGIC_COOKIE_NETWORK_ORDER = htonl(RFC_5389_MAGIC_COOKIE);
|
||||||
|
|
||||||
int attributeStartIndex = NUM_BYTES_STUN_HEADER;
|
int attributeStartIndex = NUM_BYTES_STUN_HEADER;
|
||||||
|
|
||||||
if (memcmp(packetData + NUM_BYTES_MESSAGE_TYPE_AND_LENGTH,
|
if (memcmp(packetData + NUM_BYTES_MESSAGE_TYPE_AND_LENGTH,
|
||||||
|
|
Loading…
Reference in a new issue