2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
14 /* Include afs installation dir retrieval routines */
15 #include <afs/dirpath.h>
17 /* These macros are return values from extractAddr. They do not represent
18 * any valid IP address and so can indicate a failure.
20 #define AFS_IPINVALID 0xffffffff /* invalid IP address */
21 #define AFS_IPINVALIDIGNORE 0xfffffffe /* no input given to extractAddr */
26 #include <sys/types.h>
27 #include <sys/socket.h>
28 #include <netinet/in.h>
29 #include <arpa/inet.h> /* for inet_ntoa() */
45 logRotate_old, /**< Rename log file by adding .old to the file name. */
46 logRotate_timestamp, /**< Rename log file to a timestamped file name. */
50 int logLevel; /**< The initial log level. */
51 enum logDest dest; /**< Log destination */
54 const char *filename; /**< Log filename (may be a named pipe). */
55 int rotateOnOpen; /**< Rotate the log file during OpenLog. */
56 int rotateOnReset; /**< Rotate the log file when the SIGHUP is caught. */
57 enum logRotateStyle rotateStyle; /**< Specifies how logs are renamed. */
60 struct syslogOptions {
61 int facility; /**< The syslog facility. */
62 char *tag; /**< The syslog identification. */
67 #define lopt_logLevel logLevel
68 #define lopt_dest dest
69 #define lopt_filename opts.fileOpts.filename
70 #define lopt_rotateOnOpen opts.fileOpts.rotateOnOpen
71 #define lopt_rotateOnReset opts.fileOpts.rotateOnReset
72 #define lopt_rotateStyle opts.fileOpts.rotateStyle
73 #define lopt_facility opts.syslogOpts.facility
74 #define lopt_tag opts.syslogOpts.tag
76 extern void vFSLog(const char *format, va_list args)
77 AFS_ATTRIBUTE_FORMAT(__printf__, 1, 0);
79 extern void SetLogThreadNumProgram(int (*func) (void) );
81 extern void FSLog(const char *format, ...)
82 AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
85 extern int LogLevel; /* For logging macros only. */
87 #define ViceLog(level, str) do { if ((level) <= LogLevel) (FSLog str); } while (0)
88 #define vViceLog(level, str) do { if ((level) <= LogLevel) (vFSLog str); } while (0)
89 #define ViceLogThenPanic(level, str) \
90 do { ViceLog(level, str); osi_Panic str; } while(0);
92 extern int OpenLog(struct logOptions *opts);
93 extern int ReOpenLog(void);
94 extern void SetupLogSignals(void);
95 extern void CloseLog(void);
96 extern void SetupLogSoftSignals(void);
97 extern int GetLogLevel(void);
98 extern enum logDest GetLogDest(void);
99 extern const char *GetLogFilename(void);
103 #include <winsock2.h>
104 #endif /* _MFC_VER */
106 /* Initialize the windows sockets before calling networking routines. */
107 extern int afs_winsockInit(void);
108 extern void afs_winsockCleanup(void);
110 /* Unbuffer output when Un*x would do line buffering. */
111 #define setlinebuf(S) setvbuf(S, NULL, _IONBF, 0)
113 #endif /* AFS_NT40_ENV */
115 #ifndef HAVE_POSIX_REGEX
116 extern char *re_comp(const char *sp);
117 extern int re_exec(const char *p1);
120 typedef char b32_string_t[8];
121 /* b64_string_t is 8 bytes, in stds.h */
122 typedef char lb64_string_t[12];
124 #include <afs/ktime.h>
125 #include "afsutil_prototypes.h"
127 #endif /* _AFSUTIL_H_ */