3cb7a401489b7faa9d5fff4c74e75a3edc9dedee
[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 #include <krb5.h>
12 #include "linked_list.h"
13 #include <afsconfig.h>
14
15 #ifdef __STDC__
16 #define ARGS(x) x
17 #else
18 #define ARGS(x) ()
19 #endif /* __STDC__ */
20
21 void aklog ARGS((int, char *[]));
22
23 /*
24  * If we have krb.h, use the definition of CREDENTIAL from there.  Otherwise,
25  * inline it.  When we inline it we're using the inline definition from the
26  * Heimdal sources (since Heimdal doesn't include a definition of struct
27  * credentials with the sources
28  */
29
30 #ifdef HAVE_KERBEROSIV_KRB_H
31 #include <kerberosIV/krb.h>
32 #else /* HAVE_KERBEROSIV_KRB_H */
33
34 #ifndef MAX_KTXT_LEN
35 #define MAX_KTXT_LEN 1250
36 #endif /* MAX_KTXT_LEN */
37 #ifndef ANAME_SZ
38 #define ANAME_SZ 40
39 #endif /* ANAME_SZ */
40 #ifndef REALM_SZ
41 #define REALM_SZ 40
42 #endif /* REALM_SZ */
43 #ifndef SNAME_SZ
44 #define SNAME_SZ 40
45 #endif /* SNAME_SZ */
46 #ifndef INST_SZ
47 #define INST_SZ 40
48 #endif /* INST_SZ */
49
50 #ifndef u_int32_t
51 #define u_int32_t uint32_t
52 #endif
53
54 struct ktext {
55     unsigned int length;
56     unsigned char dat[MAX_KTXT_LEN];
57     afs_uint32 mbz;
58 };
59
60 struct credentials {
61     char    service[ANAME_SZ];
62     char    instance[INST_SZ];
63     char    realm[REALM_SZ];
64     char    session[8];
65     int     lifetime;
66     int     kvno;
67     struct ktext ticket_st;
68     int32_t    issue_date;
69     char    pname[ANAME_SZ];
70     char    pinst[INST_SZ];
71 };
72
73 typedef struct credentials CREDENTIALS;
74 #endif /* ! HAVE_KERBEROSIV_KRB_H */
75
76 #ifdef WINDOWS
77 /*
78  * Complete server info for one cell.
79  *
80  * Normally this is defined in afs/cellconfig.h, but the Windows header
81  * files and API don't use this structure. So, I'll include it here so
82  * I don't have to rewrite large chunks of code.
83  */
84 #define MAXCELLCHARS    64
85 #define MAXHOSTCHARS    64
86 #define MAXHOSTSPERCELL  8
87
88 struct afsconf_cell {
89     char name[MAXCELLCHARS];        /* Cell name */
90     short numServers;               /* Num active servers for the cell*/
91     short flags;                    /* useful flags */
92     struct sockaddr_in hostAddr[MAXHOSTSPERCELL];
93                                     /* IP addresses for cell's servers*/
94     char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS];
95                                     /* Names for cell's servers */
96     char *linkedCell;               /* Linked cell name, if any */
97 };
98
99 /* Windows krb5 libraries don't seem to have this call */
100 #define krb5_xfree(p)   free(p)
101
102 /* Title for dialog boxes */
103 #define AKLOG_DIALOG_NAME               "aklog"
104
105 #endif /* WINDOWS */
106
107 #endif /* __AKLOG_H__ */