Subject: [AVT] Endianess issue

From: B Prashanth <[email-masked]>
Date: Tue, 02 Sep 2003 17:20:54 +0530

Dear All,

As we all know that network utilities uses the following calls for 
conversion of netwwork to host order and vice versa:
ntohs and htons
ntohl and htonl
These calls work fine for the fields in the RTP and RTCP header that are 
either 8 or 16 or 32 bits long.
However, such call won't be effective when we deal with header fields 
that are of length other than the ones specified above.
For e.g. In RTCP header, the report block in a SR or RR report header 
has a 8-bit "fraction lost" field and a 24-bit  "cummulative number of 
packets lost" field. It would worth noting that there are no OS 
utilities that can do "network to host order conversion" for a 24 bit 
field of
"cummulative number of packets lost" in the SR or RR report. How does 
one handle this situation.

An early response is very much appreciated on this issue.
Thanking you in advance  

-- 
Prashanth B.P.
Sr. Design Engr.
NeoMagic Design Center.
Polyplex Building, First Floor
B-37 Sector 1
Noida 
INDIA 201301
E-Mail:  [email-masked]
Tel:     +91-120-2536205/6  Extn:4103
Fax:     +91-120-2536207

NeoMagic Corporation, based in Santa Clara, California, provides Applications Processors to enable new generations of handheld systems, offering the lowest power, smallest form-factor, and best multimedia features and performance. The company has pioneered the integration of memory, complex logic, and analog circuits into single-chip solutions. 
URL: http://www.neomagic.com.
--

---

From: "Neo Anderson" <[email-masked]>
Date: Wed, 3 Sep 2003 10:11:46 +0530

Comments inline.

>These calls work fine for the fields in the RTP and RTCP header that

>are either 8 or 16 or 32 bits long.

Yes, they are meant for 16/32 bit fields only. hence the "s" and "l"

in their names.

>However, such call won't be effective when we deal with header

>fields that are of length other than the ones specified above.

>For e.g. In RTCP header, the report block in a SR or RR report

>header has a 8-bit "fraction lost" field and a 24-bit  "cummulative

>number of packets lost" field. It would worth noting that there are

>no OS utilities that can do "network to host order conversion" for a

>24 bit field of

>"cummulative number of packets lost" in the SR or RR report. How

>does one handle this situation.

Assigning the data from the integer (the 24 bits you may be having in

a 32 bit integer, let us say), octet by octet (say by masking the 32

bit integer) to the "char buffer" you are using to send the packet on

the network is one way to handle this. Care that it shold be in n/w

byte order.

afaik, there is no standard macro/function for doing this.

--Neo
Get your own Free E-mail at Witch Wisdom http://www.witchwisdom.com
__________________
http://www.zzn.com

_______________________________________________
Audio/Video Transport Working Group
[email-masked]
https://www1.ietf.org/mailman/listinfo/avt

---

From: "Neo Anderson" <[email-masked]>
Date: Wed, 3 Sep 2003 10:11:51 +0530

Comments inline.

--Neo