GRAND.CENTRAL.ORG

AFS Assigned Numbers Registry - ioctl() and pioctl() function codes

This is a registry of the function codes used for ioctl() and pioctl() functions used on AFS files and for configuring cache managers. While these interfaces are not part of the AFS wire protocol, there is a desire to promote interoperability between AFS implementations by providing a common registry for these codes.

There are several ioctl/pioctl code groups, each of which contains a maximum of 255 available codes. There is a code group for each AFS implementation participating in this registry, plus a group for common implementation-independent functions. The code group list and the common group are managed by the AFS assigned numbers registrar. The lists below is the canonical list, and all unassigned codes are reserved.

The implementation-specific groups are managed by the maintainers of each implementation. The lists below may not be canonical, but will be updated as requested by the implementation maintainers. Unassigned codes must not be used without approval of the implementation maintainer.

Code Groups

GroupMacroImplementation / Owner
C_VICEIOCTL2('C',x)Common functions
V_VICEIOCTL(x)Transarc/IBM and legacy functions
A_ARLAIOCTL(x)Arla (http://www.stacken.kth.se/projekt/arla/)
O_VICEIOCTL2('O',x)OpenAFS (http://www.openafs.org/)

Common ioctl() Codes

GroupCodeNamePurpose / Usage
C0- reserved -
C239- reserved -Reserved for code space expansion
C255- reserved -Reserved for code space expansion

Transarc/IBM and Legacy ioctl() Codes

GroupCodeNamePurpose / Usage
V0- reserved -
V1VIOCCLOSEWAITForce close() to wait for store
V2VIOCABORTAbort close on this fd
V3VIOCIGETCELLGet cell name
V239- reserved -Reserved for code space expansion
V240VIOC_SITE1Reserved for site-specific extensions
V241VIOC_SITE2Reserved for site-specific extensions
V242VIOC_SITE3Reserved for site-specific extensions
V243VIOC_SITE4Reserved for site-specific extensions
V244VIOC_SITE5Reserved for site-specific extensions
V245VIOC_SITE6Reserved for site-specific extensions
V246VIOC_SITE7Reserved for site-specific extensions
V247VIOC_SITE8Reserved for site-specific extensions
V248VIOC_PRIVATE1Reserved for implementation use
V249VIOC_PRIVATE2Reserved for implementation use
V250VIOC_PRIVATE3Reserved for implementation use
V251VIOC_PRIVATE4Reserved for implementation use
V252VIOC_PRIVATE5Reserved for implementation use
V253VIOC_PRIVATE6Reserved for implementation use
V254VIOC_PRIVATE7Reserved for implementation use
V255VIOC_PRIVATE8Reserved for implementation use

Common pioctl() Codes

GroupCodeNamePurpose / Usage
C0- reserved -
C1VIOC_NEWALIASAdd new cell alias
C2VIOC_GETALIASGet cell alias info
C3VIOC_CBADDRPush callback address
C4VIOC_CHOWNChange file owner
C5VIOC_DISCONSet/get diconnected mode
C6VIOC_CREATE_MT_PTCreate mount point
C7VIOCGETTOK2Get tokens (extended)
C8VIOCSETTOK2Set tokens (extended)
C9VIOCNEWUUIDForce a new uuid
C10VIOCGETPROPGet property
C11VIOCSETPROPSet property
C239- reserved -Reserved for code space expansion
C255- reserved -Reserved for code space expansion

Transarc/IBM and Legacy pioctl() Codes

GroupCodeNamePurpose / Usage
V0- reserved -
V1VIOCSETALSet access control list
V2VIOCGETALGet access control list
V3VIOCSETTOKSet authentication tokens
V4VIOCGETVOLSTATGet volume status
V5VIOCSETVOLSTATSet volume status
V6VIOCFLUSHInvalidate cache entry
V7VIOCSTATGet file status
V8VIOCGETTOKGet authentication tokens
V9VIOCUNLOGInvalidate tokens
V10VIOCCKSERVCheck that servers are up
V11VIOCCKBACKCheck backup volume mappings
V12VIOCCKCONNCheck connections for a user
V13VIOCGETTIMEMake gettime call (historic)
V14VIOCWHEREISFind out where a volume is located
V15VIOCPREFETCHPrefetch a file
V16VIOCNOPNo-op (historic)
V17VIOCENGROUPEnable group access (historic)
V18VIOCDISGROUPDisable group access (historic)
V19VIOCLISTGROUPSList enabled and disabled groups (historic)
V20VIOCACCESSAccess using PRS_FS bits
V21VIOCUNPAGInvalidate pag
V22VIOCGETFIDGet file ID quickly
V23VIOCWAITFOREVERWait for dead servers forever (historic)
V24VIOCSETCACHESIZESet venus cache size in 1k units
V25VIOCFLUSHCBFlush callback only
V26VIOCNEWCELLConfigure new cell
V27VIOCGETCELLGet cell info
V28VIOC_AFS_DELETE_MT_PTDelete mount point
V29VIOC_AFS_STAT_MT_PTStat mount point
V30VIOC_FILE_CELL_NAMEGet cell in which file lives
V31VIOC_GET_WS_CELLGet cell in which workstation lives
V32VIOC_AFS_MARINER_HOSTGet/set mariner (cache manager monitor) host
V33VIOC_GET_PRIMARY_CELLGet primary cell for caller
V34VIOC_VENUSLOGEnable/Disable venus logging
V35VIOC_GETCELLSTATUSGet cell status info
V36VIOC_SETCELLSTATUSSet corresponding info
V37VIOC_FLUSHVOLUMEFlush whole volume's data
V38VIOC_AFS_SYSNAMEChange @sys value
V39VIOC_EXPORTAFSExport afs to nfs clients
V40VIOCGETCACHEPARMSGet cache stats
V41VIOCGETVCXSTATUS
V42VIOC_SETSPREFS33Set server ranks (deprecated)
V43VIOC_GETSPREFSGet server ranks
V44VIOC_GAGSilence CM
V45VIOC_TWIDDLEAdjust RX knobs
V46VIOC_SETSPREFSSet server ranks
V47VIOC_STORBEHINDAdjust store asynchrony
V48VIOC_GCPAGSDisable automatic pag gc-ing
V49VIOC_GETINITPARAMSGet initial cm params
V50VIOC_GETCPREFSGet client interface
V51VIOC_SETCPREFSSet client interface
V52VIOC_AFS_FLUSHMOUNTFlush mount symlink data
V53VIOC_RXSTAT_PROCControl process RX stats
V54VIOC_RXSTAT_PEERControl peer RX stats
V55VIOC_GETRXKCRYPTGet rxkad encryption flag
V56VIOC_GETRXKCRYPTSet rxkad encryption flag
V57VIOC_FPRIOSTATUSarla: set file prio
V58VIOC_FHGETarla: fallback getfh
V59VIOC_FHOPENarla: fallback fhopen
V60VIOC_XFSDEBUGarla: controls xfsdebug
V61VIOC_ARLADEBUGarla: controls arla debug
V62VIOC_AVIATORarla: debug interface
V63VIOC_XFSDEBUG_PRINTarla: print xfs status
V64VIOC_CALCULATE_CACHEarla: force cache check
V65VIOC_BREAKCELLBACKarla: break callback
V99PSetClientContextNFS-pag pioctl (for knfs/rmtsysd)
V239- reserved -Reserved for code space expansion
V240VIOC_SITE1Reserved for site-specific extensions
V241VIOC_SITE2Reserved for site-specific extensions
V242VIOC_SITE3Reserved for site-specific extensions
V243VIOC_SITE4Reserved for site-specific extensions
V244VIOC_SITE5Reserved for site-specific extensions
V245VIOC_SITE6Reserved for site-specific extensions
V246VIOC_SITE7Reserved for site-specific extensions
V247VIOC_SITE8Reserved for site-specific extensions
V248VIOC_PRIVATE1Reserved for implementation use
V249VIOC_PRIVATE2Reserved for implementation use
V250VIOC_PRIVATE3Reserved for implementation use
V251VIOC_PRIVATE4Reserved for implementation use
V252VIOC_PRIVATE5Reserved for implementation use
V253VIOC_PRIVATE6Reserved for implementation use
V254VIOC_PRIVATE7Reserved for implementation use
V255VIOC_PRIVATE8Reserved for implementation use

OpenAFS pioctl() Codes

The following list is for reference purposes only, and may not be fully up-to-date. For a canonical list of 'O' group pioctl's used in OpenAFS, see the most recent verison of src/config/vioc.h, available A HREF="http://cvs.openafs.org/src/config/vioc.h">via CVSweb.

GroupCodeNamePurpose / Usage
O0- reserved -
O1VIOC_NFS_NUKE_CREDSnuke creds for all NFS PAG's

Arla pioctl() Codes

The following list is for reference purposes only, and may not be fully up-to-date. For a canonical list of 'A' group pioctl's used in Arla, see the most recent verison of arla/include/kafs.h, available via CVSweb.

GroupCodeNamePurpose / Usage
A0- reserved -
A1AIOC_STATISTICSarla: fetch statistics
A2AIOC_PTSNAMETOIDarla: pts name to id
A3AIOC_GETCACHEPARAMSarla: get cache params

How to use these codes

These codes are to compute the request number argument to the ioctl() and pioctl() system calls. The exact method of computation varies from platform to platform, and is generally encoded in the definition of the macros listed in the code group table, such that _VICEIOCTL(10) produces the correct request for pioctl code 10 in the 'V' group, and _VICEIOCTL2('C',2) produces the correct request for pioctl code 2 in the 'C' group.

For UNIX systems, the method of computation is the same as that used to compute request numbers for device ioctl() calls. Such systems generally encode a device type, request code, argument type, and argument "direction" (read, write, read/write, or none). For these codes, the device is the code group letter, the direction is 'read/write' ('write' on platforms which don't have read/write), and the argument is of the following type:

  struct ViceIoctl {
    caddr_t in, out;
    short in_size;
    short out_size;
  }

This is accomplished with definitions like the following: #define _VICEIOCTL(x) _IOW('V', x, struct ViceIoctl) #define _VICEIOCTL2(dev,x) _IOW(dev, x, struct ViceIoctl)

Reserved codes

Code 0 is reserved in every group and must not be used.

Codes V.239, C.239, and C.255 are reserved for future code space expansion by the registrar and must not be used for any other purpose. Managers of other code groups are encouraged to reserve codes 239 and 255 for future code space expansion.

Codes V.240 through V.247 (VIOC_SITE1 through VIOC_SITE8) are reserved for use by extensions local to a specific site. They should never be used in any distributed software.

Codes V.248 through V.255 (VIOC_PRIVATE1 through VIOC_PRIVATE8) are reserved for private implementation-specific extensions. They should be used only by software which is absolutely certain which cache manager implementation is in use.

Registration Policy

Codes for ioctl() and pioctl() functions in the 'C' group will be assigned on request for new common, implementation-independent functions supported by any cache manager implementation wishing to provide these interfaces. Codes in other groups are assigned by and at the discretion of the maintainers of the implementation listed for the group.

New code groups will be assinged to any cache manager implementation wishing to provide these interfaces and desiring a private code space.

When a function is already provided by one implementation, other implementors are encouraged to use the same interface in order to provide for maximum interoperability.