xref: /linux/include/uapi/linux/nfs_idmap.h (revision e5451c8f8330e03ad3cfa16048b4daf961af434f)
1607ca46eSDavid Howells /*
2*40c64c26SAnna Schumaker  * include/uapi/linux/nfs_idmap.h
3607ca46eSDavid Howells  *
4607ca46eSDavid Howells  *  UID and GID to name mapping for clients.
5607ca46eSDavid Howells  *
6607ca46eSDavid Howells  *  Copyright (c) 2002 The Regents of the University of Michigan.
7607ca46eSDavid Howells  *  All rights reserved.
8607ca46eSDavid Howells  *
9607ca46eSDavid Howells  *  Marius Aamodt Eriksen <marius@umich.edu>
10607ca46eSDavid Howells  *
11607ca46eSDavid Howells  *  Redistribution and use in source and binary forms, with or without
12607ca46eSDavid Howells  *  modification, are permitted provided that the following conditions
13607ca46eSDavid Howells  *  are met:
14607ca46eSDavid Howells  *
15607ca46eSDavid Howells  *  1. Redistributions of source code must retain the above copyright
16607ca46eSDavid Howells  *     notice, this list of conditions and the following disclaimer.
17607ca46eSDavid Howells  *  2. Redistributions in binary form must reproduce the above copyright
18607ca46eSDavid Howells  *     notice, this list of conditions and the following disclaimer in the
19607ca46eSDavid Howells  *     documentation and/or other materials provided with the distribution.
20607ca46eSDavid Howells  *  3. Neither the name of the University nor the names of its
21607ca46eSDavid Howells  *     contributors may be used to endorse or promote products derived
22607ca46eSDavid Howells  *     from this software without specific prior written permission.
23607ca46eSDavid Howells  *
24607ca46eSDavid Howells  *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
25607ca46eSDavid Howells  *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26607ca46eSDavid Howells  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27607ca46eSDavid Howells  *  DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28607ca46eSDavid Howells  *  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29607ca46eSDavid Howells  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30607ca46eSDavid Howells  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31607ca46eSDavid Howells  *  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32607ca46eSDavid Howells  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33607ca46eSDavid Howells  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34607ca46eSDavid Howells  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35607ca46eSDavid Howells  */
36607ca46eSDavid Howells 
37607ca46eSDavid Howells #ifndef _UAPINFS_IDMAP_H
38607ca46eSDavid Howells #define _UAPINFS_IDMAP_H
39607ca46eSDavid Howells 
40607ca46eSDavid Howells #include <linux/types.h>
41607ca46eSDavid Howells 
42607ca46eSDavid Howells /* XXX from bits/utmp.h  */
43607ca46eSDavid Howells #define IDMAP_NAMESZ  128
44607ca46eSDavid Howells 
45607ca46eSDavid Howells #define IDMAP_TYPE_USER  0
46607ca46eSDavid Howells #define IDMAP_TYPE_GROUP 1
47607ca46eSDavid Howells 
48607ca46eSDavid Howells #define IDMAP_CONV_IDTONAME 0
49607ca46eSDavid Howells #define IDMAP_CONV_NAMETOID 1
50607ca46eSDavid Howells 
51607ca46eSDavid Howells #define IDMAP_STATUS_INVALIDMSG 0x01
52607ca46eSDavid Howells #define IDMAP_STATUS_AGAIN      0x02
53607ca46eSDavid Howells #define IDMAP_STATUS_LOOKUPFAIL 0x04
54607ca46eSDavid Howells #define IDMAP_STATUS_SUCCESS    0x08
55607ca46eSDavid Howells 
56607ca46eSDavid Howells struct idmap_msg {
57607ca46eSDavid Howells 	__u8  im_type;
58607ca46eSDavid Howells 	__u8  im_conv;
59607ca46eSDavid Howells 	char  im_name[IDMAP_NAMESZ];
60607ca46eSDavid Howells 	__u32 im_id;
61607ca46eSDavid Howells 	__u8  im_status;
62607ca46eSDavid Howells };
63607ca46eSDavid Howells 
64607ca46eSDavid Howells 
65607ca46eSDavid Howells #endif /* _UAPINFS_IDMAP_H */
66