Initial IBM OpenAFS 1.0 tree
[openafs.git] / src / auth / cellconfig.p.h
1 /*
2  * (C) COPYRIGHT IBM CORPORATION 1987, 1998
3  * LICENSED MATERIALS - PROPERTY OF IBM
4  */
5
6 /*--------------------------------------------------------------------------------------------------------------
7
8 cellconfig.h:
9
10     Interface to the routines used by the FileServer to manipulate the cell/server database
11     for the Cellular Andrew system, along with an operation to determine the name of the
12     local cell.  Included are a string variable used to hold the local cell name, definitions for
13     the database file format and routines for:
14         1) Acquiring the local cell name.
15         2) Reading in the cell/server database from disk.
16         3) Reporting the set of servers associated with a given cell name.
17         4) Printing out the contents of the cell/server database.
18         5) Reclaiming the space used by an in-memory database.
19
20 Creation date:
21     17 August 1987
22
23 --------------------------------------------------------------------------------------------------------------*/
24
25 #ifndef __CELLCONFIG_AFS_INCL_
26 #define __CELLCONFIG_AFS_INCL_  1
27
28 #ifndef IPPROTO_MAX
29         /* get sockaddr_in */
30 #ifdef AFS_NT40_ENV
31 #include <winsock2.h>
32 #else
33 #include <sys/types.h>
34 #include <netinet/in.h>
35 #endif
36 #endif
37
38 #define MAXCELLCHARS    64
39 #define MAXHOSTCHARS    64
40 #define MAXHOSTSPERCELL  8
41
42 /*
43  * Return codes.
44  */
45 #define AFSCONF_SUCCESS   0     /* worked */
46 #if 0
47 #define AFSCONF_FAILURE   1     /* mysterious failure */
48 #define AFSCONF_NOTFOUND  2     /* could not find entry */
49 #define AFSCONF_UNKNOWN   3     /* do not know that information */
50 #define AFSCONF_NOCELL    4     /* line appears before a cell has been defined */
51 #define AFSCONF_SYNTAX    5     /* syntax error */
52 #define AFSCONF_NODB      6     /* a database file is missing */
53 #define AFSCONF_FULL      7     /* no more entries */
54 #endif
55
56 /*
57  * Complete server info for one cell.
58  */
59 struct afsconf_cell {
60     char name[MAXCELLCHARS];                    /*Cell name*/
61     short numServers;                                   /*Num active servers for the cell*/
62     short flags;                                /* useful flags */
63     struct sockaddr_in hostAddr[MAXHOSTSPERCELL];       /*IP addresses for cell's servers*/
64     char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS];       /*Names for cell's servers*/
65     char *linkedCell;                           /* Linked cell name, if any */
66 };
67
68 struct afsconf_entry {
69     struct afsconf_entry *next; /* next guy in afsconf_dir */
70     struct afsconf_cell cellInfo;       /* info for this cell */
71 };
72
73 struct afsconf_dir {
74     char *name;     /* pointer to dir prefix */
75     char *cellName; /* cell name, if any, we're in */
76     struct afsconf_entry *entries; /* list of cell entries */
77     struct afsconf_keys *keystr;    /* structure containing keys */
78     afs_int32 timeRead;             /* time stamp of file last read */
79 };
80
81 extern struct afsconf_dir *afsconf_Open();
82 extern afs_int32 afsconf_Authenticate();
83
84 struct afsconf_servPair {
85     char *name;
86     int port;
87 };
88
89
90 /* some well-known ports and their names; new additions to table in cellconfig.c, too */
91 #define AFSCONF_FILESERVICE             "afs"
92 #define AFSCONF_FILEPORT                7000
93 #define AFSCONF_CALLBACKSERVICE         "afscb"
94 #define AFSCONF_CALLBACKPORT            7001
95 #define AFSCONF_PROTSERVICE             "afsprot"
96 #define AFSCONF_PROTPORT                7002
97 #define AFSCONF_VLDBSERVICE             "afsvldb"
98 #define AFSCONF_VLDBPORT                7003
99 #define AFSCONF_KAUTHSERVICE            "afskauth"
100 #define AFSCONF_KAUTHPORT               7004
101 #define AFSCONF_VOLUMESERVICE           "afsvol"
102 #define AFSCONF_VOLUMEPORT              7005
103 #define AFSCONF_ERRORSERVICE            "afserror"
104 #define AFSCONF_ERRORPORT               7006
105 #define AFSCONF_NANNYSERVICE            "afsnanny"
106 #define AFSCONF_NANNYPORT               7007
107 #define AFSCONF_UPDATESERVICE           "afsupdate"
108 #define AFSCONF_UPDATEPORT              7008
109 #define AFSCONF_RMTSYSSERVICE           "afsrmtsys"
110 #define AFSCONF_RMTSYSPORT              7009
111
112 #endif /* __CELLCONFIG_AFS_INCL_ */