Back to index

opendkim  2.6.4
util.h
Go to the documentation of this file.
00001 /*
00002 **  Copyright (c) 2004, 2005, 2007-2009 Sendmail, Inc. and its suppliers.
00003 **     All rights reserved.
00004 **
00005 **  Copyright (c) 2009, 2010, 2012, The OpenDKIM Project.  All rights reserved.
00006 **
00007 **  $Id: util.h,v 1.11.10.1 2010/10/27 21:43:09 cm-msk Exp $
00008 */
00009 
00010 #ifndef _UTIL_H_
00011 #define _UTIL_H_
00012 
00013 #ifndef lint
00014 static char util_h_id[] = "@(#)$Id: util.h,v 1.11.10.1 2010/10/27 21:43:09 cm-msk Exp $";
00015 #endif /* !lint */
00016 
00017 /* system includes */
00018 #include <sys/types.h>
00019 #include <sys/socket.h>
00020 #include <netinet/in.h>
00021 #include <regex.h>
00022 #include <stdio.h>
00023 
00024 /* opendkim includes */
00025 #include "build-config.h"
00026 #include "opendkim-db.h"
00027 
00028 /* TYPES */
00029 struct dkimf_dstring;
00030 
00031 #ifdef _FFR_REPLACE_RULES
00032 /*
00033 **  REPLACE -- replacement table
00034 */
00035 
00036 struct replace
00037 {
00038        regex_t              repl_re;
00039        char *        repl_txt;
00040        struct replace       *repl_next;
00041 };
00042 #endif /* _FFR_REPLACE_RULES */
00043 
00044 /* PROTOTYPES */
00045 extern void dkimf_base64_encode_file __P((int, FILE *, int, int, int));
00046 extern _Bool dkimf_checkhost __P((DKIMF_DB, char *));
00047 extern _Bool dkimf_checkip __P((DKIMF_DB, struct sockaddr *));
00048 #ifdef POPAUTH
00049 extern _Bool dkimf_checkpopauth __P((DKIMF_DB, struct sockaddr *));
00050 #endif /* POPAUTH */
00051 extern _Bool dkimf_hostlist __P((char *, char **));
00052 extern size_t dkimf_inet_ntoa __P((struct in_addr, char *, size_t));
00053 #ifdef POPAUTH
00054 extern int dkimf_initpopauth __P((void));
00055 #endif /* POPAUTH */
00056 #ifdef _FFR_REPLACE_RULES
00057 extern void dkimf_free_replist __P((struct replace *));
00058 extern _Bool dkimf_load_replist __P((FILE *, struct replace **));
00059 #endif /* _FFR_REPLACE_RULES */
00060 extern void dkimf_ipstring __P((char *, size_t, struct sockaddr_storage *));
00061 extern _Bool dkimf_isblank __P((char *));
00062 extern void dkimf_lowercase __P((u_char *));
00063 extern void dkimf_mkpath __P((char *, size_t, char *, char *));
00064 extern _Bool dkimf_mkregexp __P((char *, char *, size_t));
00065 extern void dkimf_optlist __P((FILE *));
00066 extern void dkimf_setmaxfd __P((void));
00067 extern int dkimf_socket_cleanup __P((char *));
00068 extern void dkimf_stripbrackets __P((char *));
00069 extern void dkimf_stripcr __P((char *));
00070 extern _Bool dkimf_subdomain __P((char *d1, char *d2));
00071 extern void dkimf_trimspaces __P((u_char *));
00072 
00073 extern struct dkimf_dstring *dkimf_dstring_new __P((int, int));
00074 extern void dkimf_dstring_free __P((struct dkimf_dstring *));
00075 extern _Bool dkimf_dstring_copy __P((struct dkimf_dstring *, u_char *));
00076 extern _Bool dkimf_dstring_cat __P((struct dkimf_dstring *, u_char *));
00077 extern _Bool dkimf_dstring_cat1 __P((struct dkimf_dstring *, int));
00078 extern _Bool dkimf_dstring_catn __P((struct dkimf_dstring *, u_char *, size_t));
00079 extern void dkimf_dstring_chop __P((struct dkimf_dstring *, int));
00080 extern u_char *dkimf_dstring_get __P((struct dkimf_dstring *));
00081 extern int dkimf_dstring_len __P((struct dkimf_dstring *));
00082 extern void dkimf_dstring_blank __P((struct dkimf_dstring *));
00083 extern size_t dkimf_dstring_printf __P((struct dkimf_dstring *, char *, ...));
00084 
00085 #ifdef USE_UNBOUND
00086 extern _Bool dkimf_timespec_past __P((struct timespec *tv));
00087 extern int dkimf_wait_fd __P((int fd, struct timespec *until));
00088 #endif /* USE_UNBOUND */
00089 
00090 #endif /* _UTIL_H_ */