]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-smb.c
indent (sorry, i left them behind
[tcpdump] / print-smb.c
index fe685429feab14baf78f9b99c7478f5acf6c8c4c..edfcbdc45f07aaed48ada31774a4f88adaf21109 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) Andrew Tridgell 1995-1999
  *
  * This software may be distributed either under the terms of the
@@ -12,7 +12,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.13 2001-06-25 18:58:07 itojun Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.16 2001-06-28 03:15:38 itojun Exp $";
 #endif
 
 #include <stdio.h>
@@ -46,16 +46,16 @@ struct smbfns
     struct smbdescript descript;
 };
 
-#define DEFDESCRIPT    {NULL,NULL,NULL,NULL,NULL}
+#define DEFDESCRIPT    { NULL, NULL, NULL, NULL, NULL }
 
-#define FLG_CHAIN      (1<<0)
+#define FLG_CHAIN      (1 << 0)
 
 static struct smbfns *
 smbfind(int id, struct smbfns *list)
 {
     int sindex;
 
-    for (sindex = 0; list[sindex].name; sindex++) 
+    for (sindex = 0; list[sindex].name; sindex++)
        if (list[sindex].id == id)
            return(&list[sindex]);
 
@@ -127,26 +127,26 @@ trans2_qfsinfo(const uchar *param, const uchar *data, ...)
 }
 
 struct smbfns trans2_fns[] = {
-    { 0, "TRANSACT2_OPEN", 0, 
+    { 0, "TRANSACT2_OPEN", 0,
        { "Flags2=[w]\nMode=[w]\nSearchAttrib=[A]\nAttrib=[A]\nTime=[T2]\nOFun=[w]\nSize=[D]\nRes=([w, w, w, w, w])\nPath=[S]",
-         NULL, 
+         NULL,
          "Handle=[d]\nAttrib=[A]\nTime=[T2]\nSize=[D]\nAccess=[w]\nType=[w]\nState=[w]\nAction=[w]\nInode=[W]\nOffErr=[d]\n|EALength=[d]\n",
-         NULL, NULL }}, 
-    { 1, "TRANSACT2_FINDFIRST", 0, 
-       { NULL, NULL, NULL, NULL, trans2_findfirst }}, 
-    { 2, "TRANSACT2_FINDNEXT", 0, DEFDESCRIPT }, 
-    { 3, "TRANSACT2_QFSINFO", 0, 
-       { NULL, NULL, NULL, NULL, trans2_qfsinfo }}, 
-    { 4, "TRANSACT2_SETFSINFO", 0, DEFDESCRIPT }, 
-    { 5, "TRANSACT2_QPATHINFO", 0, DEFDESCRIPT }, 
-    { 6, "TRANSACT2_SETPATHINFO", 0, DEFDESCRIPT }, 
-    { 7, "TRANSACT2_QFILEINFO", 0, DEFDESCRIPT }, 
-    { 8, "TRANSACT2_SETFILEINFO", 0, DEFDESCRIPT }, 
-    { 9, "TRANSACT2_FSCTL", 0, DEFDESCRIPT }, 
-    { 10, "TRANSACT2_IOCTL", 0, DEFDESCRIPT }, 
-    { 11, "TRANSACT2_FINDNOTIFYFIRST", 0, DEFDESCRIPT }, 
-    { 12, "TRANSACT2_FINDNOTIFYNEXT", 0, DEFDESCRIPT }, 
-    { 13, "TRANSACT2_MKDIR", 0, DEFDESCRIPT }, 
+         NULL, NULL }},
+    { 1, "TRANSACT2_FINDFIRST", 0,
+       { NULL, NULL, NULL, NULL, trans2_findfirst }},
+    { 2, "TRANSACT2_FINDNEXT", 0, DEFDESCRIPT },
+    { 3, "TRANSACT2_QFSINFO", 0,
+       { NULL, NULL, NULL, NULL, trans2_qfsinfo }},
+    { 4, "TRANSACT2_SETFSINFO", 0, DEFDESCRIPT },
+    { 5, "TRANSACT2_QPATHINFO", 0, DEFDESCRIPT },
+    { 6, "TRANSACT2_SETPATHINFO", 0, DEFDESCRIPT },
+    { 7, "TRANSACT2_QFILEINFO", 0, DEFDESCRIPT },
+    { 8, "TRANSACT2_SETFILEINFO", 0, DEFDESCRIPT },
+    { 9, "TRANSACT2_FSCTL", 0, DEFDESCRIPT },
+    { 10, "TRANSACT2_IOCTL", 0, DEFDESCRIPT },
+    { 11, "TRANSACT2_FINDNOTIFYFIRST", 0, DEFDESCRIPT },
+    { 12, "TRANSACT2_FINDNOTIFYNEXT", 0, DEFDESCRIPT },
+    { 13, "TRANSACT2_MKDIR", 0, DEFDESCRIPT },
     { -1, NULL, 0, DEFDESCRIPT }
 };
 
@@ -186,7 +186,7 @@ print_trans2(const uchar *words, const uchar *dat, ...)
            fdata(words + 1,
                "Trans2Secondary\nTotParam=[d]\nTotData=[d]\nParamCnt=[d]\nParamOff=[d]\nParamDisp=[d]\nDataCnt=[d]\nDataOff=[d]\nDataDisp=[d]\nHandle=[d]\n",
                maxbuf);
-           return;         
+           return;
        } else {
            fdata(words + 1,
                "TotParam=[d]\nTotData=[d]\nMaxParam=[d]\nMaxData=[d]\nMaxSetup=[d]\nFlags=[w]\nTimeOut=[D]\nRes1=[w]\nParamCnt=[d]\nParamOff=[d]\nDataCnt=[d]\nDataOff=[d]\nSetupCnt=[d]\n",
@@ -212,7 +212,7 @@ print_trans2(const uchar *words, const uchar *dat, ...)
        fn->descript.fn(param, data, pcnt, dcnt);
     else {
        fdata(param, f1 ? f1 : (uchar *)"Paramaters=\n", param + pcnt);
-       fdata(data, f2 ? f2 : (uchar *)"Data=\n", data + dcnt);      
+       fdata(data, f2 ? f2 : (uchar *)"Data=\n", data + dcnt);
     }
 }
 
@@ -305,384 +305,400 @@ print_ipc(uchar *param, int paramlen, uchar *data, int datalen)
 static void
 print_trans(const uchar *words, const uchar *data1, ...)
 {
-  uchar *f1,*f2,*f3,*f4;
-  uchar *data,*param;
-  int datalen,paramlen;
-  va_list ap;
-  uchar *buf, *maxbuf;
-
-  va_start(ap, data1);
-  buf = va_arg(ap, uchar *);
-  maxbuf = va_arg(ap, uchar *);
-  va_end(ap);
-
-  if (request) {
-    paramlen = SVAL(words+1,9*2);
-    param = buf + SVAL(words+1,10*2);
-    datalen = SVAL(words+1,11*2);
-    data = buf + SVAL(words+1,12*2);
-    f1 = "TotParamCnt=[d] \nTotDataCnt=[d] \nMaxParmCnt=[d] \nMaxDataCnt=[d]\nMaxSCnt=[d] \nTransFlags=[w] \nRes1=[w] \nRes2=[w] \nRes3=[w]\nParamCnt=[d] \nParamOff=[d] \nDataCnt=[d] \nDataOff=[d] \nSUCnt=[d]\n";
-    f2 = "|Name=[S]\n";
-    f3 = "|Param ";
-    f4 = "|Data ";
-  } else {
-    paramlen = SVAL(words+1,3*2);
-    param = buf + SVAL(words+1,4*2);
-    datalen = SVAL(words+1,6*2);
-    data = buf + SVAL(words+1,7*2);
-    f1 = "TotParamCnt=[d] \nTotDataCnt=[d] \nRes1=[d]\nParamCnt=[d] \nParamOff=[d] \nRes2=[d] \nDataCnt=[d] \nDataOff=[d] \nRes3=[d]\nLsetup=[d]\n";
-    f2 = "|Unknown ";
-    f3 = "|Param ";
-    f4 = "|Data ";
-  }
-
-  fdata(words+1,f1,MIN(words+1+2*CVAL(words,0),maxbuf));
-  fdata(data1+2,f2,maxbuf - (paramlen + datalen));
-
-  if (!strcmp(data1+2,"\\MAILSLOT\\BROWSE")) {
-    print_browse(param,paramlen,data,datalen);
-    return;
-  }
-
-  if (!strcmp(data1+2,"\\PIPE\\LANMAN")) {
-    print_ipc(param,paramlen,data,datalen);
-    return;
-  }
-
-  if (paramlen) fdata(param,f3,MIN(param+paramlen,maxbuf));
-  if (datalen) fdata(data,f4,MIN(data+datalen,maxbuf));
-}
-
-
+    uchar *f1, *f2, *f3, *f4;
+    uchar *data, *param;
+    int datalen, paramlen;
+    va_list ap;
+    uchar *buf, *maxbuf;
 
-static void
-print_negprot(const uchar *words, const uchar *data, ...)
-{
-  uchar *f1=NULL,*f2=NULL;
-  va_list ap;
-  uchar *buf, *maxbuf;
-
-  va_start(ap, data);
-  buf = va_arg(ap, uchar *);
-  maxbuf = va_arg(ap, uchar *);
-  va_end(ap);
-
-  if (request) {
-    f2 = "*|Dialect=[Z]\n";
-  } else {
-    if (CVAL(words,0) == 1) {
-      f1 = "Core Protocol\nDialectIndex=[d]";
-    } else if (CVAL(words,0) == 17) {
-      f1 = "NT1 Protocol\nDialectIndex=[d]\nSecMode=[B]\nMaxMux=[d]\nNumVcs=[d]\nMaxBuffer=[D]\nRawSize=[D]\nSessionKey=[W]\nCapabilities=[W]\nServerTime=[T3]TimeZone=[d]\nCryptKey=";
-    } else if (CVAL(words,0) == 13) {
-      f1 = "Coreplus/Lanman1/Lanman2 Protocol\nDialectIndex=[d]\nSecMode=[w]\nMaxXMit=[d]\nMaxMux=[d]\nMaxVcs=[d]\nBlkMode=[w]\nSessionKey=[W]\nServerTime=[T1]TimeZone=[d]\nRes=[W]\nCryptKey=";
-    }
-  }
-
-  if (f1) 
-    fdata(words+1,f1,MIN(words + 1 + CVAL(words,0)*2,maxbuf));
-  else
-    print_data(words+1,MIN(CVAL(words,0)*2,PTR_DIFF(maxbuf,words+1)));
-  
-  if (f2) 
-    fdata(data+2,f2,MIN(data + 2 + SVAL(data,0),maxbuf));
-  else
-    print_data(data+2,MIN(SVAL(data,0),PTR_DIFF(maxbuf,data+2)));
-    
-}
+    va_start(ap, data1);
+    buf = va_arg(ap, uchar *);
+    maxbuf = va_arg(ap, uchar *);
+    va_end(ap);
 
-static void
-print_sesssetup(const uchar *words, const uchar *data, ...)
-{
-  int wcnt = CVAL(words,0);
-  uchar *f1=NULL,*f2=NULL;
-  va_list ap;
-  uchar *buf, *maxbuf;
-
-  va_start(ap, data);
-  buf = va_arg(ap, uchar *);
-  maxbuf = va_arg(ap, uchar *);
-  va_end(ap);
-
-  if (request) {
-    if (wcnt==10) {
-      f1 = "Com2=[w]\nOff2=[d]\nBufSize=[d]\nMpxMax=[d]\nVcNum=[d]\nSessionKey=[W]\nPassLen=[d]\nCryptLen=[d]\nCryptOff=[d]\nPass&Name=\n";
+    if (request) {
+       paramlen = SVAL(words + 1, 9 * 2);
+       param = buf + SVAL(words + 1, 10 * 2);
+       datalen = SVAL(words + 1, 11 * 2);
+       data = buf + SVAL(words + 1, 12 * 2);
+       f1 = "TotParamCnt=[d] \nTotDataCnt=[d] \nMaxParmCnt=[d] \nMaxDataCnt=[d]\nMaxSCnt=[d] \nTransFlags=[w] \nRes1=[w] \nRes2=[w] \nRes3=[w]\nParamCnt=[d] \nParamOff=[d] \nDataCnt=[d] \nDataOff=[d] \nSUCnt=[d]\n";
+       f2 = "|Name=[S]\n";
+       f3 = "|Param ";
+       f4 = "|Data ";
     } else {
-      f1 = "Com2=[B]\nRes1=[B]\nOff2=[d]\nMaxBuffer=[d]\nMaxMpx=[d]\nVcNumber=[d]\nSessionKey=[W]\nCaseInsensitivePasswordLength=[d]\nCaseSensitivePasswordLength=[d]\nRes=[W]\nCapabilities=[W]\nPass1&Pass2&Account&Domain&OS&LanMan=\n";
-    }
-  } else {
-    if (CVAL(words,0) == 3) {
-      f1 = "Com2=[w]\nOff2=[d]\nAction=[w]\n";
-    } else if (CVAL(words,0) == 13) {
-      f1 = "Com2=[B]\nRes=[B]\nOff2=[d]\nAction=[w]\n";
-      f2 = "NativeOS=[S]\nNativeLanMan=[S]\nPrimaryDomain=[S]\n";
+       paramlen = SVAL(words + 1, 3 * 2);
+       param = buf + SVAL(words + 1, 4 * 2);
+       datalen = SVAL(words + 1, 6 * 2);
+       data = buf + SVAL(words + 1, 7 * 2);
+       f1 = "TotParamCnt=[d] \nTotDataCnt=[d] \nRes1=[d]\nParamCnt=[d] \nParamOff=[d] \nRes2=[d] \nDataCnt=[d] \nDataOff=[d] \nRes3=[d]\nLsetup=[d]\n";
+       f2 = "|Unknown ";
+       f3 = "|Param ";
+       f4 = "|Data ";
     }
-  }
-
-  if (f1) 
-    fdata(words+1,f1,MIN(words + 1 + CVAL(words,0)*2,maxbuf));
-  else
-    print_data(words+1,MIN(CVAL(words,0)*2,PTR_DIFF(maxbuf,words+1)));
-  
-  if (f2) 
-    fdata(data+2,f2,MIN(data + 2 + SVAL(data,0),maxbuf));
-  else
-    print_data(data+2,MIN(SVAL(data,0),PTR_DIFF(maxbuf,data+2))); 
-}
 
+    fdata(words + 1, f1, MIN(words + 1 + 2 * CVAL(words, 0), maxbuf));
+    fdata(data1 + 2, f2, maxbuf - (paramlen + datalen));
 
-static struct smbfns smb_fns[] = 
-{
-{-1,"SMBunknown",0,DEFDESCRIPT},
-
-{SMBtcon,"SMBtcon",0,
-   {NULL,"Path=[Z]\nPassword=[Z]\nDevice=[Z]\n",
-    "MaxXmit=[d]\nTreeId=[d]\n",NULL,
-    NULL}},
-
-
-{SMBtdis,"SMBtdis",0,DEFDESCRIPT},
-{SMBexit,"SMBexit",0,DEFDESCRIPT},
-{SMBioctl,"SMBioctl",0,DEFDESCRIPT},
-
-{SMBecho,"SMBecho",0,
-   {"ReverbCount=[d]\n",NULL,
-    "SequenceNum=[d]\n",NULL,
-    NULL}},
-
-{SMBulogoffX, "SMBulogoffX",FLG_CHAIN,DEFDESCRIPT},
+    if (!strcmp(data1 + 2, "\\MAILSLOT\\BROWSE")) {
+       print_browse(param, paramlen, data, datalen);
+       return;
+    }
 
-{SMBgetatr,"SMBgetatr",0,
-   {NULL,"Path=[Z]\n",
-    "Attribute=[A]\nTime=[T2]Size=[D]\nRes=([w,w,w,w,w])\n",NULL,
-    NULL}},
+    if (!strcmp(data1 + 2, "\\PIPE\\LANMAN")) {
+       print_ipc(param, paramlen, data, datalen);
+       return;
+    }
 
-{SMBsetatr,"SMBsetatr",0,
-   {"Attribute=[A]\nTime=[T2]Res=([w,w,w,w,w])\n","Path=[Z]\n",
-    NULL,NULL,NULL}},
+    if (paramlen)
+       fdata(param, f3, MIN(param + paramlen, maxbuf));
+    if (datalen)
+       fdata(data, f4, MIN(data + datalen, maxbuf));
+}
 
-{SMBchkpth,"SMBchkpth",0,
-   {NULL,"Path=[Z]\n",NULL,NULL,NULL}},
 
-{SMBsearch,"SMBsearch",0,
-{"Count=[d]\nAttrib=[A]\n","Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\n",
-"Count=[d]\n","BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n",NULL}},
+static void
+print_negprot(const uchar *words, const uchar *data, ...)
+{
+    uchar *f1 = NULL, *f2 = NULL;
+    va_list ap;
+    uchar *buf, *maxbuf;
 
+    va_start(ap, data);
+    buf = va_arg(ap, uchar *);
+    maxbuf = va_arg(ap, uchar *);
+    va_end(ap);
 
-{SMBopen,"SMBopen",0,
-   {"Mode=[w]\nAttribute=[A]\n","Path=[Z]\n",
-    "Handle=[d]\nOAttrib=[A]\nTime=[T2]Size=[D]\nAccess=[w]\n",NULL,
-    NULL}},
+    if (request)
+       f2 = "*|Dialect=[Z]\n";
+    else {
+       if (CVAL(words, 0) == 1)
+           f1 = "Core Protocol\nDialectIndex=[d]";
+       else if (CVAL(words, 0) == 17)
+           f1 = "NT1 Protocol\nDialectIndex=[d]\nSecMode=[B]\nMaxMux=[d]\nNumVcs=[d]\nMaxBuffer=[D]\nRawSize=[D]\nSessionKey=[W]\nCapabilities=[W]\nServerTime=[T3]TimeZone=[d]\nCryptKey=";
+       else if (CVAL(words, 0) == 13)
+           f1 = "Coreplus/Lanman1/Lanman2 Protocol\nDialectIndex=[d]\nSecMode=[w]\nMaxXMit=[d]\nMaxMux=[d]\nMaxVcs=[d]\nBlkMode=[w]\nSessionKey=[W]\nServerTime=[T1]TimeZone=[d]\nRes=[W]\nCryptKey=";
+    }
 
-{SMBcreate,"SMBcreate",0,
-   {"Attrib=[A]\nTime=[T2]","Path=[Z]\n",
-    "Handle=[d]\n",NULL,
-    NULL}},
+    if (f1)
+       fdata(words + 1, f1, MIN(words + 1 + CVAL(words, 0) * 2, maxbuf));
+    else
+       print_data(words + 1, MIN(CVAL(words, 0) * 2,
+           PTR_DIFF(maxbuf, words + 1)));
 
-{SMBmknew,"SMBmknew",0,
-   {"Attrib=[A]\nTime=[T2]","Path=[Z]\n",
-    "Handle=[d]\n",NULL,
-    NULL}},
+    if (f2)
+       fdata(data + 2, f2, MIN(data + 2 + SVAL(data, 0), maxbuf));
+    else
+       print_data(data + 2, MIN(SVAL(data, 0), PTR_DIFF(maxbuf, data + 2)));
+}
 
-{SMBunlink,"SMBunlink",0,
-   {"Attrib=[A]\n","Path=[Z]\n",NULL,NULL,NULL}},
+static void
+print_sesssetup(const uchar *words, const uchar *data, ...)
+{
+    int wcnt = CVAL(words, 0);
+    uchar *f1 = NULL, *f2 = NULL;
+    va_list ap;
+    uchar *buf, *maxbuf;
 
-{SMBread,"SMBread",0,
-   {"Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n",NULL,
-    "Count=[d]\nRes=([w,w,w,w])\n",NULL,NULL}},
+    va_start(ap, data);
+    buf = va_arg(ap, uchar *);
+    maxbuf = va_arg(ap, uchar *);
+    va_end(ap);
 
-{SMBwrite,"SMBwrite",0,
-   {"Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n",NULL,
-    "Count=[d]\n",NULL,NULL}},
+    if (request) {
+       if (wcnt == 10)
+           f1 = "Com2=[w]\nOff2=[d]\nBufSize=[d]\nMpxMax=[d]\nVcNum=[d]\nSessionKey=[W]\nPassLen=[d]\nCryptLen=[d]\nCryptOff=[d]\nPass&Name=\n";
+       else
+           f1 = "Com2=[B]\nRes1=[B]\nOff2=[d]\nMaxBuffer=[d]\nMaxMpx=[d]\nVcNumber=[d]\nSessionKey=[W]\nCaseInsensitivePasswordLength=[d]\nCaseSensitivePasswordLength=[d]\nRes=[W]\nCapabilities=[W]\nPass1&Pass2&Account&Domain&OS&LanMan=\n";
+    } else {
+       if (CVAL(words,0) == 3) {
+       f1 = "Com2=[w]\nOff2=[d]\nAction=[w]\n";
+       } else if (CVAL(words,0) == 13) {
+       f1 = "Com2=[B]\nRes=[B]\nOff2=[d]\nAction=[w]\n";
+       f2 = "NativeOS=[S]\nNativeLanMan=[S]\nPrimaryDomain=[S]\n";
+       }
+    }
 
-{SMBclose,"SMBclose",0,
-   {"Handle=[d]\nTime=[T2]",NULL,NULL,NULL,NULL}},
+    if (f1)
+       fdata(words + 1, f1, MIN(words + 1 + CVAL(words, 0) * 2, maxbuf));
+    else
+       print_data(words + 1, MIN(CVAL(words, 0) * 2,
+           PTR_DIFF(maxbuf, words + 1)));
 
-{SMBmkdir,"SMBmkdir",0,
-   {NULL,"Path=[Z]\n",NULL,NULL,NULL}},
+    if (f2)
+       fdata(data + 2, f2, MIN(data + 2 + SVAL(data, 0), maxbuf));
+    else
+       print_data(data + 2, MIN(SVAL(data, 0), PTR_DIFF(maxbuf, data+2)));
+}
 
-{SMBrmdir,"SMBrmdir",0,
-   {NULL,"Path=[Z]\n",NULL,NULL,NULL}},
 
-{SMBdskattr,"SMBdskattr",0,
-{NULL,NULL,
-"TotalUnits=[d]\nBlocksPerUnit=[d]\nBlockSize=[d]\nFreeUnits=[d]\nMedia=[w]\n",
-NULL,NULL}},
+static struct smbfns smb_fns[] = {
+    { -1, "SMBunknown", 0, DEFDESCRIPT },
 
-{SMBmv,"SMBmv",0,
-   {"Attrib=[A]\n","OldPath=[Z]\nNewPath=[Z]\n",NULL,NULL,NULL}},
+    { SMBtcon, "SMBtcon", 0,
+       { NULL, "Path=[Z]\nPassword=[Z]\nDevice=[Z]\n",
+         "MaxXmit=[d]\nTreeId=[d]\n", NULL,
+         NULL } },
 
-/* this is a Pathworks specific call, allowing the 
-   changing of the root path */
-{pSETDIR,"SMBsetdir",0,
-   {NULL,"Path=[Z]\n",NULL,NULL,NULL}},
+    { SMBtdis, "SMBtdis", 0, DEFDESCRIPT },
+    { SMBexit,  "SMBexit", 0, DEFDESCRIPT },
+    { SMBioctl, "SMBioctl", 0, DEFDESCRIPT },
 
-{SMBlseek,"SMBlseek",0,
-   {"Handle=[d]\nMode=[w]\nOffset=[D]\n","Offset=[D]\n",NULL,NULL}},
+    { SMBecho, "SMBecho", 0,
+       { "ReverbCount=[d]\n", NULL,
+         "SequenceNum=[d]\n", NULL,
+         NULL } },
 
-{SMBflush,"SMBflush",0,
-   {"Handle=[d]\n",NULL,NULL,NULL,NULL}},
+    { SMBulogoffX, "SMBulogoffX", FLG_CHAIN, DEFDESCRIPT },
 
-{SMBsplopen,"SMBsplopen",0,
-   {"SetupLen=[d]\nMode=[w]\n","Ident=[Z]\n","Handle=[d]\n",NULL,NULL}},
+    { SMBgetatr, "SMBgetatr", 0,
+       { NULL, "Path=[Z]\n",
+         "Attribute=[A]\nTime=[T2]Size=[D]\nRes=([w,w,w,w,w])\n", NULL,
+         NULL } },
 
-{SMBsplclose,"SMBsplclose",0,
-   {"Handle=[d]\n",NULL,NULL,NULL,NULL}},
+    { SMBsetatr, "SMBsetatr", 0,
+       { "Attribute=[A]\nTime=[T2]Res=([w,w,w,w,w])\n", "Path=[Z]\n",
+         NULL, NULL, NULL } },
 
-{SMBsplretq,"SMBsplretq",0,
-   {"MaxCount=[d]\nStartIndex=[d]\n",NULL,
-    "Count=[d]\nIndex=[d]\n",
-    "*Time=[T2]Status=[B]\nJobID=[d]\nSize=[D]\nRes=[B]Name=[s16]\n",
-    NULL}},
+    { SMBchkpth, "SMBchkpth", 0,
+       { NULL, "Path=[Z]\n", NULL, NULL, NULL } },
 
-{SMBsplwr,"SMBsplwr",0,
-   {"Handle=[d]\n",NULL,NULL,NULL,NULL}},
+    { SMBsearch, "SMBsearch", 0,
+       { "Count=[d]\nAttrib=[A]\n",
+         "Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\n",
+         "Count=[d]\n",
+         "BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n",
+         NULL } },
 
-{SMBlock,"SMBlock",0,
-   {"Handle=[d]\nCount=[D]\nOffset=[D]\n",NULL,NULL,NULL,NULL}},
+    { SMBopen, "SMBopen", 0,
+       { "Mode=[w]\nAttribute=[A]\n", "Path=[Z]\n",
+         "Handle=[d]\nOAttrib=[A]\nTime=[T2]Size=[D]\nAccess=[w]\n",
+         NULL, NULL } },
 
-{SMBunlock,"SMBunlock",0,
-   {"Handle=[d]\nCount=[D]\nOffset=[D]\n",NULL,NULL,NULL,NULL}},
+    { SMBcreate, "SMBcreate", 0,
+       { "Attrib=[A]\nTime=[T2]", "Path=[Z]\n", "Handle=[d]\n", NULL, NULL } },
 
-/* CORE+ PROTOCOL FOLLOWS */
+    { SMBmknew, "SMBmknew", 0,
+       { "Attrib=[A]\nTime=[T2]", "Path=[Z]\n", "Handle=[d]\n", NULL, NULL } },
 
-{SMBreadbraw,"SMBreadbraw",0,
-{"Handle=[d]\nOffset=[D]\nMaxCount=[d]\nMinCount=[d]\nTimeOut=[D]\nRes=[d]\n",
- NULL,NULL,NULL,NULL}},
+    { SMBunlink, "SMBunlink", 0,
+       { "Attrib=[A]\n", "Path=[Z]\n", NULL, NULL, NULL } },
 
-{SMBwritebraw,"SMBwritebraw",0,
-{"Handle=[d]\nTotalCount=[d]\nRes=[w]\nOffset=[D]\nTimeOut=[D]\nWMode=[w]\nRes2=[W]\n|DataSize=[d]\nDataOff=[d]\n",
-NULL,"WriteRawAck",NULL,NULL}},
+    { SMBread, "SMBread", 0,
+       { "Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n", NULL,
+         "Count=[d]\nRes=([w,w,w,w])\n", NULL, NULL } },
 
-{SMBwritec,"SMBwritec",0,
-   {NULL,NULL,"Count=[d]\n",NULL,NULL}},
+    { SMBwrite, "SMBwrite", 0,
+       { "Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n", NULL,
+         "Count=[d]\n", NULL, NULL } },
 
-{SMBwriteclose,"SMBwriteclose",0,
-   {"Handle=[d]\nCount=[d]\nOffset=[D]\nTime=[T2]Res=([w,w,w,w,w,w])",NULL,
-    "Count=[d]\n",NULL,NULL}},
+    { SMBclose, "SMBclose", 0,
+       { "Handle=[d]\nTime=[T2]", NULL, NULL, NULL, NULL } },
 
-{SMBlockread,"SMBlockread",0,
-   {"Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n",NULL,
-    "Count=[d]\nRes=([w,w,w,w])\n",NULL,NULL}},
+    { SMBmkdir, "SMBmkdir", 0,
+       { NULL, "Path=[Z]\n", NULL, NULL, NULL } },
 
-{SMBwriteunlock,"SMBwriteunlock",0,
-   {"Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n",NULL,
-    "Count=[d]\n",NULL,NULL}},
+    { SMBrmdir, "SMBrmdir", 0,
+       { NULL, "Path=[Z]\n", NULL, NULL, NULL } },
 
-{SMBreadBmpx,"SMBreadBmpx",0,
-{"Handle=[d]\nOffset=[D]\nMaxCount=[d]\nMinCount=[d]\nTimeOut=[D]\nRes=[w]\n",
-NULL,
-"Offset=[D]\nTotCount=[d]\nRemaining=[d]\nRes=([w,w])\nDataSize=[d]\nDataOff=[d]\n",
-NULL,NULL}},
+    { SMBdskattr, "SMBdskattr", 0,
+       { NULL, NULL,
+         "TotalUnits=[d]\nBlocksPerUnit=[d]\nBlockSize=[d]\nFreeUnits=[d]\nMedia=[w]\n",
+         NULL, NULL } },
 
-{SMBwriteBmpx,"SMBwriteBmpx",0,
-{"Handle=[d]\nTotCount=[d]\nRes=[w]\nOffset=[D]\nTimeOut=[D]\nWMode=[w]\nRes2=[W]\nDataSize=[d]\nDataOff=[d]\n",NULL,
-"Remaining=[d]\n",NULL,NULL}},
+    { SMBmv, "SMBmv", 0,
+       { "Attrib=[A]\n", "OldPath=[Z]\nNewPath=[Z]\n", NULL, NULL, NULL } },
 
-{SMBwriteBs,"SMBwriteBs",0,
-   {"Handle=[d]\nTotCount=[d]\nOffset=[D]\nRes=[W]\nDataSize=[d]\nDataOff=[d]\n",NULL,
-    "Count=[d]\n",NULL,NULL}},
+    /*
+     * this is a Pathworks specific call, allowing the
+     * changing of the root path
+     */
+    { pSETDIR, "SMBsetdir", 0, { NULL, "Path=[Z]\n", NULL, NULL, NULL } },
 
-{SMBsetattrE,"SMBsetattrE",0,
-   {"Handle=[d]\nCreationTime=[T2]AccessTime=[T2]ModifyTime=[T2]",NULL,
-      NULL,NULL,NULL}},
+    { SMBlseek, "SMBlseek", 0,
+       { "Handle=[d]\nMode=[w]\nOffset=[D]\n", "Offset=[D]\n", NULL, NULL } },
 
-{SMBgetattrE,"SMBgetattrE",0,
-{"Handle=[d]\n",NULL,
- "CreationTime=[T2]AccessTime=[T2]ModifyTime=[T2]Size=[D]\nAllocSize=[D]\nAttribute=[A]\n",NULL,NULL}},
+    { SMBflush, "SMBflush", 0, { "Handle=[d]\n", NULL, NULL, NULL, NULL } },
 
-{SMBtranss,"SMBtranss",0,DEFDESCRIPT},
-{SMBioctls,"SMBioctls",0,DEFDESCRIPT},
+    { SMBsplopen, "SMBsplopen", 0,
+       { "SetupLen=[d]\nMode=[w]\n", "Ident=[Z]\n", "Handle=[d]\n",
+         NULL, NULL } },
 
-{SMBcopy,"SMBcopy",0,
-   {"TreeID2=[d]\nOFun=[w]\nFlags=[w]\n","Path=[S]\nNewPath=[S]\n",
-    "CopyCount=[d]\n","|ErrStr=[S]\n",NULL}},
+    { SMBsplclose, "SMBsplclose", 0,
+       { "Handle=[d]\n", NULL, NULL, NULL, NULL } },
 
-{SMBmove,"SMBmove",0,
-   {"TreeID2=[d]\nOFun=[w]\nFlags=[w]\n","Path=[S]\nNewPath=[S]\n",
-    "MoveCount=[d]\n","|ErrStr=[S]\n",NULL}},
+    { SMBsplretq, "SMBsplretq", 0,
+       { "MaxCount=[d]\nStartIndex=[d]\n", NULL,
+         "Count=[d]\nIndex=[d]\n",
+         "*Time=[T2]Status=[B]\nJobID=[d]\nSize=[D]\nRes=[B]Name=[s16]\n",
+         NULL } },
+
+    { SMBsplwr, "SMBsplwr", 0,
+       { "Handle=[d]\n", NULL, NULL, NULL, NULL } },
+
+    { SMBlock, "SMBlock", 0,
+       { "Handle=[d]\nCount=[D]\nOffset=[D]\n", NULL, NULL, NULL, NULL } },
+
+    { SMBunlock, "SMBunlock", 0,
+       { "Handle=[d]\nCount=[D]\nOffset=[D]\n", NULL, NULL, NULL, NULL } },
+
+    /* CORE+ PROTOCOL FOLLOWS */
+
+    { SMBreadbraw, "SMBreadbraw", 0,
+       { "Handle=[d]\nOffset=[D]\nMaxCount=[d]\nMinCount=[d]\nTimeOut=[D]\nRes=[d]\n",
+         NULL, NULL, NULL, NULL } },
+
+    { SMBwritebraw, "SMBwritebraw", 0,
+       { "Handle=[d]\nTotalCount=[d]\nRes=[w]\nOffset=[D]\nTimeOut=[D]\nWMode=[w]\nRes2=[W]\n|DataSize=[d]\nDataOff=[d]\n",
+         NULL, "WriteRawAck", NULL, NULL } },
+
+    { SMBwritec, "SMBwritec", 0,
+       { NULL, NULL, "Count=[d]\n", NULL, NULL } },
+
+    { SMBwriteclose, "SMBwriteclose", 0,
+       { "Handle=[d]\nCount=[d]\nOffset=[D]\nTime=[T2]Res=([w,w,w,w,w,w])",
+         NULL, "Count=[d]\n", NULL, NULL } },
+
+    { SMBlockread, "SMBlockread", 0,
+       { "Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n", NULL,
+         "Count=[d]\nRes=([w,w,w,w])\n", NULL, NULL } },
 
-{SMBopenX,"SMBopenX",FLG_CHAIN,
-{"Com2=[w]\nOff2=[d]\nFlags=[w]\nMode=[w]\nSearchAttrib=[A]\nAttrib=[A]\nTime=[T2]OFun=[w]\nSize=[D]\nTimeOut=[D]\nRes=[W]\n","Path=[S]\n",
-"Com2=[w]\nOff2=[d]\nHandle=[d]\nAttrib=[A]\nTime=[T2]Size=[D]\nAccess=[w]\nType=[w]\nState=[w]\nAction=[w]\nFileID=[W]\nRes=[w]\n",NULL,NULL}},
+    { SMBwriteunlock, "SMBwriteunlock", 0,
+       { "Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n", NULL,
+         "Count=[d]\n", NULL, NULL } },
 
-{SMBreadX,"SMBreadX",FLG_CHAIN,
-{"Com2=[w]\nOff2=[d]\nHandle=[d]\nOffset=[D]\nMaxCount=[d]\nMinCount=[d]\nTimeOut=[D]\nCountLeft=[d]\n",NULL,
-"Com2=[w]\nOff2=[d]\nRemaining=[d]\nRes=[W]\nDataSize=[d]\nDataOff=[d]\nRes=([w,w,w,w])\n",NULL,NULL}},
+    { SMBreadBmpx, "SMBreadBmpx", 0,
+       { "Handle=[d]\nOffset=[D]\nMaxCount=[d]\nMinCount=[d]\nTimeOut=[D]\nRes=[w]\n",
+         NULL,
+         "Offset=[D]\nTotCount=[d]\nRemaining=[d]\nRes=([w,w])\nDataSize=[d]\nDataOff=[d]\n",
+         NULL, NULL } },
 
-{SMBwriteX,"SMBwriteX",FLG_CHAIN,
-{"Com2=[w]\nOff2=[d]\nHandle=[d]\nOffset=[D]\nTimeOut=[D]\nWMode=[w]\nCountLeft=[d]\nRes=[w]\nDataSize=[d]\nDataOff=[d]\n",NULL,
-"Com2=[w]\nOff2=[d]\nCount=[d]\nRemaining=[d]\nRes=[W]\n",NULL,NULL}},
+    { SMBwriteBmpx, "SMBwriteBmpx", 0,
+       { "Handle=[d]\nTotCount=[d]\nRes=[w]\nOffset=[D]\nTimeOut=[D]\nWMode=[w]\nRes2=[W]\nDataSize=[d]\nDataOff=[d]\n", NULL,
+         "Remaining=[d]\n", NULL, NULL } },
 
-{SMBlockingX,"SMBlockingX",FLG_CHAIN,
-{"Com2=[w]\nOff2=[d]\nHandle=[d]\nLockType=[w]\nTimeOut=[D]\nUnlockCount=[d]\nLockCount=[d]\n",
-"*Process=[d]\nOffset=[D]\nLength=[D]\n",
-"Com2=[w]\nOff2=[d]\n"}},
+    { SMBwriteBs, "SMBwriteBs", 0,
+       { "Handle=[d]\nTotCount=[d]\nOffset=[D]\nRes=[W]\nDataSize=[d]\nDataOff=[d]\n",
+         NULL, "Count=[d]\n", NULL, NULL } },
 
-{SMBffirst,"SMBffirst",0,
-{"Count=[d]\nAttrib=[A]\n","Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\n",
-"Count=[d]\n","BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n",NULL}},
+    { SMBsetattrE, "SMBsetattrE", 0,
+       { "Handle=[d]\nCreationTime=[T2]AccessTime=[T2]ModifyTime=[T2]", NULL,
+         NULL, NULL, NULL } },
 
-{SMBfunique,"SMBfunique",0,
-{"Count=[d]\nAttrib=[A]\n","Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\n",
-"Count=[d]\n","BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n",NULL}},
+    { SMBgetattrE, "SMBgetattrE", 0,
+       { "Handle=[d]\n", NULL,
+         "CreationTime=[T2]AccessTime=[T2]ModifyTime=[T2]Size=[D]\nAllocSize=[D]\nAttribute=[A]\n",
+         NULL, NULL } },
 
-{SMBfclose,"SMBfclose",0,
-{"Count=[d]\nAttrib=[A]\n","Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\n",
-"Count=[d]\n","BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n",NULL}},
+    { SMBtranss, "SMBtranss", 0, DEFDESCRIPT },
+    { SMBioctls, "SMBioctls", 0, DEFDESCRIPT },
 
-{SMBfindnclose, "SMBfindnclose", 0,
-   {"Handle=[d]\n",NULL,NULL,NULL,NULL}},
+    { SMBcopy, "SMBcopy", 0,
+       { "TreeID2=[d]\nOFun=[w]\nFlags=[w]\n", "Path=[S]\nNewPath=[S]\n",
+         "CopyCount=[d]\n",  "|ErrStr=[S]\n",  NULL } },
 
-{SMBfindclose, "SMBfindclose", 0,
-   {"Handle=[d]\n",NULL,NULL,NULL,NULL}},
+    { SMBmove, "SMBmove", 0,
+       { "TreeID2=[d]\nOFun=[w]\nFlags=[w]\n", "Path=[S]\nNewPath=[S]\n",
+         "MoveCount=[d]\n",  "|ErrStr=[S]\n",  NULL } },
 
-{SMBsends,"SMBsends",0,
-   {NULL,"Source=[Z]\nDest=[Z]\n",NULL,NULL,NULL}},
+    { SMBopenX, "SMBopenX", FLG_CHAIN,
+       { "Com2=[w]\nOff2=[d]\nFlags=[w]\nMode=[w]\nSearchAttrib=[A]\nAttrib=[A]\nTime=[T2]OFun=[w]\nSize=[D]\nTimeOut=[D]\nRes=[W]\n",
+         "Path=[S]\n",
+         "Com2=[w]\nOff2=[d]\nHandle=[d]\nAttrib=[A]\nTime=[T2]Size=[D]\nAccess=[w]\nType=[w]\nState=[w]\nAction=[w]\nFileID=[W]\nRes=[w]\n",
+         NULL, NULL } },
 
-{SMBsendstrt,"SMBsendstrt",0,
-   {NULL,"Source=[Z]\nDest=[Z]\n","GroupID=[d]\n",NULL,NULL}},
-   
-{SMBsendend,"SMBsendend",0,
-   {"GroupID=[d]\n",NULL,NULL,NULL,NULL}},
+    { SMBreadX, "SMBreadX", FLG_CHAIN,
+       { "Com2=[w]\nOff2=[d]\nHandle=[d]\nOffset=[D]\nMaxCount=[d]\nMinCount=[d]\nTimeOut=[D]\nCountLeft=[d]\n",
+         NULL,
+         "Com2=[w]\nOff2=[d]\nRemaining=[d]\nRes=[W]\nDataSize=[d]\nDataOff=[d]\nRes=([w,w,w,w])\n",
+         NULL, NULL } },
 
-{SMBsendtxt,"SMBsendtxt",0,
-   {"GroupID=[d]\n",NULL,NULL,NULL,NULL}},
+    { SMBwriteX, "SMBwriteX", FLG_CHAIN,
+       { "Com2=[w]\nOff2=[d]\nHandle=[d]\nOffset=[D]\nTimeOut=[D]\nWMode=[w]\nCountLeft=[d]\nRes=[w]\nDataSize=[d]\nDataOff=[d]\n",
+         NULL,
+         "Com2=[w]\nOff2=[d]\nCount=[d]\nRemaining=[d]\nRes=[W]\n",
+         NULL, NULL } },
 
-{SMBsendb,"SMBsendb",0,
-   {NULL,"Source=[Z]\nDest=[Z]\n",NULL,NULL,NULL}},
+    { SMBlockingX, "SMBlockingX", FLG_CHAIN,
+       { "Com2=[w]\nOff2=[d]\nHandle=[d]\nLockType=[w]\nTimeOut=[D]\nUnlockCount=[d]\nLockCount=[d]\n",
+         "*Process=[d]\nOffset=[D]\nLength=[D]\n",
+         "Com2=[w]\nOff2=[d]\n", NULL, NULL } },
 
-{SMBfwdname,"SMBfwdname",0,DEFDESCRIPT},
-{SMBcancelf,"SMBcancelf",0,DEFDESCRIPT},
-{SMBgetmac,"SMBgetmac",0,DEFDESCRIPT},
+    { SMBffirst, "SMBffirst", 0,
+       { "Count=[d]\nAttrib=[A]\n",
+         "Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\n",
+         "Count=[d]\n",
+         "BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n",
+         NULL } },
 
-{SMBnegprot,"SMBnegprot",0,
-   {NULL,NULL,NULL,NULL,print_negprot}},
+    { SMBfunique, "SMBfunique", 0,
+       { "Count=[d]\nAttrib=[A]\n",
+         "Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\n",
+         "Count=[d]\n",
+         "BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n",
+         NULL } },
 
-{SMBsesssetupX,"SMBsesssetupX",FLG_CHAIN,
-   {NULL,NULL,NULL,NULL,print_sesssetup}},
+    { SMBfclose, "SMBfclose", 0,
+       { "Count=[d]\nAttrib=[A]\n",
+         "Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\n",
+         "Count=[d]\n",
+         "BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n",
+         NULL } },
+
+    { SMBfindnclose, "SMBfindnclose", 0,
+       { "Handle=[d]\n", NULL, NULL, NULL, NULL } },
 
-{SMBtconX,"SMBtconX",FLG_CHAIN,
-{"Com2=[w]\nOff2=[d]\nFlags=[w]\nPassLen=[d]\nPasswd&Path&Device=\n",NULL,
- "Com2=[w]\nOff2=[d]\n","ServiceType=[S]\n",NULL}},
+    { SMBfindclose, "SMBfindclose", 0,
+       { "Handle=[d]\n", NULL, NULL, NULL, NULL } },
+
+    { SMBsends, "SMBsends", 0,
+       { NULL, "Source=[Z]\nDest=[Z]\n", NULL, NULL, NULL } },
+
+    { SMBsendstrt, "SMBsendstrt", 0,
+       { NULL, "Source=[Z]\nDest=[Z]\n", "GroupID=[d]\n", NULL, NULL } },
+
+    { SMBsendend, "SMBsendend", 0,
+       { "GroupID=[d]\n", NULL, NULL, NULL, NULL } },
+
+    { SMBsendtxt, "SMBsendtxt", 0,
+       { "GroupID=[d]\n", NULL, NULL, NULL, NULL } },
+
+    { SMBsendb, "SMBsendb", 0,
+       { NULL, "Source=[Z]\nDest=[Z]\n", NULL, NULL, NULL } },
+
+    { SMBfwdname, "SMBfwdname", 0, DEFDESCRIPT },
+    { SMBcancelf, "SMBcancelf", 0, DEFDESCRIPT },
+    { SMBgetmac, "SMBgetmac", 0, DEFDESCRIPT },
+
+    { SMBnegprot, "SMBnegprot", 0,
+       { NULL, NULL, NULL, NULL, print_negprot } },
 
-{SMBtrans2, "SMBtrans2",0,{NULL,NULL,NULL,NULL,print_trans2}},
+    { SMBsesssetupX, "SMBsesssetupX", FLG_CHAIN,
+       { NULL, NULL, NULL, NULL, print_sesssetup } },
 
-{SMBtranss2, "SMBtranss2", 0,DEFDESCRIPT},
-{SMBctemp,"SMBctemp",0,DEFDESCRIPT},
-{SMBreadBs,"SMBreadBs",0,DEFDESCRIPT},
-{SMBtrans,"SMBtrans",0,{NULL,NULL,NULL,NULL,print_trans}},
+    { SMBtconX, "SMBtconX", FLG_CHAIN,
+       { "Com2=[w]\nOff2=[d]\nFlags=[w]\nPassLen=[d]\nPasswd&Path&Device=\n",
+         NULL, "Com2=[w]\nOff2=[d]\n", "ServiceType=[S]\n", NULL } },
 
-{SMBnttrans,"SMBnttrans", 0, DEFDESCRIPT},
-{SMBnttranss,"SMBnttranss", 0, DEFDESCRIPT},
+    { SMBtrans2, "SMBtrans2", 0, { NULL, NULL, NULL, NULL, print_trans2 } },
+
+    { SMBtranss2, "SMBtranss2", 0, DEFDESCRIPT },
+    { SMBctemp, "SMBctemp", 0, DEFDESCRIPT },
+    { SMBreadBs, "SMBreadBs", 0, DEFDESCRIPT },
+    { SMBtrans, "SMBtrans", 0, { NULL, NULL, NULL, NULL, print_trans } },
+
+    { SMBnttrans, "SMBnttrans", 0, DEFDESCRIPT },
+    { SMBnttranss, "SMBnttranss", 0, DEFDESCRIPT },
 
-{SMBntcreateX,"SMBntcreateX", FLG_CHAIN, 
-{"Com2=[w]\nOff2=[d]\nRes=[b]\nNameLen=[d]\nFlags=[W]\nRootDirectoryFid=[D]\nAccessMask=[W]\nAllocationSize=[L]\nExtFileAttributes=[W]\nShareAccess=[W]\nCreateDisposition=[W]\nCreateOptions=[W]\nImpersonationLevel=[W]\nSecurityFlags=[b]\n","Path=[S]\n",
-        "Com2=[w]\nOff2=[d]\nOplockLevel=[b]\nFid=[d]\nCreateAction=[W]\nCreateTime=[T3]LastAccessTime=[T3]LastWriteTime=[T3]ChangeTime=[T3]ExtFileAttributes=[W]\nAllocationSize=[L]\nEndOfFile=[L]\nFileType=[w]\nDeviceState=[w]\nDirectory=[b]\n", NULL}},
+    { SMBntcreateX, "SMBntcreateX", FLG_CHAIN,
+       { "Com2=[w]\nOff2=[d]\nRes=[b]\nNameLen=[d]\nFlags=[W]\nRootDirectoryFid=[D]\nAccessMask=[W]\nAllocationSize=[L]\nExtFileAttributes=[W]\nShareAccess=[W]\nCreateDisposition=[W]\nCreateOptions=[W]\nImpersonationLevel=[W]\nSecurityFlags=[b]\n",
+         "Path=[S]\n",
+         "Com2=[w]\nOff2=[d]\nOplockLevel=[b]\nFid=[d]\nCreateAction=[W]\nCreateTime=[T3]LastAccessTime=[T3]LastWriteTime=[T3]ChangeTime=[T3]ExtFileAttributes=[W]\nAllocationSize=[L]\nEndOfFile=[L]\nFileType=[w]\nDeviceState=[w]\nDirectory=[b]\n",
+         NULL } },
 
-{SMBntcancel,"SMBntcancel", 0, DEFDESCRIPT},
+    { SMBntcancel, "SMBntcancel", 0, DEFDESCRIPT },
 
-{-1,NULL,0,DEFDESCRIPT}};
+    { -1, NULL, 0, DEFDESCRIPT }
+};
 
 
 /*
@@ -778,7 +794,7 @@ print_smb(const uchar *buf, const uchar *maxbuf)
            words = data = NULL;
     }
 
-    printf("\n");  
+    printf("\n");
 }
 
 
@@ -807,9 +823,9 @@ nbt_tcp_print(const uchar *data, int length)
     printf("\n");
 
     switch (flags) {
-    case 1:    
+    case 1:
        printf("flags=0x%x\n", flags);
-    case 0:    
+    case 0:
        data = fdata(data, "NBT Session Packet\nFlags=[rw]\nLength=[rd]\n",
            data + 4);
        if (data == NULL)
@@ -840,21 +856,21 @@ nbt_tcp_print(const uchar *data, int length)
            data = fdata(data, "NBT SessionReject\nFlags=[rW]\nReason=[B]\n",
                maxbuf);
            switch (ecode) {
-           case 0x80: 
-               printf("Not listening on called name\n"); 
+           case 0x80:
+               printf("Not listening on called name\n");
                break;
-           case 0x81: 
-               printf("Not listening for calling name\n"); 
+           case 0x81:
+               printf("Not listening for calling name\n");
                break;
-           case 0x82: 
-               printf("Called name not present\n"); 
+           case 0x82:
+               printf("Called name not present\n");
                break;
-           case 0x83: 
-               printf("Called name present, but insufficient resources\n"); 
+           case 0x83:
+               printf("Called name present, but insufficient resources\n");
                break;
            default:
-               printf("Unspecified error 0x%X\n", ecode); 
-               break;    
+               printf("Unspecified error 0x%X\n", ecode);
+               break;
            }
          }
            break;
@@ -878,137 +894,144 @@ nbt_tcp_print(const uchar *data, int length)
 void
 nbt_udp137_print(const uchar *data, int length)
 {
-  const uchar *maxbuf = data + length;
-  int name_trn_id = RSVAL(data,0);
-  int response = (CVAL(data,2)>>7);
-  int opcode = (CVAL(data,2) >> 3) & 0xF;
-  int nm_flags = ((CVAL(data,2) & 0x7) << 4) + (CVAL(data,3)>>4);
-  int rcode = CVAL(data,3) & 0xF;
-  int qdcount = RSVAL(data,4);
-  int ancount = RSVAL(data,6);
-  int nscount = RSVAL(data,8);
-  int arcount = RSVAL(data,10);
-  char *opcodestr;  
-  const char *p;
-
-  startbuf = data;
-
-  if (maxbuf <= data) return;
-
-  if (vflag > 1)
-    printf("\n>>> ");
-
-  printf("NBT UDP PACKET(137): ");
-
-  switch (opcode) {
-  case 0: opcodestr = "QUERY"; break;
-  case 5: opcodestr = "REGISTRATION"; break;
-  case 6: opcodestr = "RELEASE"; break;
-  case 7: opcodestr = "WACK"; break;
-  case 8: opcodestr = "REFRESH(8)"; break;
-  case 9: opcodestr = "REFRESH"; break;
-  default: opcodestr = "OPUNKNOWN"; break;
-  }
-  printf("%s", opcodestr);
-  if (response) {
-    if (rcode)
-      printf("; NEGATIVE");
+    const uchar *maxbuf = data + length;
+    int name_trn_id = RSVAL(data, 0);
+    int response = (CVAL(data, 2) >> 7);
+    int opcode = (CVAL(data, 2) >> 3) & 0xF;
+    int nm_flags = ((CVAL(data, 2) & 0x7) << 4) + (CVAL(data, 3) >> 4);
+    int rcode = CVAL(data, 3) & 0xF;
+    int qdcount = RSVAL(data, 4);
+    int ancount = RSVAL(data, 6);
+    int nscount = RSVAL(data, 8);
+    int arcount = RSVAL(data, 10);
+    char *opcodestr;
+    const char *p;
+    int total, i;
+
+    startbuf = data;
+
+    if (maxbuf <= data)
+       return;
+
+    if (vflag > 1)
+       printf("\n>>> ");
+
+    printf("NBT UDP PACKET(137): ");
+
+    switch (opcode) {
+    case 0: opcodestr = "QUERY"; break;
+    case 5: opcodestr = "REGISTRATION"; break;
+    case 6: opcodestr = "RELEASE"; break;
+    case 7: opcodestr = "WACK"; break;
+    case 8: opcodestr = "REFRESH(8)"; break;
+    case 9: opcodestr = "REFRESH"; break;
+    default: opcodestr = "OPUNKNOWN"; break;
+    }
+    printf("%s", opcodestr);
+    if (response) {
+       if (rcode)
+           printf("; NEGATIVE");
+       else
+           printf("; POSITIVE");
+    }
+
+    if (response)
+       printf("; RESPONSE");
     else
-      printf("; POSITIVE");
-  }
-    
-  if (response) 
-    printf("; RESPONSE");
-  else
-    printf("; REQUEST");
-
-  if (nm_flags&1)
-    printf("; BROADCAST");
-  else
-    printf("; UNICAST");
-  
-  if (vflag < 2)
-    return;
-
-  printf("\nTrnID=0x%X\nOpCode=%d\nNmFlags=0x%X\nRcode=%d\nQueryCount=%d\nAnswerCount=%d\nAuthorityCount=%d\nAddressRecCount=%d\n",
-        name_trn_id,opcode,nm_flags,rcode,qdcount,ancount,nscount,arcount);
-
-  p = data + 12;
-
-  {
-    int total = ancount+nscount+arcount;
-    int i;
+       printf("; REQUEST");
 
-    if (qdcount>100 || total>100) {
-      printf("Corrupt packet??\n");
-      return;
+    if (nm_flags & 1)
+       printf("; BROADCAST");
+    else
+       printf("; UNICAST");
+
+    if (vflag < 2)
+       return;
+
+    printf("\nTrnID=0x%X\nOpCode=%d\nNmFlags=0x%X\nRcode=%d\nQueryCount=%d\nAnswerCount=%d\nAuthorityCount=%d\nAddressRecCount=%d\n",
+       name_trn_id, opcode, nm_flags, rcode, qdcount, ancount, nscount,
+       arcount);
+
+    p = data + 12;
+
+    total = ancount + nscount + arcount;
+
+    if (qdcount > 100 || total > 100) {
+       printf("Corrupt packet??\n");
+       return;
     }
 
     if (qdcount) {
-      printf("QuestionRecords:\n");
-      for (i=0;i<qdcount;i++)
-       p = fdata(p,"|Name=[n1]\nQuestionType=[rw]\nQuestionClass=[rw]\n#",maxbuf);
+       printf("QuestionRecords:\n");
+       for (i = 0; i < qdcount; i++)
+           p = fdata(p,
+               "|Name=[n1]\nQuestionType=[rw]\nQuestionClass=[rw]\n#",
+               maxbuf);
        if (p == NULL)
-         goto out;
+           goto out;
     }
 
     if (total) {
-      printf("\nResourceRecords:\n");
-      for (i=0;i<total;i++) {    
-       int rdlen;
-       int restype;
-       p = fdata(p,"Name=[n1]\n#",maxbuf);
-       if (p == NULL)
-         goto out;
-       restype = RSVAL(p,0);
-       p = fdata(p,"ResType=[rw]\nResClass=[rw]\nTTL=[rD]\n",p+8);
-       if (p == NULL)
-         goto out;
-       rdlen = RSVAL(p,0);
-       printf("ResourceLength=%d\nResourceData=\n",rdlen);
-       p += 2;
-       if (rdlen == 6) {
-         p = fdata(p,"AddrType=[rw]\nAddress=[b.b.b.b]\n",p+rdlen);
-         if (p == NULL)
-           goto out;
-       } else {
-         if (restype == 0x21) {
-           int numnames = CVAL(p,0);
-           p = fdata(p,"NumNames=[B]\n",p+1);
+       printf("\nResourceRecords:\n");
+       for (i = 0; i < total; i++) {
+           int rdlen;
+           int restype;
+
+           p = fdata(p, "Name=[n1]\n#", maxbuf);
+           if (p == NULL)
+               goto out;
+           restype = RSVAL(p, 0);
+           p = fdata(p, "ResType=[rw]\nResClass=[rw]\nTTL=[rD]\n", p + 8);
            if (p == NULL)
-             goto out;
-           while (numnames--) {
-             p = fdata(p,"Name=[n2]\t#",maxbuf);
-             if (p[0] & 0x80) printf("<GROUP> ");
-             switch (p[0] & 0x60) {
-             case 0x00: printf("B "); break;
-             case 0x20: printf("P "); break;
-             case 0x40: printf("M "); break;
-             case 0x60: printf("_ "); break;
-             }
-             if (p[0] & 0x10) printf("<DEREGISTERING> ");
-             if (p[0] & 0x08) printf("<CONFLICT> ");
-             if (p[0] & 0x04) printf("<ACTIVE> ");
-             if (p[0] & 0x02) printf("<PERMANENT> ");
-             printf("\n");
-             p += 2;
+               goto out;
+           rdlen = RSVAL(p, 0);
+           printf("ResourceLength=%d\nResourceData=\n", rdlen);
+           p += 2;
+           if (rdlen == 6) {
+               p = fdata(p, "AddrType=[rw]\nAddress=[b.b.b.b]\n", p + rdlen);
+               if (p == NULL)
+                   goto out;
+           } else {
+               if (restype == 0x21) {
+                   int numnames = CVAL(p, 0);
+                   p = fdata(p, "NumNames=[B]\n", p + 1);
+                   if (p == NULL)
+                       goto out;
+                   while (numnames--) {
+                       p = fdata(p, "Name=[n2]\t#", maxbuf);
+                       if (p[0] & 0x80)
+                           printf("<GROUP> ");
+                       switch (p[0] & 0x60) {
+                       case 0x00: printf("B "); break;
+                       case 0x20: printf("P "); break;
+                       case 0x40: printf("M "); break;
+                       case 0x60: printf("_ "); break;
+                       }
+                       if (p[0] & 0x10)
+                           printf("<DEREGISTERING> ");
+                       if (p[0] & 0x08)
+                           printf("<CONFLICT> ");
+                       if (p[0] & 0x04)
+                           printf("<ACTIVE> ");
+                       if (p[0] & 0x02)
+                           printf("<PERMANENT> ");
+                       printf("\n");
+                       p += 2;
+                   }
+               } else {
+                   print_data(p, min(rdlen, length - ((const uchar *)p - data)));
+                   p += rdlen;
+               }
            }
-         } else {
-           print_data(p, min(rdlen, length - ((const uchar *)p - data)));
-           p += rdlen;
-         }
        }
-      }
     }
-  }
 
-  if ((uchar*)p < maxbuf) {
-    fdata(p,"AdditionalData:\n",maxbuf);    
-  }      
-  
+    if ((uchar*)p < maxbuf)
+       fdata(p, "AdditionalData:\n", maxbuf);
+
 out:
-  printf("\n");
-  fflush(stdout);
+    printf("\n");
+    fflush(stdout);
 }
 
 
@@ -1016,142 +1039,161 @@ out:
 /*
  * print a NBT packet received across udp on port 138
  */
-void nbt_udp138_print(const uchar *data, int length)
+void
+nbt_udp138_print(const uchar *data, int length)
 {
-  const uchar *maxbuf = data + length;
+    const uchar *maxbuf = data + length;
 
-  if (maxbuf > snapend) maxbuf = snapend;
-  if (maxbuf <= data) return;
-  startbuf = data;
+    if (maxbuf > snapend)
+       maxbuf = snapend;
+    if (maxbuf <= data)
+       return;
+    startbuf = data;
 
-  if (vflag < 2) {
-    printf("NBT UDP PACKET(138)");
-    return;
-  }
+    if (vflag < 2) {
+       printf("NBT UDP PACKET(138)");
+       return;
+    }
 
-  data = fdata(data,"\n>>> NBT UDP PACKET(138) Res=[rw] ID=[rw] IP=[b.b.b.b] Port=[rd] Length=[rd] Res2=[rw]\nSourceName=[n1]\nDestName=[n1]\n#",maxbuf);
+    data = fdata(data,
+       "\n>>> NBT UDP PACKET(138) Res=[rw] ID=[rw] IP=[b.b.b.b] Port=[rd] Length=[rd] Res2=[rw]\nSourceName=[n1]\nDestName=[n1]\n#",
+       maxbuf);
 
-  if (data != NULL)
-    print_smb(data,maxbuf);
-  
-  printf("\n");
-  fflush(stdout);
-}
+    if (data != NULL)
+       print_smb(data, maxbuf);
 
+    printf("\n");
+    fflush(stdout);
+}
 
 
 /*
-   print netbeui frames 
+   print netbeui frames
 */
-void netbeui_print(u_short control, const uchar *data, int length)
+void
+netbeui_print(u_short control, const uchar *data, int length)
 {
-  const uchar *maxbuf = data + length;
-  int len;
-  int command;
-  const uchar *data2;
-  int is_truncated = 0;
-
-  if (maxbuf > snapend)
-    maxbuf = snapend;
-  if (&data[7] >= maxbuf)
-    goto out;
-  len = SVAL(data,0);
-  command = CVAL(data,4);
-  data2 = data + len;
-  if (data2 >= maxbuf) {
-    data2 = maxbuf;
-    is_truncated = 1;
-  }
-
-  startbuf = data;
-
-  if (vflag < 2) {
-    printf("NetBeui Packet");
-    return;
-  }
-
-  printf("\n>>> NetBeui Packet\nType=0x%X ", control);
-  data = fdata(data,"Length=[d] Signature=[w] Command=[B]\n#",maxbuf);
-  if (data == NULL)
-    goto out;
-
-  switch (command) {
-  case 0xA: 
-    data = fdata(data,"NameQuery:[P1]\nSessionNumber=[B]\nNameType=[B][P2]\nResponseCorrelator=[w]\nDestination=[n2]\nSource=[n2]\n",data2);
-    break;
-
-  case 0x8:
-    data = fdata(data,"NetbiosDataGram:[P7]\nDestination=[n2]\nSource=[n2]\n",data2);
-    break;
-
-  case 0xE:
-    data = fdata(data,"NameRecognise:\n[P1]\nData2=[w]\nTransmitCorrelator=[w]\nResponseCorelator=[w]\nDestination=[n2]\nSource=[n2]\n",data2);
-    break;
-
-  case 0x19:
-    data = fdata(data,"SessionInitialise:\nData1=[B]\nData2=[w]\nTransmitCorrelator=[w]\nResponseCorelator=[w]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n",data2);
-    break;
-
-  case 0x17:
-    data = fdata(data,"SessionConfirm:\nData1=[B]\nData2=[w]\nTransmitCorrelator=[w]\nResponseCorelator=[w]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n",data2);
-    break;
-
-  case 0x16:
-    data = fdata(data,"NetbiosDataOnlyLast:\nFlags=[{|NO_ACK|PIGGYBACK_ACK_ALLOWED|PIGGYBACK_ACK_INCLUDED|}]\nResyncIndicator=[w][P2]\nResponseCorelator=[w]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n",data2);
-    break;
-
-  case 0x14:
-    data = fdata(data,"NetbiosDataAck:\n[P3]TransmitCorrelator=[w][P2]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n",data2);
-    break;
-
-  case 0x18:
-    data = fdata(data,"SessionEnd:\n[P1]Data2=[w][P4]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n",data2);
-    break;
-
-  case 0x1f:
-    data = fdata(data,"SessionAlive\n",data2);
-    break;
-
-  default:
-    data = fdata(data,"Unknown Netbios Command ",data2);
-    break;
-  }
-  if (data == NULL)
-    goto out;
-
-  if (is_truncated) {
-    /* data2 was past the end of the buffer */
-    goto out;
-  }
-
-  /* If there isn't enough data for "\377SMB", don't look for it. */
-  if (&data2[3] >= maxbuf)
-    goto out;
-
-  if (memcmp(data2,"\377SMB",4)==0) {
-    print_smb(data2,maxbuf);
-  } else {
-    int i;
-    for (i=0;i<128;i++) {
-      if (&data2[i+3] >= maxbuf)
-        break;
-      if (memcmp(&data2[i],"\377SMB",4)==0) {
-       printf("found SMB packet at %d\n", i);
-       print_smb(&data2[i],maxbuf);
+    const uchar *maxbuf = data + length;
+    int len;
+    int command;
+    const uchar *data2;
+    int is_truncated = 0;
+
+    if (maxbuf > snapend)
+       maxbuf = snapend;
+    if (&data[7] >= maxbuf)
+       goto out;
+    len = SVAL(data,0);
+    command = CVAL(data,4);
+    data2 = data + len;
+    if (data2 >= maxbuf) {
+       data2 = maxbuf;
+       is_truncated = 1;
+    }
+
+    startbuf = data;
+
+    if (vflag < 2) {
+       printf("NetBeui Packet");
+       return;
+    }
+
+    printf("\n>>> NetBeui Packet\nType=0x%X ", control);
+    data = fdata(data, "Length=[d] Signature=[w] Command=[B]\n#", maxbuf);
+    if (data == NULL)
+       goto out;
+
+    switch (command) {
+    case 0xA:
+       data = fdata(data, "NameQuery:[P1]\nSessionNumber=[B]\nNameType=[B][P2]\nResponseCorrelator=[w]\nDestination=[n2]\nSource=[n2]\n", data2);
+       break;
+
+    case 0x8:
+       data = fdata(data,
+           "NetbiosDataGram:[P7]\nDestination=[n2]\nSource=[n2]\n", data2);
+       break;
+
+    case 0xE:
+       data = fdata(data,
+           "NameRecognise:\n[P1]\nData2=[w]\nTransmitCorrelator=[w]\nResponseCorelator=[w]\nDestination=[n2]\nSource=[n2]\n",
+           data2);
+       break;
+
+    case 0x19:
+       data = fdata(data,
+           "SessionInitialise:\nData1=[B]\nData2=[w]\nTransmitCorrelator=[w]\nResponseCorelator=[w]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n",
+           data2);
+       break;
+
+    case 0x17:
+       data = fdata(data,
+           "SessionConfirm:\nData1=[B]\nData2=[w]\nTransmitCorrelator=[w]\nResponseCorelator=[w]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n",
+           data2);
+       break;
+
+    case 0x16:
+       data = fdata(data,
+           "NetbiosDataOnlyLast:\nFlags=[{|NO_ACK|PIGGYBACK_ACK_ALLOWED|PIGGYBACK_ACK_INCLUDED|}]\nResyncIndicator=[w][P2]\nResponseCorelator=[w]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n",
+           data2);
+       break;
+
+    case 0x14:
+       data = fdata(data,
+           "NetbiosDataAck:\n[P3]TransmitCorrelator=[w][P2]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n",
+           data2);
+       break;
+
+    case 0x18:
+       data = fdata(data,
+           "SessionEnd:\n[P1]Data2=[w][P4]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n",
+           data2);
        break;
-      }
+
+    case 0x1f:
+       data = fdata(data, "SessionAlive\n", data2);
+       break;
+
+    default:
+       data = fdata(data, "Unknown Netbios Command ", data2);
+       break;
+    }
+    if (data == NULL)
+       goto out;
+
+    if (is_truncated) {
+       /* data2 was past the end of the buffer */
+       goto out;
+    }
+
+    /* If there isn't enough data for "\377SMB", don't look for it. */
+    if (&data2[3] >= maxbuf)
+       goto out;
+
+    if (memcmp(data2, "\377SMB",4) == 0)
+       print_smb(data2, maxbuf);
+    else {
+       int i;
+       for (i = 0; i < 128; i++) {
+           if (&data2[i + 3] >= maxbuf)
+               break;
+           if (memcmp(&data2[i], "\377SMB", 4) == 0) {
+               printf("found SMB packet at %d\n", i);
+               print_smb(&data2[i], maxbuf);
+               break;
+           }
+       }
     }
-  }
 
 out:
-  printf("\n");
+    printf("\n");
 }
 
 
 /*
- * print IPX-Netbios frames 
+ * print IPX-Netbios frames
  */
-void ipx_netbios_print(const uchar *data, u_int length)
+void
+ipx_netbios_print(const uchar *data, u_int length)
 {
     /*
      * this is a hack till I work out how to parse the rest of the