Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: LGPL-2.1 */
0002 /*
0003  *
0004  *   Protocol Data Unit definitions for RFC 1001/1002 support
0005  *
0006  *   Copyright (c) International Business Machines  Corp., 2004
0007  *   Author(s): Steve French (sfrench@us.ibm.com)
0008  *
0009  */
0010 
0011 /* NB: unlike smb/cifs packets, the RFC1002 structures are big endian */
0012 
0013     /* RFC 1002 session packet types */
0014 #define RFC1002_SESSION_MESSAGE 0x00
0015 #define RFC1002_SESSION_REQUEST  0x81
0016 #define RFC1002_POSITIVE_SESSION_RESPONSE 0x82
0017 #define RFC1002_NEGATIVE_SESSION_RESPONSE 0x83
0018 #define RFC1002_RETARGET_SESSION_RESPONSE 0x84
0019 #define RFC1002_SESSION_KEEP_ALIVE 0x85
0020 
0021     /* RFC 1002 flags (only one defined */
0022 #define RFC1002_LENGTH_EXTEND 0x80 /* high order bit of length (ie +64K) */
0023 
0024 struct rfc1002_session_packet {
0025     __u8    type;
0026     __u8    flags;
0027     __u16   length;
0028     union {
0029         struct {
0030             __u8 called_len;
0031             __u8 called_name[32];
0032             __u8 scope1; /* null */
0033             __u8 calling_len;
0034             __u8 calling_name[32];
0035             __u8 scope2; /* null */
0036         } __attribute__((packed)) session_req;
0037         struct {
0038             __u32 retarget_ip_addr;
0039             __u16 port;
0040         } __attribute__((packed)) retarget_resp;
0041         __u8 neg_ses_resp_error_code;
0042         /* POSITIVE_SESSION_RESPONSE packet does not include trailer.
0043         SESSION_KEEP_ALIVE packet also does not include a trailer.
0044         Trailer for the SESSION_MESSAGE packet is SMB/CIFS header */
0045     } __attribute__((packed)) trailer;
0046 } __attribute__((packed));
0047 
0048 /* Negative Session Response error codes */
0049 #define RFC1002_NOT_LISTENING_CALLED  0x80 /* not listening on called name */
0050 #define RFC1002_NOT_LISTENING_CALLING 0x81 /* not listening on calling name */
0051 #define RFC1002_NOT_PRESENT           0x82 /* called name not present */
0052 #define RFC1002_INSUFFICIENT_RESOURCE 0x83
0053 #define RFC1002_UNSPECIFIED_ERROR     0x8F
0054 
0055 /* RFC 1002 Datagram service packets are not defined here as they
0056 are not needed for the network filesystem client unless we plan on
0057 implementing broadcast resolution of the server ip address (from
0058 server netbios name). Currently server names are resolved only via DNS
0059 (tcp name) or ip address or an /etc/hosts equivalent mapping to ip address.*/
0060 
0061 #define DEFAULT_CIFS_CALLED_NAME  "*SMBSERVER      "