aboutsummaryrefslogtreecommitdiffstats
path: root/libc/include/netinet/udp.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/include/netinet/udp.h')
-rw-r--r--libc/include/netinet/udp.h36
1 files changed, 19 insertions, 17 deletions
diff --git a/libc/include/netinet/udp.h b/libc/include/netinet/udp.h
index d4eb36806..25e0dfca9 100644
--- a/libc/include/netinet/udp.h
+++ b/libc/include/netinet/udp.h
@@ -25,29 +25,31 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-
#ifndef _NETINET_UDP_H
#define _NETINET_UDP_H
-#include <sys/types.h>
+/*
+ * We would include linux/udp.h, but it brings in too much other stuff
+ */
+
+#ifdef __FAVOR_BSD
-#include <linux/udp.h>
+struct udphdr {
+ u_int16_t uh_sport; /* source port */
+ u_int16_t uh_dport; /* destination port */
+ u_int16_t uh_ulen; /* udp length */
+ u_int16_t uh_sum; /* udp checksum */
+};
+
+#else
struct udphdr {
- __extension__ union {
- struct /* BSD names */ {
- u_int16_t uh_sport;
- u_int16_t uh_dport;
- u_int16_t uh_ulen;
- u_int16_t uh_sum;
- };
- struct /* Linux names */ {
- u_int16_t source;
- u_int16_t dest;
- u_int16_t len;
- u_int16_t check;
- };
- };
+ __u16 source;
+ __u16 dest;
+ __u16 len;
+ __u16 check;
};
+#endif /* __FAVOR_BSD */
+
#endif /* _NETINET_UDP_H */