DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T x

⟦d3dcc5fd9⟧ TextFile

    Length: 2869 (0xb35)
    Types: TextFile
    Names: »x400trace2rfc.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« 
        └─⟦e5a54fb17⟧ 
            └─⟦this⟧ »pp-5.0/Lib/format/x400trace2rfc.c« 

TextFile

/* x400trace2rfc: converts an x400 Trace struct into an RFC string as by RFC 1138 */

# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Lib/format/RCS/x400trace2rfc.c,v 5.0 90/09/20 16:06:14 pp Exp Locker: pp $";
# endif

/*
 * $Header: /cs/research/pp/hubris/pp-beta/Lib/format/RCS/x400trace2rfc.c,v 5.0 90/09/20 16:06:14 pp Exp Locker: pp $
 *
 * $Log:	x400trace2rfc.c,v $
 * Revision 5.0  90/09/20  16:06:14  pp
 * rcsforce : 5.0 public release
 * 
 */



#include	"util.h"
#include	"mta.h"

extern void	globalid2rfc();
extern UTC	utclocalise();

int	x400trace2rfc (trace, buffer)
Trace 	*trace;
char	*buffer;
{
	char	tbuf[LINESIZE];
	UTC	lut;
	if (trace == (Trace *) NULL)
		return DONE;
	 
	(void) sprintf(buffer, "by");
	if (trace->trace_mta != NULL)
		(void) sprintf(buffer, "%s mta %s in",
			       buffer,
			       trace->trace_mta);
	globalid2rfc(&trace -> trace_DomId, tbuf);
	(void) sprintf(buffer, "%s %s;",
		       buffer,tbuf);

	if (trace->trace_DomSinfo.dsi_deferred != 0 
	    && (lut = utclocalise(trace->trace_DomSinfo.dsi_deferred)) != NULLUTC
	    && UTC2rfc (lut, tbuf) == OK) {
		(void) sprintf (buffer, "%s deferred until %s;",
				buffer, tbuf);
		free ((char *) lut);
	}

	if (trace->trace_DomSinfo.dsi_converted.eit_types != NULL) {
		LIST_BPT *ix = trace->trace_DomSinfo.dsi_converted.eit_types;
		int	first = TRUE;
		(void) sprintf(buffer, "%s converted (", 
			       buffer);
		while (ix != NULL) {
			if (first == TRUE) {
				first = FALSE;
				(void) sprintf(buffer, "%s%s",
					       buffer, ix->li_name);
			} else
				(void) sprintf(buffer, "%s, %s",
					       buffer, ix->li_name);
			ix = ix->li_next;
		}
		(void) sprintf(buffer, "%s);", buffer);
	}

	if (trace->trace_DomSinfo.dsi_attempted_md.global_Country != NULLCP) {
		(void) sprintf(buffer, "%s attempted", buffer);
		if (trace->trace_DomSinfo.dsi_attempted_mta != NULLCP)
			(void) sprintf(buffer, "%s mta %s in",
				       buffer,
				       trace->trace_DomSinfo.dsi_attempted_mta);
		globalid2rfc(&(trace->trace_DomSinfo.dsi_attempted_md), tbuf);
		(void) sprintf(buffer, "%s %s;",
			       buffer, tbuf);

	}
	if (trace->trace_DomSinfo.dsi_action ==  ACTION_RELAYED)
		(void) sprintf(buffer, "%s Relayed",
			       buffer);
	else if (trace->trace_DomSinfo.dsi_action == ACTION_ROUTED)
		(void) sprintf(buffer, "%s Rerouted",
			       buffer);

	if (trace->trace_DomSinfo.dsi_other_actions & ACTION_REDIRECTED)
		(void) sprintf(buffer, "%s Redirected",
			       buffer);
	if (trace->trace_DomSinfo.dsi_other_actions & ACTION_EXPANDED)
		(void) sprintf(buffer, "%s Expanded",
			       buffer);
	lut = utclocalise(trace->trace_DomSinfo.dsi_time);
	if (UTC2rfc(lut, tbuf) == OK)
		(void) sprintf(buffer, "%s; %s", buffer, tbuf);
	if (lut) free((char *) lut);
	PP_DBG (("Lib/x400trace2rfc returns (%s)", buffer));
	return OK;
}