Coda Distributed File System
realm.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 8
5
6 Copyright (c) 2003-2025 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU General Public Licence Version 2, as shown in the
11file LICENSE. The technical and financial contributors to Coda are
12listed in the file CREDITS.
13
14 Additional copyrights
15 none currently
16
17#*/
18
19#ifndef _REALM_H_
20#define _REALM_H_
21
22#include <sys/types.h>
23#include <rvmlib.h>
24#include <coda_assert.h>
25#include <auth2.h>
26#include "venusfid.h"
27
28class connent;
29class userent;
30
31class Realm {
32 friend class RealmDB;
33 friend class fsobj; // Fakeify
34
35public:
36 void *operator new(size_t size) REQUIRES_TRANSACTION
37 { /*T*/
38 void *p = rvmlib_rec_malloc(size);
39 CODA_ASSERT(p);
40 return p;
41 }
42 void operator delete(void *p) REQUIRES_TRANSACTION
43 {
45 } /*T*/
46
47 Realm(const RealmId id, const char *realm) REQUIRES_TRANSACTION; /*T*/
48 ~Realm(void) REQUIRES_TRANSACTION; /*T*/
49
50 void ResetTransient(void);
51
53 { /*T*/
54 RVMLIB_REC_OBJECT(rec_refcount);
55 rec_refcount++;
56 }
57 void Rec_PutRef(void) REQUIRES_TRANSACTION; /*T*/
58 void GetRef(void) { refcount++; }
59 void PutRef(void);
60
61 const char *Name(void) { return name; }
62 const RealmId Id(void) { return realmid; }
63
65 const char *GetRootVolName(void) { return rootvolname; }
66
67 void ReplaceRootServers(struct RPC2_addrinfo *newsrvs = NULL);
68
70
71 userent *GetUser(uid_t uid);
72 int NewUserToken(uid_t uid, SecretToken *secretp, ClearToken *clearp);
73
74 void print(FILE *f);
75
76private:
77 RealmId realmid;
78 unsigned int rec_refcount;
79 char *name;
80 char *rootvolname;
81 struct dllist_head realms;
82
83 /*T*/ unsigned int refcount;
84 /*T*/ int generation;
85 /*T*/ struct RPC2_addrinfo *rootservers;
86};
87
88#endif /* _REALM_H_ */
Definition: realmdb.h:32
Definition: realm.h:31
int GetAdmConn(connent **cpp) EXCLUDES_TRANSACTION
Definition: realm.cc:192
void GetRef(void)
Definition: realm.h:58
int NewUserToken(uid_t uid, SecretToken *secretp, ClearToken *clearp)
Definition: user.cc:100
void Rec_GetRef(void) REQUIRES_TRANSACTION
Definition: realm.h:52
const RealmId Id(void)
Definition: realm.h:62
const char * Name(void)
Definition: realm.h:61
void Rec_PutRef(void) REQUIRES_TRANSACTION
Definition: realm.cc:121
void print(FILE *f)
Definition: realm.cc:292
~Realm(void) REQUIRES_TRANSACTION
Definition: realm.cc:73
void SetRootVolName(char *name) EXCLUDES_TRANSACTION
Definition: realm.cc:282
void ReplaceRootServers(struct RPC2_addrinfo *newsrvs=NULL)
Definition: realm.cc:157
const char * GetRootVolName(void)
Definition: realm.h:65
Realm(const RealmId id, const char *realm) REQUIRES_TRANSACTION
Definition: realm.cc:46
void ResetTransient(void)
Definition: realm.cc:111
void PutRef(void)
Definition: realm.cc:131
userent * GetUser(uid_t uid)
Definition: user.cc:82
Definition: comm.h:121
Definition: fso.h:343
Definition: user.h:52
#define CODA_ASSERT(pred)
Definition: coda_assert.h:22
#define REQUIRES_TRANSACTION
Definition: coda_tsa.h:107
#define EXCLUDES_TRANSACTION
Definition: coda_tsa.h:108
name
Definition: pwdtopdbtool.py:40
uid
Definition: pwdtopdbtool.py:40
@ f
Definition: rvm_private.h:416
#define RVMLIB_REC_OBJECT(object)
Definition: rvmlib.h:126
#define rvmlib_rec_free(addr)
Definition: rvmlib.h:123
#define rvmlib_rec_malloc(size)
Definition: rvmlib.h:122
Definition: rpc2_addrinfo.h:28
Definition: dllist.h:30
#define NULL
Definition: voltypes.h:44
#define secretp
#define clearp