Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / WINNT / afsadmsvr / TaAfsAdmSvrCell.cpp
blobb6723570ac329de9d00ed0364fcb4dc165fb25a0
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
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 */
10 #include <winsock2.h>
11 #include <ws2tcpip.h>
13 #include <afs/param.h>
14 #include <afs/stds.h>
16 #include "TaAfsAdmSvrInternal.h"
20 * ROUTINES ___________________________________________________________________
25 // AfsAdmSvr_ChangeCell
26 // ...changes a cell's properties.
28 extern "C" int AfsAdmSvr_ChangeCell (UINT_PTR idClient, ASID idCell, LPAFSADMSVR_CHANGECELL_PARAMS pChange, ULONG *pStatus)
30 ASACTION Action;
31 Action.Action = ACTION_CELL_CHANGE;
32 Action.idClient = idClient;
33 Action.idCell = idCell;
34 size_t iOp = AfsAdmSvr_BeginOperation (idClient, &Action);
36 Print (dlDETAIL, TEXT("Client 0x%08lX: ChangeCell (idCell=0x%08lX)"), idClient, idCell);
38 if (!AfsAdmSvr_fIsValidClient (idClient))
39 return FALSE_(ERROR_INVALID_PARAMETER,pStatus,iOp);
41 // Call AfsClass to actually do it
43 PTSPROPERTIES PtsProperties;
44 PtsProperties.idUserMax = (int)(pChange->idUserMax);
45 PtsProperties.idGroupMax = (int)(pChange->idGroupMax);
47 ULONG status;
48 if (!AfsClass_SetPtsProperties ((LPIDENT)idCell, &PtsProperties, &status))
50 Print (dlERROR, TEXT("Client 0x%08lX: ChangeCell failed; error 0x%08lX"), idClient, status);
51 return FALSE_(status,pStatus,iOp);
54 AfsAdmSvr_TestProperties (idCell);
56 Print (dlDETAIL, TEXT("Client 0x%08lX: ChangeCell succeeded"), idClient);
57 AfsAdmSvr_EndOperation (iOp);
58 return TRUE;
63 // AfsAdmSvr_SetRefreshRate
64 // ...changes the refresh rate for a specific cell
66 extern "C" int AfsAdmSvr_SetRefreshRate (UINT_PTR idClient, ASID idCell, ULONG cminRefreshRate, ULONG *pStatus)
68 if (!AfsAdmSvr_fIsValidClient (idClient))
69 return FALSE_(ERROR_INVALID_PARAMETER,pStatus);
71 Print (dlDETAIL, TEXT("Client 0x%08lX: Setting refresh rate to %lu minutes"), idClient, cminRefreshRate);
73 if (!cminRefreshRate)
74 AfsAdmSvr_StopCellRefreshThread (idCell);
75 else
76 AfsAdmSvr_SetCellRefreshRate (idCell, cminRefreshRate);
78 return TRUE;