Postfix3.3.1
データ構造 | マクロ定義 | 関数 | 変数
anvil.c ファイル
#include <sys_defs.h>
#include <sys/time.h>
#include <limits.h>
#include <msg.h>
#include <mymalloc.h>
#include <htable.h>
#include <stringops.h>
#include <events.h>
#include <mail_conf.h>
#include <mail_params.h>
#include <mail_version.h>
#include <mail_proto.h>
#include <anvil_clnt.h>
#include <mail_server.h>

[ソースコード]

データ構造

struct  ANVIL_REMOTE
 
struct  ANVIL_LOCAL
 
struct  ANVIL_REQ_TABLE
 
struct  ANVIL_MAX
 

マクロ定義

#define ANVIL_REMOTE_FIRST_CONN(remote, id)
 
#define ANVIL_REMOTE_FREE(remote)
 
#define ANVIL_REMOTE_RSET_RATE(remote, _start)
 
#define ANVIL_REMOTE_INCR_RATE(remote, _what)
 
#define ANVIL_REMOTE_NEXT_CONN(remote)
 
#define ANVIL_REMOTE_INCR_MAIL(remote)   ANVIL_REMOTE_INCR_RATE((remote), mail)
 
#define ANVIL_REMOTE_INCR_RCPT(remote)   ANVIL_REMOTE_INCR_RATE((remote), rcpt)
 
#define ANVIL_REMOTE_INCR_NTLS(remote)   ANVIL_REMOTE_INCR_RATE((remote), ntls)
 
#define ANVIL_REMOTE_INCR_AUTH(remote)   ANVIL_REMOTE_INCR_RATE((remote), auth)
 
#define ANVIL_REMOTE_DROP_ONE(remote)
 
#define ANVIL_LOCAL_INIT(local)
 
#define ANVIL_LOCAL_ADD_ONE(local, remote)
 
#define ANVIL_LOCAL_REMOTE_LINKED(local, remote)   ((local)->anvil_remote == (remote))
 
#define ANVIL_LOCAL_DROP_ONE(local, remote)
 
#define ANVIL_LOCAL_DROP_ALL(stream, local)
 
#define ANVIL_MAX_UPDATE(_max, _value, _ident)
 
#define ANVIL_MAX_RATE_REPORT(_max, _name)
 
#define ANVIL_MAX_COUNT_REPORT(_max, _name)
 
#define STR(x)   vstring_str(x)
 
#define STREQ(x, y)   (strcmp((x), (y)) == 0)
 

関数

int main (int argc, char **argv)
 

変数

int var_anvil_time_unit
 
int var_anvil_stat_time
 
 MAIL_VERSION_STAMP_DECLARE
 

マクロ定義詳解

#define ANVIL_LOCAL_ADD_ONE (   local,
  remote 
)
値:
do { \
/* XXX allow multiple remote clients per local server. */ \
if ((local)->anvil_remote) \
ANVIL_REMOTE_DROP_ONE((local)->anvil_remote); \
(local)->anvil_remote = (remote); \
} while(0)
#define ANVIL_REMOTE_DROP_ONE(remote)
Definition: anvil.c:403

anvil.c421 行目に定義があります。

#define ANVIL_LOCAL_DROP_ALL (   stream,
  local 
)
値:
do { \
/* XXX allow multiple remote clients per local server. */ \
if ((local)->anvil_remote) \
anvil_remote_disconnect((stream), (local)->anvil_remote->ident); \
} while (0)

anvil.c445 行目に定義があります。

#define ANVIL_LOCAL_DROP_ONE (   local,
  remote 
)
値:
do { \
/* XXX allow multiple remote clients per local server. */ \
if ((local)->anvil_remote == (remote)) \
(local)->anvil_remote = 0; \
} while(0)

anvil.c436 行目に定義があります。

#define ANVIL_LOCAL_INIT (   local)
値:
do { \
(local)->anvil_remote = 0; \
} while(0)

anvil.c414 行目に定義があります。

#define ANVIL_LOCAL_REMOTE_LINKED (   local,
  remote 
)    ((local)->anvil_remote == (remote))

anvil.c431 行目に定義があります。

#define ANVIL_MAX_COUNT_REPORT (   _max,
  _name 
)
値:
do { \
if (_max.value > 0) { \
msg_info("statistics: max " _name " count %d for (%s) at %.15s", \
_max.value, _max.ident, ctime(&_max.when) + 4); \
_max.value = 0; \
} \
} while (0);
void msg_info(const char *fmt,...)
Definition: msg.c:199

anvil.c506 行目に定義があります。

#define ANVIL_MAX_RATE_REPORT (   _max,
  _name 
)
値:
do { \
if (_max.value > 0) { \
msg_info("statistics: max " _name " rate %d/%ds for (%s) at %.15s", \
_max.value, var_anvil_time_unit, \
_max.ident, ctime(&_max.when) + 4); \
_max.value = 0; \
} \
} while (0);
int var_anvil_time_unit
Definition: anvil.c:301
void msg_info(const char *fmt,...)
Definition: msg.c:199

anvil.c496 行目に定義があります。

#define ANVIL_MAX_UPDATE (   _max,
  _value,
  _ident 
)
値:
do { \
_max.value = _value; \
if (_max.ident == 0) { \
_max.ident = mystrdup(_ident); \
} else if (!STREQ(_max.ident, _ident)) { \
myfree(_max.ident); \
_max.ident = mystrdup(_ident); \
} \
_max.when = event_time(); \
} while (0)
void myfree(void *ptr)
Definition: mymalloc.c:207
char * mystrdup(const char *str)
Definition: mymalloc.c:225
#define STREQ(x, y)
Definition: anvil.c:519
time_t event_time(void)
Definition: events.c:647

anvil.c484 行目に定義があります。

#define ANVIL_REMOTE_DROP_ONE (   remote)
値:
do { \
if ((remote) && (remote)->count > 0) { \
if (--(remote)->count == 0) \
event_request_timer(anvil_remote_expire, (void *) remote, \
} \
} while(0)
int var_anvil_time_unit
Definition: anvil.c:301
time_t event_request_timer(EVENT_NOTIFY_TIME_FN callback, void *context, int delay)
Definition: events.c:894

anvil.c403 行目に定義があります。

#define ANVIL_REMOTE_FIRST_CONN (   remote,
  id 
)
値:
do { \
(remote)->ident = mystrdup(id); \
(remote)->count = 1; \
(remote)->rate = 1; \
(remote)->mail = 0; \
(remote)->rcpt = 0; \
(remote)->ntls = 0; \
(remote)->auth = 0; \
(remote)->start = event_time(); \
} while(0)
char * mystrdup(const char *str)
Definition: mymalloc.c:225
time_t event_time(void)
Definition: events.c:647

anvil.c342 行目に定義があります。

#define ANVIL_REMOTE_FREE (   remote)
値:
do { \
myfree((remote)->ident); \
myfree((void *) (remote)); \
} while(0)
void myfree(void *ptr)
Definition: mymalloc.c:207

anvil.c356 行目に定義があります。

#define ANVIL_REMOTE_INCR_AUTH (   remote)    ANVIL_REMOTE_INCR_RATE((remote), auth)

anvil.c399 行目に定義があります。

#define ANVIL_REMOTE_INCR_MAIL (   remote)    ANVIL_REMOTE_INCR_RATE((remote), mail)

anvil.c393 行目に定義があります。

#define ANVIL_REMOTE_INCR_NTLS (   remote)    ANVIL_REMOTE_INCR_RATE((remote), ntls)

anvil.c397 行目に定義があります。

#define ANVIL_REMOTE_INCR_RATE (   remote,
  _what 
)
値:
do { \
time_t _now = event_time(); \
if ((remote)->start + var_anvil_time_unit < _now) \
ANVIL_REMOTE_RSET_RATE((remote), _now); \
if ((remote)->_what < INT_MAX) \
(remote)->_what += 1; \
} while(0)
int var_anvil_time_unit
Definition: anvil.c:301
time_t event_time(void)
Definition: events.c:647
#define ANVIL_REMOTE_RSET_RATE(remote, _start)
Definition: anvil.c:364

anvil.c374 行目に定義があります。

#define ANVIL_REMOTE_INCR_RCPT (   remote)    ANVIL_REMOTE_INCR_RATE((remote), rcpt)

anvil.c395 行目に定義があります。

#define ANVIL_REMOTE_NEXT_CONN (   remote)
値:
do { \
ANVIL_REMOTE_INCR_RATE((remote), rate); \
if ((remote)->count == 0) \
event_cancel_timer(anvil_remote_expire, (void *) remote); \
(remote)->count++; \
} while(0)
#define ANVIL_REMOTE_INCR_RATE(remote, _what)
Definition: anvil.c:374
int event_cancel_timer(EVENT_NOTIFY_TIME_FN callback, void *context)
Definition: events.c:965

anvil.c385 行目に定義があります。

#define ANVIL_REMOTE_RSET_RATE (   remote,
  _start 
)
値:
do { \
(remote)->rate = 0; \
(remote)->mail = 0; \
(remote)->rcpt = 0; \
(remote)->ntls = 0; \
(remote)->auth = 0; \
(remote)->start = _start; \
} while(0)

anvil.c364 行目に定義があります。

#define STR (   x)    vstring_str(x)

anvil.c518 行目に定義があります。

#define STREQ (   x,
 
)    (strcmp((x), (y)) == 0)

anvil.c519 行目に定義があります。

関数詳解

int main ( int  argc,
char **  argv 
)

anvil.c1010 行目に定義があります。

変数詳解

MAIL_VERSION_STAMP_DECLARE

anvil.c1006 行目に定義があります。

int var_anvil_stat_time

anvil.c302 行目に定義があります。

int var_anvil_time_unit

anvil.c301 行目に定義があります。