diff -urN ../rsvpd/Makefile ./Makefile --- ../rsvpd/Makefile Thu Aug 20 06:10:03 1998 +++ ./Makefile Wed Nov 3 15:28:47 1999 @@ -14,12 +14,18 @@ # "make clean" if you change one! # +#DEFINES = -DDEBUG -DSCHEDULE -DRTAP -DSECURITY -DSTATS -DRSVP_DIAGS \ +# #-DAPI_USE_NET_BO -DISI_TEST -DWORKAROUNDS -DNO_IPV6 DEFINES = -DDEBUG -DSCHEDULE -DRTAP -DSECURITY -DSTATS -DRSVP_DIAGS \ + -DALTQ -DRSVPD -Dlog=log_write \ #-DAPI_USE_NET_BO -DISI_TEST -DWORKAROUNDS -DNO_IPV6 CC = gcc CFLAGS = -g -Wall -CPPFLAGS = -I$(TOOLSDIR) $(DEFINES) +#CPPFLAGS = -I$(TOOLSDIR) $(DEFINES) +SYSDIR?= /usr/src/sys-altq +ALTQDIR?= /usr/local/src/altq-2.0 +CPPFLAGS = -I$(TOOLSDIR) -I$(SYSDIR) -I$(ALTQDIR)/libaltq $(DEFINES) LDFLAGS = -L. LDLIBS = -lrsvp -lkvm -lm # Solaris @@ -36,7 +42,8 @@ # Select Traffic Control adaptation module object # -TCOBJS = tc_test.o rsvp_LLkern.o +#TCOBJS = tc_test.o rsvp_LLkern.o +TCOBJS = tc_altq.o rsvp_LLkern.o ##TCOBJS = tc_isps.o RSVPOBJS = rsvp_debug.o rsvp_path.o rsvp_resv.o rsvp_diag.o rsvp_timer.o \ @@ -58,7 +65,8 @@ all: $(ALL) rsvpd: rsvp_vers.o $(OBJS) - $(LINK.c) -o $@ $(OBJS) rsvp_vers.o $(LDLIBS) +# $(LINK.c) -o $@ $(OBJS) rsvp_vers.o $(LDLIBS) + $(LINK.c) -o $@ $(OBJS) rsvp_vers.o $(ALTQDIR)/libaltq/libaltq.a $(LDLIBS) librsvp.a: $(API_OBJS) ar cru $@ $(API_OBJS) diff -urN ../rsvpd/rsrr.h ./rsrr.h --- ../rsvpd/rsrr.h Tue Aug 11 09:47:19 1998 +++ ./rsrr.h Mon Oct 25 21:01:08 1999 @@ -51,8 +51,18 @@ /* * Note this needs to be 14 chars for 4.3 BSD compatibility */ +#ifdef ALTQ +#if defined(__FreeBSD__) && (__FreeBSD_version > 300000) +#define RSRR_SERV_PATH "/var/run/rsrr_svr" +#define RSRR_CLI_PATH "/var/run/rsrr_cli" +#else #define RSRR_SERV_PATH "/tmp/.rsrr_svr" #define RSRR_CLI_PATH "/tmp/.rsrr_cli" +#endif +#else /* !ALTQ */ +#define RSRR_SERV_PATH "/tmp/.rsrr_svr" +#define RSRR_CLI_PATH "/tmp/.rsrr_cli" +#endif /* !ALTQ */ #ifdef USE_IPV6 #define RSRR_SRV6_PATH "/tmp/.rsrr_sv6" #define RSRR_CL6_PATH "/tmp/.rsrr_cl6" diff -urN ../rsvpd/rsvp_global.h ./rsvp_global.h --- ../rsvpd/rsvp_global.h Tue Aug 11 09:47:20 1998 +++ ./rsvp_global.h Fri Aug 20 20:22:15 1999 @@ -97,7 +97,9 @@ extern int NoV4Mroute; extern int NoV6Mroute; extern int NoUnicast; - +#if defined(SOLARIS) || defined(ALTQ) +extern int Allow_Guaranteed; +#endif /* SOLARIS */ #endif /* __MAIN__ */ diff -urN ../rsvpd/rsvp_main.c ./rsvp_main.c --- ../rsvpd/rsvp_main.c Thu Aug 20 04:45:38 1998 +++ ./rsvp_main.c Fri Aug 20 20:24:34 1999 @@ -88,6 +88,16 @@ extern struct in6_addr encap_group6; /* Gu */ extern net_addr encap_mc_addr6; #endif /* USE_IPV6 */ +#ifdef SOLARIS +char *solconfigfile = "/etc/rsvpd.conf"; +char *stdconfigfile = "/etc/rsvpd.isi.conf"; +#endif +#ifdef ALTQ +char *altqconfigfile = "/etc/altq.conf"; +#endif +#if defined(SOLARIS) || defined(ALTQ) +int Allow_Guaranteed = 0; +#endif /* extern int use_udp; @@ -171,9 +181,15 @@ void Usage(char *namep) { +#if defined(SOLARIS) || defined(ALTQ) + fprintf(stderr, +"Usage: %s [-D] [-d debug_bits] [-l debug_level] [-t mstat_ttl] [-R encap_addr] [-f cbq_config_file] [-g]\n", + namep); +#else fprintf(stderr, "Usage: %s [-D] [-d debug_bits] [-l debug_level] [-t mstat_ttl] \n", namep); +#endif } /* @@ -246,9 +262,26 @@ /* * Process options */ +#if defined(SOLARIS) || defined(ALTQ) + while ((c = getopt(argc, argv, "Dd:l:t:R:r:s:xf:g")) != -1) { +#else while ((c = getopt(argc, argv, "Dd:l:t:R:r:")) != -1) { +#endif switch (c) { +#if defined(SOLARIS) || defined(ALTQ) + case 'f': +#if defined(SOLARIS) + solconfigfile = optarg; +#elif defined(ALTQ) + altqconfigfile = optarg; +#endif + break; + + case 'g': + Allow_Guaranteed = 1; + break; +#endif case 'D': /* -D => debug mode, i.e. do not daemonize */ Daemonize = 0; break; diff -urN ../rsvpd/rsvp_socks.c ./rsvp_socks.c --- ../rsvpd/rsvp_socks.c Thu Mar 19 04:46:20 1998 +++ ./rsvp_socks.c Mon Oct 25 20:36:30 1999 @@ -197,6 +197,13 @@ continue; ifs[index].if_index = index + 1; /* real ifm_index value */ +#ifdef ALTQ + /* + * back out the hack; it doesn't work if there is a pad + * for alignment. + */ + sdl = (struct sockaddr_dl *)(ifm + 1); +#else /* * The size of a struct if_msghdr is different on an IPv4 * and IPv6 kernel. To achieve binary compatibility, we @@ -206,6 +213,7 @@ /* sdl = (struct sockaddr_dl *)(ifm + 1); */ sdl = (struct sockaddr_dl *) ((char *)ifm + ifm->ifm_msglen - sizeof(struct sockaddr_dl)); +#endif if ((ifs[index].if_name = malloc(sdl->sdl_nlen+1)) == NULL) break; strncpy(ifs[index].if_name, sdl->sdl_data, sdl->sdl_nlen); diff -urN ../rsvpd/rsvp_var.h ./rsvp_var.h --- ../rsvpd/rsvp_var.h Tue Aug 18 07:35:11 1998 +++ ./rsvp_var.h Fri Aug 20 20:25:14 1999 @@ -577,6 +577,11 @@ #define DEBUG_RSRR 0x08 /* Log multicast routes */ #define DEBUG_MCAST_STATE 0x10 /* Multicast RSVP state (to dmap) */ #define DEBUG_TIMERS 0x20 /* Timer events */ +#if defined(SOLARIS) +#define DEBUG_CBQ 0x40 +#elif defined(ALTQ) +#define DEBUG_ALTQ 0x40 +#endif #define DEBUG_ALL 0xff #define LOG_ALWAYS 0 /* special value for log severity level */