Whamcloud - gitweb
branch: HEAD
[fs/lustre-release.git] / lustre / utils / gss / lsupport.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4
5 #ifndef __LSUPPORT_H__
6 #define __LSUPPORT_H__
7
8 #include <unistd.h>
9 #include <stdint.h>
10
11 #include <libcfs/libcfs.h>
12
13 #define GSSD_CLI        (0)
14 #define GSSD_SVC        (1)
15
16 void gssd_init_unique(int type);
17 void gssd_exit_unique(int type);
18
19 /*
20  * copied from lustre source
21  */
22
23 #define LUSTRE_GSS_SVC_MGS      0
24 #define LUSTRE_GSS_SVC_MDS      1
25 #define LUSTRE_GSS_SVC_OSS      2
26
27 extern const char * lustre_svc_name[];
28
29 struct lgssd_upcall_data {
30         uint32_t        seq;
31         uint32_t        uid;
32         uint32_t        gid;
33         uint32_t        svc;
34         uint64_t        nid;
35         char            obd[64];
36 };
37
38 #define GSSD_INTERFACE_VERSION        (1)
39
40 struct lgssd_ioctl_param {
41         int             version;        /* in   */
42         int             secid;          /* in   */
43         char           *uuid;           /* in   */
44         int             lustre_svc;     /* in   */
45         uid_t           uid;            /* in   */
46         gid_t           gid;            /* in   */
47         long            send_token_size;/* in   */
48         char           *send_token;     /* in   */
49         long            reply_buf_size; /* in   */
50         char           *reply_buf;      /* in   */
51         long            status;         /* out  */
52         long            reply_length;   /* out  */
53 };
54
55 #define GSSD_DEFAULT_GETHOSTNAME_EX     "/etc/lustre/nid2hostname"
56 #define MAPPING_DATABASE_FILE           "/etc/lustre/idmap.conf"
57
58 int lnet_nid2hostname(lnet_nid_t nid, char *buf, int buflen);
59 void cleanup_mapping(void);
60 int lookup_mapping(char *princ, lnet_nid_t nid, uid_t *uid);
61
62 #endif /* __LSUPPORT_H__ */