|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T r
Length: 3678 (0xe5e)
Types: TextFile
Names: »reprecip2rfc.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z«
└─⟦e5a54fb17⟧
└─⟦this⟧ »pp-5.0/Lib/format/reprecip2rfc.c«
/* reprecip2rfc.c - Converts a Rrseq struct into a RFC string */
# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Lib/format/RCS/reprecip2rfc.c,v 5.0 90/09/20 16:05:09 pp Exp Locker: pp $";
# endif
/*
* $Header: /cs/research/pp/hubris/pp-beta/Lib/format/RCS/reprecip2rfc.c,v 5.0 90/09/20 16:05:09 pp Exp Locker: pp $
*
* $Log: reprecip2rfc.c,v $
* Revision 5.0 90/09/20 16:05:09 pp
* rcsforce : 5.0 public release
*
*/
#include "util.h"
#include <isode/cmd_srch.h>
#include "dr.h"
extern CMD_TABLE
rr_rcode [/* reason-codes */],
rr_dcode [/* diagnostic-codes */];
extern UTC utclocalise();
extern void encinfo2rfc ();
static void lastrace2rfc ();
/* --------------------- Begin Routines -------------------------------- */
void reprecip2rfc (rp, ap, buffer) /* ReportedRecipientInfo -> RFC */
Rrinfo *rp;
ADDR *ap;
char *buffer;
{
int i;
char tbuf [LOTS*3],
obuf [LOTS*3];
if (rp == NULL)
return;
bzero (&obuf[0], sizeof obuf);
if (rp -> rr_recip)
(void) strcpy (obuf, ap -> ad_r822adr);
else {
(void) strcpy (buffer, "\0");
return;
}
(void) strcat (obuf, "; ");
lastrace2rfc (rp, tbuf);
(void) strcat (obuf, tbuf);
(void) sprintf (tbuf, "ext %d ", ap -> ad_extension);
(void) strcat (obuf, tbuf);
i = mem2prf (ap -> ad_resp, ap -> ad_mtarreq, ap -> ad_usrreq);
(void) sprintf (tbuf, "flags %02d", i);
(void) strcat (obuf, tbuf);
if (rp -> rr_originally_intended_recip &&
rp -> rr_originally_intended_recip->fn_addr) {
(void) sprintf (tbuf, " intended %s",
rp -> rr_originally_intended_recip -> fn_addr);
(void) strcat (obuf, tbuf);
}
if (rp -> rr_supplementary) {
(void) sprintf (tbuf, " info %s", rp->rr_supplementary);
(void) strcat (obuf, tbuf);
}
else if (rp -> rr_report.rep_type == DR_REP_FAILURE) {
(void) sprintf (tbuf, " info %s",
"Extra information on the failure was not supplied");
(void) strcat (obuf, tbuf);
}
(void) strcpy (buffer, obuf);
PP_DBG (("Lib/rri2rfc returns (%s)", buffer));
return;
}
static void lastrace2rfc (rp, buffer) /* LastTraceInformation -> RFC */
Rrinfo *rp;
char *buffer;
{
Delinfo *dliv;
NonDelinfo *ndliv;
char obuf [LOTS*3],
tbuf [LOTS*3];
UTC lut;
bzero (&obuf[0], sizeof obuf);
switch (rp -> rr_report.rep_type) {
case DR_REP_SUCCESS:
dliv = &rp -> rr_report.rep.rep_dinfo;
if (dliv->del_time == NULLUTC)
dliv -> del_time = utcnow ();
lut = utclocalise(dliv -> del_time);
(void) UTC2rfc (lut, tbuf);
free((char *) lut);
(void) sprintf (obuf, "SUCCESS %s; %d; ",
tbuf, dliv -> del_type);
break;
case DR_REP_FAILURE:
ndliv = &rp -> rr_report.rep.rep_ndinfo;
(void) sprintf (obuf, "FAILURE %d (%s); %d (%s); ",
ndliv -> nd_rcode,
rcmd_srch (ndliv -> nd_rcode, rr_rcode),
ndliv -> nd_dcode,
rcmd_srch (ndliv -> nd_dcode, rr_dcode));
break;
default:
PP_LOG (LLOG_EXCEPTIONS,
("Lib/lastrace2rfc/Unknown report type %d",
rp -> rr_report.rep_type));
(void) strcpy (buffer, "\0");
return;
}
if (rp -> rr_arrival == NULLUTC)
rp -> rr_arrival = utcnow ();
lut = utclocalise (rp -> rr_arrival);
(void) UTC2rfc (lut, tbuf);
free ((char *) lut);
(void) strcat (obuf, tbuf);
(void) strcat (obuf, ";");
if (rp -> rr_converted) {
tbuf[0] = NULL;
encinfo2rfc (rp -> rr_converted, tbuf);
if (tbuf[0]) {
(void) strcat (obuf, " converted");
(void) strcat (obuf, "(");
(void) strcat (obuf, tbuf);
(void) strcat (obuf, ")");
(void) strcat (obuf, "; ");
}
}
(void) strcpy (buffer, obuf);
PP_DBG (("Lib/lastrace2rfc returns (%s)", buffer));
return;
}