64eb03e04e4b5029662234a18abe70838f8d21b8
[openafs.git] / src / WINNT / afsd / cm_cell.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  */
9
10 #ifndef __CELL_H_ENV_
11 #define __CELL_H_ENV_ 1
12
13 #include "cm_server.h"
14
15 #define CELL_MAXNAMELEN                 256
16
17 #define CM_CELL_MAGIC    ('C' | 'E' <<8 | 'L'<<16 | 'L'<<24)
18
19 /* a cell structure */
20 typedef struct cm_cell {        
21     afs_uint32  magic;
22     afs_int32 cellID;                   /* cell ID */
23     struct cm_cell *nextp;              /* locked by cm_cellLock */
24     char name[CELL_MAXNAMELEN];         /* cell name; never changes */
25     cm_serverRef_t *vlServersp;         /* locked by cm_serverLock */
26     osi_mutex_t mx;                     /* mutex locking fields (flags) */
27     long flags;                         /* locked by mx */
28     time_t timeout;                     /* if dns, time at which the server addrs expire */
29 } cm_cell_t;
30
31 /* These are bit flag values */
32 #define CM_CELLFLAG_SUID             1  /* setuid flag; not yet used */
33 #define CM_CELLFLAG_DNS              2  /* cell servers are from DNS */
34 #define CM_CELLFLAG_VLSERVER_INVALID 4  /* cell servers are invalid */
35 #define CM_CELLFLAG_FREELANCE        8  /* local freelance fake cell */
36
37 extern void cm_InitCell(int newFile, long maxCells);
38
39 extern long cm_ShutdownCell(void);
40
41 extern long cm_ValidateCell(void);
42
43 extern cm_cell_t *cm_GetCell(char *namep, long flags);
44
45 extern cm_cell_t *cm_GetCell_Gen(char *namep, char *newnamep, long flags);
46
47 extern cm_cell_t *cm_FindCellByID(afs_int32 cellID);
48
49 extern void cm_ChangeRankCellVLServer(cm_server_t       *tsp);
50
51 extern osi_rwlock_t cm_cellLock;
52
53 extern cm_cell_t *cm_allCellsp;
54
55 extern int cm_DumpCells(FILE *, char *, int);
56
57 #endif /* __CELL_H_ENV_ */