Converted a bunch of 0x85 constants to SMBkeepalive.
authorTim Potter <tpot@samba.org>
Sat, 20 Oct 2001 23:34:40 +0000 (23:34 +0000)
committerTim Potter <tpot@samba.org>
Sat, 20 Oct 2001 23:34:40 +0000 (23:34 +0000)
(This used to be commit b16a15a13ed7d267c6366abaeeb3ccafa5776f5e)

source3/include/smb.h
source3/lib/util_sock.c
source3/smbd/process.c
source3/smbd/reply.c

index 7cef5670bdf3c93d9f1a67c4139fb211d7065d16..8fcbe60646b910e1dc90cd123a394c41013cebe8 100644 (file)
@@ -848,6 +848,7 @@ struct bitmap {
 #define SMBffirst        0x82   /* find first */
 #define SMBfunique       0x83   /* find unique */
 #define SMBfclose        0x84   /* find close */
+#define SMBkeepalive     0x85   /* keepalive */
 #define SMBinvalid       0xFE   /* invalid command */
 
 /* Extended 2.0 protocol */
index 5979cd8b5a2ff4f10b1c754b77ecf1d3129020d2..681bc3065d98efe5340735351772926786ddb4ca 100644 (file)
@@ -396,7 +396,7 @@ BOOL send_keepalive(int client)
 {
   unsigned char buf[4];
 
-  buf[0] = 0x85;
+  buf[0] = SMBkeepalive;
   buf[1] = buf[2] = buf[3] = 0;
 
   return(write_socket_data(client,(char *)buf,4) == 4);
@@ -592,7 +592,7 @@ static ssize_t read_smb_length_return_keepalive(int fd,char *inbuf,unsigned int
     len = smb_len(inbuf);
     msg_type = CVAL(inbuf,0);
 
-    if (msg_type == 0x85
+    if (msg_type == SMBkeepalive
       DEBUG(5,("Got keepalive packet\n"));
   }
 
@@ -620,7 +620,7 @@ ssize_t read_smb_length(int fd,char *inbuf,unsigned int timeout)
       return len;
 
     /* Ignore session keepalives. */
-    if(CVAL(inbuf,0) != 0x85)
+    if(CVAL(inbuf,0) != SMBkeepalive)
       break;
   }
 
@@ -702,7 +702,7 @@ BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout)
     }
 
     /* Ignore session keepalive packets. */
-    if(CVAL(buffer,0) != 0x85)
+    if(CVAL(buffer,0) != SMBkeepalive)
       break;
   }
   show_msg(buffer);
index a0bfdbb2a21bc460606c4ddfbe3b36dbbf3f8c40..cf01cd2cf5b9945cd36abec9e2c9bb0ff0e79fea 100644 (file)
@@ -254,7 +254,7 @@ BOOL receive_next_smb(char *inbuf, int bufsize, int timeout)
        do {
                ret = receive_message_or_smb(inbuf,bufsize,timeout);
                
-               got_keepalive = (ret && (CVAL(inbuf,0) == 0x85));
+               got_keepalive = (ret && (CVAL(inbuf,0) == SMBkeepalive));
        } while (ret && got_keepalive);
 
        return ret;
@@ -867,7 +867,7 @@ void process_smb(char *inbuf, char *outbuf)
 
   if (msg_type == 0)
     show_msg(inbuf);
-  else if(msg_type == 0x85)
+  else if(msg_type == SMBkeepalive)
     return; /* Keepalive packet. */
 
   nread = construct_reply(inbuf,outbuf,nread,max_send);
index 845fabda926de791ca5f2bc4f198eb6d455e5db4..852a2d867b37c9586bbc13eaa8cd2bd81bf681ce 100644 (file)
@@ -122,7 +122,7 @@ int reply_special(char *inbuf,char *outbuf)
                
        case 0x89: /* session keepalive request 
                      (some old clients produce this?) */
-               CVAL(outbuf,0) = 0x85;
+               CVAL(outbuf,0) = SMBkeepalive;
                CVAL(outbuf,3) = 0;
                break;
                
@@ -132,7 +132,7 @@ int reply_special(char *inbuf,char *outbuf)
                DEBUG(0,("Unexpected session response\n"));
                break;
                
-       case 0x85: /* session keepalive */
+       case SMBkeepalive: /* session keepalive */
        default:
                return(0);
        }