|
|
1.1 ! root 1: /* pa2str.c - pretty-print PSAPaddr */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/compat/RCS/pa2str.c,v 7.0 89/11/30 20:55:02 mrose Exp $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/compat/RCS/pa2str.c,v 7.0 89/11/30 20:55:02 mrose Exp $ ! 9: * ! 10: * ! 11: * $Log: pa2str.c,v $ ! 12: * Revision 7.0 89/11/30 20:55:02 mrose ! 13: * Release 6.0 ! 14: * ! 15: */ ! 16: ! 17: /* ! 18: * NOTICE ! 19: * ! 20: * Acquisition, use, and distribution of this module and related ! 21: * materials are subject to the restrictions of a license agreement. ! 22: * Consult the Preface in the User's Manual for the full terms of ! 23: * this agreement. ! 24: * ! 25: */ ! 26: ! 27: ! 28: /* LINTLIBRARY */ ! 29: ! 30: #include <ctype.h> ! 31: #include <stdio.h> ! 32: #include "general.h" ! 33: #include "manifest.h" ! 34: #include "isoaddrs.h" ! 35: ! 36: /* Presentation Address to String */ ! 37: ! 38: char *pa2str (px) ! 39: register struct PSAPaddr *px; ! 40: { ! 41: register char *bp; ! 42: struct PSAPaddr pas; ! 43: register struct PSAPaddr *pa = &pas; ! 44: register struct TSAPaddr *ta = &pa -> pa_addr.sa_addr; ! 45: static char buffer[BUFSIZ]; ! 46: ! 47: bp = buffer; ! 48: ! 49: *pa = *px; /* struct copy */ ! 50: if (ta -> ta_selectlen > 0 ! 51: && ta -> ta_selectlen < sizeof ta -> ta_selector) { ! 52: register char *dp, ! 53: *ep; ! 54: register struct TSAPaddr *tz; ! 55: ! 56: for (ep = (dp = ta -> ta_selector) + ta -> ta_selectlen, *ep = NULL; ! 57: dp < ep; ! 58: dp++) ! 59: if (!isprint (*dp) && *dp != ' ') ! 60: break; ! 61: if (dp >= ep && (tz = str2taddr (ta -> ta_selector))) { ! 62: pa -> pa_addr.sa_addr = *tz; /* struct copy */ ! 63: (void) sprintf (bp, "%s through TS bridge at ", ! 64: paddr2str (pa, NULLNA)); ! 65: bp += strlen (bp); ! 66: ! 67: bzero ((char *) pa, sizeof *pa); ! 68: *ta = px -> pa_addr.sa_addr; /* struct copy */ ! 69: ta -> ta_selectlen = 0; ! 70: } ! 71: } ! 72: (void) strcpy (bp, paddr2str (pa, NULLNA)); ! 73: ! 74: return buffer; ! 75: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.