9d84d2f5af63bfe2fbe13626029df62526b9536a
[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 #include <afsconfig.h>
19
20 #ifdef __STDC__
21 #define ARGS(x) x
22 #else
23 #define ARGS(x) ()
24 #endif /* __STDC__ */
25
26 typedef struct {
27     int (*readlink)ARGS((char *, char *, size_t));
28     int (*isdir)ARGS((char *, unsigned char *));
29     char *(*getwd)ARGS((char *));
30     int (*get_cred)ARGS((krb5_context, char *, char *, char *, CREDENTIALS *,
31                 krb5_creds **));
32     int (*get_user_realm)ARGS((krb5_context, char *));
33     void (*pstderr)ARGS((char *));
34     void (*pstdout)ARGS((char *));
35     void (*exitprog)ARGS((char));
36 } aklog_params;
37
38 void aklog ARGS((int, char *[], aklog_params *));
39 void aklog_init_params ARGS((aklog_params *));
40
41 #ifdef WINDOWS
42 /*
43  * Complete server info for one cell.
44  *
45  * Normally this is defined in afs/cellconfig.h, but the Windows header
46  * files and API don't use this structure. So, I'll include it here so
47  * I don't have to rewrite large chunks of code.
48  */
49 #define MAXCELLCHARS    64
50 #define MAXHOSTCHARS    64
51 #define MAXHOSTSPERCELL  8
52
53 struct afsconf_cell {
54     char name[MAXCELLCHARS];        /* Cell name */
55     short numServers;               /* Num active servers for the cell*/
56     short flags;                    /* useful flags */
57     struct sockaddr_in hostAddr[MAXHOSTSPERCELL];
58                                     /* IP addresses for cell's servers*/
59     char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS];       
60                                     /* Names for cell's servers */
61     char *linkedCell;               /* Linked cell name, if any */
62 };
63
64 /* Windows krb5 libraries don't seem to have this call */
65 #define krb5_xfree(p)   free(p)
66
67 /* Title for dialog boxes */
68 #define AKLOG_DIALOG_NAME               "aklog"
69
70 #endif /* WINDOWS */
71
72 #endif /* __AKLOG_H__ */