|
|
BSD 4.3reno
/* pa2str.c - pretty-print PSAPaddr */
#ifndef lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/compat/pa2str.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif
/*
* $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/compat/pa2str.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
*
*
* $Log: pa2str.c,v $
* Revision 1.1.1.1 2018/04/24 16:12:56 root
* BSD 4.3reno
*
* Revision 7.0 89/11/30 20:55:02 mrose
* Release 6.0
*
*/
/*
* NOTICE
*
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
* this agreement.
*
*/
/* LINTLIBRARY */
#include <ctype.h>
#include <stdio.h>
#include "general.h"
#include "manifest.h"
#include "isoaddrs.h"
/* Presentation Address to String */
char *pa2str (px)
register struct PSAPaddr *px;
{
register char *bp;
struct PSAPaddr pas;
register struct PSAPaddr *pa = &pas;
register struct TSAPaddr *ta = &pa -> pa_addr.sa_addr;
static char buffer[BUFSIZ];
bp = buffer;
*pa = *px; /* struct copy */
if (ta -> ta_selectlen > 0
&& ta -> ta_selectlen < sizeof ta -> ta_selector) {
register char *dp,
*ep;
register struct TSAPaddr *tz;
for (ep = (dp = ta -> ta_selector) + ta -> ta_selectlen, *ep = NULL;
dp < ep;
dp++)
if (!isprint (*dp) && *dp != ' ')
break;
if (dp >= ep && (tz = str2taddr (ta -> ta_selector))) {
pa -> pa_addr.sa_addr = *tz; /* struct copy */
(void) sprintf (bp, "%s through TS bridge at ",
paddr2str (pa, NULLNA));
bp += strlen (bp);
bzero ((char *) pa, sizeof *pa);
*ta = px -> pa_addr.sa_addr; /* struct copy */
ta -> ta_selectlen = 0;
}
}
(void) strcpy (bp, paddr2str (pa, NULLNA));
return buffer;
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.