Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Help to understand.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="sfinktah" data-source="post: 1214360" data-attributes="member: 197481"><p>Since this was the first thing that popped up in google when I tried to solve the same problem, I have included the answer:</p><p></p><p>Just define the structure yourself.</p><p></p><p><strong>osx_compat.h</strong></p><p>[code] </p><p>struct iphdr </p><p> { </p><p>#if __BYTE_ORDER == __LITTLE_ENDIAN</p><p> unsigned int ihl:4;</p><p> unsigned int version:4;</p><p>#elif __BYTE_ORDER == __BIG_ENDIAN</p><p> unsigned int version:4;</p><p> unsigned int ihl:4;</p><p>#else</p><p># error "Please fix <bits/endian.h>"</p><p>#endif</p><p> u_int8_t tos;</p><p> u_int16_t tot_len;</p><p> u_int16_t id;</p><p> u_int16_t frag_off;</p><p> u_int8_t ttl;</p><p> u_int8_t protocol;</p><p> u_int16_t check;</p><p> u_int32_t saddr;</p><p> u_int32_t daddr;</p><p> /*The options start here. */</p><p> };[/code]</p></blockquote><p></p>
[QUOTE="sfinktah, post: 1214360, member: 197481"] Since this was the first thing that popped up in google when I tried to solve the same problem, I have included the answer: Just define the structure yourself. [b]osx_compat.h[/b] [code] struct iphdr { #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int ihl:4; unsigned int version:4; #elif __BYTE_ORDER == __BIG_ENDIAN unsigned int version:4; unsigned int ihl:4; #else # error "Please fix <bits/endian.h>" #endif u_int8_t tos; u_int16_t tot_len; u_int16_t id; u_int16_t frag_off; u_int8_t ttl; u_int8_t protocol; u_int16_t check; u_int32_t saddr; u_int32_t daddr; /*The options start here. */ };[/code] [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Help to understand.
Top