/*1* fs/cifs/rfc1002pdu.h2*3* Protocol Data Unit definitions for RFC 1001/1002 support4*5* Copyright (c) International Business Machines Corp., 20046* Author(s): Steve French ([email protected])7*8* This library is free software; you can redistribute it and/or modify9* it under the terms of the GNU Lesser General Public License as published10* by the Free Software Foundation; either version 2.1 of the License, or11* (at your option) any later version.12*13* This library is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See16* the GNU Lesser General Public License for more details.17*18* You should have received a copy of the GNU Lesser General Public License19* along with this library; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21*/2223/* NB: unlike smb/cifs packets, the RFC1002 structures are big endian */2425/* RFC 1002 session packet types */26#define RFC1002_SESSION_MESSAGE 0x0027#define RFC1002_SESSION_REQUEST 0x8128#define RFC1002_POSITIVE_SESSION_RESPONSE 0x8229#define RFC1002_NEGATIVE_SESSION_RESPONSE 0x8330#define RFC1002_RETARGET_SESSION_RESPONSE 0x8431#define RFC1002_SESSION_KEEP_ALIVE 0x853233/* RFC 1002 flags (only one defined */34#define RFC1002_LENGTH_EXTEND 0x80 /* high order bit of length (ie +64K) */3536struct rfc1002_session_packet {37__u8 type;38__u8 flags;39__u16 length;40union {41struct {42__u8 called_len;43__u8 called_name[32];44__u8 scope1; /* null */45__u8 calling_len;46__u8 calling_name[32];47__u8 scope2; /* null */48} __attribute__((packed)) session_req;49struct {50__u32 retarget_ip_addr;51__u16 port;52} __attribute__((packed)) retarget_resp;53__u8 neg_ses_resp_error_code;54/* POSITIVE_SESSION_RESPONSE packet does not include trailer.55SESSION_KEEP_ALIVE packet also does not include a trailer.56Trailer for the SESSION_MESSAGE packet is SMB/CIFS header */57} __attribute__((packed)) trailer;58} __attribute__((packed));5960/* Negative Session Response error codes */61#define RFC1002_NOT_LISTENING_CALLED 0x80 /* not listening on called name */62#define RFC1002_NOT_LISTENING_CALLING 0x81 /* not listening on calling name */63#define RFC1002_NOT_PRESENT 0x82 /* called name not present */64#define RFC1002_INSUFFICIENT_RESOURCE 0x8365#define RFC1002_UNSPECIFIED_ERROR 0x8F6667/* RFC 1002 Datagram service packets are not defined here as they68are not needed for the network filesystem client unless we plan on69implementing broadcast resolution of the server ip address (from70server netbios name). Currently server names are resolved only via DNS71(tcp name) or ip address or an /etc/hosts equivalent mapping to ip address.*/7273#define DEFAULT_CIFS_CALLED_NAME "*SMBSERVER "747576