LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2005, 09:57 AM   #1
Quest101
LQ Newbie
 
Registered: Nov 2004
Posts: 27

Rep: Reputation: 15
Header compression


Hi right now I am trying to compress Real time protocol (RTP) headers ( which are attached to packets. I created a struct :

struct cRTPHeader
{

u_int32_t timestamp ;
u_int16_t sequencenumber ;
};

when i used the function sizeof (cRTPHeader) i get the size to be 8 bytes , however i actually expect 6 bytes based on 32bits + 16bits = 6 Bytes
| |
| |
int32 int16

Is there something wrong with my logic or is there something i should know about the sizeof() function

Thanx in Advance
 
Old 01-27-2005, 12:46 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
The system seems to round structs to the next power of 2 size. Not sure if they are really allocated in memory that way or not. I'm going to look into this some myself.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
H263 Compression maldini1010 Linux - Software 0 01-12-2005 04:38 PM
RTP header compression Quest101 Linux - Networking 0 01-03-2005 11:18 AM
compression oldstinkyfish Linux - Software 2 12-02-2004 02:53 PM
best compression drigz Linux - Software 2 06-05-2004 07:38 AM
c header files in linux in place of header files in windows? harun_acs Programming 1 03-17-2004 02:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration