smb_xdr.h revision 68b2bbf26c7040fea4281dcb58b81e7627e46f34
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _SMBSRV_SMB_XDR_H
#define _SMBSRV_SMB_XDR_H
#ifdef __cplusplus
extern "C" {
#endif
#include <smbsrv/wintypes.h>
#include <smbsrv/smb_ioctl.h>
#include <smbsrv/smb_share.h>
#include <smbsrv/wintypes.h>
#if defined(_KERNEL) || defined(_FAKE_KERNEL)
#include <sys/sysmacros.h>
#define xdr_int8_t xdr_char
#define xdr_uint8_t xdr_u_char
#define xdr_int16_t xdr_short
#define xdr_uint16_t xdr_u_short
#else /* _KERNEL */
#include <stddef.h> /* offsetof */
#endif /* _KERNEL */
/* null-terminated string */
typedef struct smb_string {
char *buf;
} smb_string_t;
struct smb_buf32;
/*
* Initial message on server named pipes.
* Followed by smb_netuserinfo
*/
typedef struct smb_pipehdr {
/*
* Maximum message size for SMB named pipes.
* Should be less than PIPE_BUF (5120).
* Use the same value Windows does.
*/
#define SMB_PIPE_MAX_MSGSIZE 4280
/*
* Door up-call stuff shared with smbd
*/
/*
* Door header flags.
*/
/*
* Header for door calls. The op codes and return codes are defined
* in smb_door.h. The header is here to make it available to XDR.
*
* fid For opipe: the pipe identifier.
* op The door operation being invoked.
* txid Unique transaction id for the current door call.
* datalen Bytes of data following the header (excludes the header).
* resid For opipe: the number of bytes remaining in the server.
* door_rc Return code provided by the door server.
* status A pass-through status provided by the door operation.
*/
typedef struct smb_doorhdr {
typedef struct smb_netuserinfo {
char *ui_domain;
char *ui_account;
char *ui_workstation;
typedef struct smb_opennum {
char qualifier[MAXNAMELEN];
typedef struct smb_netconnectinfo {
char *ci_username;
char *ci_share;
typedef struct smb_netfileinfo {
char *fi_path;
char *fi_username;
typedef struct smb_netsvcitem {
union {
} nsi_un;
typedef struct smb_netsvc {
} smb_netsvc_t;
const char *smb_doorhdr_opname(uint32_t);
uint_t *);
uint_t *);
typedef uint16_t sid_type_t;
typedef struct lsa_account {
char a_domain[MAXNAMELEN];
char a_name[MAXNAMELEN];
char a_sid[SMB_SID_STRSZ];
/*
* VSS Door Structures
*/
#define SMB_VSS_GMT_SIZE sizeof ("@GMT-yyyy.mm.dd-hh.mm.ss")
typedef struct smb_gmttoken_query {
char *gtq_path;
typedef char *smb_gmttoken_t;
typedef struct smb_gmttoken_response {
struct {
typedef struct smb_gmttoken_snapname {
char *gts_path;
char *gts_gmttoken;
/*
* User and Group Quotas
*
* SMB User and Group quota values of SMB_QUOTA_UNLIMITED mean
* No Limit. This maps to 0 (none) on ZFS.
*/
#define SMB_QUOTA_UNLIMITED 0xFFFFFFFFFFFFFFFF
typedef struct smb_quota {
char q_sidstr[SMB_SID_STRSZ];
} smb_quota_t;
typedef struct smb_quota_sid {
char qs_sidstr[SMB_SID_STRSZ];
typedef enum {
typedef struct smb_quota_query {
char *qq_root_path;
typedef struct smb_quota_response {
typedef struct smb_quota_set {
char *qs_root_path;
typedef struct dfs_referral_query {
char *rq_path;
typedef struct dfs_referral_response {
typedef struct smb_shr_hostaccess_query {
char *shq_none;
char *shq_ro;
char *shq_rw;
#ifdef __cplusplus
}
#endif
#endif /* _SMBSRV_SMB_XDR_H */