Home | History | Annotate | Line # | Download | only in qmqpd
      1 /*	$NetBSD: qmqpd.h,v 1.1.1.1 2009/06/23 10:08:53 tron Exp $	*/
      2 
      3 /*++
      4 /* NAME
      5 /*	qmqpd 3h
      6 /* SUMMARY
      7 /*	Postfix QMQP server
      8 /* SYNOPSIS
      9 /*	include "qmqpd.h"
     10 /* DESCRIPTION
     11 /* .nf
     12 
     13  /*
     14   * System library.
     15   */
     16 #include <sys/time.h>
     17 
     18  /*
     19   * Utility library.
     20   */
     21 #include <vstream.h>
     22 #include <vstring.h>
     23 
     24  /*
     25   * Global library.
     26   */
     27 #include <mail_stream.h>
     28 
     29  /*
     30   * Per-session state.
     31   */
     32 typedef struct {
     33     int     err;			/* error flags */
     34     VSTREAM *client;			/* client connection */
     35     VSTRING *message;			/* message buffer */
     36     VSTRING *buf;			/* line buffer */
     37     struct timeval arrival_time;	/* start of session */
     38     char   *name;			/* client name */
     39     char   *addr;			/* client IP address */
     40     char   *port;			/* client TCP port */
     41     char   *namaddr;			/* name[addr]:port */
     42     char   *rfc_addr;			/* RFC 2821 client IP address */
     43     int     addr_family;		/* address family */
     44     char   *queue_id;			/* queue file ID */
     45     VSTREAM *cleanup;			/* cleanup server */
     46     MAIL_STREAM *dest;			/* cleanup server */
     47     int     rcpt_count;			/* recipient count */
     48     char   *reason;			/* exception name */
     49     char   *sender;			/* sender address */
     50     char   *recipient;			/* recipient address */
     51     char   *protocol;			/* protocol name */
     52     char   *where;			/* protocol state */
     53     VSTRING *why_rejected;		/* REJECT reason */
     54 } QMQPD_STATE;
     55 
     56  /*
     57   * Representation of unknown upstream client or message information within
     58   * qmqpd processes. This is not the representation that Postfix uses in
     59   * queue files, in queue manager delivery requests, or in XCLIENT/XFORWARD
     60   * commands!
     61   */
     62 #define CLIENT_ATTR_UNKNOWN	"unknown"
     63 
     64 #define CLIENT_NAME_UNKNOWN	CLIENT_ATTR_UNKNOWN
     65 #define CLIENT_ADDR_UNKNOWN	CLIENT_ATTR_UNKNOWN
     66 #define CLIENT_PORT_UNKNOWN	CLIENT_ATTR_UNKNOWN
     67 #define CLIENT_NAMADDR_UNKNOWN	CLIENT_ATTR_UNKNOWN
     68 
     69  /*
     70   * QMQP protocol status codes.
     71   */
     72 #define QMQPD_STAT_OK		'K'
     73 #define QMQPD_STAT_RETRY	'Z'
     74 #define QMQPD_STAT_HARD		'D'
     75 
     76  /*
     77   * qmqpd_state.c
     78   */
     79 QMQPD_STATE *qmqpd_state_alloc(VSTREAM *);
     80 void    qmqpd_state_free(QMQPD_STATE *);
     81 
     82  /*
     83   * qmqpd_peer.c
     84   */
     85 void    qmqpd_peer_init(QMQPD_STATE *);
     86 void    qmqpd_peer_reset(QMQPD_STATE *);
     87 
     88 /* LICENSE
     89 /* .ad
     90 /* .fi
     91 /*	The Secure Mailer license must be distributed with this software.
     92 /* AUTHOR(S)
     93 /*	Wietse Venema
     94 /*	IBM T.J. Watson Research
     95 /*	P.O. Box 704
     96 /*	Yorktown Heights, NY 10598, USA
     97 /*--*/
     98