diff options
Diffstat (limited to 'usr.sbin/smtpd/smtpd.h')
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 1f112c94af9..d1d84cccc58 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.208 2011/04/13 20:53:18 gilles Exp $ */ +/* $OpenBSD: smtpd.h,v 1.209 2011/04/14 17:06:43 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -634,6 +634,7 @@ struct smtpd { struct passwd *sc_pw; char sc_hostname[MAXHOSTNAMELEN]; struct ramqueue sc_rqueue; + struct queue_backend *sc_queue; TAILQ_HEAD(listenerlist, listener) *sc_listeners; TAILQ_HEAD(maplist, map) *sc_maps, *sc_maps_reload; @@ -901,6 +902,40 @@ struct map_virtual { }; +/* queue structures */ +enum queue_type { + QT_INVALID=0, + QT_FS +}; + +enum queue_kind { + Q_INVALID=0, + Q_ENQUEUE, + Q_INCOMING, + Q_QUEUE, + Q_PURGE, + Q_OFFLINE, + Q_BOUNCE +}; + +enum queue_op { + QOP_INVALID=0, + QOP_CREATE, + QOP_DELETE, + QOP_UPDATE, + QOP_COMMIT, + QOP_LOAD, + QOP_FD_R, + QOP_FD_RW +}; + +struct queue_backend { + enum queue_type type; + int (*message)(struct smtpd *, enum queue_kind, enum queue_op, char *); + int (*envelope)(struct smtpd *, enum queue_kind, enum queue_op, + struct message *); +}; + extern void (*imsg_callback)(struct smtpd *, struct imsgev *, struct imsg *); @@ -1017,6 +1052,25 @@ void queue_commit_envelopes(struct smtpd *, struct message*); u_int16_t queue_hash(char *); +/* queue_backend.c */ +struct queue_backend *queue_backend_lookup(enum queue_type); +int queue_message_create(struct smtpd *, enum queue_kind, char *); +int queue_message_delete(struct smtpd *, enum queue_kind, char *); +int queue_message_commit(struct smtpd *, enum queue_kind, char *); +int queue_message_fd_r(struct smtpd *, enum queue_kind, char *); +int queue_message_fd_rw(struct smtpd *, enum queue_kind, char *); +int queue_envelope_create(struct smtpd *, enum queue_kind, + struct message *); +int queue_envelope_delete(struct smtpd *, enum queue_kind, + struct message *); +int queue_envelope_load(struct smtpd *, enum queue_kind, + char *, struct message *); +int queue_envelope_update(struct smtpd *, enum queue_kind, + struct message *); + + + + /* queue_shared.c */ int queue_create_layout_message(char *, char *); void queue_delete_layout_message(char *, char *); |