]> The Tcpdump Group git mirrors - tcpdump/blobdiff - smb.h
Default to first interface from pcap_findalldevs()
[tcpdump] / smb.h
diff --git a/smb.h b/smb.h
index a8ee2c208fbf7721526925655f673c1e83b50fc9..b521617fe01a2f8dfadb1699b44ee0d08a471578 100644 (file)
--- a/smb.h
+++ b/smb.h
@@ -1,5 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/smb.h,v 1.5 2001-06-25 18:58:08 itojun Exp $ (LBL) */
-/* 
+/*
  * Copyright (C) Andrew Tridgell 1995-1999
  *
  * This software may be distributed either under the terms of the
  * Copyright (C) Andrew Tridgell 1995-1999
  *
  * This software may be distributed either under the terms of the
@@ -7,39 +6,8 @@
  * or later
  */
 
  * or later
  */
 
-#define CVAL(buf,pos) (((unsigned char *)(buf))[pos])
-#define PVAL(buf,pos) ((unsigned)CVAL(buf,pos))
-#define SCVAL(buf,pos,val) (CVAL(buf,pos) = (val))
-
-#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
-#define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
-#define SSVALX(buf,pos,val) (CVAL(buf,pos)=(val)&0xFF,CVAL(buf,pos+1)=(val)>>8)
-#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
-#define SVALS(buf,pos) ((int16)SVAL(buf,pos))
-#define IVALS(buf,pos) ((int32)IVAL(buf,pos))
-#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16)(val)))
-#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val)))
-#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val)))
-#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32)(val)))
-
-/* now the reverse routines - these are used in nmb packets (mostly) */
-#define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
-#define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16)))
-
-#define RSVAL(buf,pos) SREV(SVAL(buf,pos))
-#define RIVAL(buf,pos) IREV(IVAL(buf,pos))
-#define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val))
-#define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val))
-
-#define uint16 unsigned short
-#define uint32 unsigned int
-#ifndef uchar
-#define uchar unsigned char
-#endif
-
-#ifndef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
+/* for netdissect_options */
+#include "netdissect.h"
 
 /* the complete */
 #define SMBmkdir      0x00   /* create directory */
 
 /* the complete */
 #define SMBmkdir      0x00   /* create directory */
 #define TRANSACT2_FINDNOTIFYNEXT  12
 #define TRANSACT2_MKDIR           13
 
 #define TRANSACT2_FINDNOTIFYNEXT  12
 #define TRANSACT2_MKDIR           13
 
-#define PTR_DIFF(p1, p2) ((size_t)(((char *)(p1)) - (char *)(p2)))
+#define PTR_DIFF(p1, p2) ((size_t)(((const char *)(p1)) - (const char *)(p2)))
 
 /* some protos */
 
 /* some protos */
-const uchar *fdata(const uchar *, const char *, const uchar *);
+const u_char *smb_fdata(netdissect_options *, const u_char *, const char *, const u_char *, int);