]>
The Tcpdump Group git mirrors - tcpdump/blob - print-smb.c
0c5e9e95b328c1c0a9120c75eb2eafc911576e1c
2 * Copyright (C) Andrew Tridgell 1995-1999
4 * This software may be distributed either under the terms of the
5 * BSD-style license that accompanies tcpdump or the GNU GPL version 2
14 static const char rcsid
[] =
15 "@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.24 2002-07-11 07:44:49 guy Exp $" ;
20 #include <sys/types.h>
22 #include <netinet/in.h>
24 #include "interface.h"
28 static int request
= 0 ;
30 const u_char
* startbuf
= NULL
;
37 void (* fn
)( const u_char
*, const u_char
*, const u_char
*, const u_char
*);
40 struct smbdescriptint
{
45 void (* fn
)( const u_char
*, const u_char
*, int , int );
53 struct smbdescript descript
;
61 struct smbdescriptint descript
;
64 #define DEFDESCRIPT { NULL, NULL, NULL, NULL, NULL }
66 #define FLG_CHAIN (1 << 0)
68 static struct smbfns
*
69 smbfind ( int id
, struct smbfns
* list
)
73 for ( sindex
= 0 ; list
[ sindex
]. name
; sindex
++)
74 if ( list
[ sindex
]. id
== id
)
75 return (& list
[ sindex
]);
80 static struct smbfnsint
*
81 smbfindint ( int id
, struct smbfnsint
* list
)
85 for ( sindex
= 0 ; list
[ sindex
]. name
; sindex
++)
86 if ( list
[ sindex
]. id
== id
)
87 return (& list
[ sindex
]);
93 trans2_findfirst ( const u_char
* param
, const u_char
* data
, int pcnt
, int dcnt
)
98 fmt
= "Attribute=[A] \n SearchCount=[d] \n Flags=[w] \n Level=[dP5] \n File=[S] \n " ;
100 fmt
= "Handle=[w] \n Count=[d] \n EOS=[w] \n Eoffset=[d] \n LastNameOfs=[w] \n " ;
102 smb_fdata ( param
, fmt
, param
+ pcnt
);
105 print_data ( data
, dcnt
);
110 trans2_qfsinfo ( const u_char
* param
, const u_char
* data
, int pcnt
, int dcnt
)
112 static int level
= 0 ;
117 level
= EXTRACT_LE_16BITS ( param
);
118 fmt
= "InfoLevel=[d] \n " ;
119 smb_fdata ( param
, fmt
, param
+ pcnt
);
123 fmt
= "idFileSystem=[W] \n SectorUnit=[D] \n Unit=[D] \n Avail=[D] \n SectorSize=[d] \n " ;
126 fmt
= "CreationTime=[T2]VolNameLength=[B] \n VolumeLabel=[s12] \n " ;
129 fmt
= "Capabilities=[W] \n MaxFileLen=[D] \n VolNameLen=[D] \n Volume=[S] \n " ;
132 fmt
= "UnknownLevel \n " ;
135 smb_fdata ( data
, fmt
, data
+ dcnt
);
139 print_data ( data
, dcnt
);
147 struct smbfnsint trans2_fns
[] = {
148 { 0 , "TRANSACT2_OPEN" , 0 ,
149 { "Flags2=[w] \n Mode=[w] \n SearchAttrib=[A] \n Attrib=[A] \n Time=[T2] \n OFun=[w] \n Size=[D] \n Res=([w, w, w, w, w]) \n Path=[S]" ,
151 "Handle=[d] \n Attrib=[A] \n Time=[T2] \n Size=[D] \n Access=[w] \n Type=[w] \n State=[w] \n Action=[w] \n Inode=[W] \n OffErr=[d] \n |EALength=[d] \n " ,
153 { 1 , "TRANSACT2_FINDFIRST" , 0 ,
154 { NULL
, NULL
, NULL
, NULL
, trans2_findfirst
}},
155 { 2 , "TRANSACT2_FINDNEXT" , 0 , DEFDESCRIPT
},
156 { 3 , "TRANSACT2_QFSINFO" , 0 ,
157 { NULL
, NULL
, NULL
, NULL
, trans2_qfsinfo
}},
158 { 4 , "TRANSACT2_SETFSINFO" , 0 , DEFDESCRIPT
},
159 { 5 , "TRANSACT2_QPATHINFO" , 0 , DEFDESCRIPT
},
160 { 6 , "TRANSACT2_SETPATHINFO" , 0 , DEFDESCRIPT
},
161 { 7 , "TRANSACT2_QFILEINFO" , 0 , DEFDESCRIPT
},
162 { 8 , "TRANSACT2_SETFILEINFO" , 0 , DEFDESCRIPT
},
163 { 9 , "TRANSACT2_FSCTL" , 0 , DEFDESCRIPT
},
164 { 10 , "TRANSACT2_IOCTL" , 0 , DEFDESCRIPT
},
165 { 11 , "TRANSACT2_FINDNOTIFYFIRST" , 0 , DEFDESCRIPT
},
166 { 12 , "TRANSACT2_FINDNOTIFYNEXT" , 0 , DEFDESCRIPT
},
167 { 13 , "TRANSACT2_MKDIR" , 0 , DEFDESCRIPT
},
168 { - 1 , NULL
, 0 , DEFDESCRIPT
}
173 print_trans2 ( const u_char
* words
, const u_char
* dat
, const u_char
* buf
, const u_char
* maxbuf
)
175 static struct smbfnsint
* fn
= & trans2_fns
[ 0 ];
176 const u_char
* data
, * param
;
177 const u_char
* w
= words
+ 1 ;
178 const char * f1
= NULL
, * f2
= NULL
;
183 TCHECK2 ( w
[ 14 * 2 ], 2 );
184 pcnt
= EXTRACT_LE_16BITS ( w
+ 9 * 2 );
185 param
= buf
+ EXTRACT_LE_16BITS ( w
+ 10 * 2 );
186 dcnt
= EXTRACT_LE_16BITS ( w
+ 11 * 2 );
187 data
= buf
+ EXTRACT_LE_16BITS ( w
+ 12 * 2 );
188 fn
= smbfindint ( EXTRACT_LE_16BITS ( w
+ 14 * 2 ), trans2_fns
);
191 printf ( "%s \n " , fn
-> name
);
192 printf ( "Trans2Interim \n " );
195 TCHECK2 ( w
[ 7 * 2 ], 2 );
196 pcnt
= EXTRACT_LE_16BITS ( w
+ 3 * 2 );
197 param
= buf
+ EXTRACT_LE_16BITS ( w
+ 4 * 2 );
198 dcnt
= EXTRACT_LE_16BITS ( w
+ 6 * 2 );
199 data
= buf
+ EXTRACT_LE_16BITS ( w
+ 7 * 2 );
202 printf ( "%s param_length=%d data_length=%d \n " , fn
-> name
, pcnt
, dcnt
);
207 "Trans2Secondary \n TotParam=[d] \n TotData=[d] \n ParamCnt=[d] \n ParamOff=[d] \n ParamDisp=[d] \n DataCnt=[d] \n DataOff=[d] \n DataDisp=[d] \n Handle=[d] \n " ,
212 "TotParam=[d] \n TotData=[d] \n MaxParam=[d] \n MaxData=[d] \n MaxSetup=[d] \n Flags=[w] \n TimeOut=[D] \n Res1=[w] \n ParamCnt=[d] \n ParamOff=[d] \n DataCnt=[d] \n DataOff=[d] \n SetupCnt=[d] \n " ,
214 smb_fdata ( data
+ 1 , "TransactionName=[S] \n %" , maxbuf
);
216 f1
= fn
-> descript
. req_f1
;
217 f2
= fn
-> descript
. req_f2
;
220 "TotParam=[d] \n TotData=[d] \n Res1=[w] \n ParamCnt=[d] \n ParamOff=[d] \n ParamDisp[d] \n DataCnt=[d] \n DataOff=[d] \n DataDisp=[d] \n SetupCnt=[d] \n " ,
222 f1
= fn
-> descript
. rep_f1
;
223 f2
= fn
-> descript
. rep_f2
;
227 (* fn
-> descript
. fn
)( param
, data
, pcnt
, dcnt
);
229 smb_fdata ( param
, f1
? f1
: "Parameters= \n " , param
+ pcnt
);
230 smb_fdata ( data
, f2
? f2
: "Data= \n " , data
+ dcnt
);
240 print_browse ( const u_char
* param
, int paramlen
, const u_char
* data
, int datalen
)
242 const u_char
* maxbuf
= data
+ datalen
;
248 smb_fdata ( param
, "BROWSE PACKET \n |Param " , param
+ paramlen
);
252 data
= smb_fdata ( data
,
253 "BROWSE PACKET: \n Type=[B] (LocalMasterAnnouncement) \n UpdateCount=[w] \n Res1=[B] \n AnnounceInterval=[d] \n Name=[n2] \n MajorVersion=[B] \n MinorVersion=[B] \n ServerType=[W] \n ElectionVersion=[w] \n BrowserConstant=[w] \n " ,
258 data
= smb_fdata ( data
,
259 "BROWSE PACKET: \n Type=[B] (HostAnnouncement) \n UpdateCount=[w] \n Res1=[B] \n AnnounceInterval=[d] \n Name=[n2] \n MajorVersion=[B] \n MinorVersion=[B] \n ServerType=[W] \n ElectionVersion=[w] \n BrowserConstant=[w] \n " ,
264 data
= smb_fdata ( data
,
265 "BROWSE PACKET: \n Type=[B] (AnnouncementRequest) \n Flags=[B] \n ReplySystemName=[S] \n " ,
270 data
= smb_fdata ( data
,
271 "BROWSE PACKET: \n Type=[B] (WorkgroupAnnouncement) \n UpdateCount=[w] \n Res1=[B] \n AnnounceInterval=[d] \n Name=[n2] \n MajorVersion=[B] \n MinorVersion=[B] \n ServerType=[W] \n CommentPointer=[W] \n ServerName=[S] \n " ,
276 data
= smb_fdata ( data
,
277 "BROWSE PACKET: \n Type=[B] (ElectionFrame) \n ElectionVersion=[B] \n OSSummary=[W] \n Uptime=[(W, W)] \n ServerName=[S] \n " ,
282 data
= smb_fdata ( data
,
283 "BROWSE PACKET: \n Type=[B] (BecomeBackupBrowser) \n Name=[S] \n " ,
288 data
= smb_fdata ( data
,
289 "BROWSE PACKET: \n Type=[B] (GetBackupList) \n ListCount?=[B] \n Token?=[B] \n " ,
294 data
= smb_fdata ( data
,
295 "BROWSE PACKET: \n Type=[B] (BackupListResponse) \n ServerCount?=[B] \n Token?=[B]*Name=[S] \n " ,
300 data
= smb_fdata ( data
,
301 "BROWSE PACKET: \n Type=[B] (MasterAnnouncement) \n MasterName=[S] \n " ,
306 data
= smb_fdata ( data
,
307 "BROWSE PACKET: \n Type=[B] (ResetBrowser) \n Options=[B] \n " , maxbuf
);
311 data
= smb_fdata ( data
, "Unknown Browser Frame " , maxbuf
);
322 print_ipc ( const u_char
* param
, int paramlen
, const u_char
* data
, int datalen
)
325 smb_fdata ( param
, "Command=[w] \n Str1=[S] \n Str2=[S] \n " , param
+ paramlen
);
327 smb_fdata ( data
, "IPC " , data
+ datalen
);
332 print_trans ( const u_char
* words
, const u_char
* data1
, const u_char
* buf
, const u_char
* maxbuf
)
334 const char * f1
, * f2
, * f3
, * f4
;
335 const u_char
* data
, * param
;
336 const u_char
* w
= words
+ 1 ;
337 int datalen
, paramlen
;
340 TCHECK2 ( w
[ 12 * 2 ], 2 );
341 paramlen
= EXTRACT_LE_16BITS ( w
+ 9 * 2 );
342 param
= buf
+ EXTRACT_LE_16BITS ( w
+ 10 * 2 );
343 datalen
= EXTRACT_LE_16BITS ( w
+ 11 * 2 );
344 data
= buf
+ EXTRACT_LE_16BITS ( w
+ 12 * 2 );
345 f1
= "TotParamCnt=[d] \n TotDataCnt=[d] \n MaxParmCnt=[d] \n MaxDataCnt=[d] \n MaxSCnt=[d] \n TransFlags=[w] \n Res1=[w] \n Res2=[w] \n Res3=[w] \n ParamCnt=[d] \n ParamOff=[d] \n DataCnt=[d] \n DataOff=[d] \n SUCnt=[d] \n " ;
350 TCHECK2 ( w
[ 7 * 2 ], 2 );
351 paramlen
= EXTRACT_LE_16BITS ( w
+ 3 * 2 );
352 param
= buf
+ EXTRACT_LE_16BITS ( w
+ 4 * 2 );
353 datalen
= EXTRACT_LE_16BITS ( w
+ 6 * 2 );
354 data
= buf
+ EXTRACT_LE_16BITS ( w
+ 7 * 2 );
355 f1
= "TotParamCnt=[d] \n TotDataCnt=[d] \n Res1=[d] \n ParamCnt=[d] \n ParamOff=[d] \n Res2=[d] \n DataCnt=[d] \n DataOff=[d] \n Res3=[d] \n Lsetup=[d] \n " ;
361 smb_fdata ( words
+ 1 , f1
, SMBMIN ( words
+ 1 + 2 * words
[ 0 ], maxbuf
));
362 smb_fdata ( data1
+ 2 , f2
, maxbuf
- ( paramlen
+ datalen
));
364 if ( strcmp (( const char *)( data1
+ 2 ), " \\ MAILSLOT \\ BROWSE" ) == 0 ) {
365 print_browse ( param
, paramlen
, data
, datalen
);
369 if ( strcmp (( const char *)( data1
+ 2 ), " \\ PIPE \\ LANMAN" ) == 0 ) {
370 print_ipc ( param
, paramlen
, data
, datalen
);
375 smb_fdata ( param
, f3
, SMBMIN ( param
+ paramlen
, maxbuf
));
377 smb_fdata ( data
, f4
, SMBMIN ( data
+ datalen
, maxbuf
));
386 print_negprot ( const u_char
* words
, const u_char
* data
, const u_char
* buf
, const u_char
* maxbuf
)
388 const char * f1
= NULL
, * f2
= NULL
;
392 f2
= "*|Dialect=[Z] \n " ;
395 f1
= "Core Protocol \n DialectIndex=[d]" ;
396 else if ( words
[ 0 ] == 17 )
397 f1
= "NT1 Protocol \n DialectIndex=[d] \n SecMode=[B] \n MaxMux=[d] \n NumVcs=[d] \n MaxBuffer=[D] \n RawSize=[D] \n SessionKey=[W] \n Capabilities=[W] \n ServerTime=[T3]TimeZone=[d] \n CryptKey=" ;
398 else if ( words
[ 0 ] == 13 )
399 f1
= "Coreplus/Lanman1/Lanman2 Protocol \n DialectIndex=[d] \n SecMode=[w] \n MaxXMit=[d] \n MaxMux=[d] \n MaxVcs=[d] \n BlkMode=[w] \n SessionKey=[W] \n ServerTime=[T1]TimeZone=[d] \n Res=[W] \n CryptKey=" ;
403 smb_fdata ( words
+ 1 , f1
, SMBMIN ( words
+ 1 + words
[ 0 ] * 2 , maxbuf
));
405 print_data ( words
+ 1 , SMBMIN ( words
[ 0 ] * 2 ,
406 PTR_DIFF ( maxbuf
, words
+ 1 )));
410 smb_fdata ( data
+ 2 , f2
, SMBMIN ( data
+ 2 + EXTRACT_LE_16BITS ( data
), maxbuf
));
412 print_data ( data
+ 2 , SMBMIN ( EXTRACT_LE_16BITS ( data
), PTR_DIFF ( maxbuf
, data
+ 2 )));
420 print_sesssetup ( const u_char
* words
, const u_char
* data
, const u_char
* buf
, const u_char
* maxbuf
)
423 const char * f1
= NULL
, * f2
= NULL
;
429 f1
= "Com2=[w] \n Off2=[d] \n BufSize=[d] \n MpxMax=[d] \n VcNum=[d] \n SessionKey=[W] \n PassLen=[d] \n CryptLen=[d] \n CryptOff=[d] \n Pass&Name= \n " ;
431 f1
= "Com2=[B] \n Res1=[B] \n Off2=[d] \n MaxBuffer=[d] \n MaxMpx=[d] \n VcNumber=[d] \n SessionKey=[W] \n CaseInsensitivePasswordLength=[d] \n CaseSensitivePasswordLength=[d] \n Res=[W] \n Capabilities=[W] \n Pass1&Pass2&Account&Domain&OS&LanMan= \n " ;
434 f1
= "Com2=[w] \n Off2=[d] \n Action=[w] \n " ;
435 } else if ( words
[ 0 ] == 13 ) {
436 f1
= "Com2=[B] \n Res=[B] \n Off2=[d] \n Action=[w] \n " ;
437 f2
= "NativeOS=[S] \n NativeLanMan=[S] \n PrimaryDomain=[S] \n " ;
442 smb_fdata ( words
+ 1 , f1
, SMBMIN ( words
+ 1 + words
[ 0 ] * 2 , maxbuf
));
444 print_data ( words
+ 1 , SMBMIN ( words
[ 0 ] * 2 ,
445 PTR_DIFF ( maxbuf
, words
+ 1 )));
449 smb_fdata ( data
+ 2 , f2
, SMBMIN ( data
+ 2 + EXTRACT_LE_16BITS ( data
), maxbuf
));
451 print_data ( data
+ 2 , SMBMIN ( EXTRACT_LE_16BITS ( data
), PTR_DIFF ( maxbuf
, data
+ 2 )));
459 static struct smbfns smb_fns
[] = {
460 { - 1 , "SMBunknown" , 0 , DEFDESCRIPT
},
462 { SMBtcon
, "SMBtcon" , 0 ,
463 { NULL
, "Path=[Z] \n Password=[Z] \n Device=[Z] \n " ,
464 "MaxXmit=[d] \n TreeId=[d] \n " , NULL
,
467 { SMBtdis
, "SMBtdis" , 0 , DEFDESCRIPT
},
468 { SMBexit
, "SMBexit" , 0 , DEFDESCRIPT
},
469 { SMBioctl
, "SMBioctl" , 0 , DEFDESCRIPT
},
471 { SMBecho
, "SMBecho" , 0 ,
472 { "ReverbCount=[d] \n " , NULL
,
473 "SequenceNum=[d] \n " , NULL
,
476 { SMBulogoffX
, "SMBulogoffX" , FLG_CHAIN
, DEFDESCRIPT
},
478 { SMBgetatr
, "SMBgetatr" , 0 ,
479 { NULL
, "Path=[Z] \n " ,
480 "Attribute=[A] \n Time=[T2]Size=[D] \n Res=([w,w,w,w,w]) \n " , NULL
,
483 { SMBsetatr
, "SMBsetatr" , 0 ,
484 { "Attribute=[A] \n Time=[T2]Res=([w,w,w,w,w]) \n " , "Path=[Z] \n " ,
485 NULL
, NULL
, NULL
} },
487 { SMBchkpth
, "SMBchkpth" , 0 ,
488 { NULL
, "Path=[Z] \n " , NULL
, NULL
, NULL
} },
490 { SMBsearch
, "SMBsearch" , 0 ,
491 { "Count=[d] \n Attrib=[A] \n " ,
492 "Path=[Z] \n BlkType=[B] \n BlkLen=[d] \n |Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n Res2=[W] \n " ,
494 "BlkType=[B] \n BlkLen=[d] \n * \n Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n Res2=[W] \n Attrib=[a] \n Time=[T1]Size=[D] \n Name=[s13] \n " ,
497 { SMBopen
, "SMBopen" , 0 ,
498 { "Mode=[w] \n Attribute=[A] \n " , "Path=[Z] \n " ,
499 "Handle=[d] \n OAttrib=[A] \n Time=[T2]Size=[D] \n Access=[w] \n " ,
502 { SMBcreate
, "SMBcreate" , 0 ,
503 { "Attrib=[A] \n Time=[T2]" , "Path=[Z] \n " , "Handle=[d] \n " , NULL
, NULL
} },
505 { SMBmknew
, "SMBmknew" , 0 ,
506 { "Attrib=[A] \n Time=[T2]" , "Path=[Z] \n " , "Handle=[d] \n " , NULL
, NULL
} },
508 { SMBunlink
, "SMBunlink" , 0 ,
509 { "Attrib=[A] \n " , "Path=[Z] \n " , NULL
, NULL
, NULL
} },
511 { SMBread
, "SMBread" , 0 ,
512 { "Handle=[d] \n ByteCount=[d] \n Offset=[D] \n CountLeft=[d] \n " , NULL
,
513 "Count=[d] \n Res=([w,w,w,w]) \n " , NULL
, NULL
} },
515 { SMBwrite
, "SMBwrite" , 0 ,
516 { "Handle=[d] \n ByteCount=[d] \n Offset=[D] \n CountLeft=[d] \n " , NULL
,
517 "Count=[d] \n " , NULL
, NULL
} },
519 { SMBclose
, "SMBclose" , 0 ,
520 { "Handle=[d] \n Time=[T2]" , NULL
, NULL
, NULL
, NULL
} },
522 { SMBmkdir
, "SMBmkdir" , 0 ,
523 { NULL
, "Path=[Z] \n " , NULL
, NULL
, NULL
} },
525 { SMBrmdir
, "SMBrmdir" , 0 ,
526 { NULL
, "Path=[Z] \n " , NULL
, NULL
, NULL
} },
528 { SMBdskattr
, "SMBdskattr" , 0 ,
530 "TotalUnits=[d] \n BlocksPerUnit=[d] \n BlockSize=[d] \n FreeUnits=[d] \n Media=[w] \n " ,
534 { "Attrib=[A] \n " , "OldPath=[Z] \n NewPath=[Z] \n " , NULL
, NULL
, NULL
} },
537 * this is a Pathworks specific call, allowing the
538 * changing of the root path
540 { pSETDIR
, "SMBsetdir" , 0 , { NULL
, "Path=[Z] \n " , NULL
, NULL
, NULL
} },
542 { SMBlseek
, "SMBlseek" , 0 ,
543 { "Handle=[d] \n Mode=[w] \n Offset=[D] \n " , "Offset=[D] \n " , NULL
, NULL
} },
545 { SMBflush
, "SMBflush" , 0 , { "Handle=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
547 { SMBsplopen
, "SMBsplopen" , 0 ,
548 { "SetupLen=[d] \n Mode=[w] \n " , "Ident=[Z] \n " , "Handle=[d] \n " ,
551 { SMBsplclose
, "SMBsplclose" , 0 ,
552 { "Handle=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
554 { SMBsplretq
, "SMBsplretq" , 0 ,
555 { "MaxCount=[d] \n StartIndex=[d] \n " , NULL
,
556 "Count=[d] \n Index=[d] \n " ,
557 "*Time=[T2]Status=[B] \n JobID=[d] \n Size=[D] \n Res=[B]Name=[s16] \n " ,
560 { SMBsplwr
, "SMBsplwr" , 0 ,
561 { "Handle=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
563 { SMBlock
, "SMBlock" , 0 ,
564 { "Handle=[d] \n Count=[D] \n Offset=[D] \n " , NULL
, NULL
, NULL
, NULL
} },
566 { SMBunlock
, "SMBunlock" , 0 ,
567 { "Handle=[d] \n Count=[D] \n Offset=[D] \n " , NULL
, NULL
, NULL
, NULL
} },
569 /* CORE+ PROTOCOL FOLLOWS */
571 { SMBreadbraw
, "SMBreadbraw" , 0 ,
572 { "Handle=[d] \n Offset=[D] \n MaxCount=[d] \n MinCount=[d] \n TimeOut=[D] \n Res=[d] \n " ,
573 NULL
, NULL
, NULL
, NULL
} },
575 { SMBwritebraw
, "SMBwritebraw" , 0 ,
576 { "Handle=[d] \n TotalCount=[d] \n Res=[w] \n Offset=[D] \n TimeOut=[D] \n WMode=[w] \n Res2=[W] \n |DataSize=[d] \n DataOff=[d] \n " ,
577 NULL
, "WriteRawAck" , NULL
, NULL
} },
579 { SMBwritec
, "SMBwritec" , 0 ,
580 { NULL
, NULL
, "Count=[d] \n " , NULL
, NULL
} },
582 { SMBwriteclose
, "SMBwriteclose" , 0 ,
583 { "Handle=[d] \n Count=[d] \n Offset=[D] \n Time=[T2]Res=([w,w,w,w,w,w])" ,
584 NULL
, "Count=[d] \n " , NULL
, NULL
} },
586 { SMBlockread
, "SMBlockread" , 0 ,
587 { "Handle=[d] \n ByteCount=[d] \n Offset=[D] \n CountLeft=[d] \n " , NULL
,
588 "Count=[d] \n Res=([w,w,w,w]) \n " , NULL
, NULL
} },
590 { SMBwriteunlock
, "SMBwriteunlock" , 0 ,
591 { "Handle=[d] \n ByteCount=[d] \n Offset=[D] \n CountLeft=[d] \n " , NULL
,
592 "Count=[d] \n " , NULL
, NULL
} },
594 { SMBreadBmpx
, "SMBreadBmpx" , 0 ,
595 { "Handle=[d] \n Offset=[D] \n MaxCount=[d] \n MinCount=[d] \n TimeOut=[D] \n Res=[w] \n " ,
597 "Offset=[D] \n TotCount=[d] \n Remaining=[d] \n Res=([w,w]) \n DataSize=[d] \n DataOff=[d] \n " ,
600 { SMBwriteBmpx
, "SMBwriteBmpx" , 0 ,
601 { "Handle=[d] \n TotCount=[d] \n Res=[w] \n Offset=[D] \n TimeOut=[D] \n WMode=[w] \n Res2=[W] \n DataSize=[d] \n DataOff=[d] \n " , NULL
,
602 "Remaining=[d] \n " , NULL
, NULL
} },
604 { SMBwriteBs
, "SMBwriteBs" , 0 ,
605 { "Handle=[d] \n TotCount=[d] \n Offset=[D] \n Res=[W] \n DataSize=[d] \n DataOff=[d] \n " ,
606 NULL
, "Count=[d] \n " , NULL
, NULL
} },
608 { SMBsetattrE
, "SMBsetattrE" , 0 ,
609 { "Handle=[d] \n CreationTime=[T2]AccessTime=[T2]ModifyTime=[T2]" , NULL
,
610 NULL
, NULL
, NULL
} },
612 { SMBgetattrE
, "SMBgetattrE" , 0 ,
613 { "Handle=[d] \n " , NULL
,
614 "CreationTime=[T2]AccessTime=[T2]ModifyTime=[T2]Size=[D] \n AllocSize=[D] \n Attribute=[A] \n " ,
617 { SMBtranss
, "SMBtranss" , 0 , DEFDESCRIPT
},
618 { SMBioctls
, "SMBioctls" , 0 , DEFDESCRIPT
},
620 { SMBcopy
, "SMBcopy" , 0 ,
621 { "TreeID2=[d] \n OFun=[w] \n Flags=[w] \n " , "Path=[S] \n NewPath=[S] \n " ,
622 "CopyCount=[d] \n " , "|ErrStr=[S] \n " , NULL
} },
624 { SMBmove
, "SMBmove" , 0 ,
625 { "TreeID2=[d] \n OFun=[w] \n Flags=[w] \n " , "Path=[S] \n NewPath=[S] \n " ,
626 "MoveCount=[d] \n " , "|ErrStr=[S] \n " , NULL
} },
628 { SMBopenX
, "SMBopenX" , FLG_CHAIN
,
629 { "Com2=[w] \n Off2=[d] \n Flags=[w] \n Mode=[w] \n SearchAttrib=[A] \n Attrib=[A] \n Time=[T2]OFun=[w] \n Size=[D] \n TimeOut=[D] \n Res=[W] \n " ,
631 "Com2=[w] \n Off2=[d] \n Handle=[d] \n Attrib=[A] \n Time=[T2]Size=[D] \n Access=[w] \n Type=[w] \n State=[w] \n Action=[w] \n FileID=[W] \n Res=[w] \n " ,
634 { SMBreadX
, "SMBreadX" , FLG_CHAIN
,
635 { "Com2=[w] \n Off2=[d] \n Handle=[d] \n Offset=[D] \n MaxCount=[d] \n MinCount=[d] \n TimeOut=[D] \n CountLeft=[d] \n " ,
637 "Com2=[w] \n Off2=[d] \n Remaining=[d] \n Res=[W] \n DataSize=[d] \n DataOff=[d] \n Res=([w,w,w,w]) \n " ,
640 { SMBwriteX
, "SMBwriteX" , FLG_CHAIN
,
641 { "Com2=[w] \n Off2=[d] \n Handle=[d] \n Offset=[D] \n TimeOut=[D] \n WMode=[w] \n CountLeft=[d] \n Res=[w] \n DataSize=[d] \n DataOff=[d] \n " ,
643 "Com2=[w] \n Off2=[d] \n Count=[d] \n Remaining=[d] \n Res=[W] \n " ,
646 { SMBlockingX
, "SMBlockingX" , FLG_CHAIN
,
647 { "Com2=[w] \n Off2=[d] \n Handle=[d] \n LockType=[w] \n TimeOut=[D] \n UnlockCount=[d] \n LockCount=[d] \n " ,
648 "*Process=[d] \n Offset=[D] \n Length=[D] \n " ,
649 "Com2=[w] \n Off2=[d] \n " , NULL
, NULL
} },
651 { SMBffirst
, "SMBffirst" , 0 ,
652 { "Count=[d] \n Attrib=[A] \n " ,
653 "Path=[Z] \n BlkType=[B] \n BlkLen=[d] \n |Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n " ,
655 "BlkType=[B] \n BlkLen=[d] \n * \n Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n Res2=[W] \n Attrib=[a] \n Time=[T1]Size=[D] \n Name=[s13] \n " ,
658 { SMBfunique
, "SMBfunique" , 0 ,
659 { "Count=[d] \n Attrib=[A] \n " ,
660 "Path=[Z] \n BlkType=[B] \n BlkLen=[d] \n |Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n " ,
662 "BlkType=[B] \n BlkLen=[d] \n * \n Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n Res2=[W] \n Attrib=[a] \n Time=[T1]Size=[D] \n Name=[s13] \n " ,
665 { SMBfclose
, "SMBfclose" , 0 ,
666 { "Count=[d] \n Attrib=[A] \n " ,
667 "Path=[Z] \n BlkType=[B] \n BlkLen=[d] \n |Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n " ,
669 "BlkType=[B] \n BlkLen=[d] \n * \n Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n Res2=[W] \n Attrib=[a] \n Time=[T1]Size=[D] \n Name=[s13] \n " ,
672 { SMBfindnclose
, "SMBfindnclose" , 0 ,
673 { "Handle=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
675 { SMBfindclose
, "SMBfindclose" , 0 ,
676 { "Handle=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
678 { SMBsends
, "SMBsends" , 0 ,
679 { NULL
, "Source=[Z] \n Dest=[Z] \n " , NULL
, NULL
, NULL
} },
681 { SMBsendstrt
, "SMBsendstrt" , 0 ,
682 { NULL
, "Source=[Z] \n Dest=[Z] \n " , "GroupID=[d] \n " , NULL
, NULL
} },
684 { SMBsendend
, "SMBsendend" , 0 ,
685 { "GroupID=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
687 { SMBsendtxt
, "SMBsendtxt" , 0 ,
688 { "GroupID=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
690 { SMBsendb
, "SMBsendb" , 0 ,
691 { NULL
, "Source=[Z] \n Dest=[Z] \n " , NULL
, NULL
, NULL
} },
693 { SMBfwdname
, "SMBfwdname" , 0 , DEFDESCRIPT
},
694 { SMBcancelf
, "SMBcancelf" , 0 , DEFDESCRIPT
},
695 { SMBgetmac
, "SMBgetmac" , 0 , DEFDESCRIPT
},
697 { SMBnegprot
, "SMBnegprot" , 0 ,
698 { NULL
, NULL
, NULL
, NULL
, print_negprot
} },
700 { SMBsesssetupX
, "SMBsesssetupX" , FLG_CHAIN
,
701 { NULL
, NULL
, NULL
, NULL
, print_sesssetup
} },
703 { SMBtconX
, "SMBtconX" , FLG_CHAIN
,
704 { "Com2=[w] \n Off2=[d] \n Flags=[w] \n PassLen=[d] \n Passwd&Path&Device= \n " ,
705 NULL
, "Com2=[w] \n Off2=[d] \n " , "ServiceType=[S] \n " , NULL
} },
707 { SMBtrans2
, "SMBtrans2" , 0 , { NULL
, NULL
, NULL
, NULL
, print_trans2
} },
709 { SMBtranss2
, "SMBtranss2" , 0 , DEFDESCRIPT
},
710 { SMBctemp
, "SMBctemp" , 0 , DEFDESCRIPT
},
711 { SMBreadBs
, "SMBreadBs" , 0 , DEFDESCRIPT
},
712 { SMBtrans
, "SMBtrans" , 0 , { NULL
, NULL
, NULL
, NULL
, print_trans
} },
714 { SMBnttrans
, "SMBnttrans" , 0 , DEFDESCRIPT
},
715 { SMBnttranss
, "SMBnttranss" , 0 , DEFDESCRIPT
},
717 { SMBntcreateX
, "SMBntcreateX" , FLG_CHAIN
,
718 { "Com2=[w] \n Off2=[d] \n Res=[b] \n NameLen=[d] \n Flags=[W] \n RootDirectoryFid=[D] \n AccessMask=[W] \n AllocationSize=[L] \n ExtFileAttributes=[W] \n ShareAccess=[W] \n CreateDisposition=[W] \n CreateOptions=[W] \n ImpersonationLevel=[W] \n SecurityFlags=[b] \n " ,
720 "Com2=[w] \n Off2=[d] \n OplockLevel=[b] \n Fid=[d] \n CreateAction=[W] \n CreateTime=[T3]LastAccessTime=[T3]LastWriteTime=[T3]ChangeTime=[T3]ExtFileAttributes=[W] \n AllocationSize=[L] \n EndOfFile=[L] \n FileType=[w] \n DeviceState=[w] \n Directory=[b] \n " ,
723 { SMBntcancel
, "SMBntcancel" , 0 , DEFDESCRIPT
},
725 { - 1 , NULL
, 0 , DEFDESCRIPT
}
730 * print a SMB message
733 print_smb ( const u_char
* buf
, const u_char
* maxbuf
)
736 const u_char
* words
, * data
;
738 char * fmt_smbheader
=
739 "[P4]SMB Command = [B] \n Error class = [BP1] \n Error code = [d] \n Flags1 = [B] \n Flags2 = [B][P13] \n Tree ID = [d] \n Proc ID = [d] \n UID = [d] \n MID = [d] \n Word Count = [b] \n " ;
743 request
= ( buf
[ 9 ] & 0x80 ) ? 0 : 1 ;
747 fn
= smbfind ( command
, smb_fns
);
752 printf ( "SMB PACKET: %s (%s) \n " , fn
-> name
, request
? "REQUEST" : "REPLY" );
757 /* print out the header */
758 smb_fdata ( buf
, fmt_smbheader
, buf
+ 33 );
761 printf ( "SMBError = %s \n " , smb_errstr ( buf
[ 5 ], EXTRACT_LE_16BITS (& buf
[ 7 ])));
773 data
= words
+ 1 + wct
* 2 ;
776 f1
= fn
-> descript
. req_f1
;
777 f2
= fn
-> descript
. req_f2
;
779 f1
= fn
-> descript
. rep_f1
;
780 f2
= fn
-> descript
. rep_f2
;
784 (* fn
-> descript
. fn
)( words
, data
, buf
, maxbuf
);
787 printf ( "smbvwv[]= \n " );
789 smb_fdata ( words
+ 1 , f1
, words
+ 1 + wct
* 2 );
794 for ( i
= 0 ; i
< wct
; i
++) {
795 TCHECK2 ( words
[ 1 + 2 * i
], 2 );
796 v
= EXTRACT_LE_16BITS ( words
+ 1 + 2 * i
);
797 printf ( "smb_vwv[%d]=%d (0x%X) \n " , i
, v
, v
);
803 bcc
= EXTRACT_LE_16BITS ( data
);
806 printf ( "smbbuf[]= \n " );
807 smb_fdata ( data
+ 2 , f2
, data
+ 2 + bcc
);
810 printf ( "smb_bcc=%d \n " , bcc
);
812 printf ( "smb_buf[]= \n " );
813 print_data ( data
+ 2 , SMBMIN ( bcc
, PTR_DIFF ( maxbuf
, data
+ 2 )));
818 if (( fn
-> flags
& FLG_CHAIN
) == 0 )
823 command
= EXTRACT_LE_16BITS ( words
+ 1 );
826 TCHECK2 ( words
[ 3 ], 2 );
827 words
= buf
+ EXTRACT_LE_16BITS ( words
+ 3 );
829 fn
= smbfind ( command
, smb_fns
);
831 printf ( " \n SMB PACKET: %s (%s) (CHAINED) \n " ,
832 fn
-> name
, request
? "REQUEST" : "REPLY" );
844 * print a NBT packet received across tcp on port 139
847 nbt_tcp_print ( const u_char
* data
, int length
)
849 const u_char
* maxbuf
= data
+ length
;
855 nbt_len
= EXTRACT_16BITS ( data
+ 2 );
864 printf ( " NBT Packet" );
873 printf ( "flags=0x%x \n " , flags
);
875 data
= smb_fdata ( data
, "NBT Session Packet \n Flags=[rw] \n Length=[rd] \n " ,
879 if ( memcmp ( data
, " \377 SMB" , 4 ) == 0 ) {
880 if ( nbt_len
> PTR_DIFF ( maxbuf
, data
))
881 printf ( "WARNING: Short packet. Try increasing the snap length (%lu) \n " ,
882 ( unsigned long ) PTR_DIFF ( maxbuf
, data
));
883 print_smb ( data
, maxbuf
> data
+ nbt_len
? data
+ nbt_len
: maxbuf
);
885 printf ( "Session packet:(raw data?) \n " );
889 data
= smb_fdata ( data
,
890 "NBT Session Request \n Flags=[rW] \n Destination=[n1] \n Source=[n1] \n " ,
895 data
= smb_fdata ( data
, "NBT Session Granted \n Flags=[rW] \n " , maxbuf
);
905 data
= smb_fdata ( data
, "NBT SessionReject \n Flags=[rW] \n Reason=[B] \n " ,
909 printf ( "Not listening on called name \n " );
912 printf ( "Not listening for calling name \n " );
915 printf ( "Called name not present \n " );
918 printf ( "Called name present, but insufficient resources \n " );
921 printf ( "Unspecified error 0x%X \n " , ecode
);
928 data
= smb_fdata ( data
, "NBT Session Keepalive \n Flags=[rW] \n " , maxbuf
);
932 printf ( "flags=0x%x \n " , flags
);
933 data
= smb_fdata ( data
, "NBT - Unknown packet type \n Type=[rW] \n " , maxbuf
);
945 * print a NBT packet received across udp on port 137
948 nbt_udp137_print ( const u_char
* data
, int length
)
950 const u_char
* maxbuf
= data
+ length
;
951 int name_trn_id
, response
, opcode
, nm_flags
, rcode
;
952 int qdcount
, ancount
, nscount
, arcount
;
957 TCHECK2 ( data
[ 10 ], 2 );
958 name_trn_id
= EXTRACT_16BITS ( data
);
959 response
= ( data
[ 2 ] >> 7 );
960 opcode
= ( data
[ 2 ] >> 3 ) & 0xF ;
961 nm_flags
= (( data
[ 2 ] & 0x7 ) << 4 ) + ( data
[ 3 ] >> 4 );
962 rcode
= data
[ 3 ] & 0xF ;
963 qdcount
= EXTRACT_16BITS ( data
+ 4 );
964 ancount
= EXTRACT_16BITS ( data
+ 6 );
965 nscount
= EXTRACT_16BITS ( data
+ 8 );
966 arcount
= EXTRACT_16BITS ( data
+ 10 );
975 printf ( "NBT UDP PACKET(137): " );
978 case 0 : opcodestr
= "QUERY" ; break ;
979 case 5 : opcodestr
= "REGISTRATION" ; break ;
980 case 6 : opcodestr
= "RELEASE" ; break ;
981 case 7 : opcodestr
= "WACK" ; break ;
982 case 8 : opcodestr
= "REFRESH(8)" ; break ;
983 case 9 : opcodestr
= "REFRESH" ; break ;
984 case 15 : opcodestr
= "MULTIHOMED REGISTRATION" ; break ;
985 default : opcodestr
= "OPUNKNOWN" ; break ;
987 printf ( "%s" , opcodestr
);
990 printf ( "; NEGATIVE" );
992 printf ( "; POSITIVE" );
996 printf ( "; RESPONSE" );
1001 printf ( "; BROADCAST" );
1003 printf ( "; UNICAST" );
1008 printf ( " \n TrnID=0x%X \n OpCode=%d \n NmFlags=0x%X \n Rcode=%d \n QueryCount=%d \n AnswerCount=%d \n AuthorityCount=%d \n AddressRecCount=%d \n " ,
1009 name_trn_id
, opcode
, nm_flags
, rcode
, qdcount
, ancount
, nscount
,
1014 total
= ancount
+ nscount
+ arcount
;
1016 if ( qdcount
> 100 || total
> 100 ) {
1017 printf ( "Corrupt packet?? \n " );
1022 printf ( "QuestionRecords: \n " );
1023 for ( i
= 0 ; i
< qdcount
; i
++)
1025 "|Name=[n1] \n QuestionType=[rw] \n QuestionClass=[rw] \n #" ,
1032 printf ( " \n ResourceRecords: \n " );
1033 for ( i
= 0 ; i
< total
; i
++) {
1037 p
= smb_fdata ( p
, "Name=[n1] \n #" , maxbuf
);
1040 restype
= EXTRACT_16BITS ( p
);
1041 p
= smb_fdata ( p
, "ResType=[rw] \n ResClass=[rw] \n TTL=[rD] \n " , p
+ 8 );
1044 rdlen
= EXTRACT_16BITS ( p
);
1045 printf ( "ResourceLength=%d \n ResourceData= \n " , rdlen
);
1048 p
= smb_fdata ( p
, "AddrType=[rw] \n Address=[b.b.b.b] \n " , p
+ rdlen
);
1052 if ( restype
== 0x21 ) {
1057 p
= smb_fdata ( p
, "NumNames=[B] \n " , p
+ 1 );
1060 while ( numnames
--) {
1061 p
= smb_fdata ( p
, "Name=[n2] \t #" , maxbuf
);
1065 switch ( p
[ 0 ] & 0x60 ) {
1066 case 0x00 : printf ( "B " ); break ;
1067 case 0x20 : printf ( "P " ); break ;
1068 case 0x40 : printf ( "M " ); break ;
1069 case 0x60 : printf ( "_ " ); break ;
1072 printf ( "<DEREGISTERING> " );
1074 printf ( "<CONFLICT> " );
1076 printf ( "<ACTIVE> " );
1078 printf ( "<PERMANENT> " );
1083 print_data ( p
, min ( rdlen
, length
- ( p
- data
)));
1091 smb_fdata ( p
, "AdditionalData: \n " , maxbuf
);
1105 * print a NBT packet received across udp on port 138
1108 nbt_udp138_print ( const u_char
* data
, int length
)
1110 const u_char
* maxbuf
= data
+ length
;
1112 if ( maxbuf
> snapend
)
1119 printf ( "NBT UDP PACKET(138)" );
1123 data
= smb_fdata ( data
,
1124 " \n >>> NBT UDP PACKET(138) Res=[rw] ID=[rw] IP=[b.b.b.b] Port=[rd] Length=[rd] Res2=[rw] \n SourceName=[n1] \n DestName=[n1] \n #" ,
1128 /* If there isn't enough data for "\377SMB", don't check for it. */
1129 if (& data
[ 3 ] >= maxbuf
)
1132 if ( memcmp ( data
, " \377 SMB" , 4 ) == 0 )
1133 print_smb ( data
, maxbuf
);
1142 print netbeui frames
1145 netbeui_print ( u_short control
, const u_char
* data
, int length
)
1147 const u_char
* maxbuf
= data
+ length
;
1150 const u_char
* data2
;
1151 int is_truncated
= 0 ;
1153 if ( maxbuf
> snapend
)
1156 len
= EXTRACT_LE_16BITS ( data
);
1159 if ( data2
>= maxbuf
) {
1167 printf ( "NetBeui Packet" );
1171 printf ( " \n >>> NetBeui Packet \n Type=0x%X " , control
);
1172 data
= smb_fdata ( data
, "Length=[d] Signature=[w] Command=[B] \n #" , maxbuf
);
1178 data
= smb_fdata ( data
, "NameQuery:[P1] \n SessionNumber=[B] \n NameType=[B][P2] \n ResponseCorrelator=[w] \n Destination=[n2] \n Source=[n2] \n " , data2
);
1182 data
= smb_fdata ( data
,
1183 "NetbiosDataGram:[P7] \n Destination=[n2] \n Source=[n2] \n " , data2
);
1187 data
= smb_fdata ( data
,
1188 "NameRecognise: \n [P1] \n Data2=[w] \n TransmitCorrelator=[w] \n ResponseCorelator=[w] \n Destination=[n2] \n Source=[n2] \n " ,
1193 data
= smb_fdata ( data
,
1194 "SessionInitialise: \n Data1=[B] \n Data2=[w] \n TransmitCorrelator=[w] \n ResponseCorelator=[w] \n RemoteSessionNumber=[B] \n LocalSessionNumber=[B] \n " ,
1199 data
= smb_fdata ( data
,
1200 "SessionConfirm: \n Data1=[B] \n Data2=[w] \n TransmitCorrelator=[w] \n ResponseCorelator=[w] \n RemoteSessionNumber=[B] \n LocalSessionNumber=[B] \n " ,
1205 data
= smb_fdata ( data
,
1206 "NetbiosDataOnlyLast: \n Flags=[{|NO_ACK|PIGGYBACK_ACK_ALLOWED|PIGGYBACK_ACK_INCLUDED|}] \n ResyncIndicator=[w][P2] \n ResponseCorelator=[w] \n RemoteSessionNumber=[B] \n LocalSessionNumber=[B] \n " ,
1211 data
= smb_fdata ( data
,
1212 "NetbiosDataAck: \n [P3]TransmitCorrelator=[w][P2] \n RemoteSessionNumber=[B] \n LocalSessionNumber=[B] \n " ,
1217 data
= smb_fdata ( data
,
1218 "SessionEnd: \n [P1]Data2=[w][P4] \n RemoteSessionNumber=[B] \n LocalSessionNumber=[B] \n " ,
1223 data
= smb_fdata ( data
, "SessionAlive \n " , data2
);
1227 data
= smb_fdata ( data
, "Unknown Netbios Command " , data2
);
1234 /* data2 was past the end of the buffer */
1238 /* If there isn't enough data for "\377SMB", don't look for it. */
1239 if (& data2
[ 3 ] >= maxbuf
)
1242 if ( memcmp ( data2
, " \377 SMB" , 4 ) == 0 )
1243 print_smb ( data2
, maxbuf
);
1246 for ( i
= 0 ; i
< 128 ; i
++) {
1247 if (& data2
[ i
+ 3 ] >= maxbuf
)
1249 if ( memcmp (& data2
[ i
], " \377 SMB" , 4 ) == 0 ) {
1250 printf ( "found SMB packet at %d \n " , i
);
1251 print_smb (& data2
[ i
], maxbuf
);
1267 * print IPX-Netbios frames
1270 ipx_netbios_print ( const u_char
* data
, u_int length
)
1273 * this is a hack till I work out how to parse the rest of the
1274 * NetBIOS-over-IPX stuff
1277 const u_char
* maxbuf
;
1279 maxbuf
= data
+ length
;
1280 /* Don't go past the end of the captured data in the packet. */
1281 if ( maxbuf
> snapend
)
1284 for ( i
= 0 ; i
< 128 ; i
++) {
1285 if (& data
[ i
+ 4 ] > maxbuf
)
1287 if ( memcmp (& data
[ i
], " \377 SMB" , 4 ) == 0 ) {
1288 smb_fdata ( data
, " \n >>> IPX transport " , & data
[ i
]);
1290 print_smb (& data
[ i
], maxbuf
);
1297 smb_fdata ( data
, " \n >>> Unknown IPX " , maxbuf
);