smb.h revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SMBSRV_SMB_H
#define _SMBSRV_SMB_H
/*
* SMB definitions and interfaces, mostly defined in the CIFS spec.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* SMB definitions and interfaces, mostly defined in the CIFS spec.
*/
#ifdef _KERNEL
#endif
#include <smbsrv/smb_i18n.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Typedefs from CIFS section 3.2
*/
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
/*
* The msgbuf format and length of an SMB header.
*/
#define SMB_HEADER_DOS_FMT "Mbbbwbww10.wwww"
#define SMB_HEADER_NT_FMT "Mblbww#c2.wwww"
#define SMB_HEADER_LEN 32
/*
* CIFS definition for the SMB header (CIFS Section 3.2). Note that the
* pid_high field is not documented in the 1997 CIFS specificaction. This
* is a decoded or memory-based definition, which may be padded to align
* its elements on word boundaries. See smb_hdrbuf_t for the network
* ready structure.
*/
typedef struct smb_hdr {
union {
struct {
} dos_error;
}status;
union {
struct {
} extra;
} extra;
} smb_hdr_t;
/*
* Encoded or packed SMB header in network ready format.
*/
typedef struct smb_hdrbuf {
unsigned char hdr[SMB_HEADER_LEN];
} smb_hdrbuf_t;
typedef struct smb_nethdr {
union {
struct {
} dos_error;
} status;
union {
struct {
} extra;
} extra;
} smb_nethdr_t;
/*
* Protocol magic value as a 32-bit. This will be 0xff 0x53 0x4d 0x42 on
* the wire.
*/
#define SMB_PROTOCOL_MAGIC 0x424d53ff
/*
* Time and date encoding (CIFS Section 3.6). The date is encoded such
* that the year has a range of 0-119, which represents 1980-2099. The
* month range is 1-12, and the day range is 1-31.
*/
typedef struct smb_date {
} smb_date_t;
/*
* The hours range is 0-23, the minutes range is 0-59 and the two_sec
* range is 0-29.
*/
typedef struct smb_time {
} smb_time_t;
/*
* This is a 64-bit signed absolute time representing 100ns increments.
* A positive value represents the absolute time since 1601AD. A
* negative value represents a context specific relative time.
*/
typedef struct smb_time2 {
} smb_time2_t;
/*
* The number of seconds since Jan 1, 1970, 00:00:00.0.
*/
typedef uint32_t smb_utime_t;
#define SMB_LM_NEGOTIATE_WORDCNT 13
#define SMB_NT_NEGOTIATE_WORDCNT 17
typedef struct smb_nt_negotiate_rsp {
/*
* SMB_COM_TRANSACTION
*/
typedef struct smb_transact_rsp {
/* value = 10 + SetupCount */
#if 0
#endif
/*
* SMBreadX
*/
typedef struct smb_read_andx_rsp {
#if 0
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SMBSRV_SMB_H */