aboutsummaryrefslogtreecommitdiff
path: root/gacopyz/gacopyz.h
diff options
context:
space:
mode:
Diffstat (limited to 'gacopyz/gacopyz.h')
-rw-r--r--gacopyz/gacopyz.h58
1 files changed, 36 insertions, 22 deletions
diff --git a/gacopyz/gacopyz.h b/gacopyz/gacopyz.h
index f0b5bff2..f7d547a7 100644
--- a/gacopyz/gacopyz.h
+++ b/gacopyz/gacopyz.h
@@ -48,6 +48,13 @@ extern "C" {
/* Implementation version number */
#define SMFI_VERSION 0x01000000
+#define SM_LM_VRS_MAJOR(v) (((v) & 0x7f000000) >> 24)
+#define SM_LM_VRS_MINOR(v) (((v) & 0x007fff00) >> 8)
+#define SM_LM_VRS_PLVL(v) ((v) & 0x0000007f)
+
+#define GACOPYZ_SM_MKVER(maj,min,pat) \
+ ((((maj) & 0x7f)<<24) | (((min) & 0x7ffff) << 8) | ((pat) & 0x7f))
+
/* Milter protocol version */
#define SMFI_PROT_VERSION 6
@@ -199,26 +206,26 @@ typedef union {
struct sockaddr_un sunix;
} milter_sockaddr_t;
-enum macro_index {
- maci_conn,
- maci_helo,
- maci_mail,
- maci_rcpt,
- maci_data,
- maci_eom,
- maci_eoh,
+enum gacopyz_stage {
+ gacopyz_stage_conn,
+ gacopyz_stage_helo,
+ gacopyz_stage_mail,
+ gacopyz_stage_rcpt,
+ gacopyz_stage_data,
+ gacopyz_stage_eom,
+ gacopyz_stage_eoh,
- maci_max,
- maci_none = maci_max
+ gacopyz_stage_max,
+ gacopyz_stage_none = gacopyz_stage_max
};
-#define SMFIM_CONNECT maci_conn
-#define SMFIM_HELO maci_helo
-#define SMFIM_ENVFROM maci_mail
-#define SMFIM_ENVRCPT maci_rcpt
-#define SMFIM_DATA maci_data
-#define SMFIM_EOM maci_eom
-#define SMFIM_EOH maci_eoh
+#define SMFIM_CONNECT gacopyz_stage_conn
+#define SMFIM_HELO gacopyz_stage_helo
+#define SMFIM_ENVFROM gacopyz_stage_mail
+#define SMFIM_ENVRCPT gacopyz_stage_rcpt
+#define SMFIM_DATA gacopyz_stage_data
+#define SMFIM_EOM gacopyz_stage_eom
+#define SMFIM_EOH gacopyz_stage_eoh
#define _SOCK_ADDR milter_sockaddr_t
#define smfiDesc gacopyz_milter_descr
@@ -275,6 +282,7 @@ struct gacopyz_milter_descr
};
/* Standard API calls */
+extern int smfi_version (unsigned int *, unsigned int *, unsigned int *);
extern int smfi_opensocket (int);
extern int smfi_register (struct smfiDesc);
extern int smfi_main (void);
@@ -365,15 +373,17 @@ int gacopyz_replace_body(SMFICTX *ctx, const unsigned char *bodyp,
size_t bodylen);
int gacopyz_progress(SMFICTX *ctx);
int gacopyz_quarantine(SMFICTX *ctx, const char *reason);
-int gacopyz_addrcpt_par(SMFICTX *ctx, const char *rcpt, const char *args);
+int gacopyz_add_rcpt_par(SMFICTX *ctx, const char *rcpt, const char *args);
int gacopyz_chgfrom(SMFICTX *ctx, const char *from, const char *args);
-int gacopyz_setsymlist(SMFICTX *ctx, enum macro_index ind, const char *macros);
+int gacopyz_setsymlist(SMFICTX *ctx, enum gacopyz_stage ind, const char *macros);
int gacopyz_setpriv (SMFICTX *ctx, void *data);
void *gacopyz_getpriv (SMFICTX *ctx);
/* Logging (extensions) */
+extern const char *gacopyz_stage_name[gacopyz_stage_max];
+
#define GACOPYZ_VBUFSIZE 69
size_t gacopyz_format_vbuf(char vbuf[GACOPYZ_VBUFSIZE], const char *buf,
size_t size);
@@ -411,6 +421,10 @@ void gacopyz_srv_iterate_macros (gacopyz_srv_t srv,
void *data),
void *data);
void gacopyz_srv_count_macros (gacopyz_srv_t srv, size_t *count);
+
+const char **gacopyz_srv_get_required_macros(gacopyz_srv_t srv,
+ enum gacopyz_stage stage);
+
int gacopyz_srv_connect (gacopyz_srv_t srv);
int gacopyz_srv_init(gacopyz_srv_t srv);
int gacopyz_srv_negotiate(gacopyz_srv_t srv);
@@ -440,9 +454,9 @@ void gacopyz_srv_set_callback(gacopyz_srv_t srv,
void gacopyz_srv_set_callback_data(gacopyz_srv_t, void *);
int gacopyz_srv_set_source(gacopyz_srv_t srv, unsigned long addr);
-int gacopyz_srv_set_version(gacopyz_srv_t srv, int version);
-int gacopyz_srv_set_protocol(gacopyz_srv_t srv, int proto);
-int gacopyz_srv_set_actions(gacopyz_srv_t srv, int acts);
+int gacopyz_srv_set_version(gacopyz_srv_t srv, unsigned long version);
+int gacopyz_srv_set_protocol(gacopyz_srv_t srv, unsigned long proto);
+int gacopyz_srv_set_actions(gacopyz_srv_t srv, unsigned long acts);
#define GACOPYZ_WRITE_TIMEOUT 10
#define GACOPYZ_READ_TIMEOUT 10

Return to:

Send suggestions and report system problems to the System administrator.