Thread: Where are network protocol structs defined?

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    127

    Where are network protocol structs defined?

    Can anyone tell me what headers I need to include to use struct iphdr and struct tcphdr?

    Thanks.

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    127
    If google had been any help, I wouldn't have posted. I just ended up defining them myself from the linux definitions.

  4. #4
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by homer_3 View Post
    If google had been any help, I wouldn't have posted. I just ended up defining them myself from the linux definitions.
    if google is of no help - maybe problem is not in google, but in a user?

    most links specify that required include is ip.h

    on my system it is located in /usr/include/linux/ip.h

    after including this file - iphdr struct was recognized by compiler. so google was right this time...
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linker error (?)
    By aosmith in forum C++ Programming
    Replies: 14
    Last Post: 03-18-2010, 04:19 PM
  2. Replies: 5
    Last Post: 02-27-2010, 03:20 AM
  3. EDCF protocol in Network simulation program
    By linux_007 in forum C++ Programming
    Replies: 0
    Last Post: 04-12-2009, 03:04 PM
  4. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 01:58 PM
  5. Header files
    By borland_man in forum C++ Programming
    Replies: 14
    Last Post: 02-22-2002, 04:30 AM