stats.c revision 058561cbaa119a6f2659bc27ef343e1b47266bb2
/*
* Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sendmail.h>
#include <sendmail/mailstats.h>
static struct statistics Stat;
static bool GotStats = false; /* set when we have stats to merge */
/*
** MARKSTATS -- mark statistics
**
** Parameters:
** e -- the envelope.
** to -- to address.
** type -- type of stats this represents.
**
** Returns:
** none.
**
** Side Effects:
** changes static Stat structure
*/
void
register ENVELOPE *e;
int type;
{
switch (type)
{
case STATS_QUARANTINE:
break;
case STATS_REJECT:
{
else
}
break;
case STATS_CONNECT:
else
break;
case STATS_NORMAL:
{
{
}
}
else
{
}
break;
default:
/* Silently ignore bogus call */
return;
}
GotStats = true;
}
/*
** CLEARSTATS -- clear statistics structure
**
** Parameters:
** none.
**
** Returns:
** none.
**
** Side Effects:
** clears the Stat structure.
*/
void
{
/* clear the structure to avoid future disappointment */
GotStats = false;
}
/*
** POSTSTATS -- post statistics in the statistics file
**
** Parameters:
** sfile -- the name of the statistics file.
**
** Returns:
** none.
**
** Side Effects:
** merges the Stat structure with the sfile file.
*/
void
char *sfile;
{
int fd;
static bool entered = false;
struct statistics stats;
return;
entered = true;
sff |= SFF_NOSLINK;
sff |= SFF_NOHLINK;
if (fd < 0)
{
if (LogLevel > 12)
errno = 0;
entered = false;
return;
}
{
/* merge current statistics into statfile */
register int i;
for (i = 0; i < MAXMAILERS; i++)
{
}
}
else
/* write out results */
/* clear the structure to avoid future disappointment */
clearstats();
entered = false;
}