Whamcloud - gitweb
land clio.
[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_MDS      0
24 #define LUSTRE_GSS_SVC_OSS      1
25
26 extern const char * lustre_svc_name[];
27
28 struct lgssd_upcall_data {
29         uint32_t        seq;
30         uint32_t        uid;
31         uint32_t        gid;
32         uint32_t        svc;
33         uint64_t        nid;
34         char            obd[64];
35 };
36
37 #define GSSD_INTERFACE_VERSION        (1)
38
39 struct lgssd_ioctl_param {
40         int             version;        /* in   */
41         int             secid;          /* in   */
42         char           *uuid;           /* in   */
43         int             lustre_svc;     /* in   */
44         uid_t           uid;            /* in   */
45         gid_t           gid;            /* in   */
46         long            send_token_size;/* in   */
47         char           *send_token;     /* in   */
48         long            reply_buf_size; /* in   */
49         char           *reply_buf;      /* in   */
50         long            status;         /* out  */
51         long            reply_length;   /* out  */
52 };
53
54 #define GSSD_DEFAULT_GETHOSTNAME_EX     "/etc/lustre/nid2hostname"
55 #define MAPPING_DATABASE_FILE           "/etc/lustre/idmap.conf"
56
57 int lnet_nid2hostname(lnet_nid_t nid, char *buf, int buflen);
58 void cleanup_mapping(void);
59 int lookup_mapping(char *princ, lnet_nid_t nid, uid_t *uid);
60
61 #endif /* __LSUPPORT_H__ */