Networking Forums

Networking Forums > Computer Networking > Linux Networking > structre object question

Reply
Thread Tools Display Modes

structre object question

 
 
kernel.lover
Guest
Posts: n/a

 
      01-31-2005, 09:50 AM
Hello,
In linux kernel source etheernet header is defined as structure as
struct ethhdr
{
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
unsigned short h_proto; /* packet type ID field */
} __attribute__((packed));
I want to know what __attribute__((packed)) meance?
It is not looking as a structure object then what is thati?
regards,
cranium
 
Reply With Quote
 
 
 
 
Noah Roberts
Guest
Posts: n/a

 
      02-01-2005, 05:22 AM
kernel.lover wrote:
> Hello,
> In linux kernel source etheernet header is defined as structure as
> struct ethhdr
> {
> unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
> unsigned char h_source[ETH_ALEN]; /* source ether addr */
> unsigned short h_proto; /* packet type ID field */
> } __attribute__((packed));
> I want to know what __attribute__((packed)) meance?
> It is not looking as a structure object then what is thati?
> regards,
> cranium


Sometimes google is your friend.

http://www.google.com/search?hl=en&q...=Google+Search

searched for 'gcc packed'. Top link should help some, there are more...
 
Reply With Quote
 
jimxu
Guest
Posts: n/a

 
      02-02-2005, 02:01 AM

"kernel.lover" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hello,
> In linux kernel source etheernet header is defined as structure as
> struct ethhdr
> {
> unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
> unsigned char h_source[ETH_ALEN]; /* source ether addr */
> unsigned short h_proto; /* packet type ID field */
> } __attribute__((packed));
> I want to know what __attribute__((packed)) meance?
> It is not looking as a structure object then what is thati?
> regards,
> cranium


__attribute__((packed)) is used for different OS when sending messages.
For example:
If your ethhdr is 15 bytes, if you do not use the flag, local machine
will full fill the package to 16 bytes, and remote machine may be conflict
with it.
If you use flag __attribute__((packed)), the system will not fill the
space and the package only be sent with 15 bytes.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove DNS record when removing computer object from AD gjuan3000@gmail.com Windows Networking 1 04-27-2009 07:45 PM
Routing table data structre and functions dhina.jayavelu@gmail.com Network Routers 1 10-01-2008 06:48 PM
Stumped.......IPC object opening? pankaj_wolfhunter@yahoo.co.in Linux Networking 1 03-17-2007 02:26 AM
FRS log: No NTFRSSubscriber object found Minas Hambardzumyan Windows Networking 0 02-06-2006 02:59 PM
cannot copy files, object name no longer available elmaje Windows Networking 0 06-08-2005 04:29 PM



1 2 3 4 5 6 7 8 9 10 11