ec_rxstart doesn't eists
[unix-history] / usr / src / sys / netiso / clnp_subr.c
index c25c402..3817abe 100644 (file)
@@ -1,3 +1,12 @@
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)clnp_subr.c 7.13 (Berkeley) %G%
+ */
+
 /***********************************************************
                Copyright IBM Corporation 1987
 
 /***********************************************************
                Copyright IBM Corporation 1987
 
@@ -26,11 +35,6 @@ SOFTWARE.
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_subr.c,v 5.1 89/02/09 16:20:46 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_subr.c,v $ */
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_subr.c,v 5.1 89/02/09 16:20:46 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_subr.c,v $ */
-/*     @(#)clnp_subr.c 7.8 (Berkeley) %G% */
-
-#ifndef lint
-static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_subr.c,v 5.1 89/02/09 16:20:46 hagens Exp $";
-#endif lint
 
 #ifdef ISO
 
 
 #ifdef ISO
 
@@ -46,6 +50,7 @@ static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_subr.c,v 5.1 89/02/0
 
 #include "../net/if.h"
 #include "../net/route.h"
 
 #include "../net/if.h"
 #include "../net/route.h"
+#include "../net/if_dl.h"
 
 #include "iso.h"
 #include "iso_var.h"
 
 #include "iso.h"
 #include "iso_var.h"
@@ -100,7 +105,7 @@ int                                         length; /* length (in bytes) of packet */
        return mhead;
 }
 
        return mhead;
 }
 
-#ifdef ndef
+#ifdef notdef
 /*
  * FUNCTION:           clnp_extract_addr
  *
 /*
  * FUNCTION:           clnp_extract_addr
  *
@@ -154,7 +159,7 @@ register struct iso_addr    *destp;         /* ptr to destination address buffer */
        else
                return (caddr_t) 0;
 }
        else
                return (caddr_t) 0;
 }
-#endif ndef
+#endif notdef
 
 /*
  * FUNCTION:           clnp_ours
 
 /*
  * FUNCTION:           clnp_ours
@@ -176,12 +181,18 @@ register struct iso_addr *dst;            /* ptr to destination address */
 
        for (ia = iso_ifaddr; ia; ia = ia->ia_next) {
                IFDEBUG(D_ROUTE)
 
        for (ia = iso_ifaddr; ia; ia = ia->ia_next) {
                IFDEBUG(D_ROUTE)
-                       printf("clnp_ours: ia_sis x%x, dst x%x\n", &IA_SIS(ia)->siso_addr, 
+                       printf("clnp_ours: ia_sis x%x, dst x%x\n", &ia->ia_addr, 
                                dst);
                ENDDEBUG
                                dst);
                ENDDEBUG
-               /* PHASE 2: uses iso_addrmatch & mask from iso_ifaddr */
-               if (iso_addrmatch1(&IA_SIS(ia)->siso_addr, dst))
-                       return 1;
+               /*
+                * XXX Warning:
+                * We are overloading siso_tlen in the if's address, as an nsel length.
+                */
+               if (dst->isoa_len == ia->ia_addr.siso_nlen &&
+                       bcmp((caddr_t)ia->ia_addr.siso_addr.isoa_genaddr,
+                                (caddr_t)dst->isoa_genaddr,
+                                ia->ia_addr.siso_nlen - ia->ia_addr.siso_tlen) == 0)
+                                       return 1;
        }
        return 0;
 }
        }
        return 0;
 }
@@ -289,15 +300,8 @@ struct snpa_hdr            *inbound_shp;   /* subnetwork header of inbound packet */
         *      then generate a redirect request
         */
        if ((iso_systype & SNPA_IS) && (inbound_shp) && 
         *      then generate a redirect request
         */
        if ((iso_systype & SNPA_IS) && (inbound_shp) && 
-               (ifp == inbound_shp->snh_ifp)) {
-               struct snpa_cache                       *sc;
-
-               sc = snpac_look(&((struct sockaddr_iso *)next_hop)->siso_addr);
-               if (sc != NULL) {
-                       esis_rdoutput(inbound_shp, m, oidx, dst, sc);
-               }
-       }
-
+               (ifp == inbound_shp->snh_ifp))
+                   esis_rdoutput(inbound_shp, m, oidx, dst, route.ro_rt);
        /*
         *      If options are present, update them
         */
        /*
         *      If options are present, update them
         */
@@ -339,7 +343,7 @@ struct snpa_hdr             *inbound_shp;   /* subnetwork header of inbound packet */
        /*
         *      Dispatch the datagram if it is small enough, otherwise fragment
         */
        /*
         *      Dispatch the datagram if it is small enough, otherwise fragment
         */
-       if (len <= SN_MTU(ifp)) {
+       if (len <= SN_MTU(ifp, route.ro_rt)) {
                iso_gen_csum(m, CLNP_CKSUM_OFF, (int)clnp->cnf_hdr_len);
                (void) (*ifp->if_output)(ifp, m, next_hop, route.ro_rt);
        } else {
                iso_gen_csum(m, CLNP_CKSUM_OFF, (int)clnp->cnf_hdr_len);
                (void) (*ifp->if_output)(ifp, m, next_hop, route.ro_rt);
        } else {
@@ -355,7 +359,7 @@ done:
        }
 }
 
        }
 }
 
-#ifdef ndef
+#ifdef notdef
 /*
  * FUNCTION:           clnp_insert_addr
  *
 /*
  * FUNCTION:           clnp_insert_addr
  *
@@ -384,7 +388,7 @@ register struct iso_addr    *dstp;  /* ptr to dst addr */
        return bufp;
 }
 
        return bufp;
 }
 
-#endif ndef
+#endif notdef
 
 /*
  * FUNCTION:           clnp_route
 
 /*
  * FUNCTION:           clnp_route
@@ -500,10 +504,10 @@ clnp_route(dst, ro, flags, first_hop, ifa)
  * NOTES:                      Remember that option index pointers are really
  *                                     offsets from the beginning of the mbuf.
  */
  * NOTES:                      Remember that option index pointers are really
  *                                     offsets from the beginning of the mbuf.
  */
-clnp_srcroute(options, oidx, route, first_hop, ifa, final_dst)
+clnp_srcroute(options, oidx, ro, first_hop, ifa, final_dst)
 struct mbuf                    *options;               /* ptr to options */
 struct clnp_optidx     *oidx;                  /* index to options */
 struct mbuf                    *options;               /* ptr to options */
 struct clnp_optidx     *oidx;                  /* index to options */
-struct route_iso       *route;                 /* route structure */
+struct route_iso       *ro;                    /* route structure */
 struct sockaddr                **first_hop;    /* RETURN: fill in with ptr to firsthop */
 struct iso_ifaddr      **ifa;                  /* RETURN: fill in with ptr to interface */
 struct iso_addr                *final_dst;             /* final destination */
 struct sockaddr                **first_hop;    /* RETURN: fill in with ptr to firsthop */
 struct iso_ifaddr      **ifa;                  /* RETURN: fill in with ptr to interface */
 struct iso_addr                *final_dst;             /* final destination */
@@ -529,7 +533,7 @@ struct iso_addr             *final_dst;             /* final destination */
        /*
         *      try to route it
         */
        /*
         *      try to route it
         */
-       error = clnp_route(&dst, route, 0, first_hop, ifa);
+       error = clnp_route(&dst, ro, 0, first_hop, ifa);
        if (error != 0)
                return error;
        
        if (error != 0)
                return error;
        
@@ -547,6 +551,30 @@ struct iso_addr            *final_dst;             /* final destination */
        return error;
 }
 
        return error;
 }
 
+/*
+ * FUNCTION:           clnp_badmtu
+ *
+ * PURPOSE:                    print notice of route with mtu not initialized.
+ *
+ * RETURNS:                    mtu of ifp.
+ *
+ * SIDE EFFECTS:       prints notice, slows down system.
+ */
+clnp_badmtu(ifp, rt, line, file)
+struct ifnet *ifp;     /* outgoing interface */
+struct rtentry *rt; /* dst route */
+int line;                      /* where the dirty deed occured */
+char *file;                    /* where the dirty deed occured */
+{
+       printf("sending on route %x with no mtu, line %s of file %s\n",
+               rt, line, file);
+#ifdef ARGO_DEBUG
+       printf("route dst is");
+       dump_isoaddr(rt_key(rt));
+#endif
+       return ifp->if_mtu;
+}
+
 /*
  * FUNCTION:           clnp_ypocb - backwards bcopy
  *
 /*
  * FUNCTION:           clnp_ypocb - backwards bcopy
  *
@@ -566,29 +594,4 @@ u_int      len;            /* number of bytes */
        while (len--)
                *(to + len) = *(from + len);
 }
        while (len--)
                *(to + len) = *(from + len);
 }
-
-/*
- * FUNCTION:           clnp_hdrsize
- *
- * PURPOSE:                    Return the size of a typical clnp hdr.
- *
- * RETURNS:                    Size of hdr in bytes.
- *
- * SIDE EFFECTS:       
- *
- * NOTES:                      Assumes segmenting subset. If addrlen is
- *                                     zero, default to largest nsap address size.
- */
-clnp_hdrsize(addrlen)
-u_char addrlen;                /* length of nsap address */
-{
-       if (addrlen == 0)
-               addrlen = 20;
-       
-       addrlen++;                      /* length of address byte */
-       addrlen *= 2;           /* src and dst addresses */
-       addrlen += sizeof(struct clnp_fixed) + sizeof(struct clnp_segment);
-
-       return(addrlen);
-}
 #endif ISO
 #endif ISO