]>
The Tcpdump Group git mirrors - tcpdump/blob - print-smb.c
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.20 2002-01-17 04:38:29 guy Exp $" ;
20 #include <sys/types.h>
22 #include "interface.h"
26 static int request
= 0 ;
28 const u_char
* startbuf
= NULL
;
35 void (* fn
)( const u_char
*, const u_char
*, const u_char
*, const u_char
*);
38 struct smbdescriptint
{
43 void (* fn
)( const u_char
*, const u_char
*, int , int );
51 struct smbdescript descript
;
59 struct smbdescriptint descript
;
62 #define DEFDESCRIPT { NULL, NULL, NULL, NULL, NULL }
64 #define FLG_CHAIN (1 << 0)
66 static struct smbfns
*
67 smbfind ( int id
, struct smbfns
* list
)
71 for ( sindex
= 0 ; list
[ sindex
]. name
; sindex
++)
72 if ( list
[ sindex
]. id
== id
)
73 return (& list
[ sindex
]);
78 static struct smbfnsint
*
79 smbfindint ( int id
, struct smbfnsint
* list
)
83 for ( sindex
= 0 ; list
[ sindex
]. name
; sindex
++)
84 if ( list
[ sindex
]. id
== id
)
85 return (& list
[ sindex
]);
91 trans2_findfirst ( const u_char
* param
, const u_char
* data
, int pcnt
, int dcnt
)
96 fmt
= "Attribute=[A] \n SearchCount=[d] \n Flags=[w] \n Level=[dP5] \n File=[S] \n " ;
98 fmt
= "Handle=[w] \n Count=[d] \n EOS=[w] \n Eoffset=[d] \n LastNameOfs=[w] \n " ;
100 smb_fdata ( param
, fmt
, param
+ pcnt
);
103 print_data ( data
, dcnt
);
108 trans2_qfsinfo ( const u_char
* param
, const u_char
* data
, int pcnt
, int dcnt
)
110 static int level
= 0 ;
115 level
= EXTRACT_LE_16BITS ( param
);
116 fmt
= "InfoLevel=[d] \n " ;
117 smb_fdata ( param
, fmt
, param
+ pcnt
);
121 fmt
= "idFileSystem=[W] \n SectorUnit=[D] \n Unit=[D] \n Avail=[D] \n SectorSize=[d] \n " ;
124 fmt
= "CreationTime=[T2]VolNameLength=[B] \n VolumeLabel=[s12] \n " ;
127 fmt
= "Capabilities=[W] \n MaxFileLen=[D] \n VolNameLen=[D] \n Volume=[S] \n " ;
130 fmt
= "UnknownLevel \n " ;
133 smb_fdata ( data
, fmt
, data
+ dcnt
);
137 print_data ( data
, dcnt
);
145 struct smbfnsint trans2_fns
[] = {
146 { 0 , "TRANSACT2_OPEN" , 0 ,
147 { "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]" ,
149 "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 " ,
151 { 1 , "TRANSACT2_FINDFIRST" , 0 ,
152 { NULL
, NULL
, NULL
, NULL
, trans2_findfirst
}},
153 { 2 , "TRANSACT2_FINDNEXT" , 0 , DEFDESCRIPT
},
154 { 3 , "TRANSACT2_QFSINFO" , 0 ,
155 { NULL
, NULL
, NULL
, NULL
, trans2_qfsinfo
}},
156 { 4 , "TRANSACT2_SETFSINFO" , 0 , DEFDESCRIPT
},
157 { 5 , "TRANSACT2_QPATHINFO" , 0 , DEFDESCRIPT
},
158 { 6 , "TRANSACT2_SETPATHINFO" , 0 , DEFDESCRIPT
},
159 { 7 , "TRANSACT2_QFILEINFO" , 0 , DEFDESCRIPT
},
160 { 8 , "TRANSACT2_SETFILEINFO" , 0 , DEFDESCRIPT
},
161 { 9 , "TRANSACT2_FSCTL" , 0 , DEFDESCRIPT
},
162 { 10 , "TRANSACT2_IOCTL" , 0 , DEFDESCRIPT
},
163 { 11 , "TRANSACT2_FINDNOTIFYFIRST" , 0 , DEFDESCRIPT
},
164 { 12 , "TRANSACT2_FINDNOTIFYNEXT" , 0 , DEFDESCRIPT
},
165 { 13 , "TRANSACT2_MKDIR" , 0 , DEFDESCRIPT
},
166 { - 1 , NULL
, 0 , DEFDESCRIPT
}
171 print_trans2 ( const u_char
* words
, const u_char
* dat
, const u_char
* buf
, const u_char
* maxbuf
)
173 static struct smbfnsint
* fn
= & trans2_fns
[ 0 ];
174 const u_char
* data
, * param
;
175 const u_char
* w
= words
+ 1 ;
176 const u_char
* f1
= NULL
, * f2
= NULL
;
181 TCHECK2 ( w
[ 14 * 2 ], 2 );
182 pcnt
= EXTRACT_LE_16BITS ( w
+ 9 * 2 );
183 param
= buf
+ EXTRACT_LE_16BITS ( w
+ 10 * 2 );
184 dcnt
= EXTRACT_LE_16BITS ( w
+ 11 * 2 );
185 data
= buf
+ EXTRACT_LE_16BITS ( w
+ 12 * 2 );
186 fn
= smbfindint ( EXTRACT_LE_16BITS ( w
+ 14 * 2 ), trans2_fns
);
189 printf ( "%s \n " , fn
-> name
);
190 printf ( "Trans2Interim \n " );
193 TCHECK2 ( w
[ 7 * 2 ], 2 );
194 pcnt
= EXTRACT_LE_16BITS ( w
+ 3 * 2 );
195 param
= buf
+ EXTRACT_LE_16BITS ( w
+ 4 * 2 );
196 dcnt
= EXTRACT_LE_16BITS ( w
+ 6 * 2 );
197 data
= buf
+ EXTRACT_LE_16BITS ( w
+ 7 * 2 );
200 printf ( "%s param_length=%d data_length=%d \n " , fn
-> name
, pcnt
, dcnt
);
205 "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 " ,
210 "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 " ,
212 smb_fdata ( data
+ 1 , "TransactionName=[S] \n %" , maxbuf
);
214 f1
= fn
-> descript
. req_f1
;
215 f2
= fn
-> descript
. req_f2
;
218 "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 " ,
220 f1
= fn
-> descript
. rep_f1
;
221 f2
= fn
-> descript
. rep_f2
;
225 (* fn
-> descript
. fn
)( param
, data
, pcnt
, dcnt
);
227 smb_fdata ( param
, f1
? f1
: ( u_char
*) "Paramaters= \n " , param
+ pcnt
);
228 smb_fdata ( data
, f2
? f2
: ( u_char
*) "Data= \n " , data
+ dcnt
);
238 print_browse ( const u_char
* param
, int paramlen
, const u_char
* data
, int datalen
)
240 const u_char
* maxbuf
= data
+ datalen
;
246 smb_fdata ( param
, "BROWSE PACKET \n |Param " , param
+ paramlen
);
250 data
= smb_fdata ( data
,
251 "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 " ,
256 data
= smb_fdata ( data
,
257 "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 " ,
262 data
= smb_fdata ( data
,
263 "BROWSE PACKET: \n Type=[B] (AnnouncementRequest) \n Flags=[B] \n ReplySystemName=[S] \n " ,
268 data
= smb_fdata ( data
,
269 "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 " ,
274 data
= smb_fdata ( data
,
275 "BROWSE PACKET: \n Type=[B] (ElectionFrame) \n ElectionVersion=[B] \n OSSummary=[W] \n Uptime=[(W, W)] \n ServerName=[S] \n " ,
280 data
= smb_fdata ( data
,
281 "BROWSE PACKET: \n Type=[B] (BecomeBackupBrowser) \n Name=[S] \n " ,
286 data
= smb_fdata ( data
,
287 "BROWSE PACKET: \n Type=[B] (GetBackupList) \n ListCount?=[B] \n Token?=[B] \n " ,
292 data
= smb_fdata ( data
,
293 "BROWSE PACKET: \n Type=[B] (BackupListResponse) \n ServerCount?=[B] \n Token?=[B]*Name=[S] \n " ,
298 data
= smb_fdata ( data
,
299 "BROWSE PACKET: \n Type=[B] (MasterAnnouncement) \n MasterName=[S] \n " ,
304 data
= smb_fdata ( data
,
305 "BROWSE PACKET: \n Type=[B] (ResetBrowser) \n Options=[B] \n " , maxbuf
);
309 data
= smb_fdata ( data
, "Unknown Browser Frame " , maxbuf
);
320 print_ipc ( const u_char
* param
, int paramlen
, const u_char
* data
, int datalen
)
323 smb_fdata ( param
, "Command=[w] \n Str1=[S] \n Str2=[S] \n " , param
+ paramlen
);
325 smb_fdata ( data
, "IPC " , data
+ datalen
);
330 print_trans ( const u_char
* words
, const u_char
* data1
, const u_char
* buf
, const u_char
* maxbuf
)
332 const u_char
* f1
, * f2
, * f3
, * f4
;
333 const u_char
* data
, * param
;
334 const u_char
* w
= words
+ 1 ;
335 int datalen
, paramlen
;
338 TCHECK2 ( w
[ 12 * 2 ], 2 );
339 paramlen
= EXTRACT_LE_16BITS ( w
+ 9 * 2 );
340 param
= buf
+ EXTRACT_LE_16BITS ( w
+ 10 * 2 );
341 datalen
= EXTRACT_LE_16BITS ( w
+ 11 * 2 );
342 data
= buf
+ EXTRACT_LE_16BITS ( w
+ 12 * 2 );
343 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 " ;
348 TCHECK2 ( w
[ 7 * 2 ], 2 );
349 paramlen
= EXTRACT_LE_16BITS ( w
+ 3 * 2 );
350 param
= buf
+ EXTRACT_LE_16BITS ( w
+ 4 * 2 );
351 datalen
= EXTRACT_LE_16BITS ( w
+ 6 * 2 );
352 data
= buf
+ EXTRACT_LE_16BITS ( w
+ 7 * 2 );
353 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 " ;
359 smb_fdata ( words
+ 1 , f1
, SMBMIN ( words
+ 1 + 2 * words
[ 0 ], maxbuf
));
360 smb_fdata ( data1
+ 2 , f2
, maxbuf
- ( paramlen
+ datalen
));
362 if (! strcmp ( data1
+ 2 , " \\ MAILSLOT \\ BROWSE" )) {
363 print_browse ( param
, paramlen
, data
, datalen
);
367 if (! strcmp ( data1
+ 2 , " \\ PIPE \\ LANMAN" )) {
368 print_ipc ( param
, paramlen
, data
, datalen
);
373 smb_fdata ( param
, f3
, SMBMIN ( param
+ paramlen
, maxbuf
));
375 smb_fdata ( data
, f4
, SMBMIN ( data
+ datalen
, maxbuf
));
384 print_negprot ( const u_char
* words
, const u_char
* data
, const u_char
* buf
, const u_char
* maxbuf
)
386 u_char
* f1
= NULL
, * f2
= NULL
;
390 f2
= "*|Dialect=[Z] \n " ;
393 f1
= "Core Protocol \n DialectIndex=[d]" ;
394 else if ( words
[ 0 ] == 17 )
395 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=" ;
396 else if ( words
[ 0 ] == 13 )
397 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=" ;
401 smb_fdata ( words
+ 1 , f1
, SMBMIN ( words
+ 1 + words
[ 0 ] * 2 , maxbuf
));
403 print_data ( words
+ 1 , SMBMIN ( words
[ 0 ] * 2 ,
404 PTR_DIFF ( maxbuf
, words
+ 1 )));
408 smb_fdata ( data
+ 2 , f2
, SMBMIN ( data
+ 2 + EXTRACT_LE_16BITS ( data
), maxbuf
));
410 print_data ( data
+ 2 , SMBMIN ( EXTRACT_LE_16BITS ( data
), PTR_DIFF ( maxbuf
, data
+ 2 )));
418 print_sesssetup ( const u_char
* words
, const u_char
* data
, const u_char
* buf
, const u_char
* maxbuf
)
421 u_char
* f1
= NULL
, * f2
= NULL
;
427 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 " ;
429 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 " ;
432 f1
= "Com2=[w] \n Off2=[d] \n Action=[w] \n " ;
433 } else if ( words
[ 0 ] == 13 ) {
434 f1
= "Com2=[B] \n Res=[B] \n Off2=[d] \n Action=[w] \n " ;
435 f2
= "NativeOS=[S] \n NativeLanMan=[S] \n PrimaryDomain=[S] \n " ;
440 smb_fdata ( words
+ 1 , f1
, SMBMIN ( words
+ 1 + words
[ 0 ] * 2 , maxbuf
));
442 print_data ( words
+ 1 , SMBMIN ( words
[ 0 ] * 2 ,
443 PTR_DIFF ( maxbuf
, words
+ 1 )));
447 smb_fdata ( data
+ 2 , f2
, SMBMIN ( data
+ 2 + EXTRACT_LE_16BITS ( data
), maxbuf
));
449 print_data ( data
+ 2 , SMBMIN ( EXTRACT_LE_16BITS ( data
), PTR_DIFF ( maxbuf
, data
+ 2 )));
457 static struct smbfns smb_fns
[] = {
458 { - 1 , "SMBunknown" , 0 , DEFDESCRIPT
},
460 { SMBtcon
, "SMBtcon" , 0 ,
461 { NULL
, "Path=[Z] \n Password=[Z] \n Device=[Z] \n " ,
462 "MaxXmit=[d] \n TreeId=[d] \n " , NULL
,
465 { SMBtdis
, "SMBtdis" , 0 , DEFDESCRIPT
},
466 { SMBexit
, "SMBexit" , 0 , DEFDESCRIPT
},
467 { SMBioctl
, "SMBioctl" , 0 , DEFDESCRIPT
},
469 { SMBecho
, "SMBecho" , 0 ,
470 { "ReverbCount=[d] \n " , NULL
,
471 "SequenceNum=[d] \n " , NULL
,
474 { SMBulogoffX
, "SMBulogoffX" , FLG_CHAIN
, DEFDESCRIPT
},
476 { SMBgetatr
, "SMBgetatr" , 0 ,
477 { NULL
, "Path=[Z] \n " ,
478 "Attribute=[A] \n Time=[T2]Size=[D] \n Res=([w,w,w,w,w]) \n " , NULL
,
481 { SMBsetatr
, "SMBsetatr" , 0 ,
482 { "Attribute=[A] \n Time=[T2]Res=([w,w,w,w,w]) \n " , "Path=[Z] \n " ,
483 NULL
, NULL
, NULL
} },
485 { SMBchkpth
, "SMBchkpth" , 0 ,
486 { NULL
, "Path=[Z] \n " , NULL
, NULL
, NULL
} },
488 { SMBsearch
, "SMBsearch" , 0 ,
489 { "Count=[d] \n Attrib=[A] \n " ,
490 "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 " ,
492 "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 " ,
495 { SMBopen
, "SMBopen" , 0 ,
496 { "Mode=[w] \n Attribute=[A] \n " , "Path=[Z] \n " ,
497 "Handle=[d] \n OAttrib=[A] \n Time=[T2]Size=[D] \n Access=[w] \n " ,
500 { SMBcreate
, "SMBcreate" , 0 ,
501 { "Attrib=[A] \n Time=[T2]" , "Path=[Z] \n " , "Handle=[d] \n " , NULL
, NULL
} },
503 { SMBmknew
, "SMBmknew" , 0 ,
504 { "Attrib=[A] \n Time=[T2]" , "Path=[Z] \n " , "Handle=[d] \n " , NULL
, NULL
} },
506 { SMBunlink
, "SMBunlink" , 0 ,
507 { "Attrib=[A] \n " , "Path=[Z] \n " , NULL
, NULL
, NULL
} },
509 { SMBread
, "SMBread" , 0 ,
510 { "Handle=[d] \n ByteCount=[d] \n Offset=[D] \n CountLeft=[d] \n " , NULL
,
511 "Count=[d] \n Res=([w,w,w,w]) \n " , NULL
, NULL
} },
513 { SMBwrite
, "SMBwrite" , 0 ,
514 { "Handle=[d] \n ByteCount=[d] \n Offset=[D] \n CountLeft=[d] \n " , NULL
,
515 "Count=[d] \n " , NULL
, NULL
} },
517 { SMBclose
, "SMBclose" , 0 ,
518 { "Handle=[d] \n Time=[T2]" , NULL
, NULL
, NULL
, NULL
} },
520 { SMBmkdir
, "SMBmkdir" , 0 ,
521 { NULL
, "Path=[Z] \n " , NULL
, NULL
, NULL
} },
523 { SMBrmdir
, "SMBrmdir" , 0 ,
524 { NULL
, "Path=[Z] \n " , NULL
, NULL
, NULL
} },
526 { SMBdskattr
, "SMBdskattr" , 0 ,
528 "TotalUnits=[d] \n BlocksPerUnit=[d] \n BlockSize=[d] \n FreeUnits=[d] \n Media=[w] \n " ,
532 { "Attrib=[A] \n " , "OldPath=[Z] \n NewPath=[Z] \n " , NULL
, NULL
, NULL
} },
535 * this is a Pathworks specific call, allowing the
536 * changing of the root path
538 { pSETDIR
, "SMBsetdir" , 0 , { NULL
, "Path=[Z] \n " , NULL
, NULL
, NULL
} },
540 { SMBlseek
, "SMBlseek" , 0 ,
541 { "Handle=[d] \n Mode=[w] \n Offset=[D] \n " , "Offset=[D] \n " , NULL
, NULL
} },
543 { SMBflush
, "SMBflush" , 0 , { "Handle=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
545 { SMBsplopen
, "SMBsplopen" , 0 ,
546 { "SetupLen=[d] \n Mode=[w] \n " , "Ident=[Z] \n " , "Handle=[d] \n " ,
549 { SMBsplclose
, "SMBsplclose" , 0 ,
550 { "Handle=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
552 { SMBsplretq
, "SMBsplretq" , 0 ,
553 { "MaxCount=[d] \n StartIndex=[d] \n " , NULL
,
554 "Count=[d] \n Index=[d] \n " ,
555 "*Time=[T2]Status=[B] \n JobID=[d] \n Size=[D] \n Res=[B]Name=[s16] \n " ,
558 { SMBsplwr
, "SMBsplwr" , 0 ,
559 { "Handle=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
561 { SMBlock
, "SMBlock" , 0 ,
562 { "Handle=[d] \n Count=[D] \n Offset=[D] \n " , NULL
, NULL
, NULL
, NULL
} },
564 { SMBunlock
, "SMBunlock" , 0 ,
565 { "Handle=[d] \n Count=[D] \n Offset=[D] \n " , NULL
, NULL
, NULL
, NULL
} },
567 /* CORE+ PROTOCOL FOLLOWS */
569 { SMBreadbraw
, "SMBreadbraw" , 0 ,
570 { "Handle=[d] \n Offset=[D] \n MaxCount=[d] \n MinCount=[d] \n TimeOut=[D] \n Res=[d] \n " ,
571 NULL
, NULL
, NULL
, NULL
} },
573 { SMBwritebraw
, "SMBwritebraw" , 0 ,
574 { "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 " ,
575 NULL
, "WriteRawAck" , NULL
, NULL
} },
577 { SMBwritec
, "SMBwritec" , 0 ,
578 { NULL
, NULL
, "Count=[d] \n " , NULL
, NULL
} },
580 { SMBwriteclose
, "SMBwriteclose" , 0 ,
581 { "Handle=[d] \n Count=[d] \n Offset=[D] \n Time=[T2]Res=([w,w,w,w,w,w])" ,
582 NULL
, "Count=[d] \n " , NULL
, NULL
} },
584 { SMBlockread
, "SMBlockread" , 0 ,
585 { "Handle=[d] \n ByteCount=[d] \n Offset=[D] \n CountLeft=[d] \n " , NULL
,
586 "Count=[d] \n Res=([w,w,w,w]) \n " , NULL
, NULL
} },
588 { SMBwriteunlock
, "SMBwriteunlock" , 0 ,
589 { "Handle=[d] \n ByteCount=[d] \n Offset=[D] \n CountLeft=[d] \n " , NULL
,
590 "Count=[d] \n " , NULL
, NULL
} },
592 { SMBreadBmpx
, "SMBreadBmpx" , 0 ,
593 { "Handle=[d] \n Offset=[D] \n MaxCount=[d] \n MinCount=[d] \n TimeOut=[D] \n Res=[w] \n " ,
595 "Offset=[D] \n TotCount=[d] \n Remaining=[d] \n Res=([w,w]) \n DataSize=[d] \n DataOff=[d] \n " ,
598 { SMBwriteBmpx
, "SMBwriteBmpx" , 0 ,
599 { "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
,
600 "Remaining=[d] \n " , NULL
, NULL
} },
602 { SMBwriteBs
, "SMBwriteBs" , 0 ,
603 { "Handle=[d] \n TotCount=[d] \n Offset=[D] \n Res=[W] \n DataSize=[d] \n DataOff=[d] \n " ,
604 NULL
, "Count=[d] \n " , NULL
, NULL
} },
606 { SMBsetattrE
, "SMBsetattrE" , 0 ,
607 { "Handle=[d] \n CreationTime=[T2]AccessTime=[T2]ModifyTime=[T2]" , NULL
,
608 NULL
, NULL
, NULL
} },
610 { SMBgetattrE
, "SMBgetattrE" , 0 ,
611 { "Handle=[d] \n " , NULL
,
612 "CreationTime=[T2]AccessTime=[T2]ModifyTime=[T2]Size=[D] \n AllocSize=[D] \n Attribute=[A] \n " ,
615 { SMBtranss
, "SMBtranss" , 0 , DEFDESCRIPT
},
616 { SMBioctls
, "SMBioctls" , 0 , DEFDESCRIPT
},
618 { SMBcopy
, "SMBcopy" , 0 ,
619 { "TreeID2=[d] \n OFun=[w] \n Flags=[w] \n " , "Path=[S] \n NewPath=[S] \n " ,
620 "CopyCount=[d] \n " , "|ErrStr=[S] \n " , NULL
} },
622 { SMBmove
, "SMBmove" , 0 ,
623 { "TreeID2=[d] \n OFun=[w] \n Flags=[w] \n " , "Path=[S] \n NewPath=[S] \n " ,
624 "MoveCount=[d] \n " , "|ErrStr=[S] \n " , NULL
} },
626 { SMBopenX
, "SMBopenX" , FLG_CHAIN
,
627 { "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 " ,
629 "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 " ,
632 { SMBreadX
, "SMBreadX" , FLG_CHAIN
,
633 { "Com2=[w] \n Off2=[d] \n Handle=[d] \n Offset=[D] \n MaxCount=[d] \n MinCount=[d] \n TimeOut=[D] \n CountLeft=[d] \n " ,
635 "Com2=[w] \n Off2=[d] \n Remaining=[d] \n Res=[W] \n DataSize=[d] \n DataOff=[d] \n Res=([w,w,w,w]) \n " ,
638 { SMBwriteX
, "SMBwriteX" , FLG_CHAIN
,
639 { "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 " ,
641 "Com2=[w] \n Off2=[d] \n Count=[d] \n Remaining=[d] \n Res=[W] \n " ,
644 { SMBlockingX
, "SMBlockingX" , FLG_CHAIN
,
645 { "Com2=[w] \n Off2=[d] \n Handle=[d] \n LockType=[w] \n TimeOut=[D] \n UnlockCount=[d] \n LockCount=[d] \n " ,
646 "*Process=[d] \n Offset=[D] \n Length=[D] \n " ,
647 "Com2=[w] \n Off2=[d] \n " , NULL
, NULL
} },
649 { SMBffirst
, "SMBffirst" , 0 ,
650 { "Count=[d] \n Attrib=[A] \n " ,
651 "Path=[Z] \n BlkType=[B] \n BlkLen=[d] \n |Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n " ,
653 "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 " ,
656 { SMBfunique
, "SMBfunique" , 0 ,
657 { "Count=[d] \n Attrib=[A] \n " ,
658 "Path=[Z] \n BlkType=[B] \n BlkLen=[d] \n |Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n " ,
660 "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 " ,
663 { SMBfclose
, "SMBfclose" , 0 ,
664 { "Count=[d] \n Attrib=[A] \n " ,
665 "Path=[Z] \n BlkType=[B] \n BlkLen=[d] \n |Res1=[B] \n Mask=[s11] \n Srv1=[B] \n DirIndex=[d] \n Srv2=[w] \n " ,
667 "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 " ,
670 { SMBfindnclose
, "SMBfindnclose" , 0 ,
671 { "Handle=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
673 { SMBfindclose
, "SMBfindclose" , 0 ,
674 { "Handle=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
676 { SMBsends
, "SMBsends" , 0 ,
677 { NULL
, "Source=[Z] \n Dest=[Z] \n " , NULL
, NULL
, NULL
} },
679 { SMBsendstrt
, "SMBsendstrt" , 0 ,
680 { NULL
, "Source=[Z] \n Dest=[Z] \n " , "GroupID=[d] \n " , NULL
, NULL
} },
682 { SMBsendend
, "SMBsendend" , 0 ,
683 { "GroupID=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
685 { SMBsendtxt
, "SMBsendtxt" , 0 ,
686 { "GroupID=[d] \n " , NULL
, NULL
, NULL
, NULL
} },
688 { SMBsendb
, "SMBsendb" , 0 ,
689 { NULL
, "Source=[Z] \n Dest=[Z] \n " , NULL
, NULL
, NULL
} },
691 { SMBfwdname
, "SMBfwdname" , 0 , DEFDESCRIPT
},
692 { SMBcancelf
, "SMBcancelf" , 0 , DEFDESCRIPT
},
693 { SMBgetmac
, "SMBgetmac" , 0 , DEFDESCRIPT
},
695 { SMBnegprot
, "SMBnegprot" , 0 ,
696 { NULL
, NULL
, NULL
, NULL
, print_negprot
} },
698 { SMBsesssetupX
, "SMBsesssetupX" , FLG_CHAIN
,
699 { NULL
, NULL
, NULL
, NULL
, print_sesssetup
} },
701 { SMBtconX
, "SMBtconX" , FLG_CHAIN
,
702 { "Com2=[w] \n Off2=[d] \n Flags=[w] \n PassLen=[d] \n Passwd&Path&Device= \n " ,
703 NULL
, "Com2=[w] \n Off2=[d] \n " , "ServiceType=[S] \n " , NULL
} },
705 { SMBtrans2
, "SMBtrans2" , 0 , { NULL
, NULL
, NULL
, NULL
, print_trans2
} },
707 { SMBtranss2
, "SMBtranss2" , 0 , DEFDESCRIPT
},
708 { SMBctemp
, "SMBctemp" , 0 , DEFDESCRIPT
},
709 { SMBreadBs
, "SMBreadBs" , 0 , DEFDESCRIPT
},
710 { SMBtrans
, "SMBtrans" , 0 , { NULL
, NULL
, NULL
, NULL
, print_trans
} },
712 { SMBnttrans
, "SMBnttrans" , 0 , DEFDESCRIPT
},
713 { SMBnttranss
, "SMBnttranss" , 0 , DEFDESCRIPT
},
715 { SMBntcreateX
, "SMBntcreateX" , FLG_CHAIN
,
716 { "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 " ,
718 "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 " ,
721 { SMBntcancel
, "SMBntcancel" , 0 , DEFDESCRIPT
},
723 { - 1 , NULL
, 0 , DEFDESCRIPT
}
728 * print a SMB message
731 print_smb ( const u_char
* buf
, const u_char
* maxbuf
)
734 const u_char
* words
, * data
;
736 char * fmt_smbheader
=
737 "[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 " ;
741 request
= ( buf
[ 9 ] & 0x80 ) ? 0 : 1 ;
745 fn
= smbfind ( command
, smb_fns
);
750 printf ( "SMB PACKET: %s (%s) \n " , fn
-> name
, request
? "REQUEST" : "REPLY" );
755 /* print out the header */
756 smb_fdata ( buf
, fmt_smbheader
, buf
+ 33 );
759 printf ( "SMBError = %s \n " , smb_errstr ( buf
[ 5 ], EXTRACT_LE_16BITS (& buf
[ 7 ])));
765 const u_char
* f1
, * f2
;
771 data
= words
+ 1 + wct
* 2 ;
774 f1
= fn
-> descript
. req_f1
;
775 f2
= fn
-> descript
. req_f2
;
777 f1
= fn
-> descript
. rep_f1
;
778 f2
= fn
-> descript
. rep_f2
;
782 (* fn
-> descript
. fn
)( words
, data
, buf
, maxbuf
);
785 printf ( "smbvwv[]= \n " );
787 smb_fdata ( words
+ 1 , f1
, words
+ 1 + wct
* 2 );
792 for ( i
= 0 ; i
< wct
; i
++) {
793 TCHECK2 ( words
[ 1 + 2 * i
], 2 );
794 v
= EXTRACT_LE_16BITS ( words
+ 1 + 2 * i
);
795 printf ( "smb_vwv[%d]=%d (0x%X) \n " , i
, v
, v
);
801 bcc
= EXTRACT_LE_16BITS ( data
);
804 printf ( "smbbuf[]= \n " );
805 smb_fdata ( data
+ 2 , f2
, data
+ 2 + bcc
);
808 printf ( "smb_bcc=%d \n " , bcc
);
810 printf ( "smb_buf[]= \n " );
811 print_data ( data
+ 2 , SMBMIN ( bcc
, PTR_DIFF ( maxbuf
, data
+ 2 )));
816 if (( fn
-> flags
& FLG_CHAIN
) == 0 )
821 command
= EXTRACT_LE_16BITS ( words
+ 1 );
824 TCHECK2 ( words
[ 3 ], 2 );
825 words
= buf
+ EXTRACT_LE_16BITS ( words
+ 3 );
827 fn
= smbfind ( command
, smb_fns
);
829 printf ( " \n SMB PACKET: %s (%s) (CHAINED) \n " ,
830 fn
-> name
, request
? "REQUEST" : "REPLY" );
842 * print a NBT packet received across tcp on port 139
845 nbt_tcp_print ( const u_char
* data
, int length
)
847 const u_char
* maxbuf
= data
+ length
;
853 nbt_len
= EXTRACT_16BITS ( data
+ 2 );
862 printf ( "NBT Packet" );
871 printf ( "flags=0x%x \n " , flags
);
873 data
= smb_fdata ( data
, "NBT Session Packet \n Flags=[rw] \n Length=[rd] \n " ,
877 if ( memcmp ( data
, " \377 SMB" , 4 ) == 0 ) {
878 if ( nbt_len
> PTR_DIFF ( maxbuf
, data
))
879 printf ( "WARNING: Short packet. Try increasing the snap length (%lu) \n " ,
880 ( unsigned long ) PTR_DIFF ( maxbuf
, data
));
881 print_smb ( data
, maxbuf
> data
+ nbt_len
? data
+ nbt_len
: maxbuf
);
883 printf ( "Session packet:(raw data?) \n " );
887 data
= smb_fdata ( data
,
888 "NBT Session Request \n Flags=[rW] \n Destination=[n1] \n Source=[n1] \n " ,
893 data
= smb_fdata ( data
, "NBT Session Granted \n Flags=[rW] \n " , maxbuf
);
903 data
= smb_fdata ( data
, "NBT SessionReject \n Flags=[rW] \n Reason=[B] \n " ,
907 printf ( "Not listening on called name \n " );
910 printf ( "Not listening for calling name \n " );
913 printf ( "Called name not present \n " );
916 printf ( "Called name present, but insufficient resources \n " );
919 printf ( "Unspecified error 0x%X \n " , ecode
);
926 data
= smb_fdata ( data
, "NBT Session Keepalive \n Flags=[rW] \n " , maxbuf
);
930 printf ( "flags=0x%x \n " , flags
);
931 data
= smb_fdata ( data
, "NBT - Unknown packet type \n Type=[rW] \n " , maxbuf
);
943 * print a NBT packet received across udp on port 137
946 nbt_udp137_print ( const u_char
* data
, int length
)
948 const u_char
* maxbuf
= data
+ length
;
949 int name_trn_id
, response
, opcode
, nm_flags
, rcode
;
950 int qdcount
, ancount
, nscount
, arcount
;
955 TCHECK2 ( data
[ 10 ], 2 );
956 name_trn_id
= EXTRACT_16BITS ( data
);
957 response
= ( data
[ 2 ] >> 7 );
958 opcode
= ( data
[ 2 ] >> 3 ) & 0xF ;
959 nm_flags
= (( data
[ 2 ] & 0x7 ) << 4 ) + ( data
[ 3 ] >> 4 );
960 rcode
= data
[ 3 ] & 0xF ;
961 qdcount
= EXTRACT_16BITS ( data
+ 4 );
962 ancount
= EXTRACT_16BITS ( data
+ 6 );
963 nscount
= EXTRACT_16BITS ( data
+ 8 );
964 arcount
= EXTRACT_16BITS ( data
+ 10 );
973 printf ( "NBT UDP PACKET(137): " );
976 case 0 : opcodestr
= "QUERY" ; break ;
977 case 5 : opcodestr
= "REGISTRATION" ; break ;
978 case 6 : opcodestr
= "RELEASE" ; break ;
979 case 7 : opcodestr
= "WACK" ; break ;
980 case 8 : opcodestr
= "REFRESH(8)" ; break ;
981 case 9 : opcodestr
= "REFRESH" ; break ;
982 case 15 : opcodestr
= "MULTIHOMED REGISTRATION" ; break ;
983 default : opcodestr
= "OPUNKNOWN" ; break ;
985 printf ( "%s" , opcodestr
);
988 printf ( "; NEGATIVE" );
990 printf ( "; POSITIVE" );
994 printf ( "; RESPONSE" );
999 printf ( "; BROADCAST" );
1001 printf ( "; UNICAST" );
1006 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 " ,
1007 name_trn_id
, opcode
, nm_flags
, rcode
, qdcount
, ancount
, nscount
,
1012 total
= ancount
+ nscount
+ arcount
;
1014 if ( qdcount
> 100 || total
> 100 ) {
1015 printf ( "Corrupt packet?? \n " );
1020 printf ( "QuestionRecords: \n " );
1021 for ( i
= 0 ; i
< qdcount
; i
++)
1023 "|Name=[n1] \n QuestionType=[rw] \n QuestionClass=[rw] \n #" ,
1030 printf ( " \n ResourceRecords: \n " );
1031 for ( i
= 0 ; i
< total
; i
++) {
1035 p
= smb_fdata ( p
, "Name=[n1] \n #" , maxbuf
);
1038 restype
= EXTRACT_16BITS ( p
);
1039 p
= smb_fdata ( p
, "ResType=[rw] \n ResClass=[rw] \n TTL=[rD] \n " , p
+ 8 );
1042 rdlen
= EXTRACT_16BITS ( p
);
1043 printf ( "ResourceLength=%d \n ResourceData= \n " , rdlen
);
1046 p
= smb_fdata ( p
, "AddrType=[rw] \n Address=[b.b.b.b] \n " , p
+ rdlen
);
1050 if ( restype
== 0x21 ) {
1055 p
= smb_fdata ( p
, "NumNames=[B] \n " , p
+ 1 );
1058 while ( numnames
--) {
1059 p
= smb_fdata ( p
, "Name=[n2] \t #" , maxbuf
);
1063 switch ( p
[ 0 ] & 0x60 ) {
1064 case 0x00 : printf ( "B " ); break ;
1065 case 0x20 : printf ( "P " ); break ;
1066 case 0x40 : printf ( "M " ); break ;
1067 case 0x60 : printf ( "_ " ); break ;
1070 printf ( "<DEREGISTERING> " );
1072 printf ( "<CONFLICT> " );
1074 printf ( "<ACTIVE> " );
1076 printf ( "<PERMANENT> " );
1081 print_data ( p
, min ( rdlen
, length
- (( const u_char
*) p
- data
)));
1088 if (( u_char
*) p
< maxbuf
)
1089 smb_fdata ( p
, "AdditionalData: \n " , maxbuf
);
1103 * print a NBT packet received across udp on port 138
1106 nbt_udp138_print ( const u_char
* data
, int length
)
1108 const u_char
* maxbuf
= data
+ length
;
1110 if ( maxbuf
> snapend
)
1117 printf ( "NBT UDP PACKET(138)" );
1121 data
= smb_fdata ( data
,
1122 " \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 #" ,
1126 /* If there isn't enough data for "\377SMB", don't check for it. */
1127 if (& data
[ 3 ] >= maxbuf
)
1130 if ( memcmp ( data
, " \377 SMB" , 4 ) == 0 )
1131 print_smb ( data
, maxbuf
);
1140 print netbeui frames
1143 netbeui_print ( u_short control
, const u_char
* data
, int length
)
1145 const u_char
* maxbuf
= data
+ length
;
1148 const u_char
* data2
;
1149 int is_truncated
= 0 ;
1151 if ( maxbuf
> snapend
)
1154 len
= EXTRACT_LE_16BITS ( data
);
1157 if ( data2
>= maxbuf
) {
1165 printf ( "NetBeui Packet" );
1169 printf ( " \n >>> NetBeui Packet \n Type=0x%X " , control
);
1170 data
= smb_fdata ( data
, "Length=[d] Signature=[w] Command=[B] \n #" , maxbuf
);
1176 data
= smb_fdata ( data
, "NameQuery:[P1] \n SessionNumber=[B] \n NameType=[B][P2] \n ResponseCorrelator=[w] \n Destination=[n2] \n Source=[n2] \n " , data2
);
1180 data
= smb_fdata ( data
,
1181 "NetbiosDataGram:[P7] \n Destination=[n2] \n Source=[n2] \n " , data2
);
1185 data
= smb_fdata ( data
,
1186 "NameRecognise: \n [P1] \n Data2=[w] \n TransmitCorrelator=[w] \n ResponseCorelator=[w] \n Destination=[n2] \n Source=[n2] \n " ,
1191 data
= smb_fdata ( data
,
1192 "SessionInitialise: \n Data1=[B] \n Data2=[w] \n TransmitCorrelator=[w] \n ResponseCorelator=[w] \n RemoteSessionNumber=[B] \n LocalSessionNumber=[B] \n " ,
1197 data
= smb_fdata ( data
,
1198 "SessionConfirm: \n Data1=[B] \n Data2=[w] \n TransmitCorrelator=[w] \n ResponseCorelator=[w] \n RemoteSessionNumber=[B] \n LocalSessionNumber=[B] \n " ,
1203 data
= smb_fdata ( data
,
1204 "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 " ,
1209 data
= smb_fdata ( data
,
1210 "NetbiosDataAck: \n [P3]TransmitCorrelator=[w][P2] \n RemoteSessionNumber=[B] \n LocalSessionNumber=[B] \n " ,
1215 data
= smb_fdata ( data
,
1216 "SessionEnd: \n [P1]Data2=[w][P4] \n RemoteSessionNumber=[B] \n LocalSessionNumber=[B] \n " ,
1221 data
= smb_fdata ( data
, "SessionAlive \n " , data2
);
1225 data
= smb_fdata ( data
, "Unknown Netbios Command " , data2
);
1232 /* data2 was past the end of the buffer */
1236 /* If there isn't enough data for "\377SMB", don't look for it. */
1237 if (& data2
[ 3 ] >= maxbuf
)
1240 if ( memcmp ( data2
, " \377 SMB" , 4 ) == 0 )
1241 print_smb ( data2
, maxbuf
);
1244 for ( i
= 0 ; i
< 128 ; i
++) {
1245 if (& data2
[ i
+ 3 ] >= maxbuf
)
1247 if ( memcmp (& data2
[ i
], " \377 SMB" , 4 ) == 0 ) {
1248 printf ( "found SMB packet at %d \n " , i
);
1249 print_smb (& data2
[ i
], maxbuf
);
1265 * print IPX-Netbios frames
1268 ipx_netbios_print ( const u_char
* data
, u_int length
)
1271 * this is a hack till I work out how to parse the rest of the
1272 * NetBIOS-over-IPX stuff
1275 const u_char
* maxbuf
;
1277 maxbuf
= data
+ length
;
1278 /* Don't go past the end of the captured data in the packet. */
1279 if ( maxbuf
> snapend
)
1282 for ( i
= 0 ; i
< 128 ; i
++) {
1283 if (& data
[ i
+ 4 ] > maxbuf
)
1285 if ( memcmp (& data
[ i
], " \377 SMB" , 4 ) == 0 ) {
1286 smb_fdata ( data
, " \n >>> IPX transport " , & data
[ i
]);
1288 print_smb (& data
[ i
], maxbuf
);
1295 smb_fdata ( data
, " \n >>> Unknown IPX " , maxbuf
);