X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Famanda.h;h=d03d8bc8605373b586ef0ad85c0a5c643562e803;hb=e442edb4d5816c4ad107ad9e71164f845eba70ad;hp=2858516b7e7df17c1619b07bad7b2d1337139c3b;hpb=6ba576375c19b829b2a13dbe6562eedd2716b9ea;p=debian%2Famanda diff --git a/common-src/amanda.h b/common-src/amanda.h index 2858516..d03d8bc 100644 --- a/common-src/amanda.h +++ b/common-src/amanda.h @@ -31,8 +31,14 @@ #ifndef AMANDA_H #define AMANDA_H +#include +#include + +#include "amflock.h" + #ifdef HAVE_CONFIG_H -#include "config.h" +/* use a relative path here to avoid conflicting with Perl's config.h. */ +#include "../config/config.h" #endif /* @@ -54,6 +60,9 @@ # include #endif +/* gnulib creates this header locally if the system doesn't provide it */ +#include + /* * I would prefer that each Amanda module include only those system headers * that are locally needed, but on most Unixes the system header files are not @@ -84,6 +93,32 @@ # endif #endif +#ifdef ENABLE_NLS +# include +# include +# define plural(String1, String2, Count) \ + (((Count) == 1) ? (String1) : (String2)) +#else +# define plural(String1, String2, Count) \ + (((Count) == 1) ? (String1) : (String2)) +# define setlocale(Which, Locale) +# define textdomain(Domain) +# define bindtextdomain(Package, Directory) +# define gettext(String) String +# define dgettext(Domain, String) String +# define dcgettext(Domain, String, Catagory) String +# define ngettext(String1, String2, Count) \ + plural((String1), (String2), (Count)) +# define dngettext(Domain, String1, String2, Count) \ + plural((String1), (String2), (Count)) +# define dcngettext(Domain, String1, String2, Count, Catagory) \ + plural((String1), (String2), (Count)) +#endif +#define T_(String) String +#ifndef SWIG /* TODO: make this go away */ +#define _(String) dgettext("amanda", (String)) +#endif + #ifdef HAVE_FCNTL_H # include #endif @@ -250,9 +285,12 @@ struct iovec { # include #endif +#ifdef HAVE_NETINET_IN_H +# include +#endif + #include #include -#include #include #include #include @@ -268,9 +306,8 @@ struct iovec { #include #endif -#ifndef HAVE_SOCKADDR_STORAGE -# define sockaddr_storage sockaddr_in -# define ss_family sin_family +#ifdef WORKING_IPV6 +#define INET6 #endif #ifndef INET_ADDRSTRLEN @@ -566,83 +603,58 @@ extern char *debug_prefix_time(char *); #define MAX_TAPE_LABEL_BUF (MAX_TAPE_LABEL_LEN+1) #define MAX_TAPE_LABEL_FMT "%10240s" -/* Define miscellaneous amanda functions. */ -#define ERR_INTERACTIVE 1 -#define ERR_SYSLOG 2 -#define ERR_AMANDALOG 4 - -extern void set_logerror(void (*f)(char *)); -extern void set_pname(char *pname); -extern char *get_pname(void); -extern int erroutput_type; -extern void error(const char *format, ...) - __attribute__ ((format (printf, 1, 2), noreturn)); -extern void errordump(const char *format, ...) - __attribute__ ((format (printf, 1, 2), noreturn)); -extern int onerror(void (*errf)(void)); - -extern void *debug_alloc (const char *c, int l, size_t size); -extern void *debug_newalloc (const char *c, int l, void *old, size_t size); -extern char *debug_stralloc (const char *c, int l, const char *str); -extern char *debug_newstralloc(const char *c, int l, char *oldstr, - const char *newstr); -extern const char *debug_caller_loc (const char *file, int line); -extern int debug_alloc_push (char *file, int line); -extern void debug_alloc_pop (void); +/* Unfortunately, the system-level sockaddr_storage definition can lead to + * C aliasing errors (where the optimizer doesn't notice that two operations + * affect the same datum). We define our own similar type as a union. + */ +typedef union sockaddr_union { + struct sockaddr sa; + struct sockaddr_in sin; +#ifdef WORKING_IPV6 + struct sockaddr_in6 sin6; +#endif +#ifdef HAVE_SOCKADDR_STORAGE + struct sockaddr_storage ss; /* not used; just here to make the union full-size */ +#endif +} sockaddr_union; + +#include "debug.h" +#include "file.h" + +void *debug_alloc(const char *file, int line, size_t size); +void *debug_newalloc(const char *file, int line, void *old, size_t size); +char *debug_stralloc(const char *file, int line, const char *str); +char *debug_newstralloc(const char *file, int line, + char *oldstr, const char *newstr); +char *debug_vstralloc(const char *file, int line, const char *str, ...); +char *debug_newvstralloc(const char *file, int line, + char *oldstr, const char *str, ...); +char *debug_vstrallocf(const char *file, int line, const char *fmt, + ...) G_GNUC_PRINTF(3, 4); +char *debug_newvstrallocf(const char *file, int line, char *oldstr, + const char *fmt, ...) G_GNUC_PRINTF(4, 5); + +/* Usage: vstrextend(foo, "bar, "baz", NULL). Extends the existing + * string, or allocates a brand new one. */ +char *debug_vstrextend(const char *file, int line, char **oldstr, ...); #define alloc(s) debug_alloc(__FILE__, __LINE__, (s)) #define newalloc(p,s) debug_newalloc(__FILE__, __LINE__, (p), (s)) #define stralloc(s) debug_stralloc(__FILE__, __LINE__, (s)) #define newstralloc(p,s) debug_newstralloc(__FILE__, __LINE__, (p), (s)) +#define vstralloc(...) debug_vstralloc(__FILE__,__LINE__,__VA_ARGS__) +#define newvstralloc(...) debug_newvstralloc(__FILE__,__LINE__,__VA_ARGS__) +#define vstrallocf(...) debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__) +#define newvstrallocf(...) debug_newvstrallocf(__FILE__,__LINE__,__VA_ARGS__) +#define vstrextend(...) debug_vstrextend(__FILE__,__LINE__,__VA_ARGS__) -/* - * Voodoo time. We want to be able to mark these calls with the source - * line, but CPP does not handle variable argument lists so we cannot - * do what we did above (e.g. for alloc()). - * - * What we do is call a function to save the file and line number - * and have it return "false". That triggers the "?" operator to - * the right side of the ":" which is a call to the debug version of - * vstralloc/newvstralloc but without parameters. The compiler gets - * those from the next input tokens: - * - * xx = vstralloc(a,b,NULL); - * - * becomes: - * - * xx = debug_alloc_push(__FILE__,__LINE__)?0:debug_vstralloc(a,b,NULL); - * - * This works as long as vstralloc/newvstralloc are not part of anything - * very complicated. Assignment is fine, as is an argument to another - * function (but you should not do that because it creates a memory leak). - * This will not work in arithmetic or comparison, but it is unlikely - * they are used like that. - * - * xx = vstralloc(a,b,NULL); OK - * return vstralloc(j,k,NULL); OK - * sub(a, vstralloc(g,h,NULL), z); OK, but a leak - * if(vstralloc(s,t,NULL) == NULL) { ... NO, but unneeded - * xx = vstralloc(x,y,NULL) + 13; NO, but why do it? - */ - -#define vstralloc debug_alloc_push(__FILE__,__LINE__)?0:debug_vstralloc -#define newvstralloc debug_alloc_push(__FILE__,__LINE__)?0:debug_newvstralloc -#define vstrallocf debug_alloc_push(__FILE__,__LINE__)?0:debug_vstrallocf - -extern char *debug_vstralloc(const char *str, ...); -extern char *debug_newvstralloc(char *oldstr, const char *newstr, ...); -extern char *debug_vstrallocf(const char *fmt, ...) - __attribute__ ((format (printf, 1, 2))); +#define stralloc2(s1,s2) vstralloc((s1),(s2),NULL) +#define newstralloc2(p,s1,s2) newvstralloc((p),(s1),(s2),NULL) -#define stralloc2(s1,s2) vstralloc((s1),(s2),NULL) -#define newstralloc2(p,s1,s2) newvstralloc((p),(s1),(s2),NULL) +#define vstrallocf(...) debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__) -/* Usage: vstrextend(foo, "bar, "baz", NULL). Extends the existing - * string, or allocates a brand new one. */ -extern char *vstrextend(char **oldstr, ...); - -extern /*@only@*/ /*@null@*/ char *debug_agets(const char *c, int l, FILE *file); -extern /*@only@*/ /*@null@*/ char *debug_areads(const char *c, int l, int fd); +/*@only@*/ /*@null@*/ char *debug_agets(const char *file, int line, FILE *f); +/*@only@*/ /*@null@*/ char *debug_areads(const char *file, int line, int fd); #define agets(f) debug_agets(__FILE__,__LINE__,(f)) #define areads(f) debug_areads(__FILE__,__LINE__,(f)) @@ -664,14 +676,8 @@ extern int debug_amtable_alloc(const char *file, (b), \ (f)) -extern void amtable_free(void **table, size_t *current); - -extern uid_t client_uid; -extern gid_t client_gid; +extern void amtable_free(void **, size_t *); -void safe_fd(int fd_start, int fd_count); -void safe_cd(void); -void save_core(void); char ** safe_env(void); char * validate_regexp(const char *regex); char * validate_glob(const char *glob); @@ -686,8 +692,6 @@ int match_disk(const char *glob, const char *disk); int match_datestamp(const char *dateexp, const char *datestamp); int match_level(const char *levelexp, const char *level); time_t unctime(char *timestr); -ssize_t areads_dataready(int fd); -void areads_relbuf(int fd); /* * amfree(ptr) -- if allocated, release space and set ptr to NULL. @@ -712,52 +716,6 @@ void areads_relbuf(int fd); (s1) = t_t_t; \ } while(0) -/* - * "Safe" close macros. Close the object then set it to a value that - * will cause an error if referenced. - * - * aclose(fd) -- close a file descriptor and set it to -1. - * afclose(f) -- close a stdio file and set it to NULL. - * apclose(p) -- close a stdio pipe file and set it to NULL. - * - * Note: be careful not to do the following: - * - * for(fd = low; fd < high; fd++) { - * aclose(fd); - * } - * - * Since aclose() sets the argument to -1, this will loop forever. - * Just copy fd to a temp variable and use that with aclose(). - * - * Aclose() interacts with areads() to inform it to release any buffer - * it has outstanding on the file descriptor. - */ - -#define aclose(fd) do { \ - if((fd) >= 0) { \ - close(fd); \ - areads_relbuf(fd); \ - } \ - (fd) = -1; \ - (void)(fd); /* Fix value never used warning at end of routines */ \ -} while(0) - -#define afclose(f) do { \ - if((f) != NULL) { \ - fclose(f); \ - (f) = NULL; \ - (void)(f); /* Fix value never used warning at end of routines */ \ - } \ -} while(0) - -#define apclose(p) do { \ - if((p) != NULL) { \ - pclose(p); \ - (p) = NULL; \ - (void)(p); /* Fix value never used warning at end of routines */ \ - } \ -} while(0) - /* * Return the number of elements in an array. */ @@ -856,15 +814,15 @@ void areads_relbuf(int fd); #define NUM_STR_SIZE 128 /* a generic number buffer size */ #define skip_whitespace(ptr,c) do { \ - while((c) != '\n' && isspace(c)) (c) = *(ptr)++; \ + while((c) != '\n' && isspace((int)c)) (c) = *(ptr)++; \ } while(0) #define skip_non_whitespace(ptr,c) do { \ - while((c) != '\0' && !isspace(c)) (c) = *(ptr)++; \ + while((c) != '\0' && !isspace((int)c)) (c) = *(ptr)++; \ } while(0) #define skip_non_whitespace_cs(ptr,c) do { \ - while((c) != '\0' && (c) != '#' && !isspace(c)) (c) = *(ptr)++; \ + while((c) != '\0' && (c) != '#' && !isspace((int)c)) (c) = *(ptr)++;\ } while(0) #define skip_non_integer(ptr,c) do { \ @@ -878,7 +836,7 @@ void areads_relbuf(int fd); #define skip_quoted_string(ptr, c) do { \ int iq = 0; \ - while (((c) != '\0') && !((iq == 0) && isspace(c))) { \ + while (((c) != '\0') && !((iq == 0) && isspace((int)c))) { \ if ((c) == '"') { \ iq = !iq; \ } else if (((c) == '\\') && (*(ptr) == '"')) { \ @@ -908,7 +866,7 @@ void areads_relbuf(int fd); #define copy_string(ptr,c,f,l,fp) do { \ (fp) = (f); \ - while((c) != '\0' && !isspace(c)) { \ + while((c) != '\0' && !isspace((int)c)) { \ if((fp) >= (f) + (l) - 1) { \ *(fp) = '\0'; \ (fp) = NULL; \ @@ -924,7 +882,7 @@ void areads_relbuf(int fd); #define copy_string_cs(ptr,c,f,l,fp) do { \ (fp) = (f); \ - while((c) != '\0' && (c) != '#' && !isspace(c)) { \ + while((c) != '\0' && (c) != '#' && !isspace((int)c)) { \ if((fp) >= (f) + (l) - 1) { \ *(fp) = '\0'; \ (fp) = NULL; \ @@ -950,20 +908,9 @@ void areads_relbuf(int fd); ((ptr)+=sizeof((cnst))-1, (var)=(ptr)[-1], 0) \ :1) -/* from amflock.c */ -extern int amflock(int fd, char *resource); -extern int amroflock(int fd, char *resource); -extern int amfunlock(int fd, char *resource); - -/* from file.c */ -extern int mkpdir(char *file, mode_t mode, uid_t uid, gid_t gid); -extern int rmpdir(char *file, char *topdir); -extern char *sanitise_filename(char *inp); -extern char *old_sanitise_filename(char *inp); - /* from old bsd-security.c */ extern int debug; -extern int check_security(struct sockaddr_storage *, char *, unsigned long, char **); +extern int check_security(sockaddr_union *, char *, unsigned long, char **); /* * Handle functions which are not always declared on all systems. This @@ -972,7 +919,7 @@ extern int check_security(struct sockaddr_storage *, char *, unsigned long, char /* AIX #defines accept, and provides a prototype for the alternate name */ #if !defined(HAVE_ACCEPT_DECL) && !defined(accept) -extern int accept(int s, struct sockaddr *addr, socklen_t *addrlen); +extern int accept(int s, struct sockaddr *addr, socklen_t_equiv *addrlen); #endif #ifndef HAVE_ATOF_DECL @@ -988,7 +935,7 @@ extern void bcopy(const void *s1, void *s2, size_t n); #endif #ifndef HAVE_BIND_DECL -extern int bind(int s, const struct sockaddr *name, socklen_t namelen); +extern int bind(int s, const struct sockaddr *name, socklen_t_equiv namelen); #endif #ifndef HAVE_BZERO @@ -1004,34 +951,7 @@ extern void closelog(void); #endif #ifndef HAVE_CONNECT_DECL -extern int connect(int s, struct sockaddr *name, socklen_t namelen); -#endif - -#if !defined(TEXTDB) && !defined(HAVE_DBM_OPEN_DECL) -#undef DBM_INSERT -#define DBM_INSERT 0 - -#undef DBM_REPLACE -#define DBM_REPLACE 1 - - typedef struct { - int dummy[10]; - } DBM; - -#ifndef HAVE_STRUCT_DATUM - typedef struct { - char *dptr; - int dsize; - } datum; -#endif - - extern DBM *dbm_open(char *file, int flags, int mode); - extern void dbm_close(DBM *db); - extern datum dbm_fetch(DBM *db, datum key); - extern datum dbm_firstkey(DBM *db); - extern datum dbm_nextkey(DBM *db); - extern int dbm_delete(DBM *db, datum key); - extern int dbm_store(DBM *db, datum key, datum content, int flg); +extern int connect(int s, struct sockaddr *name, socklen_t_equiv namelen); #endif #ifndef HAVE_FCLOSE_DECL @@ -1078,25 +998,17 @@ extern int getopt(int argc, char * const *argv, const char *optstring); /* AIX #defines getpeername, and provides a prototype for the alternate name */ #if !defined(HAVE_GETPEERNAME_DECL) && !defined(getpeername) -extern int getpeername(int s, struct sockaddr *name, socklen_t *namelen); +extern int getpeername(int s, struct sockaddr *name, socklen_t_equiv *namelen); #endif /* AIX #defines getsockname, and provides a prototype for the alternate name */ #if !defined(HAVE_GETSOCKNAME_DECL) && !defined(getsockname) -extern int getsockname(int s, struct sockaddr *name, socklen_t *namelen); +extern int getsockname(int s, struct sockaddr *name, socklen_t_equiv *namelen); #endif #ifndef HAVE_GETSOCKOPT_DECL extern int getsockopt(int s, int level, int optname, char *optval, - socklen_t *optlen); -#endif - -#ifndef HAVE_GETTIMEOFDAY_DECL -# ifdef HAVE_TWO_ARG_GETTIMEOFDAY -extern int gettimeofday(struct timeval *tp, struct timezone *tzp); -# else -extern int gettimeofday(struct timeval *tp); -# endif + socklen_t_equiv *optlen); #endif #ifndef HAVE_INITGROUPS @@ -1184,7 +1096,7 @@ extern void *realloc(void *ptr, size_t size); /* AIX #defines recvfrom, and provides a prototype for the alternate name */ #if !defined(HAVE_RECVFROM_DECL) && !defined(recvfrom) extern int recvfrom(int s, char *buf, int len, int flags, - struct sockaddr *from, socklen_t *fromlen); + struct sockaddr *from, socklen_t_equiv *fromlen); #endif #ifndef HAVE_REMOVE_DECL @@ -1279,7 +1191,7 @@ extern int shmget(key_t key, size_t size, int shmflg); #ifndef HAVE_SNPRINTF_DECL #include "arglist.h" int snprintf(char *buf, size_t len, const char *format,...) - __attribute__((format(printf,3,4))); + G_GNUC_PRINTF(3,4); #endif #ifndef HAVE_VSNPRINTF_DECL #include "arglist.h" @@ -1317,7 +1229,7 @@ extern int strncasecmp(const char *s1, const char *s2, int n); #ifndef HAVE_SYSLOG_DECL extern void syslog(int priority, const char *logstring, ...) - __attribute__ ((format (printf, 2, 3))); + G_GNUC_PRINTF(2,3); #endif #ifndef HAVE_SYSTEM_DECL @@ -1350,11 +1262,9 @@ extern int vfprintf(FILE *stream, const char *format, va_list ap); extern int vprintf(const char *format, va_list ap); #endif -/* GNULIB include */ -#ifndef CONFIGURE_TEST +/* gnulib-only includes (hence "" instead of <>) */ #include "getaddrinfo.h" #include "inet_ntop.h" -#endif #if !defined(S_ISCHR) && defined(_S_IFCHR) && defined(_S_IFMT) #define S_ISCHR(mode) (((mode) & _S_IFMT) == _S_IFCHR) @@ -1398,15 +1308,11 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); #endif #if SIZEOF_SIZE_T == SIZEOF_INT -# define SIZE_T_FMT "%u" -# define SIZE_T_FMT_TYPE unsigned # define SIZE_T_ATOI (size_t)atoi # ifndef SIZE_MAX -# define SIZE_MAX UINT_MAX +# define SIZE_MAX G_MAXUINT # endif #else -# define SIZE_T_FMT "%lu" -# define SIZE_T_FMT_TYPE unsigned long # define SIZE_T_ATOI (size_t)atol # ifndef SIZE_MAX # define SIZE_MAX ULONG_MAX @@ -1414,8 +1320,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); #endif #if SIZEOF_SSIZE_T == SIZEOF_INT -# define SSIZE_T_FMT "%d" -# define SSIZE_T_FMT_TYPE int # define SSIZE_T_ATOI (ssize_t)atoi # ifndef SSIZE_MAX # define SSIZE_MAX INT_MAX @@ -1424,8 +1328,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # define SSIZE_MIN INT_MIN # endif #else -# define SSIZE_T_FMT "%ld" -# define SSIZE_T_FMT_TYPE long # define SSIZE_T_ATOI (ssize_t)atol # ifndef SSIZE_MAX # define SSIZE_MAX LONG_MAX @@ -1436,15 +1338,11 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); #endif #if SIZEOF_TIME_T == SIZEOF_INT -# define TIME_T_FMT "%u" -# define TIME_T_FMT_TYPE unsigned # define TIME_T_ATOI (time_t)atoi # ifndef TIME_MAX -# define TIME_MAX UINT_MAX +# define TIME_MAX G_MAXUINT # endif #else -# define TIME_T_FMT "%lu" -# define TIME_T_FMT_TYPE unsigned long # define TIME_T_ATOI (time_t)atol # ifndef TIME_MAX # define TIME_MAX ULONG_MAX @@ -1452,30 +1350,21 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); #endif #if SIZEOF_OFF_T > SIZEOF_LONG -# define OFF_T_FMT LL_FMT -# define OFF_T_RFMT LL_RFMT -# define OFF_T_FMT_TYPE long long # ifdef HAVE_ATOLL -# define OFF_T_ATOI (off_t)atoll +# define OFF_T_ATOI (off_t)atoll # else -# define OFF_T_ATOI (off_t)atol +# define OFF_T_ATOI (off_t)atol # endif # ifdef HAVE_STRTOLL -# define OFF_T_STRTOL (off_t)strtoll +# define OFF_T_STRTOL (off_t)strtoll # else -# define OFF_T_STRTOL (off_t)strtol +# define OFF_T_STRTOL (off_t)strtol # endif #else # if SIZEOF_OFF_T == SIZEOF_LONG -# define OFF_T_FMT "%ld" -# define OFF_T_RFMT "ld" -# define OFF_T_FMT_TYPE long # define OFF_T_ATOI (off_t)atol # define OFF_T_STRTOL (off_t)strtol # else -# define OFF_T_FMT "%d" -# define OFF_T_RFMT "d" -# define OFF_T_FMT_TYPE int # define OFF_T_ATOI (off_t)atoi # define OFF_T_STRTOL (off_t)strtol # endif @@ -1492,7 +1381,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # else # define AM64_MIN (off_t)(-9223372036854775807LL -1LL) # endif -# define AM64_FMT OFF_T_FMT #else #if SIZEOF_LONG == 8 # ifdef LONG_MAX @@ -1505,7 +1393,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # else # define AM64_MIN (off_t)(-9223372036854775807L -1L) # endif -# define AM64_FMT "%ld" #else #if SIZEOF_LONG_LONG == 8 # ifdef LONG_LONG_MAX @@ -1518,7 +1405,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # else # define AM64_MIN (off_t)(-9223372036854775807LL -1LL) # endif -# define AM64_FMT LL_FMT #else #if SIZEOF_INTMAX_T == 8 # ifdef INTMAX_MAX @@ -1531,7 +1417,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # else # define AM64_MIN (off_t)(-9223372036854775807LL -1LL) # endif -# define AM64_FMT LL_FMT #else /* no 64 bits type found, use long. */ # ifdef LONG_MAX # define AM64_MAX (off_t)(LONG_MAX) @@ -1543,55 +1428,24 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # else # define AM64_MIN (off_t)(-2147483647 -1) # endif -# define AM64_FMT "%ld" #endif #endif #endif #endif -#ifdef HAVE_LIBREADLINE -# ifdef HAVE_READLINE_READLINE_H -# include -# ifdef HAVE_READLINE_HISTORY_H -# include -# endif -# else -# ifdef HAVE_READLINE_H -# include -# ifdef HAVE_HISTORY_H -# include -# endif -# else -# undef HAVE_LIBREADLINE -# endif -# endif -#else - -char * readline(const char *prompt); -void add_history(const char *line); - -#endif - #define BIND_CYCLE_RETRIES 120 /* Total of 30 minutes */ -#define DBG_SUBDIR_SERVER "server" -#define DBG_SUBDIR_CLIENT "client" -#define DBG_SUBDIR_AMANDAD "amandad" - #define MAX_DUMPERS 63 #ifndef NI_MAXHOST #define NI_MAXHOST 1025 #endif -#define _(x) x - -#ifndef AI_V4MAPPED -#define AI_V4MAPPED 0 -#endif - -#ifndef AI_ALL -#define AI_ALL 0 -#endif +typedef enum { + KENCRYPT_NONE, /* krb5 encryption not enabled */ + KENCRYPT_WILL_DO, /* krb5 encryption will be enabled once amanda + protocol stream is closed */ + KENCRYPT_YES /* krb5 encryption enabled on all stream */ +} kencrypt_type; #endif /* !AMANDA_H */