Parcourir la source

[IPV4] MROUTE: Adjust include files for user-space.

<linux/mroute.h> needs <linux/types.h>.
Avoid including <linux/in.h> in user-space, which conflicts with
standard <netinet/in.h>.
Add basic struct and constant in <linux/pim.h>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
YOSHIFUJI Hideaki il y a 17 ans
Parent
commit
80a9492a33
2 fichiers modifiés avec 19 ajouts et 0 suppressions
  1. 3 0
      include/linux/mroute.h
  2. 16 0
      include/linux/pim.h

+ 3 - 0
include/linux/mroute.h

@@ -2,7 +2,10 @@
 #define __LINUX_MROUTE_H
 
 #include <linux/sockios.h>
+#include <linux/types.h>
+#ifdef __KERNEL__
 #include <linux/in.h>
+#endif
 #include <linux/pim.h>
 
 /*

+ 16 - 0
include/linux/pim.h

@@ -3,6 +3,22 @@
 
 #include <asm/byteorder.h>
 
+#ifndef __KERNEL__
+struct pim {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+	__u8	pim_type:4,		/* PIM message type */
+		pim_ver:4;		/* PIM version */
+#elif defined(__BIG_ENDIAN_BITFIELD)
+	__u8	pim_ver:4;		/* PIM version */
+		pim_type:4;		/* PIM message type */
+#endif
+	__u8	pim_rsv;		/* Reserved */
+	__be16	pim_cksum;		/* Checksum */
+};
+
+#define PIM_MINLEN		8
+#endif
+
 /* Message types - V1 */
 #define PIM_V1_VERSION		__constant_htonl(0x10000000)
 #define PIM_V1_REGISTER		1