/*
- * Copyright (c) 2000-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#define NFS_MATTR_PRINCIPAL 25 /* GSS principal to authenticate with */
#define NFS_MATTR_SVCPRINCIPAL 26 /* GSS principal to authenticate to, the server principal */
#define NFS_MATTR_NFS_VERSION_RANGE 27 /* Packed version range to try */
+#define NFS_MATTR_KERB_ETYPE 28 /* Enctype to use for kerberos mounts */
/* NFS mount flags */
#define NFS_MFLAG_SOFT 0 /* soft mount (requests fail if unresponsive) */
#define NFS_MFLAG_MUTEJUKEBOX 8 /* don't treat jukebox errors as unresponsive */
#define NFS_MFLAG_EPHEMERAL 9 /* ephemeral (mirror) mount */
#define NFS_MFLAG_NOCALLBACK 10 /* don't provide callback RPC service */
-#define NFS_MFLAG_NONAMEDATTR 11 /* don't use named attributes */
+#define NFS_MFLAG_NAMEDATTR 11 /* don't use named attributes */
#define NFS_MFLAG_NOACL 12 /* don't support ACLs */
#define NFS_MFLAG_ACLONLY 13 /* only support ACLs - not mode */
#define NFS_MFLAG_NFC 14 /* send NFC strings */
#define NFS_LOCK_MODE_DISABLED 1 /* do not support advisory file locking */
#define NFS_LOCK_MODE_LOCAL 2 /* perform advisory file locking locally */
+
+/* Supported encryption types for kerberos session keys */
+typedef enum nfs_supported_kerberos_etypes {
+ NFS_DES3_CBC_SHA1_KD = 16,
+ NFS_AES128_CTS_HMAC_SHA1_96 = 17,
+ NFS_AES256_CTS_HMAC_SHA1_96 = 18
+} nfs_supported_kerberos_etypes;
+
+/* Structure to hold an array of kerberos enctypes to allow on a mount */
+#define NFS_MAX_ETYPES 3
+struct nfs_etype {
+ uint32_t count;
+ uint32_t selected; /* index in etypes that is being used. Set to count if nothing has been selected */
+ nfs_supported_kerberos_etypes etypes[NFS_MAX_ETYPES];
+};
+
/*
* Old-style arguments to mount NFS
*/
struct nfsstatcount64 ops; /* Count of NFS Requests received for this export */
struct nfsstatcount64 bytes_read; /* Count of bytes read from this export */
struct nfsstatcount64 bytes_written; /* Count of bytes written to his export */
-}__attribute__((__packed__));
+};
/* Macro for updating nfs export stat counters */
#define NFSStatAdd64(PTR, VAL) \
#include <sys/_types/_guid_t.h> /* for guid_t below */
#define MAXIDNAMELEN 1024
struct nfs_testmapid {
- uint32_t ntm_name2id; /* lookup name 2 id or id 2 name */
+ uint32_t ntm_lookup; /* lookup name 2 id or id 2 name */
uint32_t ntm_grpflag; /* Is this a group or user maping */
uint32_t ntm_id; /* id to map or return */
uint32_t pad;
guid_t ntm_guid; /* intermidiate guid used in conversion */
char ntm_name[MAXIDNAMELEN]; /* name to map or return */
};
-
+
+#define NTM_ID2NAME 0
+#define NTM_NAME2ID 1
+#define NTM_NAME2GUID 2
+#define NTM_GUID2NAME 3
+
/*
* fs.nfs sysctl(3) identifiers
*/
extern u_int32_t nfs_xid, nfs_xidwrap;
extern int nfs_iosize, nfs_allow_async, nfs_statfs_rate_limit;
extern int nfs_access_cache_timeout, nfs_access_delete, nfs_access_dotzfs, nfs_access_for_getattr;
-extern int nfs_lockd_mounts, nfs_lockd_request_sent, nfs_single_des;
+extern int nfs_lockd_mounts, nfs_lockd_request_sent;
extern int nfs_tprintf_initial_delay, nfs_tprintf_delay;
extern int nfsiod_thread_count, nfsiod_thread_max, nfs_max_async_writes;
extern int nfs_idmap_ctrl, nfs_callback_port;
/* bits for nfs_idmap_ctrl: */
#define NFS_IDMAP_CTRL_USE_IDMAP_SERVICE 0x00000001 /* use the ID mapping service */
#define NFS_IDMAP_CTRL_FALLBACK_NO_COMMON_IDS 0x00000002 /* fallback should NOT handle common IDs like "root" and "nobody" */
-#define NFS_IDMAP_CTRL_FALLBACK_NO_WELLKNOWN_IDS 0x00000004 /* fallback should NOT handle the well known "XXX@" IDs */
-#define NFS_IDMAP_CTRL_UNKNOWN_IS_99 0x00000008 /* for unknown IDs use uid/gid 99 instead of -2/nobody */
-#define NFS_IDMAP_CTRL_COMPARE_RESULTS 0x00000010 /* compare results of ID mapping service and fallback */
#define NFS_IDMAP_CTRL_LOG_FAILED_MAPPINGS 0x00000020 /* log failed ID mapping attempts */
#define NFS_IDMAP_CTRL_LOG_SUCCESSFUL_MAPPINGS 0x00000040 /* log successful ID mapping attempts */
extern TAILQ_HEAD(nfsd_head, nfsd) nfsd_head, nfsd_queue;
+typedef int (*nfsrv_proc_t)(struct nfsrv_descript *, struct nfsrv_sock *,
+ vfs_context_t, mbuf_t *);
+
/* mutex for nfs server */
extern lck_mtx_t *nfsd_mutex;
extern int nfsd_thread_count, nfsd_thread_max;
extern thread_call_t nfsrv_fmod_timer_call;
#endif
+/* nfs 4 default domain for user mapping */
+extern char nfs4_default_domain[MAXPATHLEN];
+
__BEGIN_DECLS
nfstype vtonfs_type(enum vtype, int);
uint32_t nfs4_ace_nfsmask_to_vfsrights(uint32_t);
uint32_t nfs4_ace_vfsrights_to_nfsmask(uint32_t);
int nfs4_id2guid(char *, guid_t *, int);
-int nfs4_guid2id(guid_t *, char *, int *, int);
+int nfs4_guid2id(guid_t *, char *, size_t *, int);
int nfs_parsefattr(struct nfsm_chain *, int, struct nfs_vattr *);
int nfs4_parsefattr(struct nfsm_chain *, struct nfs_fsattr *, struct nfs_vattr *, fhandle_t *, struct dqblk *, struct nfs_fs_locations *);