/* ** Copyright (c) 2004, 2005, 2007 Sendmail, Inc. and its suppliers. ** All rights reserved. ** ** $Id: util.h,v 1.15 2007/10/07 12:34:58 msk Exp $ */ #ifndef _UTIL_H_ #define _UTIL_H_ #ifndef lint static char util_h_id[] = "@(#)$Id: util.h,v 1.15 2007/10/07 12:34:58 msk Exp $"; #endif /* !lint */ /* system includes */ #include #include #include #include /* libsm includes */ #include #ifdef POPAUTH /* libdb includes */ # include #endif /* POPAUTH */ /* dkim-filter includes */ #include "dkim-filter.h" /* TYPES */ #ifdef _FFR_REPLACE_RULES struct dkimf_dstring; /* ** REPLACE -- replacement table */ struct replace { regex_t repl_re; char * repl_txt; struct replace *repl_next; }; #endif /* _FFR_REPLACE_RULES */ /* PROTOTYPES */ extern bool dkimf_checkhost __P((Peer, char *)); extern bool dkimf_checkip __P((Peer, struct sockaddr *)); #ifdef POPAUTH extern bool dkimf_checkpopauth __P((DB *, struct sockaddr *)); #endif /* POPAUTH */ extern bool dkimf_hostlist __P((char *, char **)); extern size_t dkimf_inet_ntoa __P((struct in_addr, char *, size_t)); #ifdef POPAUTH extern int dkimf_initpopauth __P((void)); #endif /* POPAUTH */ extern bool dkimf_load_list __P((FILE *, char **, struct Peer **)); #ifdef _FFR_REPLACE_RULES extern bool dkimf_load_replist __P((FILE *, struct replace **)); #endif /* _FFR_REPLACE_RULES */ extern void dkimf_lowercase __P((u_char *)); extern void dkimf_mkpath __P((char *, size_t, char *, char *)); extern void dkimf_optlist __P((FILE *)); extern void dkimf_setmaxfd __P((void)); extern int dkimf_socket_cleanup __P((char *)); extern void dkimf_stripcr __P((char *)); extern void dkimf_trimspaces __P((u_char *)); extern struct dkimf_dstring *dkimf_dstring_new __P((int, int)); extern void dkimf_dstring_free __P((struct dkimf_dstring *)); extern bool dkimf_dstring_copy __P((struct dkimf_dstring *, char *)); extern bool dkimf_dstring_cat __P((struct dkimf_dstring *, char *)); extern bool dkimf_dstring_cat1 __P((struct dkimf_dstring *, int)); extern void dkimf_dstring_chop __P((struct dkimf_dstring *, int)); extern char *dkimf_dstring_get __P((struct dkimf_dstring *)); extern int dkimf_dstring_len __P((struct dkimf_dstring *)); extern void dkimf_dstring_blank __P((struct dkimf_dstring *)); #endif /* _UTIL_H_ */