aklog-intergration-20041119
[openafs.git] / src / aklog / aklog.h
1 /* 
2  * $Id$
3  *
4  * Copyright 1990,1991 by the Massachusetts Institute of Technology
5  * For distribution and copying rights, see the file "mit-copyright.h"
6  */
7
8 #ifndef __AKLOG_H__
9 #define __AKLOG_H__
10
11 #if !defined(lint) && !defined(SABER)
12 static char *rcsid_aklog_h = "$Id$";
13 #endif /* lint || SABER */
14
15 #include <krb5.h>
16 #include <kerberosIV/krb.h>
17 #include "linked_list.h"
18
19 #ifdef __STDC__
20 #define ARGS(x) x
21 #else
22 #define ARGS(x) ()
23 #endif /* __STDC__ */
24
25 typedef struct {
26     int (*readlink)ARGS((char *, char *, size_t));
27     int (*isdir)ARGS((char *, unsigned char *));
28     char *(*getwd)ARGS((char *));
29     int (*get_cred)ARGS((krb5_context, char *, char *, char *, CREDENTIALS *,
30                 krb5_creds **));
31     int (*get_user_realm)ARGS((krb5_context, char *));
32     void (*pstderr)ARGS((char *));
33     void (*pstdout)ARGS((char *));
34     void (*exitprog)ARGS((char));
35 } aklog_params;
36
37 void aklog ARGS((int, char *[], aklog_params *));
38 void aklog_init_params ARGS((aklog_params *));
39
40 #ifdef WINDOWS
41 /*
42  * Complete server info for one cell.
43  *
44  * Normally this is defined in afs/cellconfig.h, but the Windows header
45  * files and API don't use this structure. So, I'll include it here so
46  * I don't have to rewrite large chunks of code.
47  */
48 #define MAXCELLCHARS    64
49 #define MAXHOSTCHARS    64
50 #define MAXHOSTSPERCELL  8
51
52 struct afsconf_cell {
53     char name[MAXCELLCHARS];        /* Cell name */
54     short numServers;               /* Num active servers for the cell*/
55     short flags;                    /* useful flags */
56     struct sockaddr_in hostAddr[MAXHOSTSPERCELL];
57                                     /* IP addresses for cell's servers*/
58     char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS];       
59                                     /* Names for cell's servers */
60     char *linkedCell;               /* Linked cell name, if any */
61 };
62
63 /* Windows krb5 libraries don't seem to have this call */
64 #define krb5_xfree(p)   free(p)
65
66 /* Title for dialog boxes */
67 #define AKLOG_DIALOG_NAME               "aklog"
68
69 #endif /* WINDOWS */
70
71 #endif /* __AKLOG_H__ */