add generalized database mapping (using the K config line and
[unix-history] / usr / src / usr.sbin / sendmail / src / sendmail.h
index feec367..88a3f2b 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)sendmail.h  5.30.1.1 (Berkeley) %G%
+ *     @(#)sendmail.h  5.31 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -15,7 +15,7 @@
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 5.30.1.1                %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 5.31            %G%";
 # endif lint
 # else  _DEFINE
 # define EXTERN extern
 # endif lint
 # else  _DEFINE
 # define EXTERN extern
@@ -345,6 +345,10 @@ EXTERN struct rewrite      *RewriteRules[MAXRWSETS];
 # define HOSTBEGIN     '\035'  /* hostname lookup begin */
 # define HOSTEND       '\036'  /* hostname lookup end */
 
 # define HOSTBEGIN     '\035'  /* hostname lookup begin */
 # define HOSTEND       '\036'  /* hostname lookup end */
 
+/* bracket characters for generalized lookup */
+# define LOOKUPBEGIN   '\005'  /* generalized lookup begin */
+# define LOOKUPEND     '\006'  /* generalized lookup end */
+
 /* \001 is also reserved as the macro expansion character */
 
 /* external <==> internal mapping table */
 /* \001 is also reserved as the macro expansion character */
 
 /* external <==> internal mapping table */
@@ -375,6 +379,42 @@ MCONINFO
 /* flag bits */
 #define MCIF_VALID     00001           /* this entry is valid */
 \f/*
 /* flag bits */
 #define MCIF_VALID     00001           /* this entry is valid */
 \f/*
+**  Mapping functions
+**
+**     These allow arbitrary mappings in the config file.  The idea
+**     (albeit not the implementation) comes from IDA sendmail.
+*/
+
+
+/*
+**  The class of a map -- essentially the functions to call
+*/
+
+# define MAPCLASS      struct _mapclass
+
+MAPCLASS
+{
+       bool    (*map_init)();          /* initialization function */
+       char    *(*map_lookup)();       /* lookup function */
+};
+
+
+/*
+**  An actual map.
+*/
+
+# define MAP           struct _map
+
+MAP
+{
+       MAPCLASS        *map_class;     /* the class of this map */
+       int             map_flags;      /* flags, see below */
+       char            *map_file;      /* the (nominal) filename */
+};
+
+/* bit values for map_flags */
+# define MF_VALID      00001           /* this entry is valid */
+\f/*
 **  Symbol table definitions
 */
 
 **  Symbol table definitions
 */
 
@@ -389,6 +429,8 @@ struct symtab
                ADDRESS         *sv_addr;       /* pointer to address header */
                MAILER          *sv_mailer;     /* pointer to mailer */
                char            *sv_alias;      /* alias */
                ADDRESS         *sv_addr;       /* pointer to address header */
                MAILER          *sv_mailer;     /* pointer to mailer */
                char            *sv_alias;      /* alias */
+               MAPCLASS        sv_mapclass;    /* mapping function class */
+               MAP             sv_map;         /* mapping function */
                MCONINFO        sv_mci;         /* mailer connection info */
        }       s_value;
 };
                MCONINFO        sv_mci;         /* mailer connection info */
        }       s_value;
 };