Diff below removes code protected under RSVP_ISI that doesn't even
compile.

Anybody objecting to it's teduification? Any ok?

Index: netinet/igmp.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/igmp.c,v
retrieving revision 1.31
diff -u -p -r1.31 igmp.c
--- netinet/igmp.c      20 Apr 2010 22:05:43 -0000      1.31
+++ netinet/igmp.c      8 Apr 2013 12:13:57 -0000
@@ -603,9 +603,7 @@ igmp_sendpkt(struct in_multi *inm, int t
 
        imo.imo_multicast_ifp = inm->inm_ia->ia_ifp;
        imo.imo_multicast_ttl = 1;
-#ifdef RSVP_ISI
-       imo.imo_multicast_vif = -1;
-#endif
+
        /*
         * Request loopback of the report if we are acting as a multicast
         * router, so that the process-level routing daemon can hear it.
Index: netinet/ip_mroute.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_mroute.c,v
retrieving revision 1.60
diff -u -p -r1.60 ip_mroute.c
--- netinet/ip_mroute.c 28 Mar 2013 16:45:16 -0000      1.60
+++ netinet/ip_mroute.c 8 Apr 2013 12:13:57 -0000
@@ -130,12 +130,6 @@ u_int              mrtdebug = 0;     /* debug level        
*
 
 #define                VIFI_INVALID    ((vifi_t) -1)
 
-#ifdef RSVP_ISI
-u_int          rsvpdebug = 0;    /* rsvp debug level   */
-extern struct socket *ip_rsvpd;
-extern int rsvp_on;
-#endif /* RSVP_ISI */
-
 #define                EXPIRE_TIMEOUT  250             /* 4x / second */
 #define                UPCALL_EXPIRE   6               /* number of timeouts */
 struct timeout expire_upcalls_ch;
@@ -162,11 +156,7 @@ static int get_api_config(struct mbuf *)
 static int socket_send(struct socket *, struct mbuf *,
                            struct sockaddr_in *);
 static void expire_upcalls(void *);
-#ifdef RSVP_ISI
-static int ip_mdq(struct mbuf *, struct ifnet *, struct mfc *, vifi_t);
-#else
 static int ip_mdq(struct mbuf *, struct ifnet *, struct mfc *);
-#endif
 static void phyint_send(struct ip *, struct vif *, struct mbuf *);
 static void encap_send(struct ip *, struct vif *, struct mbuf *);
 static void send_packet(struct vif *, struct mbuf *);
@@ -879,11 +869,6 @@ add_vif(struct mbuf *m)
 
        timeout_del(&vifp->v_repq_ch);
 
-#ifdef RSVP_ISI
-       vifp->v_rsvp_on = 0;
-       vifp->v_rsvpd = NULL;
-#endif /* RSVP_ISI */
-
        splx(s);
 
        /* Adjust numvifs up if the vifi is higher than numvifs. */
@@ -1138,11 +1123,7 @@ add_mfc(struct mbuf *m)
                        for (; rte != NULL; rte = nrte) {
                                nrte = rte->next;
                                if (rte->ifp) {
-#ifdef RSVP_ISI
-                                       ip_mdq(rte->m, rte->ifp, rt, -1);
-#else
                                        ip_mdq(rte->m, rte->ifp, rt);
-#endif /* RSVP_ISI */
                                }
                                m_freem(rte->m);
 #ifdef UPCALL_TIMING
@@ -1305,11 +1286,7 @@ socket_send(struct socket *s, struct mbu
 #define TUNNEL_LEN  12  /* # bytes of IP option for tunnel encapsulation  */
 
 int
-#ifdef RSVP_ISI
-ip_mforward(struct mbuf *m, struct ifnet *ifp, struct ip_moptions *imo)
-#else
 ip_mforward(struct mbuf *m, struct ifnet *ifp)
-#endif /* RSVP_ISI */
 {
        struct ip *ip = mtod(m, struct ip *);
        struct mfc *rt;
@@ -1340,28 +1317,6 @@ ip_mforward(struct mbuf *m, struct ifnet
                return (1);
        }
 
-#ifdef RSVP_ISI
-       if (imo && ((vifi = imo->imo_multicast_vif) < numvifs)) {
-               if (ip->ip_ttl < MAXTTL) {
-                       /* compensate for -1 in *_send routines */
-                       ip->ip_ttl++;
-               }
-               if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
-                       struct vif *vifp = viftable + vifi;
-                       printf("Sending IPPROTO_RSVP from %x to %x on "
-                           "vif %d (%s%s)\n",
-                           ntohl(ip->ip_src), ntohl(ip->ip_dst), vifi,
-                           (vifp->v_flags & VIFF_TUNNEL) ? "tunnel on " : "",
-                           vifp->v_ifp->if_xname);
-               }
-               return (ip_mdq(m, ifp, (struct mfc *)NULL, vifi));
-       }
-       if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
-               printf("Warning: IPPROTO_RSVP from %x to %x without "
-                   "vif option\n", ntohl(ip->ip_src), ntohl(ip->ip_dst));
-       }
-#endif /* RSVP_ISI */
-
        /*
         * Don't forward a packet with time-to-live of zero or one,
         * or a packet destined to a local-only group.
@@ -1379,11 +1334,7 @@ ip_mforward(struct mbuf *m, struct ifnet
        /* Entry exists, so forward if necessary */
        if (rt != NULL) {
                splx(s);
-#ifdef RSVP_ISI
-               return (ip_mdq(m, ifp, rt, -1));
-#else
                return (ip_mdq(m, ifp, rt));
-#endif /* RSVP_ISI */
        } else {
                /*
                 * If we don't have a route for packet's origin,
@@ -1603,11 +1554,7 @@ expire_upcalls(void *v)
  * Packet forwarding routine once entry in the cache is made
  */
 static int
-#ifdef RSVP_ISI
-ip_mdq(struct mbuf *m, struct ifnet *ifp, struct mfc *rt, vifi_t xmt_vif)
-#else
 ip_mdq(struct mbuf *m, struct ifnet *ifp, struct mfc *rt)
-#endif /* RSVP_ISI */
 {
        struct ip  *ip = mtod(m, struct ip *);
        vifi_t vifi;
@@ -1615,9 +1562,7 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp
        int plen = ntohs(ip->ip_len) - (ip->ip_hl << 2);
 
 /*
- * Macro to send packet on vif.  Since RSVP packets don't get counted on
- * input, they shouldn't get counted on output, so statistics keeping is
- * separate.
+ * Macro to send packet on vif.
  */
 #define MC_SEND(ip, vifp, m) do {                                      \
        if ((vifp)->v_flags & VIFF_TUNNEL)                              \
@@ -1626,23 +1571,6 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp
                phyint_send((ip), (vifp), (m));                         \
 } while (/*CONSTCOND*/ 0)
 
-#ifdef RSVP_ISI
-       /*
-        * If xmt_vif is not -1, send on only the requested vif.
-        *
-        * (since vifi_t is u_short, -1 becomes MAXUSHORT, which > numvifs.
-        */
-       if (xmt_vif < numvifs) {
-#ifdef PIM
-               if (viftable[xmt_vif].v_flags & VIFF_REGISTER)
-                       pim_register_send(ip, viftable + xmt_vif, m, rt);
-               else
-#endif
-               MC_SEND(ip, viftable + xmt_vif, m);
-               return (1);
-       }
-#endif /* RSVP_ISI */
-
        /*
         * Don't forward if it didn't arrive from the parent vif for its origin.
         */
@@ -1767,20 +1695,6 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp
        return (0);
 }
 
-#ifdef RSVP_ISI
-/*
- * check if a vif number is legal/ok. This is used by ip_output.
- */
-int
-legal_vif_num(int vif)
-{
-       if (vif >= 0 && vif < numvifs)
-               return (1);
-       else
-               return (0);
-}
-#endif /* RSVP_ISI */
-
 static void
 phyint_send(struct ip *ip, struct vif *vifp, struct mbuf *m)
 {
@@ -1876,9 +1790,6 @@ send_packet(struct vif *vifp, struct mbu
                imo.imo_multicast_ifp = vifp->v_ifp;
                imo.imo_multicast_ttl = mtod(m, struct ip *)->ip_ttl - IPTTLDEC;
                imo.imo_multicast_loop = 1;
-#ifdef RSVP_ISI
-               imo.imo_multicast_vif = -1;
-#endif
 
                error = ip_output(m, (struct mbuf *)NULL, (struct route *)NULL,
                    IP_FORWARDING|IP_MULTICASTOPTS, &imo,
@@ -1890,223 +1801,6 @@ send_packet(struct vif *vifp, struct mbu
        }
        splx(s);
 }
-
-#ifdef RSVP_ISI
-int
-ip_rsvp_vif_init(struct socket *so, struct mbuf *m)
-{
-       int vifi, s;
-
-       if (rsvpdebug)
-               printf("ip_rsvp_vif_init: so_type = %d, pr_protocol = %d\n",
-                   so->so_type, so->so_proto->pr_protocol);
-
-       if (so->so_type != SOCK_RAW ||
-           so->so_proto->pr_protocol != IPPROTO_RSVP)
-               return (EOPNOTSUPP);
-
-       /* Check mbuf. */
-       if (m == NULL || m->m_len != sizeof(int)) {
-               return (EINVAL);
-       }
-       vifi = *(mtod(m, int *));
-
-       if (rsvpdebug)
-               printf("ip_rsvp_vif_init: vif = %d rsvp_on = %d\n",
-                   vifi, rsvp_on);
-
-       s = splsoftnet();
-
-       /* Check vif. */
-       if (!legal_vif_num(vifi)) {
-               splx(s);
-               return (EADDRNOTAVAIL);
-       }
-
-       /* Check if socket is available. */
-       if (viftable[vifi].v_rsvpd != NULL) {
-               splx(s);
-               return (EADDRINUSE);
-       }
-
-       viftable[vifi].v_rsvpd = so;
-       /* This may seem silly, but we need to be sure we don't over-increment
-        * the RSVP counter, in case something slips up.
-        */
-       if (!viftable[vifi].v_rsvp_on) {
-               viftable[vifi].v_rsvp_on = 1;
-               rsvp_on++;
-       }
-
-       splx(s);
-       return (0);
-}
-
-int
-ip_rsvp_vif_done(struct socket *so, struct mbuf *m)
-{
-       int vifi, s;
-
-       if (rsvpdebug)
-               printf("ip_rsvp_vif_done: so_type = %d, pr_protocol = %d\n",
-                   so->so_type, so->so_proto->pr_protocol);
-
-       if (so->so_type != SOCK_RAW ||
-           so->so_proto->pr_protocol != IPPROTO_RSVP)
-               return (EOPNOTSUPP);
-
-       /* Check mbuf. */
-       if (m == NULL || m->m_len != sizeof(int)) {
-               return (EINVAL);
-       }
-       vifi = *(mtod(m, int *));
-
-       s = splsoftnet();
-
-       /* Check vif. */
-       if (!legal_vif_num(vifi)) {
-               splx(s);
-               return (EADDRNOTAVAIL);
-       }
-
-       if (rsvpdebug)
-               printf("ip_rsvp_vif_done: v_rsvpd = %x so = %x\n",
-                   viftable[vifi].v_rsvpd, so);
-
-       viftable[vifi].v_rsvpd = NULL;
-       /*
-        * This may seem silly, but we need to be sure we don't over-decrement
-        * the RSVP counter, in case something slips up.
-        */
-       if (viftable[vifi].v_rsvp_on) {
-               viftable[vifi].v_rsvp_on = 0;
-               rsvp_on--;
-       }
-
-       splx(s);
-       return (0);
-}
-
-void
-ip_rsvp_force_done(struct socket *so)
-{
-       int vifi, s;
-
-       /* Don't bother if it is not the right type of socket. */
-       if (so->so_type != SOCK_RAW ||
-           so->so_proto->pr_protocol != IPPROTO_RSVP)
-               return;
-
-       s = splsoftnet();
-
-       /*
-        * The socket may be attached to more than one vif...this
-        * is perfectly legal.
-        */
-       for (vifi = 0; vifi < numvifs; vifi++) {
-               if (viftable[vifi].v_rsvpd == so) {
-                       viftable[vifi].v_rsvpd = NULL;
-                       /*
-                        * This may seem silly, but we need to be sure we don't
-                        * over-decrement the RSVP counter, in case something
-                        * slips up.
-                        */
-                       if (viftable[vifi].v_rsvp_on) {
-                               viftable[vifi].v_rsvp_on = 0;
-                               rsvp_on--;
-                       }
-               }
-       }
-
-       splx(s);
-       return;
-}
-
-void
-rsvp_input(struct mbuf *m, struct ifnet *ifp)
-{
-       int vifi, s;
-       struct ip *ip = mtod(m, struct ip *);
-       static struct sockaddr_in rsvp_src = { sizeof(sin), AF_INET };
-
-       if (rsvpdebug)
-               printf("rsvp_input: rsvp_on %d\n", rsvp_on);
-
-       /*
-        * Can still get packets with rsvp_on = 0 if there is a local member
-        * of the group to which the RSVP packet is addressed.  But in this
-        * case we want to throw the packet away.
-        */
-       if (!rsvp_on) {
-               m_freem(m);
-               return;
-       }
-
-       /*
-        * If the old-style non-vif-associated socket is set, then use
-        * it and ignore the new ones.
-        */
-       if (ip_rsvpd != NULL) {
-               if (rsvpdebug)
-                       printf("rsvp_input: "
-                           "Sending packet up old-style socket\n");
-               rip_input(m, 0);        /*XXX*/
-               return;
-       }
-
-       s = splsoftnet();
-
-       if (rsvpdebug)
-               printf("rsvp_input: check vifs\n");
-
-       /* Find which vif the packet arrived on. */
-       for (vifi = 0; vifi < numvifs; vifi++) {
-               if (viftable[vifi].v_ifp == ifp)
-                       break;
-       }
-
-       if (vifi == numvifs) {
-               /* Can't find vif packet arrived on. Drop packet. */
-               if (rsvpdebug)
-                       printf("rsvp_input: "
-                           "Can't find vif for packet...dropping it.\n");
-               m_freem(m);
-               splx(s);
-               return;
-       }
-
-       if (rsvpdebug)
-               printf("rsvp_input: check socket\n");
-
-       if (viftable[vifi].v_rsvpd == NULL) {
-               /*
-                * drop packet, since there is no specific socket for this
-                * interface
-                */
-               if (rsvpdebug)
-                       printf("rsvp_input: No socket defined for vif %d\n",
-                           vifi);
-               m_freem(m);
-               splx(s);
-               return;
-       }
-
-       rsvp_src.sin_addr = ip->ip_src;
-
-       if (rsvpdebug && m)
-               printf("rsvp_input: m->m_len = %d, sbspace() = %d\n",
-                   m->m_len, sbspace(&viftable[vifi].v_rsvpd->so_rcv));
-
-       if (socket_send(viftable[vifi].v_rsvpd, m, &rsvp_src) < 0)
-               if (rsvpdebug)
-                       printf("rsvp_input: Failed to append to socket\n");
-       else
-               if (rsvpdebug)
-                       printf("rsvp_input: send packet up\n");
-
-       splx(s);
-}
-#endif /* RSVP_ISI */
 
 /*
  * Code for bandwidth monitors
Index: netinet/ip_mroute.h
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_mroute.h,v
retrieving revision 1.15
diff -u -p -r1.15 ip_mroute.h
--- netinet/ip_mroute.h 13 Jul 2009 19:14:29 -0000      1.15
+++ netinet/ip_mroute.h 8 Apr 2013 12:13:57 -0000
@@ -231,10 +231,6 @@ struct vif {
        u_long    v_bytes_out;          /* # bytes out on interface */
        struct    route v_route;        /* cached route if this is a tunnel */
        struct    timeout v_repq_ch;    /* for tbf_reprocess_q() */
-#ifdef RSVP_ISI
-       int       v_rsvp_on;            /* # RSVP listening on this vif */
-       struct    socket *v_rsvpd;      /* # RSVPD daemon */
-#endif /* RSVP_ISI */
 };
 
 /*
@@ -325,16 +321,6 @@ int        ip_mrouter_done(void);
 void   ip_mrouter_detach(struct ifnet *);
 void   reset_vif(struct vif *);
 void   vif_delete(struct ifnet *);
-#ifdef RSVP_ISI
-int    ip_mforward(struct mbuf *, struct ifnet *, struct ip_moptions *);
-int    legal_vif_num(int);
-int    ip_rsvp_vif_init(struct socket *, struct mbuf *);
-int    ip_rsvp_vif_done(struct socket *, struct mbuf *);
-void   ip_rsvp_force_done(struct socket *);
-void   rsvp_input(struct mbuf *, int, int);
-#else
-int    ip_mforward(struct mbuf *, struct ifnet *);
-#endif /* RSVP_ISI */
 
 #endif /* _KERNEL */
 #endif /* _NETINET_IP_MROUTE_H_ */
Index: netinet6/ip6_mroute.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/ip6_mroute.c,v
retrieving revision 1.59
diff -u -p -r1.59 ip6_mroute.c
--- netinet6/ip6_mroute.c       28 Mar 2013 16:45:16 -0000      1.59
+++ netinet6/ip6_mroute.c       8 Apr 2013 12:13:57 -0000
@@ -1297,11 +1297,8 @@ ip6_mdq(struct mbuf *m, struct ifnet *if
        int plen = m->m_pkthdr.len;
 
 /*
- * Macro to send packet on mif.  Since RSVP packets don't get counted on
- * input, they shouldn't get counted on output, so statistics keeping is
- * separate.
+ * Macro to send packet on mif.
  */
-
 #define MC6_SEND(ip6, mifp, m) do {                            \
                if ((mifp)->m6_flags & MIFF_REGISTER)           \
                    register_send((ip6), (mifp), (m));          \
Index: netinet6/ip6_mroute.h
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/ip6_mroute.h,v
retrieving revision 1.8
diff -u -p -r1.8 ip6_mroute.h
--- netinet6/ip6_mroute.h       19 Sep 2012 22:37:23 -0000      1.8
+++ netinet6/ip6_mroute.h       8 Apr 2013 12:13:57 -0000
@@ -219,10 +219,6 @@ struct mif6 {
        u_int64_t       m6_bytes_in;    /* # bytes in on interface           */
        u_int64_t       m6_bytes_out;   /* # bytes out on interface          */
        struct route_in6 m6_route;/* cached route if this is a tunnel */
-#ifdef notyet
-       u_int           m6_rsvp_on;     /* RSVP listening on this vif */
-       struct socket   *m6_rsvpd;      /* RSVP daemon socket */
-#endif
 };
 
 /*
Index: netinet6/raw_ip6.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/raw_ip6.c,v
retrieving revision 1.53
diff -u -p -r1.53 raw_ip6.c
--- netinet6/raw_ip6.c  7 Apr 2013 20:58:25 -0000       1.53
+++ netinet6/raw_ip6.c  8 Apr 2013 12:13:58 -0000
@@ -654,7 +654,6 @@ rip6_usrreq(struct socket *so, int req, 
                if (so == ip6_mrouter)
                        ip6_mrouter_done();
 #endif
-               /* xxx: RSVP */
                if (in6p->in6p_icmp6filt) {
                        free(in6p->in6p_icmp6filt, M_PCB);
                        in6p->in6p_icmp6filt = NULL;

Reply via email to