/* AFS Volume Location Service client interface1*2* Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.3* Written by David Howells ([email protected])4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public License7* as published by the Free Software Foundation; either version8* 2 of the License, or (at your option) any later version.9*/1011#ifndef AFS_VL_H12#define AFS_VL_H1314#include "afs.h"1516#define AFS_VL_PORT 7003 /* volume location service port */17#define VL_SERVICE 52 /* RxRPC service ID for the Volume Location service */1819enum AFSVL_Operations {20VLGETENTRYBYID = 503, /* AFS Get Cache Entry By ID operation ID */21VLGETENTRYBYNAME = 504, /* AFS Get Cache Entry By Name operation ID */22VLPROBE = 514, /* AFS Probe Volume Location Service operation ID */23};2425enum AFSVL_Errors {26AFSVL_IDEXIST = 363520, /* Volume Id entry exists in vl database */27AFSVL_IO = 363521, /* I/O related error */28AFSVL_NAMEEXIST = 363522, /* Volume name entry exists in vl database */29AFSVL_CREATEFAIL = 363523, /* Internal creation failure */30AFSVL_NOENT = 363524, /* No such entry */31AFSVL_EMPTY = 363525, /* Vl database is empty */32AFSVL_ENTDELETED = 363526, /* Entry is deleted (soft delete) */33AFSVL_BADNAME = 363527, /* Volume name is illegal */34AFSVL_BADINDEX = 363528, /* Index is out of range */35AFSVL_BADVOLTYPE = 363529, /* Bad volume type */36AFSVL_BADSERVER = 363530, /* Illegal server number (out of range) */37AFSVL_BADPARTITION = 363531, /* Bad partition number */38AFSVL_REPSFULL = 363532, /* Run out of space for Replication sites */39AFSVL_NOREPSERVER = 363533, /* No such Replication server site exists */40AFSVL_DUPREPSERVER = 363534, /* Replication site already exists */41AFSVL_RWNOTFOUND = 363535, /* Parent R/W entry not found */42AFSVL_BADREFCOUNT = 363536, /* Illegal Reference Count number */43AFSVL_SIZEEXCEEDED = 363537, /* Vl size for attributes exceeded */44AFSVL_BADENTRY = 363538, /* Bad incoming vl entry */45AFSVL_BADVOLIDBUMP = 363539, /* Illegal max volid increment */46AFSVL_IDALREADYHASHED = 363540, /* RO/BACK id already hashed */47AFSVL_ENTRYLOCKED = 363541, /* Vl entry is already locked */48AFSVL_BADVOLOPER = 363542, /* Bad volume operation code */49AFSVL_BADRELLOCKTYPE = 363543, /* Bad release lock type */50AFSVL_RERELEASE = 363544, /* Status report: last release was aborted */51AFSVL_BADSERVERFLAG = 363545, /* Invalid replication site server °ag */52AFSVL_PERM = 363546, /* No permission access */53AFSVL_NOMEM = 363547, /* malloc/realloc failed to alloc enough memory */54};5556/*57* maps to "struct vldbentry" in vvl-spec.pdf58*/59struct afs_vldbentry {60char name[65]; /* name of volume (with NUL char) */61afs_voltype_t type; /* volume type */62unsigned num_servers; /* num servers that hold instances of this vol */63unsigned clone_id; /* cloning ID */6465unsigned flags;66#define AFS_VLF_RWEXISTS 0x1000 /* R/W volume exists */67#define AFS_VLF_ROEXISTS 0x2000 /* R/O volume exists */68#define AFS_VLF_BACKEXISTS 0x4000 /* backup volume exists */6970afs_volid_t volume_ids[3]; /* volume IDs */7172struct {73struct in_addr addr; /* server address */74unsigned partition; /* partition ID on this server */75unsigned flags; /* server specific flags */76#define AFS_VLSF_NEWREPSITE 0x0001 /* unused */77#define AFS_VLSF_ROVOL 0x0002 /* this server holds a R/O instance of the volume */78#define AFS_VLSF_RWVOL 0x0004 /* this server holds a R/W instance of the volume */79#define AFS_VLSF_BACKVOL 0x0008 /* this server holds a backup instance of the volume */80} servers[8];81};8283#endif /* AFS_VL_H */848586