libadmin-vos-irix-fixes-20080421
[openafs.git] / src / libadmin / test / vos.c
index 2882fad..e374081 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#ifndef AFS_NT40_ENV
+#include <netdb.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <afs/afsutil.h>
+#endif
 
 RCSID
     ("$Header$");
@@ -141,7 +147,7 @@ PrintMessage(vos_messageType_t type, char *message)
 }
 
 int
-DoVosBackupVolumeCreate(struct cmd_syndesc *as, char *arock)
+DoVosBackupVolumeCreate(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { VOLUME } DoVosBackupVolumeCreate_parm_t;
     afs_status_t st = 0;
@@ -159,7 +165,7 @@ DoVosBackupVolumeCreate(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosBackupVolumeCreateMultiple(struct cmd_syndesc *as, char *arock)
+DoVosBackupVolumeCreateMultiple(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, PREFIX,
        EXCLUDE
@@ -211,7 +217,7 @@ Print_vos_partitionEntry_p(vos_partitionEntry_p part, const char *prefix)
 }
 
 int
-DoVosPartitionGet(struct cmd_syndesc *as, char *arock)
+DoVosPartitionGet(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION } DoVosPartitionGet_parm_t;
     afs_status_t st = 0;
@@ -242,7 +248,7 @@ DoVosPartitionGet(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosPartitionList(struct cmd_syndesc *as, char *arock)
+DoVosPartitionList(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER } DoVosPartitionGet_parm_t;
     afs_status_t st = 0;
@@ -278,7 +284,7 @@ DoVosPartitionList(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosServerSync(struct cmd_syndesc *as, char *arock)
+DoVosServerSync(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION } DoVosServerSync_parm_t;
     afs_status_t st = 0;
@@ -306,7 +312,7 @@ DoVosServerSync(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosFileServerAddressChange(struct cmd_syndesc *as, char *arock)
+DoVosFileServerAddressChange(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { OLDADDRESS,
        NEWADDRESS
@@ -331,7 +337,7 @@ DoVosFileServerAddressChange(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosFileServerAddressRemove(struct cmd_syndesc *as, char *arock)
+DoVosFileServerAddressRemove(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { ADDRESS } DoVosFileServerAddressRemove_parm_t;
     afs_status_t st = 0;
@@ -360,7 +366,7 @@ Print_vos_fileServerEntry_p(vos_fileServerEntry_p serv, const char *prefix)
 }
 
 int
-DoVosFileServerList(struct cmd_syndesc *as, char *arock)
+DoVosFileServerList(struct cmd_syndesc *as, void *arock)
 {
     afs_status_t st = 0;
     void *iter;
@@ -411,7 +417,7 @@ Print_vos_serverTransactionStatus_p(vos_serverTransactionStatus_p tran,
 }
 
 int
-DoVosServerTransactionStatusList(struct cmd_syndesc *as, char *arock)
+DoVosServerTransactionStatusList(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER } DoVosServerTransactionStatusList_parm_t;
     afs_status_t st = 0;
@@ -519,7 +525,7 @@ Print_vos_vldbEntry_p(vos_vldbEntry_p entry, const char *prefix)
 }
 
 int
-DoVosVLDBGet(struct cmd_syndesc *as, char *arock)
+DoVosVLDBGet(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { VOLUME } DoVosVLDBGet_parm_t;
     afs_status_t st = 0;
@@ -543,7 +549,7 @@ DoVosVLDBGet(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVLDBList(struct cmd_syndesc *as, char *arock)
+DoVosVLDBList(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION } DoVosVLDBList_parm_t;
     afs_status_t st = 0;
@@ -591,7 +597,7 @@ DoVosVLDBList(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVLDBEntryRemove(struct cmd_syndesc *as, char *arock)
+DoVosVLDBEntryRemove(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, VOLUME } DoVosVLDBEntryRemove_parm_t;
     afs_status_t st = 0;
@@ -634,7 +640,7 @@ DoVosVLDBEntryRemove(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVLDBUnlock(struct cmd_syndesc *as, char *arock)
+DoVosVLDBUnlock(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION } DoVosVLDBUnlock_parm_t;
     afs_status_t st = 0;
@@ -668,7 +674,7 @@ DoVosVLDBUnlock(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVLDBEntryLock(struct cmd_syndesc *as, char *arock)
+DoVosVLDBEntryLock(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { VOLUME } DoVosVLDBEntryLoc_parm_tk;
     afs_status_t st = 0;
@@ -687,7 +693,7 @@ DoVosVLDBEntryLock(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVLDBEntryUnlock(struct cmd_syndesc *as, char *arock)
+DoVosVLDBEntryUnlock(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { VOLUME } DoVosVLDBEntryUnlock_parm_t;
     afs_status_t st = 0;
@@ -706,7 +712,7 @@ DoVosVLDBEntryUnlock(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVLDBReadOnlySiteCreate(struct cmd_syndesc *as, char *arock)
+DoVosVLDBReadOnlySiteCreate(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION,
        VOLUME
@@ -741,7 +747,7 @@ DoVosVLDBReadOnlySiteCreate(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVLDBReadOnlySiteDelete(struct cmd_syndesc *as, char *arock)
+DoVosVLDBReadOnlySiteDelete(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION,
        VOLUME
@@ -777,7 +783,7 @@ DoVosVLDBReadOnlySiteDelete(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVLDBSync(struct cmd_syndesc *as, char *arock)
+DoVosVLDBSync(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, FORCE } DoVosVLDBSync_parm_t;
     afs_status_t st = 0;
@@ -816,7 +822,7 @@ DoVosVLDBSync(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeCreate(struct cmd_syndesc *as, char *arock)
+DoVosVolumeCreate(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, VOLUME,
        QUOTA
@@ -861,7 +867,7 @@ DoVosVolumeCreate(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeDelete(struct cmd_syndesc *as, char *arock)
+DoVosVolumeDelete(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeDelete_parm_t;
     afs_status_t st = 0;
@@ -895,7 +901,7 @@ DoVosVolumeDelete(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeRename(struct cmd_syndesc *as, char *arock)
+DoVosVolumeRename(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { OLDVOLUME, NEWVOLUME } DoVosVolumeRename_parm_t;
     afs_status_t st = 0;
@@ -919,7 +925,7 @@ DoVosVolumeRename(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeDump(struct cmd_syndesc *as, char *arock)
+DoVosVolumeDump(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, VOLUME, STARTTIME,
        DUMPFILE
@@ -975,7 +981,7 @@ DoVosVolumeDump(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeRestore(struct cmd_syndesc *as, char *arock)
+DoVosVolumeRestore(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, ID, VOLUME, DUMPFILE,
        FULL
@@ -1029,7 +1035,7 @@ DoVosVolumeRestore(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeOnline(struct cmd_syndesc *as, char *arock)
+DoVosVolumeOnline(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, VOLUME, SLEEP,
        BUSY
@@ -1077,7 +1083,7 @@ DoVosVolumeOnline(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeOffline(struct cmd_syndesc *as, char *arock)
+DoVosVolumeOffline(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeOffline_parm_t;
     afs_status_t st = 0;
@@ -1334,7 +1340,7 @@ Print_vos_volumeEntry_p(vos_volumeEntry_p entry, const char *prefix)
 }
 
 int
-DoVosVolumeGet(struct cmd_syndesc *as, char *arock)
+DoVosVolumeGet(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeGet_parm_t;
     afs_status_t st = 0;
@@ -1371,7 +1377,7 @@ DoVosVolumeGet(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeList(struct cmd_syndesc *as, char *arock)
+DoVosVolumeList(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION } DoVosVolumeList_parm_t;
     afs_status_t st = 0;
@@ -1417,7 +1423,7 @@ DoVosVolumeList(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeMove(struct cmd_syndesc *as, char *arock)
+DoVosVolumeMove(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { VOLUME, FROMSERVER, FROMPARTITION, TOSERVER,
        TOPARTITION
@@ -1469,7 +1475,7 @@ DoVosVolumeMove(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeRelease(struct cmd_syndesc *as, char *arock)
+DoVosVolumeRelease(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { VOLUME, FORCE } DoVosVolumeRelease_parm_t;
     afs_status_t st = 0;
@@ -1492,7 +1498,7 @@ DoVosVolumeRelease(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeZap(struct cmd_syndesc *as, char *arock)
+DoVosVolumeZap(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, VOLUME, FORCE } DoVosVolumeZap_parm_t;
     afs_status_t st = 0;
@@ -1531,7 +1537,7 @@ DoVosVolumeZap(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosPartitionNameToId(struct cmd_syndesc *as, char *arock)
+DoVosPartitionNameToId(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { PARTITION } DoVosPartitionNameToId_parm_t;
     afs_status_t st = 0;
@@ -1549,7 +1555,7 @@ DoVosPartitionNameToId(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosPartitionIdToName(struct cmd_syndesc *as, char *arock)
+DoVosPartitionIdToName(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { PARTITIONID } DoVosPartitionIdToName_parm_t;
     afs_status_t st = 0;
@@ -1572,7 +1578,7 @@ DoVosPartitionIdToName(struct cmd_syndesc *as, char *arock)
 }
 
 int
-DoVosVolumeQuotaChange(struct cmd_syndesc *as, char *arock)
+DoVosVolumeQuotaChange(struct cmd_syndesc *as, void *arock)
 {
     typedef enum { SERVER, PARTITION, VOLUME,
        QUOTA
@@ -1613,18 +1619,202 @@ DoVosVolumeQuotaChange(struct cmd_syndesc *as, char *arock)
     return 0;
 }
 
+/*
+ * Parse a server name/address and return the address in HOST BYTE order
+ */
+static afs_uint32
+GetServer(char *aname)
+{
+    register struct hostent *th;
+    afs_uint32 addr;
+    int b1, b2, b3, b4;
+    register afs_int32 code;
+    char hostname[MAXHOSTCHARS];
+
+    code = sscanf(aname, "%d.%d.%d.%d", &b1, &b2, &b3, &b4);
+    if (code == 4) {
+       addr = (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
+       addr = ntohl(addr);     /* convert to host order */
+    } else {
+       th = gethostbyname(aname);
+       if (!th)
+           return 0;
+       memcpy(&addr, th->h_addr, sizeof(addr));
+    }
+
+    if (addr == htonl(0x7f000001)) {   /* local host */
+       code = gethostname(hostname, MAXHOSTCHARS);
+       if (code)
+           return 0;
+       th = gethostbyname(hostname);   /* returns host byte order */
+       if (!th)
+           return 0;
+       memcpy(&addr, th->h_addr, sizeof(addr));
+    }
+
+    return (addr);
+}
+
+static void
+Print_vos_volintInfo(afs_uint32 server, afs_uint32 partition, volintInfo* pinfo, const char *prefix)
+{
+    static afs_uint32 server_cache;
+    static int cache_valid = 0;
+    static char hostname[256], address[32];
+
+    if (!cache_valid || server != server_cache) {
+       struct in_addr s;
+
+       s.s_addr = server;
+       strcpy(hostname, hostutil_GetNameByINet(server));
+       strcpy(address, inet_ntoa(s));
+       server_cache = server;
+       cache_valid = 1;
+    }
+    
+    
+    printf("%sname\t\t%s\n",prefix, pinfo->name);
+    printf("%sid\t\t%lu\n",prefix, pinfo->volid);
+    printf("%sserv\t\t%s\t%s\n",prefix, address,hostname);
+    printf("%spart\t\t%u\n", prefix,partition);
+    
+    switch (pinfo->status) {
+    case 2: /* VOK */
+       printf("%sstatus\t\tOK\n",prefix);
+       break;
+    case 101: /* VBUSY */
+       printf("%sstatus\t\tBUSY\n",prefix);
+       return;
+    default:
+       printf("%sstatus\t\tUNATTACHABLE\n",prefix);
+       return;
+    }
+    printf("%sbackupID\t%lu\n",prefix, pinfo->backupID);
+    printf("%sparentID\t%lu\n",prefix, pinfo->parentID);
+    printf("%scloneID\t%lu\n",prefix, pinfo->cloneID);
+    printf("%sinUse\t\t%s\n",prefix, pinfo->inUse ? "Y" : "N");
+    printf("%sneedsSalvaged\t%s\n",prefix, pinfo->needsSalvaged ? "Y" : "N");
+    /* 0xD3 is from afs/volume.h since I had trouble including the file */
+    printf("%sdestroyMe\t%s\n",prefix, pinfo->destroyMe == 0xD3 ? "Y" : "N");
+    switch (pinfo->type) {
+    case 0:
+       printf("%stype\t\tRW\n",prefix);
+       break;
+    case 1:
+       printf("%stype\t\tRO\n",prefix);
+       break;
+    case 2:
+       printf("%stype\t\tBK\n",prefix);
+       break;
+    default:
+       printf("%stype\t\t?\n",prefix);
+       break;
+    }
+    printf("%screationDate\t%-9lu\n", prefix,pinfo->creationDate);
+    printf("%saccessDate\t%-9lu\n", prefix,pinfo->accessDate);
+    printf("%supdateDate\t%-9lu\n", prefix,pinfo->updateDate);
+    printf("%sbackupDate\t%-9lu\n", prefix,pinfo->backupDate);
+    printf("%scopyDate\t%-9lu\n", prefix,pinfo->copyDate);
+           
+    printf("%sflags\t\t%#lx\t(Optional)\n",prefix, pinfo->flags);
+    printf("%sdiskused\t%u\n",prefix, pinfo->size);
+    printf("%smaxquota\t%u\n",prefix, pinfo->maxquota);
+    printf("%sminquota\t%lu\t(Optional)\n",prefix, pinfo->spare0);
+    printf("%sfilecount\t%u\n",prefix, pinfo->filecount);
+    printf("%sdayUse\t\t%u\n",prefix, pinfo->dayUse);
+    printf("%sweekUse\t%lu\t(Optional)\n",prefix, pinfo->spare1);
+    printf("%svolUpdateCounter\t\t%lu\t(Optional)\n",prefix, pinfo->spare2);
+    printf("%sspare3\t\t%lu\t(Optional)\n",prefix, pinfo->spare3);
+}
+
+int
+DoVosVolumeGet2(struct cmd_syndesc *as, void *arock)
+{
+    typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeGet_parm_t;
+    afs_status_t st = 0;
+    void *vos_server = NULL;
+    afs_uint32 partition_id;
+    afs_uint32 volume_id;
+
+       volintInfo info;
+       memset(&info, 0, sizeof(struct volintInfo));
+
+    if (as->parms[SERVER].items) {
+       if (!vos_ServerOpen
+           (cellHandle, as->parms[SERVER].items->data, &vos_server, &st)) {
+           ERR_ST_EXT("vos_ServerOpen", st);
+       }
+    }
+
+    if (as->parms[PARTITION].items) {
+       partition_id =
+           GetPartitionIdFromString(as->parms[PARTITION].items->data);
+    }
+
+    if (as->parms[VOLUME].items) {
+       const char *volume = as->parms[VOLUME].items->data;
+       volume_id = GetVolumeIdFromString(volume);
+    }
+    
+
+       if (!vos_VolumeGet2
+       (cellHandle, vos_server, 0, partition_id, volume_id, &info, &st)) {
+       ERR_ST_EXT("vos_VolumeGet2", st);
+    }
+
+
+    Print_vos_volintInfo(GetServer(as->parms[SERVER].items->data),partition_id,&info," ");
+
+    return 0;
+}
+
+
+int
+DoVos_ClearVolUpdateCounter(struct cmd_syndesc *as, void *arock)
+{
+    typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeGet_parm_t;
+    afs_status_t st = 0;
+    void *vos_server = NULL;
+    unsigned int partition_id;
+    unsigned int volume_id;
+
+    if (as->parms[SERVER].items) {
+       if (!vos_ServerOpen
+           (cellHandle, as->parms[SERVER].items->data, &vos_server, &st)) {
+           ERR_ST_EXT("vos_ServerOpen", st);
+       }
+    }
+
+    if (as->parms[PARTITION].items) {
+       partition_id =
+           GetPartitionIdFromString(as->parms[PARTITION].items->data);
+    }
+
+    if (as->parms[VOLUME].items) {
+       const char *volume = as->parms[VOLUME].items->data;
+       volume_id = GetVolumeIdFromString(volume);
+    }
+
+    if (!vos_ClearVolUpdateCounter
+       (cellHandle, vos_server,partition_id, volume_id, &st)) {
+       ERR_ST_EXT("vos_ClearVolUpdateCounter", st);
+    }
+
+    return 0;
+}
+
 void
 SetupVosAdminCmd(void)
 {
     struct cmd_syndesc *ts;
 
-    ts = cmd_CreateSyntax("VosBackupVolumeCreate", DoVosBackupVolumeCreate, 0,
+    ts = cmd_CreateSyntax("VosBackupVolumeCreate", DoVosBackupVolumeCreate, NULL,
                          "create a backup volume");
     cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to back up");
     SetupCommonCmdArgs(ts);
 
     ts = cmd_CreateSyntax("VosBackupVolumeCreateMultiple",
-                         DoVosBackupVolumeCreateMultiple, 0,
+                         DoVosBackupVolumeCreateMultiple, NULL,
                          "create a backup volume");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
                "server housing volumes to back up");
@@ -1636,7 +1826,7 @@ SetupVosAdminCmd(void)
                "exclude volumes from backup that match prefix");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosPartitionGet", DoVosPartitionGet, 0,
+    ts = cmd_CreateSyntax("VosPartitionGet", DoVosPartitionGet, NULL,
                          "get information about a partition");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server housing partition of interest");
@@ -1644,13 +1834,13 @@ SetupVosAdminCmd(void)
                "partition to query");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosPartitionList", DoVosPartitionList, 0,
+    ts = cmd_CreateSyntax("VosPartitionList", DoVosPartitionList, NULL,
                          "list information about all partitions at a server");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server housing partitions of interest");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosServerSync", DoVosServerSync, 0,
+    ts = cmd_CreateSyntax("VosServerSync", DoVosServerSync, NULL,
                          "sync server with vldb");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to sync");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL,
@@ -1658,7 +1848,7 @@ SetupVosAdminCmd(void)
     SetupCommonCmdArgs(ts);
 
     ts = cmd_CreateSyntax("VosFileServerAddressChange",
-                         DoVosFileServerAddressChange, 0,
+                         DoVosFileServerAddressChange, NULL,
                          "change a server's address in the vldb");
     cmd_AddParm(ts, "-oldaddress", CMD_SINGLE, CMD_REQUIRED,
                "old address to change");
@@ -1666,29 +1856,29 @@ SetupVosAdminCmd(void)
     SetupCommonCmdArgs(ts);
 
     ts = cmd_CreateSyntax("VosFileServerAddressRemove",
-                         DoVosFileServerAddressRemove, 0,
+                         DoVosFileServerAddressRemove, NULL,
                          "remove a server's address from the vldb");
     cmd_AddParm(ts, "-address", CMD_SINGLE, CMD_REQUIRED,
                "address to remove");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosFileServerList", DoVosFileServerList, 0,
+    ts = cmd_CreateSyntax("VosFileServerList", DoVosFileServerList, NULL,
                          "list the file servers in a cell");
     SetupCommonCmdArgs(ts);
 
     ts = cmd_CreateSyntax("VosServerTransactionStatusList",
-                         DoVosServerTransactionStatusList, 0,
+                         DoVosServerTransactionStatusList, NULL,
                          "list the active transactions at a server");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVLDBGet", DoVosVLDBGet, 0,
+    ts = cmd_CreateSyntax("VosVLDBGet", DoVosVLDBGet, NULL,
                          "get a vldb entry for a volume");
     cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED,
                "volume to retrieve");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVLDBList", DoVosVLDBList, 0,
+    ts = cmd_CreateSyntax("VosVLDBList", DoVosVLDBList, NULL,
                          "list a group of vldb entries");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
                "limit entries to a particular server");
@@ -1696,7 +1886,7 @@ SetupVosAdminCmd(void)
                "limit entries to a particular partition");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVLDBEntryRemove", DoVosVLDBEntryRemove, 0,
+    ts = cmd_CreateSyntax("VosVLDBEntryRemove", DoVosVLDBEntryRemove, NULL,
                          "remove vldb entries");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
                "limit entries to a particular server");
@@ -1705,7 +1895,7 @@ SetupVosAdminCmd(void)
     cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_OPTIONAL, "volume to remove");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVLDBUnlock", DoVosVLDBUnlock, 0,
+    ts = cmd_CreateSyntax("VosVLDBUnlock", DoVosVLDBUnlock, NULL,
                          "unlock a group of vldb entries");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
                "limit entries to a particular server");
@@ -1713,18 +1903,18 @@ SetupVosAdminCmd(void)
                "limit entries to a particular partition");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVLDBEntryLock", DoVosVLDBList, 0,
+    ts = cmd_CreateSyntax("VosVLDBEntryLock", DoVosVLDBList, NULL,
                          "lock a single vldb entry");
     cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to lock");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVLDBEntryUnlock", DoVosVLDBEntryUnlock, 0,
+    ts = cmd_CreateSyntax("VosVLDBEntryUnlock", DoVosVLDBEntryUnlock, NULL,
                          "unlock a single vldb entry");
     cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to unlock");
     SetupCommonCmdArgs(ts);
 
     ts = cmd_CreateSyntax("VosVLDBReadOnlySiteCreate",
-                         DoVosVLDBReadOnlySiteCreate, 0,
+                         DoVosVLDBReadOnlySiteCreate, NULL,
                          "create a read only site");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server where read only will be created");
@@ -1735,7 +1925,7 @@ SetupVosAdminCmd(void)
     SetupCommonCmdArgs(ts);
 
     ts = cmd_CreateSyntax("VosVLDBReadOnlySiteDelete",
-                         DoVosVLDBReadOnlySiteDelete, 0,
+                         DoVosVLDBReadOnlySiteDelete, NULL,
                          "delete a read only site before initial replication");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
                "server where read only will be deleted");
@@ -1744,7 +1934,7 @@ SetupVosAdminCmd(void)
     cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to delete");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVLDBSync", DoVosVLDBSync, 0,
+    ts = cmd_CreateSyntax("VosVLDBSync", DoVosVLDBSync, NULL,
                          "sync vldb with server");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to sync");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL,
@@ -1752,7 +1942,7 @@ SetupVosAdminCmd(void)
     cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "force sync to occur");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeCreate", DoVosVolumeCreate, 0,
+    ts = cmd_CreateSyntax("VosVolumeCreate", DoVosVolumeCreate, NULL,
                          "create a read write volume");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server where volume will be created");
@@ -1764,7 +1954,7 @@ SetupVosAdminCmd(void)
                "size quota of new volume in 1kb units");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeDelete", DoVosVolumeDelete, 0,
+    ts = cmd_CreateSyntax("VosVolumeDelete", DoVosVolumeDelete, NULL,
                          "delete a volume");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server where volume exists");
@@ -1773,13 +1963,13 @@ SetupVosAdminCmd(void)
     cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to delete");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeRename", DoVosVolumeRename, 0,
+    ts = cmd_CreateSyntax("VosVolumeRename", DoVosVolumeRename, NULL,
                          "rename a volume");
     cmd_AddParm(ts, "-oldname", CMD_SINGLE, CMD_REQUIRED, "old volume name");
     cmd_AddParm(ts, "-newname", CMD_SINGLE, CMD_REQUIRED, "new volume name");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeDump", DoVosVolumeDump, 0,
+    ts = cmd_CreateSyntax("VosVolumeDump", DoVosVolumeDump, NULL,
                          "dump a volume to a file");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
                "dump volume at a particular server");
@@ -1792,7 +1982,7 @@ SetupVosAdminCmd(void)
                "file to contain dump results");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeRestore", DoVosVolumeRestore, 0,
+    ts = cmd_CreateSyntax("VosVolumeRestore", DoVosVolumeRestore, NULL,
                          "restore a volume from a dumpfile");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server that houses volume to restore");
@@ -1807,7 +1997,7 @@ SetupVosAdminCmd(void)
                "does a full restore of volume");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeOnline", DoVosVolumeOnline, 0,
+    ts = cmd_CreateSyntax("VosVolumeOnline", DoVosVolumeOnline, NULL,
                          "bring a volume online");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server that houses volume");
@@ -1819,7 +2009,7 @@ SetupVosAdminCmd(void)
     cmd_AddParm(ts, "-busy", CMD_FLAG, CMD_OPTIONAL, "mark volume busy");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeOffline", DoVosVolumeOffline, 0,
+    ts = cmd_CreateSyntax("VosVolumeOffline", DoVosVolumeOffline, NULL,
                          "take a volume offline");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server that houses volume");
@@ -1829,7 +2019,7 @@ SetupVosAdminCmd(void)
                "volume to bring offline");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeGet", DoVosVolumeGet, 0,
+    ts = cmd_CreateSyntax("VosVolumeGet", DoVosVolumeGet, NULL,
                          "get a volume entry");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server that houses volume");
@@ -1839,7 +2029,7 @@ SetupVosAdminCmd(void)
                "volume to retrieve");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeList", DoVosVolumeList, 0,
+    ts = cmd_CreateSyntax("VosVolumeList", DoVosVolumeList, NULL,
                          "list a group of volumes");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "limit volumes to a particular server");
@@ -1847,7 +2037,7 @@ SetupVosAdminCmd(void)
                "limit volumes to a particular partition");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeMove", DoVosVolumeMove, 0,
+    ts = cmd_CreateSyntax("VosVolumeMove", DoVosVolumeMove, NULL,
                          "move a volume");
     cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to move");
     cmd_AddParm(ts, "-fromserver", CMD_SINGLE, CMD_REQUIRED, "source server");
@@ -1859,7 +2049,7 @@ SetupVosAdminCmd(void)
                "destination partition");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeRelease", DoVosVolumeRelease, 0,
+    ts = cmd_CreateSyntax("VosVolumeRelease", DoVosVolumeRelease, NULL,
                          "release updates to read only");
     cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED,
                "volume to replicate");
@@ -1867,7 +2057,7 @@ SetupVosAdminCmd(void)
                "force release to occur");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeZap", DoVosVolumeZap, 0, "zap a volume");
+    ts = cmd_CreateSyntax("VosVolumeZap", DoVosVolumeZap, NULL, "zap a volume");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server that houses the volume to zap");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED,
@@ -1876,18 +2066,18 @@ SetupVosAdminCmd(void)
     cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "force zap");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosPartitionNameToId", DoVosPartitionNameToId, 0,
+    ts = cmd_CreateSyntax("VosPartitionNameToId", DoVosPartitionNameToId, NULL,
                          "convert a partition name to a number");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED,
                "partition to convert");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosPartitionIdToName", DoVosPartitionIdToName, 0,
+    ts = cmd_CreateSyntax("VosPartitionIdToName", DoVosPartitionIdToName, NULL,
                          "convert a number to a partition");
     cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_REQUIRED, "number to convert");
     SetupCommonCmdArgs(ts);
 
-    ts = cmd_CreateSyntax("VosVolumeQuotaChange", DoVosVolumeQuotaChange, 0,
+    ts = cmd_CreateSyntax("VosVolumeQuotaChange", DoVosVolumeQuotaChange, NULL,
                          "change the quota for a partition");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
                "server that houses the volume");
@@ -1898,4 +2088,25 @@ SetupVosAdminCmd(void)
                "new quota in 1kb units");
     SetupCommonCmdArgs(ts);
 
+    ts = cmd_CreateSyntax("VosVolumeGet2", DoVosVolumeGet2, NULL,
+                         "get a volume entry");
+    cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
+               "server that houses volume");
+    cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED,
+               "partition that houses volume");
+    cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED,
+               "volume to retrieve");
+    SetupCommonCmdArgs(ts);
+    
+    ts = cmd_CreateSyntax("ClearVolUpdateCounter", DoVos_ClearVolUpdateCounter, NULL,
+                         "clear volUpdateCounter");
+    cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
+               "server that houses volume");
+    cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED,
+               "partition that houses volume");
+    cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED,
+               "volume");
+    SetupCommonCmdArgs(ts);
+
 }
+