+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)clnp_subr.c 7.13 (Berkeley) 5/6/91
+ */
+
/***********************************************************
Copyright IBM Corporation 1987
*/
/* $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.11 (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
return mhead;
}
-#ifdef ndef
+#ifdef notdef
/*
* FUNCTION: clnp_extract_addr
*
else
return (caddr_t) 0;
}
-#endif ndef
+#endif notdef
/*
* FUNCTION: clnp_ours
/*
* 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 {
}
}
-#ifdef ndef
+#ifdef notdef
/*
* FUNCTION: clnp_insert_addr
*
return bufp;
}
-#endif ndef
+#endif notdef
/*
* FUNCTION: clnp_route
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
*
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