(void) sprintf(t, "%02d:%02d:%02d.%-.6ld ", tm->tm_hour, tm->tm_min, tm->tm_sec, ipl->ipl_usec);
(void) strftime(t, sizeof(line) - (t - line), "%T", tm); t += strlen(t); (void) sprintf(t, ".%-.6ld ", ipl->ipl_usec);
static	void	print_statelog(log, buf, blen)FILE	*log;char	*buf;int	blen;{	struct	ipslog *sl;	iplog_t	*ipl = (iplog_t *)buf;	struct	protoent *pr;	char	*t = line, *proto, pname[6];	struct	tm	*tm;	int	res;	sl = (struct ipslog *)((char *)ipl + sizeof(*ipl));	res = (opts & OPT_RESOLVE) ? 1 : 0;	tm = localtime((time_t *)&ipl->ipl_sec);	if (!(opts & OPT_SYSLOG)) {		(void) sprintf(t, "%2d/%02d/%4d ",			tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900);		t += strlen(t);	}	(void) sprintf(t, "%02d:%02d:%02d.%-.6ld ",		tm->tm_hour, tm->tm_min, tm->tm_sec, ipl->ipl_usec);	t += strlen(t);	if (sl->isl_type == ISL_NEW)		strcpy(t, "STATE:NEW ");	else if (sl->isl_type == ISL_EXPIRE)		strcpy(t, "STATE:EXPIRE ");	else		sprintf(t, "Type: %d ", sl->isl_type);	t += strlen(t);	pr = getprotobynumber((int)sl->isl_p);	if (!pr) {		proto = pname;		sprintf(proto, "%d", (u_int)sl->isl_p);	} else		proto = pr->p_name;	if (sl->isl_p == IPPROTO_TCP || sl->isl_p == IPPROTO_UDP) {		(void) sprintf(t, "%s,%s -> ",			hostname(res, sl->isl_src),			portname(res, proto, sl->isl_sport));		t += strlen(t);		(void) sprintf(t, "%s,%s PR %s",			hostname(res, sl->isl_dst),			portname(res, proto, sl->isl_dport), proto);	} else if (sl->isl_p == IPPROTO_ICMP) {		(void) sprintf(t, "%s -> ", hostname(res, sl->isl_src));		t += strlen(t);		(void) sprintf(t, "%s PR icmp %d",			hostname(res, sl->isl_dst), sl->isl_itype);	}	t += strlen(t);	if (sl->isl_type != ISL_NEW) {#ifdef	USE_QUAD_T		(void) sprintf(t, " Pkts %qd Bytes %qd",#else		(void) sprintf(t, " Pkts %ld Bytes %ld",#endif				sl->isl_pkts, sl->isl_bytes);		t += strlen(t);	}	*t++ = '\n';	*t++ = '\0';	if (opts & OPT_SYSLOG)		syslog(LOG_INFO, "%s", line);	else		(void) fprintf(log, "%s", line);}