BSD 4_3_Net_2 release
[unix-history] / usr / src / sys / netiso / clnp_debug.c
index c0772b0..7e0621d 100644 (file)
@@ -1,3 +1,38 @@
+/*-
+ * 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_debug.c        7.8 (Berkeley) 5/27/91
+ */
+
 /***********************************************************
                Copyright IBM Corporation 1987
 
 /***********************************************************
                Copyright IBM Corporation 1987
 
@@ -26,11 +61,6 @@ SOFTWARE.
  */
 /* $Header: clnp_debug.c,v 4.2 88/06/29 14:58:34 hagens Exp $ */
 /* $Source: /usr/argo/sys/netargo/RCS/clnp_debug.c,v $ */
  */
 /* $Header: clnp_debug.c,v 4.2 88/06/29 14:58:34 hagens Exp $ */
 /* $Source: /usr/argo/sys/netargo/RCS/clnp_debug.c,v $ */
-/*     @(#)clnp_debug.c        7.4 (Berkeley) %G% */
-
-#ifndef lint
-static char *rcsid = "$Header: clnp_debug.c,v 4.2 88/06/29 14:58:34 hagens Exp $";
-#endif lint
 
 #include "types.h"
 #include "param.h"
 
 #include "types.h"
 #include "param.h"
@@ -137,7 +167,7 @@ struct iso_addr *isoa;
        char    *cp;
 
        /* print length */
        char    *cp;
 
        /* print length */
-       clnp_sprintf(iso_addr_b, "[%d] ", isoa->isoa_len);
+       sprintf(iso_addr_b, "[%d] ", isoa->isoa_len);
 
        /* set cp to end of what we have */
        cp = iso_addr_b;
 
        /* set cp to end of what we have */
        cp = iso_addr_b;
@@ -181,7 +211,7 @@ struct iso_addr *isoa;
                                cp = clnp_hexp(&o986->o986_vers, 1, cp);
                                *cp++ = DELIM;
 #ifdef  vax
                                cp = clnp_hexp(&o986->o986_vers, 1, cp);
                                *cp++ = DELIM;
 #ifdef  vax
-                               clnp_sprintf(cp, "%d.%d.%d.%d.%d", 
+                               sprintf(cp, "%d.%d.%d.%d.%d", 
                                o986->o986_inetaddr[0] & 0xff,
                                o986->o986_inetaddr[1] & 0xff,
                                o986->o986_inetaddr[2] & 0xff,
                                o986->o986_inetaddr[0] & 0xff,
                                o986->o986_inetaddr[1] & 0xff,
                                o986->o986_inetaddr[2] & 0xff,
@@ -227,95 +257,4 @@ register struct sockaddr_iso *s;
        return (iso_addr_b);
 }
 
        return (iso_addr_b);
 }
 
-
-/*
- *             The following hacks are a trimmed down version of sprintf.
- */
-/*VARARGS1*/
-/*ARGSUSED*/
-clnp_sprintf(buf, fmt, x1, x2)
-       register char *buf, *fmt;
-       unsigned x1, x2;
-{
-       clnp_prf(buf, fmt, (unsigned int *)&x1);
-}
-
-clnp_prf(buf, fmt, adx)
-       register char   *buf;
-       register char *fmt;
-       register unsigned int *adx;
-{
-       register int b, c, i;
-       char *s;
-       char *clnp_printn();
-
-loop:
-       while ((c = *fmt++) != '%') {
-               if(c == '\0') {
-                       *buf++ = (char)0;
-                       return;
-               }
-               *buf++ = c;
-       }
-again:
-       c = *fmt++;
-       switch (c) {
-       case 'l':
-               goto again;
-       case 'x': case 'X':
-               b = 16;
-               goto number;
-       case 'd': case 'D':
-       case 'u':               /* what a joke */
-               b = 10;
-               goto number;
-       case 'o': case 'O':
-               b = 8;
-number:
-               buf = clnp_printn((unsigned long)*adx, b, buf);
-               break;
-       case 'c':
-               b = *adx;
-               for (i = 24; i >= 0; i -= 8)
-                       if (c = (b >> i) & 0x7f)
-                               *buf++ = c;
-               break;
-
-       case 's':
-               s = (char *)*adx;
-               while (*s)
-                       *buf++ = *s++;
-               break;
-
-       case '%':
-               *buf++ = '%';
-               break;
-       }
-       adx++;
-       goto loop;
-}
-
-char *
-clnp_printn(n, b, where)
-unsigned long  n;
-int            b;
-char   *where;
-{
-       char prbuf[11];
-       register char *cp;
-
-       if (b == 10 && (int)n < 0) {
-               *where++ = '-';
-               n = (unsigned)(-(int)n);
-       }
-       cp = prbuf;
-       do {
-               *cp++ = "0123456789abcdef"[n%b];
-               n /= b;
-       } while (n);
-       do {
-               *where++ = *--cp;
-       } while (cp > prbuf);
-       return(where);
-}
 #endif ARGO_DEBUG
 #endif ARGO_DEBUG