/*++ /* NAME /* postscreen_state 3 /* SUMMARY /* postscreen session state and queue length management /* SYNOPSIS /* #include <postscreen.h> /* /* PSC_STATE *psc_new_session_state(stream, client_addr, client_port, /* server_addr, server_port) /* VSTREAM *stream; /* const char *client_addr; /* const char *client_port; /* const char *server_addr; /* const char *server_port; /* /* void psc_free_session_state(state) /* PSC_STATE *state; /* /* char *psc_print_state_flags(flags, context) /* int flags; /* const char *context; /* /* void PSC_ADD_SERVER_STATE(state, server_fd) /* PSC_STATE *state; /* int server_fd; /* /* void PSC_DEL_SERVER_STATE(state) /* PSC_STATE *state; /* /* void PSC_DEL_CLIENT_STATE(state) /* PSC_STATE *state; /* /* void PSC_DROP_SESSION_STATE(state, final_reply) /* PSC_STATE *state; /* const char *final_reply; /* /* void PSC_ENFORCE_SESSION_STATE(state, rcpt_reply) /* PSC_STATE *state; /* const char *rcpt_reply; /* /* void PSC_PASS_SESSION_STATE(state, testname, pass_flag) /* PSC_STATE *state; /* const char *testname; /* int pass_flag; /* /* void PSC_FAIL_SESSION_STATE(state, fail_flag) /* PSC_STATE *state; /* int fail_flag; /* /* void PSC_UNFAIL_SESSION_STATE(state, fail_flag) /* PSC_STATE *state; /* int fail_flag; /* DESCRIPTION /* This module maintains per-client session state, and two /* global file descriptor counters: /* .IP psc_check_queue_length /* The total number of remote SMTP client sockets. /* .IP psc_post_queue_length /* The total number of server file descriptors that are currently /* in use for client file descriptor passing. This number /* equals the number of client file descriptors in transit. /* .PP /* psc_new_session_state() creates a new session state object /* for the specified client stream, and increments the /* psc_check_queue_length counter. The flags and per-test time /* stamps are initialized with PSC_INIT_TESTS(), or for concurrent /* sessions, with PSC_INIT_TEST_FLAGS_ONLY(). The addr and /* port arguments are null-terminated strings with the remote /* SMTP client endpoint. The _reply members are set to /* polite "try again" SMTP replies. The protocol member is set /* to "SMTP". /* /* The psc_stress variable is set to non-zero when /* psc_check_queue_length passes over a high-water mark. /* /* psc_free_session_state() destroys the specified session state /* object, closes the applicable I/O channels, and decrements /* the applicable file descriptor counters: psc_check_queue_length /* and psc_post_queue_length. /* /* The psc_stress variable is reset to zero when psc_check_queue_length /* passes under a low-water mark. /* /* psc_print_state_flags() converts per-session flags into /* human-readable form. The context is for error reporting. /* The result is overwritten upon each call. /* /* PSC_ADD_SERVER_STATE() updates the specified session state /* object with the specified server file descriptor, and /* increments the global psc_post_queue_length file descriptor /* counter. /* /* PSC_DEL_SERVER_STATE() closes the specified session state /* object's server file descriptor, and decrements the global /* psc_post_queue_length file descriptor counter. /* /* PSC_DEL_CLIENT_STATE() updates the specified session state /* object, closes the client stream, and decrements the global /* psc_check_queue_length file descriptor counter. /* /* PSC_DROP_SESSION_STATE() updates the specified session state /* object and closes the client stream after sending the /* specified SMTP reply. /* /* PSC_ENFORCE_SESSION_STATE() updates the specified session /* state object. It arranges that the built-in SMTP engine /* logs sender/recipient information and rejects all RCPT TO /* commands with the specified SMTP reply. /* /* PSC_PASS_SESSION_STATE() sets the specified "pass" flag. /* The testname is used for debug logging. /* /* PSC_FAIL_SESSION_STATE() sets the specified "fail" flag. /* /* PSC_UNFAIL_SESSION_STATE() unsets the specified "fail" flag. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /* /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA
/*--*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.