Subject: Patch for ISI 4.2a4-1

From: Antonio Medina Ortega <[email-masked]>
Date: Mon, 25 Mar 2002 14:21:41 +0100

Hi everybody!!

     At last, I have solved compilation problems in my linux box ( Mandrake
8.1, Kernel 2.4), I have solved that problems by means of Craig Rodrigues
Patch.The pacth is available at:

      http://www.atm.tut.fi/list-archive/rsvp/msg00479.html

   I am also enclosing the patch. So, if someone have compilation problems
in a Linux box, try this patch, for me it was fine.

  Thank you to:  <<rsvp.patch.txt>>  <<rsvp.patch.rh7.1.txt>>  <<README>> 

  Craig Rodrigues        Distributed Systems and Logistics, Office 6/304
[email-masked]       BBN Technologies, a Verizon company
(617) 873-4725         Cambridge, MA

  Antonio.
diff -r -u orig/rel4.2a4/apitools/rtap_cmds.c rel4.2a4/apitools/rtap_cmds.c
--- orig/rel4.2a4/apitools/rtap_cmds.c	Wed Aug 12 14:50:29 1998
+++ rel4.2a4/apitools/rtap_cmds.c	Fri Oct 12 18:15:02 2001
@@ -138,6 +138,14 @@
 #define MAX_T           64
 
 int             T = 1;  	/* Current Thread number */
+
+/* support old spec */
+#ifdef  USE_IPV6
+#ifndef IPV6_ADD_MEMBERSHIP
+#define IPV6_ADD_MEMBERSHIP     IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP    IPV6_LEAVE_GROUP
+#endif /* IPV6_ADD_MEMBERSHIP */
+#endif  /* USE_IPV6 */
  
 area_t		*Filter_specs[MAX_T];
 area_t		*Flowspecs[MAX_T];
diff -r -u orig/rel4.2a4/apitools/rtap_main.c rel4.2a4/apitools/rtap_main.c
--- orig/rel4.2a4/apitools/rtap_main.c	Tue Aug 31 19:04:32 1999
+++ rel4.2a4/apitools/rtap_main.c	Fri Oct 12 17:20:34 2001
@@ -18,6 +18,7 @@
 #include <unistd.h>
 #include <math.h>
 #include <sys/types.h>
+#include <time.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -41,9 +42,9 @@
 /*
  *	External declarations
  */
-int	Do_Command(char *, FILE *);
-void	rtap_cmds_init();
-char	*rapi_errlist[];
+extern int	Do_Command(char *, FILE *);
+extern void	rtap_cmds_init();
+extern char	*rapi_errlist[];
 
 /*
  * Forward Declarations
diff -r -u orig/rel4.2a4/apitools/scrapi.c rel4.2a4/apitools/scrapi.c
--- orig/rel4.2a4/apitools/scrapi.c	Tue Aug 31 19:13:00 1999
+++ rel4.2a4/apitools/scrapi.c	Thu Sep 27 21:16:57 2001
@@ -11,6 +11,8 @@
 #include <strings.h>
 #include <limits.h>
 #include <unistd.h>
+#include <string.h>
+#include <sys/ioctl.h>
 #include <rapi_err.h>
 
 /*
diff -r -u orig/rel4.2a4/apitools/scrapi.h rel4.2a4/apitools/scrapi.h
--- orig/rel4.2a4/apitools/scrapi.h	Wed Nov 25 12:58:56 1998
+++ rel4.2a4/apitools/scrapi.h	Fri Oct 12 17:28:46 2001
@@ -45,7 +45,7 @@
 #include <stdio.h>
 
 #if	defined(AF_INET6) && defined(IPPROTO_IPV6)
-#define	HAS_IPV6
+/* define	HAS_IPV6 */
 #endif	/* defined(AF_INET6) && defined(IPPROTO_IPV6) */
 
 #ifndef	NO_IPV6
diff -r -u orig/rel4.2a4/apitools/scrapit.c rel4.2a4/apitools/scrapit.c
--- orig/rel4.2a4/apitools/scrapit.c	Wed Nov 25 12:58:56 1998
+++ rel4.2a4/apitools/scrapit.c	Fri Oct 12 17:34:38 2001
@@ -2,6 +2,7 @@
 #include <netdb.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <string.h>
 #include <strings.h>
 
 #ifndef	TRUE
@@ -96,7 +97,7 @@
 	printf("    status destination protocol source\n");
 #ifdef	ISI_TEST
 	printf("    translation form\n");
-#endif	ISI_TEST
+#endif	/* ISI_TEST */
 	printf("Parameters:\n");
 	printf("    destination or source ::= <address/port> | <port> | <0>\n");
 	printf("    protocol ::= <name> | <number>\n");
@@ -107,7 +108,7 @@
 	printf("    ttl ::= <number>\n");
 #ifdef	ISI_TEST
 	printf("    form ::= <fl> | <gpi> | <none>\n");
-#endif	ISI_TEST
+#endif	/* ISI_TEST */
 }
 
 static
@@ -241,7 +242,7 @@
 	else
 		fprintf(stderr,"%s: Bad translation parameter\n",program);
 }
-#endif	ISI_TEST
+#endif	/* ISI_TEST */
 
 static
 cmdinfo table[]= {
@@ -253,7 +254,7 @@
 	{ "status",		status,			4 },
 #ifdef	ISI_TEST
 	{ "translation",	translation,		2 },
-#endif	ISI_TEST
+#endif	/* ISI_TEST */
 };
 
 static
diff -r -u orig/rel4.2a4/rsvpd/rapi_lib.c rel4.2a4/rsvpd/rapi_lib.c
--- orig/rel4.2a4/rsvpd/rapi_lib.c	Thu Sep 24 20:31:00 1998
+++ rel4.2a4/rsvpd/rapi_lib.c	Thu Sep 27 21:16:57 2001
@@ -1420,7 +1420,6 @@
 static char *
 copy_tspec_i2d(rapi_tspec_t * i_spec, API_TSpec * d_spec, char *endp)
 	{
-	int printf();
 	char *next;
 
 	if ((char *)d_spec + sizeof(rapi_tspec_t) > endp) {
diff -r -u orig/rel4.2a4/rsvpd/rapi_lib.h rel4.2a4/rsvpd/rapi_lib.h
--- orig/rel4.2a4/rsvpd/rapi_lib.h	Mon Dec  6 15:34:07 1999
+++ rel4.2a4/rsvpd/rapi_lib.h	Fri Sep 28 00:07:45 2001
@@ -79,7 +79,7 @@
 enum    qos_service_type {
 	QOS_TSPEC = 		0,	/* Generic Tspec		*/
 	QOS_CNTR_LOAD =		1,	/* Controlled-Load service	*/
-	QOS_GUARANTEED =	2,	/* Guaranteed Service		*/
+	QOS_GUARANTEED =	2	/* Guaranteed Service		*/
 
 /* Backwards compatibility */
 #define QOS_TSPECX	QOS_TSPEC
@@ -408,7 +408,7 @@
 	RAPI_RESV_CONFIRM = 5,
 /* Following are private to ISI implementation: */
 	RAPI_PATH_STATUS = 9,
-	RAPI_RESV_STATUS = 10,
+	RAPI_RESV_STATUS = 10
 } rapi_eventinfo_t;
 
 typedef int  ((*rapi_event_rtn_t) (
diff -r -u orig/rel4.2a4/rsvpd/rsrr_unicast.c rel4.2a4/rsvpd/rsrr_unicast.c
--- orig/rel4.2a4/rsvpd/rsrr_unicast.c	Mon Dec  6 19:07:58 1999
+++ rel4.2a4/rsvpd/rsrr_unicast.c	Thu Sep 27 21:16:57 2001
@@ -692,8 +692,13 @@
 #define R_STALETIME	15
 #define R_LOAD		30
 
+#ifndef MSG_TRUNC
 #define MSG_TRUNC	0x20
+#endif /* MSG_TRUNC */
+
+#ifndef MSG_DONTWAIT
 #define MSG_DONTWAIT	0x40	/* Nonblocking io		 */
+#endif /* MSG_DONTWAIT */
 
 static struct rtnl_handle rt_nl;
 static const __u32 zerokey[KEYLEN];
diff -r -u orig/rel4.2a4/rsvpd/rsvp_key.c rel4.2a4/rsvpd/rsvp_key.c
--- orig/rel4.2a4/rsvpd/rsvp_key.c	Tue Aug 18 13:31:24 1998
+++ rel4.2a4/rsvpd/rsvp_key.c	Thu Sep 27 21:16:57 2001
@@ -232,17 +232,21 @@
       /*	Check that recomputed digest matches what arrived.
        */
       if (!(memcmp(received_digest, computed_digest, MD5_LENG)))
+      {
 	if(check_seqno(&integrity, kap))     /* Valid sequence number    */
 	  break;
 	else
 	  return PKT_ERR_REPLAY;
+      }
     }
 
   if (!kap)
+  {
     if (i == 0)
       return PKT_ERR_NOINTASS;	             /* No matching key          */
     else
       return PKT_ERR_INTEGRITY;              /* No satisfactory key      */
+  }
 
   return 0;                                /* OK                         */
 }
@@ -452,12 +456,14 @@
 
   /* Previous field not invalid */
   if (!((old[0] == 0xffffffff) && (old[1] == 0xffffffff)))
+  {
     if (LT(new[0], old[0]) && ((old[0] - new[0]) < UINT_MAX/2))
       return 0;
     else if ((new[0] == old[0]) && (LT(new[1], old[1])))
       return 0;
     else if (LT(old[0], new[0]) && ((new[0] - old[0]) > UINT_MAX/2))
       return 0;
+  }
 
   /* Valid sequence number, update stored value */
   old[0] =  new[0];
diff -r -u orig/rel4.2a4/rsvpd/rsvp_socks.c rel4.2a4/rsvpd/rsvp_socks.c
--- orig/rel4.2a4/rsvpd/rsvp_socks.c	Mon Dec  6 15:08:19 1999
+++ rel4.2a4/rsvpd/rsvp_socks.c	Thu Sep 27 21:16:57 2001
@@ -1283,8 +1283,13 @@
  *
  */
 
+#ifndef MSG_TRUNC
 #define MSG_TRUNC	0x20
+#endif /* MSG_TRUNC */
+
+#ifndef MSG_DONTWAIT
 #define MSG_DONTWAIT	0x40	/* Nonblocking io		 */
+#endif /* MSG_DONTWAIT */
 
 int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
 {
diff -r -u orig/rel4.2a4/rsvpd/rsvp_trans.c rel4.2a4/rsvpd/rsvp_trans.c
--- orig/rel4.2a4/rsvpd/rsvp_trans.c	Mon Dec  6 15:08:19 1999
+++ rel4.2a4/rsvpd/rsvp_trans.c	Thu Sep 27 21:16:57 2001
@@ -153,12 +153,6 @@
 #endif	/* sun */
 
 #ifdef	linux
-struct in_pktinfo
-{
-	int		ipi_ifindex;
-	struct in_addr	ipi_spec_dst;
-	struct in_addr	ipi_addr;
-};
 
 #define	uh_sport source
 #define	uh_dport dest
diff -u -r ../orig/rel4.2a4/apitools/rtap_cmds.c rel4.2a4/apitools/rtap_cmds.c
--- ../orig/rel4.2a4/apitools/rtap_cmds.c	Wed Aug 12 14:50:29 1998
+++ rel4.2a4/apitools/rtap_cmds.c	Tue Feb 26 12:09:03 2002
@@ -138,6 +138,14 @@
 #define MAX_T           64
 
 int             T = 1;  	/* Current Thread number */
+
+/* support old spec */
+#ifdef  USE_IPV6
+#ifndef IPV6_ADD_MEMBERSHIP
+#define IPV6_ADD_MEMBERSHIP     IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP    IPV6_LEAVE_GROUP
+#endif /* IPV6_ADD_MEMBERSHIP */
+#endif  /* USE_IPV6 */
  
 area_t		*Filter_specs[MAX_T];
 area_t		*Flowspecs[MAX_T];
diff -u -r ../orig/rel4.2a4/apitools/rtap_main.c rel4.2a4/apitools/rtap_main.c
--- ../orig/rel4.2a4/apitools/rtap_main.c	Tue Aug 31 19:04:32 1999
+++ rel4.2a4/apitools/rtap_main.c	Tue Feb 26 12:09:03 2002
@@ -18,6 +18,7 @@
 #include <unistd.h>
 #include <math.h>
 #include <sys/types.h>
+#include <time.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -41,9 +42,9 @@
 /*
  *	External declarations
  */
-int	Do_Command(char *, FILE *);
-void	rtap_cmds_init();
-char	*rapi_errlist[];
+extern int	Do_Command(char *, FILE *);
+extern void	rtap_cmds_init();
+extern char	*rapi_errlist[];
 
 /*
  * Forward Declarations
diff -u -r ../orig/rel4.2a4/apitools/scrapi.c rel4.2a4/apitools/scrapi.c
--- ../orig/rel4.2a4/apitools/scrapi.c	Tue Aug 31 19:13:00 1999
+++ rel4.2a4/apitools/scrapi.c	Tue Feb 26 12:09:03 2002
@@ -11,6 +11,8 @@
 #include <strings.h>
 #include <limits.h>
 #include <unistd.h>
+#include <string.h>
+#include <sys/ioctl.h>
 #include <rapi_err.h>
 
 /*
diff -u -r ../orig/rel4.2a4/apitools/scrapi.h rel4.2a4/apitools/scrapi.h
--- ../orig/rel4.2a4/apitools/scrapi.h	Wed Nov 25 12:58:56 1998
+++ rel4.2a4/apitools/scrapi.h	Tue Feb 26 12:09:03 2002
@@ -45,7 +45,7 @@
 #include <stdio.h>
 
 #if	defined(AF_INET6) && defined(IPPROTO_IPV6)
-#define	HAS_IPV6
+/* define	HAS_IPV6 */
 #endif	/* defined(AF_INET6) && defined(IPPROTO_IPV6) */
 
 #ifndef	NO_IPV6
diff -u -r ../orig/rel4.2a4/apitools/scrapit.c rel4.2a4/apitools/scrapit.c
--- ../orig/rel4.2a4/apitools/scrapit.c	Wed Nov 25 12:58:56 1998
+++ rel4.2a4/apitools/scrapit.c	Tue Feb 26 12:09:03 2002
@@ -2,6 +2,7 @@
 #include <netdb.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <string.h>
 #include <strings.h>
 
 #ifndef	TRUE
@@ -96,7 +97,7 @@
 	printf("    status destination protocol source\n");
 #ifdef	ISI_TEST
 	printf("    translation form\n");
-#endif	ISI_TEST
+#endif	/* ISI_TEST */
 	printf("Parameters:\n");
 	printf("    destination or source ::= <address/port> | <port> | <0>\n");
 	printf("    protocol ::= <name> | <number>\n");
@@ -107,7 +108,7 @@
 	printf("    ttl ::= <number>\n");
 #ifdef	ISI_TEST
 	printf("    form ::= <fl> | <gpi> | <none>\n");
-#endif	ISI_TEST
+#endif	/* ISI_TEST */
 }
 
 static
@@ -241,7 +242,7 @@
 	else
 		fprintf(stderr,"%s: Bad translation parameter\n",program);
 }
-#endif	ISI_TEST
+#endif	/* ISI_TEST */
 
 static
 cmdinfo table[]= {
@@ -253,7 +254,7 @@
 	{ "status",		status,			4 },
 #ifdef	ISI_TEST
 	{ "translation",	translation,		2 },
-#endif	ISI_TEST
+#endif	/* ISI_TEST */
 };
 
 static
diff -u -r ../orig/rel4.2a4/rsvpd/rapi_lib.c rel4.2a4/rsvpd/rapi_lib.c
--- ../orig/rel4.2a4/rsvpd/rapi_lib.c	Thu Sep 24 20:31:00 1998
+++ rel4.2a4/rsvpd/rapi_lib.c	Tue Feb 26 12:09:03 2002
@@ -1420,7 +1420,6 @@
 static char *
 copy_tspec_i2d(rapi_tspec_t * i_spec, API_TSpec * d_spec, char *endp)
 	{
-	int printf();
 	char *next;
 
 	if ((char *)d_spec + sizeof(rapi_tspec_t) > endp) {
diff -u -r ../orig/rel4.2a4/rsvpd/rapi_lib.h rel4.2a4/rsvpd/rapi_lib.h
--- ../orig/rel4.2a4/rsvpd/rapi_lib.h	Mon Dec  6 15:34:07 1999
+++ rel4.2a4/rsvpd/rapi_lib.h	Tue Feb 26 12:09:03 2002
@@ -79,7 +79,7 @@
 enum    qos_service_type {
 	QOS_TSPEC = 		0,	/* Generic Tspec		*/
 	QOS_CNTR_LOAD =		1,	/* Controlled-Load service	*/
-	QOS_GUARANTEED =	2,	/* Guaranteed Service		*/
+	QOS_GUARANTEED =	2	/* Guaranteed Service		*/
 
 /* Backwards compatibility */
 #define QOS_TSPECX	QOS_TSPEC
@@ -408,7 +408,7 @@
 	RAPI_RESV_CONFIRM = 5,
 /* Following are private to ISI implementation: */
 	RAPI_PATH_STATUS = 9,
-	RAPI_RESV_STATUS = 10,
+	RAPI_RESV_STATUS = 10
 } rapi_eventinfo_t;
 
 typedef int  ((*rapi_event_rtn_t) (
diff -u -r ../orig/rel4.2a4/rsvpd/rsrr_unicast.c rel4.2a4/rsvpd/rsrr_unicast.c
--- ../orig/rel4.2a4/rsvpd/rsrr_unicast.c	Mon Dec  6 19:07:58 1999
+++ rel4.2a4/rsvpd/rsrr_unicast.c	Tue Feb 26 12:09:03 2002
@@ -692,8 +692,13 @@
 #define R_STALETIME	15
 #define R_LOAD		30
 
+#ifndef MSG_TRUNC
 #define MSG_TRUNC	0x20
+#endif /* MSG_TRUNC */
+
+#ifndef MSG_DONTWAIT
 #define MSG_DONTWAIT	0x40	/* Nonblocking io		 */
+#endif /* MSG_DONTWAIT */
 
 static struct rtnl_handle rt_nl;
 static const __u32 zerokey[KEYLEN];
diff -u -r ../orig/rel4.2a4/rsvpd/rsvp_key.c rel4.2a4/rsvpd/rsvp_key.c
--- ../orig/rel4.2a4/rsvpd/rsvp_key.c	Tue Aug 18 13:31:24 1998
+++ rel4.2a4/rsvpd/rsvp_key.c	Tue Feb 26 12:09:03 2002
@@ -232,17 +232,21 @@
       /*	Check that recomputed digest matches what arrived.
        */
       if (!(memcmp(received_digest, computed_digest, MD5_LENG)))
+      {
 	if(check_seqno(&integrity, kap))     /* Valid sequence number    */
 	  break;
 	else
 	  return PKT_ERR_REPLAY;
+      }
     }
 
   if (!kap)
+  {
     if (i == 0)
       return PKT_ERR_NOINTASS;	             /* No matching key          */
     else
       return PKT_ERR_INTEGRITY;              /* No satisfactory key      */
+  }
 
   return 0;                                /* OK                         */
 }
@@ -452,12 +456,14 @@
 
   /* Previous field not invalid */
   if (!((old[0] == 0xffffffff) && (old[1] == 0xffffffff)))
+  {
     if (LT(new[0], old[0]) && ((old[0] - new[0]) < UINT_MAX/2))
       return 0;
     else if ((new[0] == old[0]) && (LT(new[1], old[1])))
       return 0;
     else if (LT(old[0], new[0]) && ((new[0] - old[0]) > UINT_MAX/2))
       return 0;
+  }
 
   /* Valid sequence number, update stored value */
   old[0] =  new[0];
diff -u -r ../orig/rel4.2a4/rsvpd/rsvp_socks.c rel4.2a4/rsvpd/rsvp_socks.c
--- ../orig/rel4.2a4/rsvpd/rsvp_socks.c	Mon Dec  6 15:08:19 1999
+++ rel4.2a4/rsvpd/rsvp_socks.c	Tue Feb 26 12:09:03 2002
@@ -1283,8 +1283,13 @@
  *
  */
 
+#ifndef MSG_TRUNC
 #define MSG_TRUNC	0x20
+#endif /* MSG_TRUNC */
+
+#ifndef MSG_DONTWAIT
 #define MSG_DONTWAIT	0x40	/* Nonblocking io		 */
+#endif /* MSG_DONTWAIT */
 
 int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
 {
diff -u -r ../orig/rel4.2a4/rsvpd/rsvp_socks.h rel4.2a4/rsvpd/rsvp_socks.h
--- ../orig/rel4.2a4/rsvpd/rsvp_socks.h	Mon Dec  6 15:08:19 1999
+++ rel4.2a4/rsvpd/rsvp_socks.h	Tue Feb 26 12:09:25 2002
@@ -47,7 +47,7 @@
 ********************************************************************/
 
 #if	defined(AF_INET6) && defined(IPPROTO_IPV6)
-#define	HAS_IPV6
+/* define	HAS_IPV6 */
 #endif	/* defined(AF_INET6) && defined(IPPROTO_IPV6) */
 
 #ifndef	NO_IPV6
diff -u -r ../orig/rel4.2a4/rsvpd/rsvp_trans.c rel4.2a4/rsvpd/rsvp_trans.c
--- ../orig/rel4.2a4/rsvpd/rsvp_trans.c	Mon Dec  6 15:08:19 1999
+++ rel4.2a4/rsvpd/rsvp_trans.c	Tue Feb 26 12:09:03 2002
@@ -153,12 +153,6 @@
 #endif	/* sun */
 
 #ifdef	linux
-struct in_pktinfo
-{
-	int		ipi_ifindex;
-	struct in_addr	ipi_spec_dst;
-	struct in_addr	ipi_addr;
-};
 
 #define	uh_sport source
 #define	uh_dport dest