From 855bcda8119a227e45d3cc897b53db98ca334c7a Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sat, 22 Mar 2008 09:33:26 +0000 Subject: Added comment about byte ordering in TURN CHANNEL-NUMBER attribute and modified select() parameter in TURN client git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1888 74dad513-b988-da41-8d7b-12977e46ad98 --- pjnath/include/pjnath/stun_msg.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pjnath/include') diff --git a/pjnath/include/pjnath/stun_msg.h b/pjnath/include/pjnath/stun_msg.h index 15114808..5cf0f6c9 100644 --- a/pjnath/include/pjnath/stun_msg.h +++ b/pjnath/include/pjnath/stun_msg.h @@ -872,11 +872,17 @@ typedef struct pj_stun_uint_attr pj_stun_channel_number_attr; /** * Get 16bit channel number from 32bit integral value. + * Note that uint32 attributes are always stored in host byte order + * after they have been parsed from the PDU, so no need to do ntohs() + * here. */ #define PJ_STUN_GET_CH_NB(u32) ((pj_uint16_t)(u32>>16)) /** * Convert 16bit channel number into 32bit integral value. + * Note that uint32 attributes will be converted to network byte order + * when the attribute is written to packet, so no need to do htons() + * here. */ #define PJ_STUN_SET_CH_NB(chnum) (((pj_uint32_t)chnum) << 16) -- cgit v1.2.3