patch-2.1.15 linux/include/linux/in.h

Next file: linux/include/linux/interrupt.h
Previous file: linux/include/linux/igmp.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.14/linux/include/linux/in.h linux/include/linux/in.h
@@ -45,6 +45,40 @@
 	__u32	s_addr;
 };
 
+#define IP_TOS		1
+#define IP_TTL		2
+#define IP_HDRINCL	3
+#define IP_OPTIONS	4
+#define IP_LOCALADDR	5
+#define IP_RECVOPTS	6
+#define IP_RETOPTS	7
+#define IP_LOCALDEV	8
+#define IP_RECVDSTADDR  9
+#define IP_PMTUDISC	10
+#define IP_RECVERR	11
+
+/* BSD compatibility */
+#define IP_RECVRETOPTS	IP_RETOPTS
+
+/* IP_PMTUDISC values */
+#define IP_PMTUDISC_WANT		0	/* Use per route hints	*/
+#define IP_PMTUDISC_DONT		1	/* Never send DF frames */
+#define IP_PMTUDISC_DO			2	/* Always DF		*/
+
+#define IP_MULTICAST_IF			32
+#define IP_MULTICAST_TTL 		33
+#define IP_MULTICAST_LOOP 		34
+#define IP_ADD_MEMBERSHIP		35
+#define IP_DROP_MEMBERSHIP		36
+#define IP_MULTICAST_IFN		37
+#define IP_ADD_MEMBERSHIPN		38
+#define IP_DROP_MEMBERSHIPN		39
+
+/* These need to appear somewhere around here */
+#define IP_DEFAULT_MULTICAST_TTL        1
+#define IP_DEFAULT_MULTICAST_LOOP       1
+#define IP_MAX_MEMBERSHIPS              20
+
 /* Request struct for multicast socket ops */
 
 struct ip_mreq 
@@ -53,6 +87,16 @@
 	struct in_addr imr_interface;	/* local IP address of interface */
 };
 
+struct ip_mreqn
+{
+	struct in_addr	imr_multiaddr;		/* IP multicast address of group */
+	struct in_addr	imr_address;		/* local IP address of interface */
+#if 1
+	char		imr_interface[16];
+#else
+	int		imr_ifindex;		/* Interface index */
+#endif
+};
 
 /* Structure describing an Internet (IP) socket address. */
 #define __SOCK_SIZE__	16		/* sizeof(struct sockaddr)	*/
@@ -94,8 +138,8 @@
 #define	IN_MULTICAST(a)		IN_CLASSD(a)
 #define IN_MULTICAST_NET	0xF0000000
 
-#define	IN_EXPERIMENTAL(a)	((((long int) (a)) & 0xe0000000) == 0xe0000000)
-#define	IN_BADCLASS(a)		((((long int) (a)) & 0xf0000000) == 0xf0000000)
+#define	IN_EXPERIMENTAL(a)	((((long int) (a)) & 0xf0000000) == 0xf0000000)
+#define	IN_BADCLASS(a)		IN_EXPERIMENTAL((a))
 
 /* Address to accept any incoming messages. */
 #define	INADDR_ANY		((unsigned long int) 0x00000000)
@@ -114,9 +158,10 @@
 #define	IN_LOOPBACK(a)		((((long int) (a)) & 0xff000000) == 0x7f000000)
 
 /* Defines for Multicast INADDR */
-#define INADDR_UNSPEC_GROUP   	0xe0000000      /* 224.0.0.0   */
-#define INADDR_ALLHOSTS_GROUP 	0xe0000001      /* 224.0.0.1   */
-#define INADDR_MAX_LOCAL_GROUP  0xe00000ff      /* 224.0.0.255 */
+#define INADDR_UNSPEC_GROUP   	0xe0000000U	/* 224.0.0.0   */
+#define INADDR_ALLHOSTS_GROUP 	0xe0000001U	/* 224.0.0.1   */
+#define INADDR_ALLRTRS_GROUP    0xe0000002U	/* 224.0.0.2 */
+#define INADDR_MAX_LOCAL_GROUP  0xe00000ffU	/* 224.0.0.255 */
 
 
 /* <asm/byteorder.h> contains the htonl type stuff.. */
@@ -126,6 +171,9 @@
 /* Some random defines to make it easier in the kernel.. */
 #define LOOPBACK(x)	(((x) & htonl(0xff000000)) == htonl(0x7f000000))
 #define MULTICAST(x)	(((x) & htonl(0xf0000000)) == htonl(0xe0000000))
+#define BADCLASS(x)	(((x) & htonl(0xf0000000)) == htonl(0xf0000000))
+#define ZERONET(x)	(((x) & htonl(0xff000000)) == htonl(0x00000000))
+#define LOCAL_MCAST(x)	(((x) & htonl(0xFFFFFF00)) == htonl(0xE0000000))
 
 #endif
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov