Make everything compile with -Wtraditional. Make it easier to distribute
[unix-history] / sys / netiso / clnp_subr.c
index 6cabeea..872d832 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *     from: @(#)clnp_subr.c   7.13 (Berkeley) 5/6/91
  * SUCH DAMAGE.
  *
  *     from: @(#)clnp_subr.c   7.13 (Berkeley) 5/6/91
- *     $Id$
+ *     $Id: clnp_subr.c,v 1.5 1993/11/25 01:35:48 wollman Exp $
  */
 
 /***********************************************************
  */
 
 /***********************************************************
@@ -86,6 +86,12 @@ SOFTWARE.
 #include "clnp_stat.h"
 #include "argo_debug.h"
 
 #include "clnp_stat.h"
 #include "argo_debug.h"
 
+#ifdef TROLL
+struct troll trollctl;
+#endif
+struct clnp_stat clnp_stat;
+
+
 /*
  * FUNCTION:           clnp_data_ck
  *
 /*
  * FUNCTION:           clnp_data_ck
  *
@@ -103,9 +109,9 @@ SOFTWARE.
  */
 struct mbuf *
 clnp_data_ck(m, length)
  */
 struct mbuf *
 clnp_data_ck(m, length)
-register struct mbuf   *m;             /* ptr to mbuf chain containing hdr & data */
-int                                            length; /* length (in bytes) of packet */
- {
+       register struct mbuf *m; /* ptr to mbuf chain containing hdr & data */
+       int length;             /* length (in bytes) of packet */
+{
        register int                    len;            /* length of data */
        register struct mbuf    *mhead;         /* ptr to head of chain */
 
        register int                    len;            /* length of data */
        register struct mbuf    *mhead;         /* ptr to head of chain */
 
@@ -185,7 +191,7 @@ register struct iso_addr    *destp;         /* ptr to destination address buffer */
        else
                return (caddr_t) 0;
 }
        else
                return (caddr_t) 0;
 }
-#endif notdef
+#endif /* notdef */
 
 /*
  * FUNCTION:           clnp_ours
 
 /*
  * FUNCTION:           clnp_ours
@@ -200,8 +206,9 @@ register struct iso_addr    *destp;         /* ptr to destination address buffer */
  *
  * NOTES:                      
  */
  *
  * NOTES:                      
  */
+int
 clnp_ours(dst)
 clnp_ours(dst)
-register struct iso_addr *dst;         /* ptr to destination address */
+       register struct iso_addr *dst; /* ptr to destination address */
 {
        register struct iso_ifaddr *ia; /* scan through interface addresses */
 
 {
        register struct iso_ifaddr *ia; /* scan through interface addresses */
 
@@ -233,7 +240,7 @@ int congest_threshold = 0;
  *                                     clnpintr guarantees that the header will be
  *                                     contigious (a cluster mbuf will be used if necessary).
  *
  *                                     clnpintr guarantees that the header will be
  *                                     contigious (a cluster mbuf will be used if necessary).
  *
- *                                     If oidx is NULL, no options are present.
+ *                             If oidx is NULL, no options are present.
  *
  * RETURNS:                    nothing
  *
  *
  * RETURNS:                    nothing
  *
@@ -241,13 +248,14 @@ int congest_threshold = 0;
  *
  * NOTES:                      
  */
  *
  * NOTES:                      
  */
+void
 clnp_forward(m, len, dst, oidx, seg_off, inbound_shp)
 clnp_forward(m, len, dst, oidx, seg_off, inbound_shp)
-struct mbuf                    *m;             /* pkt to forward */
-int                                    len;    /* length of pkt */
-struct iso_addr                *dst;   /* destination address */
-struct clnp_optidx     *oidx;  /* option index */
-int                                    seg_off;/* offset of segmentation part */
-struct snpa_hdr                *inbound_shp;   /* subnetwork header of inbound packet */
+       struct mbuf *m;         /* pkt to forward */
+       int len;                /* length of pkt */
+       struct iso_addr *dst;   /* destination address */
+       struct clnp_optidx *oidx; /* option index */
+       int seg_off;            /* offset of segmentation part */
+       struct snpa_hdr *inbound_shp; /* subnetwork header of inbound packet */
 {
        struct clnp_fixed               *clnp;  /* ptr to fixed part of header */
        int                                             error;  /* return value of route function */
 {
        struct clnp_fixed               *clnp;  /* ptr to fixed part of header */
        int                                             error;  /* return value of route function */
@@ -364,7 +372,7 @@ struct snpa_hdr             *inbound_shp;   /* subnetwork header of inbound packet */
                        }
                }
        }
                        }
                }
        }
-#endif DECBIT
+#endif /* DECBIT */
        
        /*
         *      Dispatch the datagram if it is small enough, otherwise fragment
        
        /*
         *      Dispatch the datagram if it is small enough, otherwise fragment
@@ -414,7 +422,7 @@ register struct iso_addr    *dstp;  /* ptr to dst addr */
        return bufp;
 }
 
        return bufp;
 }
 
-#endif notdef
+#endif /* notdef */
 
 /*
  * FUNCTION:           clnp_route
 
 /*
  * FUNCTION:           clnp_route
@@ -435,12 +443,13 @@ register struct iso_addr  *dstp;  /* ptr to dst addr */
  * NOTES:                      It is up to the caller to free the routing entry
  *                                     allocated in route.
  */
  * NOTES:                      It is up to the caller to free the routing entry
  *                                     allocated in route.
  */
+int
 clnp_route(dst, ro, flags, first_hop, ifa)
 clnp_route(dst, ro, flags, first_hop, ifa)
-       struct iso_addr *dst;                   /* ptr to datagram destination */
-       register struct route_iso *ro;  /* existing route structure */
-       int flags;                                              /* flags for routing */
-       struct sockaddr **first_hop;    /* result: fill in with ptr to firsthop */
-       struct iso_ifaddr **ifa;                /* result: fill in with ptr to interface */
+       struct iso_addr *dst;   /* ptr to datagram destination */
+       register struct route_iso *ro; /* existing route structure */
+       int flags;              /* flags for routing */
+       struct sockaddr **first_hop; /* result: fill in with ptr to firsthop */
+       struct iso_ifaddr **ifa; /* result: fill in with ptr to interface */
 {
        if (flags & SO_DONTROUTE) {
                struct iso_ifaddr *ia;
 {
        if (flags & SO_DONTROUTE) {
                struct iso_ifaddr *ia;
@@ -530,13 +539,14 @@ 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.
  */
+int
 clnp_srcroute(options, oidx, ro, 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 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 mbuf *options;   /* ptr to options */
+       struct clnp_optidx *oidx; /* index to options */
+       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 iso_addr dst;            /* first hop specified by src rt */
        int                             error = 0;      /* return code */
 {
        struct iso_addr dst;            /* first hop specified by src rt */
        int                             error = 0;      /* return code */
@@ -586,17 +596,18 @@ struct iso_addr           *final_dst;             /* final destination */
  *
  * SIDE EFFECTS:       prints notice, slows down system.
  */
  *
  * SIDE EFFECTS:       prints notice, slows down system.
  */
+int
 clnp_badmtu(ifp, rt, line, file)
 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 */
+       struct ifnet *ifp;      /* outgoing interface */
+       struct rtentry *rt; /* dst route */
+       int line;               /* where the dirty deed occured */
+       const 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");
 {
        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));
+       dump_isoaddr((struct sockaddr_iso *)rt_key(rt));
 #endif
        return ifp->if_mtu;
 }
 #endif
        return ifp->if_mtu;
 }
@@ -612,12 +623,15 @@ char *file;                       /* where the dirty deed occured */
  *
  * NOTES:                      No attempt has been made to make this efficient
  */
  *
  * NOTES:                      No attempt has been made to make this efficient
  */
+void
 clnp_ypocb(from, to, len)
 clnp_ypocb(from, to, len)
-caddr_t from;          /* src buffer */
-caddr_t to;                    /* dst buffer */
-u_int  len;            /* number of bytes */
+       caddr_t from;           /* src buffer */
+       caddr_t to;             /* dst buffer */
+       u_int   len;            /* number of bytes */
 {
        while (len--)
                *(to + len) = *(from + len);
 }
 {
        while (len--)
                *(to + len) = *(from + len);
 }
-#endif ISO
+#endif /* ISO */
+
+