Revert SVN #52665.
authorBill Meier <wmeier@newsguy.com>
Fri, 18 Oct 2013 04:31:08 +0000 (04:31 -0000)
committerBill Meier <wmeier@newsguy.com>
Fri, 18 Oct 2013 04:31:08 +0000 (04:31 -0000)
Compilation fails on (only the ?) OSX-10.6-x64 buildbot with error:

netscaler.c: In function 'nstrace_read_v30':
netscaler.c:1295: warning: implicit conversion shortens 64-bit value into a 32-bit value

(Life is too short for me to dig multiple levels deep into a set of macros to try to see which
 actual line of code is causing the problem.  Maybe the patch submitter can identify the problem).

svn path=/trunk/; revision=52666

AUTHORS
epan/dissectors/packet-nstrace.c
wiretap/file_access.c
wiretap/netscaler.c
wiretap/netscaler.h
wiretap/wtap.c
wiretap/wtap.h

diff --git a/AUTHORS b/AUTHORS
index 05e6b763faabee4903aa096867eec0de0264f974..8fe3021a0e75b32047be6a624ef581c50bcbf502 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -3777,7 +3777,6 @@ Hannes Hofer              <hhofer[AT]barracuda.com>
 Luca Coelho            <luca[AT]coelho.fi>
 Masayuki Takemura      <masayuki.takemura[AT]gmail.com>
 Ed Beroset             <beroset[AT]mindspring.com>
-Shekhar Chandra                <shekhar.chandra[AT]citrix.com>
 
 Dan Lasley <dlasley[AT]promus.com> gave permission for his
 dumpit() hex-dump routine to be used.
index b6115847b3c206640d71624f53fe524c4d445a7e..d7a5c7c710af1c7bec7266d3fe3f9238501ccfa5 100644 (file)
@@ -67,13 +67,10 @@ static gint ett_ns_activity_flags = -1;
 static const value_string ns_dir_vals[] = {
        { NSPR_PDPKTRACEFULLTX_V10,    "TX" },
        { NSPR_PDPKTRACEFULLTX_V20,    "TX" },
-       { NSPR_PDPKTRACEFULLTX_V30,    "TX" },
        { NSPR_PDPKTRACEFULLTXB_V10,   "TXB" },
        { NSPR_PDPKTRACEFULLTXB_V20,   "TXB" },
-       { NSPR_PDPKTRACEFULLTXB_V30,   "TXB" },
        { NSPR_PDPKTRACEFULLRX_V10,    "RX" },
        { NSPR_PDPKTRACEFULLRX_V20,    "RX" },
-       { NSPR_PDPKTRACEFULLRX_V30,    "RX" },
        { NSPR_PDPKTRACEPARTTX_V10,    "TX"  },
        { NSPR_PDPKTRACEPARTTX_V20,    "TX" },
        { NSPR_PDPKTRACEPARTTXB_V10,   "TXB" },
@@ -104,7 +101,6 @@ static const value_string ns_dir_vals[] = {
        { NSPR_PDPKTRACEFULLNEWRX_V24, "NEW_RX" },
        { NSPR_PDPKTRACEFULLNEWRX_V25, "NEW_RX" },
        { NSPR_PDPKTRACEFULLNEWRX_V26, "NEW_RX" },
-       { NSPR_PDPKTRACEFULLNEWRX_V30, "NEW_RX" },
        { NSPR_PDPKTRACEPARTTX_V22,    "TX" },
        { NSPR_PDPKTRACEPARTTX_V23,    "TX" },
        { NSPR_PDPKTRACEPARTTX_V24,    "TX" },
@@ -160,7 +156,7 @@ dissect_nstrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        wmem_strbuf_append(flags_strbuf, "None");
 
-       if (pnstr->rec_type == NSPR_HEADER_VERSION205 || pnstr->rec_type == NSPR_HEADER_VERSION300 || pnstr->rec_type == NSPR_HEADER_VERSION206)
+       if (pnstr->rec_type == NSPR_HEADER_VERSION205)
                {
                src_vmname_len = tvb_get_guint8(tvb,pnstr->src_vmname_len_offset);
                dst_vmname_len = tvb_get_guint8(tvb,pnstr->dst_vmname_len_offset);
@@ -176,7 +172,6 @@ dissect_nstrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        switch (pnstr->rec_type)
        {
-       case NSPR_HEADER_VERSION300:
        case NSPR_HEADER_VERSION206:
                flagoffset = pnstr->ns_activity_offset;
                flagval32 = tvb_get_letohl(tvb, flagoffset);
@@ -433,5 +428,4 @@ void proto_reg_handoff_ns(void)
        nstrace_handle = create_dissector_handle(dissect_nstrace, proto_nstrace);
        dissector_add_uint("wtap_encap", WTAP_ENCAP_NSTRACE_1_0, nstrace_handle);
        dissector_add_uint("wtap_encap", WTAP_ENCAP_NSTRACE_2_0, nstrace_handle);
-       dissector_add_uint("wtap_encap", WTAP_ENCAP_NSTRACE_3_0, nstrace_handle);
 }
index a65fd108c959a7a1d0b47cadd9a81f41d4e2c868..3134332b8630b0f742c3419a1d070ac9e5323be8 100644 (file)
@@ -972,12 +972,7 @@ static const struct file_type_info dump_open_table_base[] = {
        /* WTAP_FILE_STANAG_4607 */
        { "STANAG 4607 Format", "stanag4607", NULL, NULL,
          FALSE, FALSE, 0,
-         NULL, NULL },
-
-       /* WTAP_FILE_NETSCALER_3_0 */
-       { "NetScaler Trace (Version 3.0)", "nstrace30", "cap", NULL,
-         TRUE, FALSE, 0,
-         nstrace_30_dump_can_write_encap, nstrace_dump_open }
+         NULL, NULL }
 
 };
 
index 82db34fe3ea415c5484fbd1547d58f89c1ccfa94..64afb855f794349a4b1d8e23a14116c685ffd132 100644 (file)
@@ -36,7 +36,6 @@
 /* Defined but not used */
 #define NSPR_SIGSTR_V21 "NetScaler V21 Performance Data"
 #define NSPR_SIGSTR_V22 "NetScaler V22 Performance Data"
-#define NSPR_SIGSTR_V30 "Netscaler V30 Performance Data"
 
 /*
  * NetScaler trace files are divided into 8K pages, with each page
@@ -52,7 +51,6 @@
  * other than the type and zero or more additional padding bytes).
  */
 #define NSPR_PAGESIZE   8192
-#define NSPR_PAGESIZE_TRACE (2*NSPR_PAGESIZE)
 
 /* The different record types
 ** NOTE: The Record Type is two byte fields and unused space is recognized by
@@ -113,7 +111,6 @@ typedef struct nspr_header_v10
                                    /* end of declaration */
 #define NSPR_HEADER3B_V21 NSPR_HEADER3B_V20
 #define NSPR_HEADER3B_V22 NSPR_HEADER3B_V20
-#define NSPR_HEADER3B_V30 NSPR_HEADER3B_V20
 
 typedef struct nspr_hd_v20
 {
@@ -299,22 +296,22 @@ typedef struct nspr_pktracefull_v25
 /* New full packet trace structure v26 for vm info tracing */
 typedef struct nspr_pktracefull_v26
 {
-    NSPR_HEADER3B_V22(fp);     /* long performance header */
-    guint8 fp_DevNo;           /* Network Device (NIC) number */
-    guint8 fp_AbsTimeHr[8];    /* High resolution absolute time in nanosec */
-    guint8 fp_PcbDevNo[4];     /* PCB devno */
-    guint8 fp_lPcbDevNo[4];    /* link PCB devno */
-    guint8 fp_VlanTag[2];      /* vlan tag */
-    guint8 fp_Coreid[2];       /* coreid of the packet */
-    guint8 fp_srcNodeId[2];    /* source node # */
-    guint8 fp_destNodeId[2];   /* destination node # */
-    guint8 fp_clFlags;         /* cluster flags */
-    guint8 fp_src_vmname_len;  /* vm src info */
-    guint8 fp_dst_vmname_len;  /* vm src info */
+    NSPR_HEADER3B_V22(fp);    /* long performance header */
+    guint8 fp_DevNo;          /* Network Device (NIC) number */
+    guint8 fp_AbsTimeHr[8];   /* High resolution absolute time in nanosec */
+    guint8 fp_PcbDevNo[4];    /* PCB devno */
+    guint8 fp_lPcbDevNo[4];   /* link PCB devno */
+    guint8 fp_VlanTag[2];     /* vlan tag */
+    guint8 fp_Coreid[2];      /* coreid of the packet */
+    guint8 fp_srcNodeId[2];   /* source node # */
+    guint8 fp_destNodeId[2];  /* destination node # */
+    guint8 fp_clFlags;        /* cluster flags */
+    guint8 fp_src_vmname_len; /* vm src info */
+    guint8 fp_dst_vmname_len; /* vm src info */
     guint8 fp_reserved;
     guint8 fp_ns_activity[4];
     guint8 fp_reserved_32[12]; /* Adding more field to reduce wireshark changes every time */
-    guint8 fp_Data[4];         /* packet data starts here */
+       guint8 fp_Data[4];     /* packet data starts here */
 } nspr_pktracefull_v26_t;
 #define nspr_pktracefull_v26_s    ((guint32)(sizeof(nspr_pktracefull_v26_t) - 4))
 
@@ -427,53 +424,27 @@ typedef struct nspr_pktracepart_v25
 #define pp_src_vmname    pp_Data
 #define pp_dst_vmname    pp_Data
 
-
-/* New full packet trace structure v30 for multipage spanning data */
-typedef struct  nspr_pktracefull_v30
-{
-    NSPR_HEADER3B_V30(fp);      /* long performance header */
-    guint8 fp_DevNo;            /* Network Device (NIC) number */
-    guint8 fp_AbsTimeHr[8];     /* High resolution absolute time in nanosec*/
-    guint8 fp_PcbDevNo[4];      /* PCB devno */
-    guint8 fp_lPcbDevNo[4];     /* link PCB devno */
-    guint8 fp_PktSizeOrg[2];    /* Original packet size */
-    guint8 fp_VlanTag[2];       /* vlan tag */
-    guint8 fp_Coreid[2];        /* coreid of the packet */
-    guint8 fp_srcNodeId[2];     /* cluster nodeid of the packet */
-    guint8 fp_destNodeId[2];
-    guint8 fp_clFlags;
-    guint8 fp_src_vmname_len;
-    guint8 fp_dst_vmname_len;
-    guint8 fp_reserved[3];
-    guint8 fp_ns_activity[4];
-    guint8 fp_reserved_32[12];
-    guint8 fp_Data[0];          /* packet data starts here */
-} nspr_pktracefull_v30_t;
-#define nspr_pktracefull_v30_s  (sizeof(nspr_pktracefull_v30_t))
-#define fp_src_vmname   fp_Data
-#define fp_dst_vmname   fp_Data
-
 /* New partial packet trace structure v26 for vm info tracing */
 typedef struct nspr_pktracepart_v26
 {
-    NSPR_HEADER3B_V22(pp);      /* long performance header */
-    guint8 pp_DevNo;            /* Network Device (NIC) number */
-    guint8 pp_AbsTimeHr[8];     /* High resolution absolute time in nanosec*/
-    guint8 pp_PktSizeOrg[2];    /* Original packet size */
-    guint8 pp_PktOffset[2];     /* starting offset in packet */
-    guint8 pp_PcbDevNo[4];      /* PCB devno */
-    guint8 pp_lPcbDevNo[4];     /* link PCB devno */
-    guint8 pp_VlanTag[2];       /* vlan tag */
-    guint8 pp_Coreid[2];        /* Coreid of the packet */
-    guint8 pp_srcNodeId[2];     /* source node # */
-    guint8 pp_destNodeId[2];    /* destination node # */
-    guint8 pp_clFlags;          /* cluster flags */
-    guint8 pp_src_vmname_len;   /* vm info */
-    guint8 pp_dst_vmname_len;   /* vm info */
+    NSPR_HEADER3B_V22(pp);    /* long performance header */
+    guint8 pp_DevNo;          /* Network Device (NIC) number */
+    guint8 pp_AbsTimeHr[8];   /*High resolution absolute time in nanosec*/
+    guint8 pp_PktSizeOrg[2];  /* Original packet size */
+    guint8 pp_PktOffset[2];   /* starting offset in packet */
+    guint8 pp_PcbDevNo[4];    /* PCB devno */
+    guint8 pp_lPcbDevNo[4];   /* link PCB devno */
+    guint8 pp_VlanTag[2];     /* vlan tag */
+    guint8 pp_Coreid[2];      /* Coreid of the packet */
+    guint8 pp_srcNodeId[2];   /* source node # */
+    guint8 pp_destNodeId[2];  /* destination node # */
+    guint8 pp_clFlags;        /* cluster flags */
+    guint8 pp_src_vmname_len; /* vm info */
+    guint8 pp_dst_vmname_len; /* vm info */
     guint8 pp_reserved;
     guint8 pp_ns_activity[4];
-    guint8 pp_reserved_32[12];  /* Adding more field to reduce wireshark changes every time */
-    guint8 pp_Data[4];          /* packet data starts here */
+    guint8 pp_reserved_32[12]; /* Adding more field to reduce wireshark changes every time */
+    guint8 pp_Data[4];        /* packet data starts here */
 } nspr_pktracepart_v26_t;
 #define nspr_pktracepart_v26_s    ((guint32)(sizeof(nspr_pktracepart_v26_t) -4))
 
@@ -501,7 +472,7 @@ typedef struct nspr_pktracepart_v26
 #define TRACE_FULL_V10_REC_LEN_OFF(phdr,enumprefix,structprefix,structname) \
     (phdr)->len = pletohs(&(fp)->nsprRecordSize);\
     (phdr)->caplen = (phdr)->len;\
-    TRACE_V10_REC_LEN_OFF(phdr,enumprefix,structprefix,structname)
+    TRACE_V10_REC_LEN_OFF(phdr,enumprefix,structprefix,structname)        
 
 #define TRACE_PART_V10_REC_LEN_OFF(phdr,enumprefix,structprefix,structname) \
     (phdr)->presence_flags |= WTAP_HAS_CAP_LEN;\
@@ -540,15 +511,11 @@ typedef struct nspr_pktracepart_v26
     __TNO(phdr,enumprefix,structprefix,structname,src_vmname_len,src_vmname_len)\
     __TNO(phdr,enumprefix,structprefix,structname,dst_vmname_len,dst_vmname_len)\
     __TNO(phdr,enumprefix,structprefix,structname,data,Data)
-
-
+    
 #define TRACE_V26_REC_LEN_OFF(phdr,enumprefix,structprefix,structname) \
     TRACE_V25_REC_LEN_OFF(phdr,enumprefix,structprefix,structname)\
     __TNO(phdr,enumprefix,structprefix,structname,ns_activity,ns_activity)\
-
-#define TRACE_V30_REC_LEN_OFF(phdr, enumprefix, structprefix, structname) \
-    TRACE_V26_REC_LEN_OFF(phdr,enumprefix,structprefix,structname)      \
-
+    
     TRACE_V10_REC_LEN_OFF(NULL,v10_part,pp,pktracepart_v10)
     TRACE_V10_REC_LEN_OFF(NULL,v10_full,fp,pktracefull_v10)
     TRACE_V20_REC_LEN_OFF(NULL,v20_part,pp,pktracepart_v20)
@@ -565,7 +532,6 @@ typedef struct nspr_pktracepart_v26
     TRACE_V25_REC_LEN_OFF(NULL,v25_full,fp,pktracefull_v25)
     TRACE_V26_REC_LEN_OFF(NULL,v26_part,pp,pktracepart_v26)
     TRACE_V26_REC_LEN_OFF(NULL,v26_full,fp,pktracefull_v26)
-    TRACE_V30_REC_LEN_OFF(NULL,v30_full,fp,pktracefull_v30)
 
 #undef __TNV1O
 #undef __TNV1L
@@ -609,8 +575,6 @@ static gboolean nstrace_read_v10(wtap *wth, int *err, gchar **err_info,
                                  gint64 *data_offset);
 static gboolean nstrace_read_v20(wtap *wth, int *err, gchar **err_info,
                                  gint64 *data_offset);
-static gboolean nstrace_read_v30(wtap *wth, int *err, gchar **err_info,
-                                 gint64 *data_offset);
 static gboolean nstrace_seek_read_v10(wtap *wth, gint64 seek_off,
                                       struct wtap_pkthdr *phdr,
                                       Buffer *buf, int length,
@@ -619,10 +583,6 @@ static gboolean nstrace_seek_read_v20(wtap *wth, gint64 seek_off,
                                       struct wtap_pkthdr *phdr,
                                       Buffer *buf, int length,
                                       int *err, gchar **err_info);
-static gboolean nstrace_seek_read_v30(wtap *wth, gint64 seek_off,
-                                      struct wtap_pkthdr *phdr,
-                                      Buffer *buf, int length,
-                                      int *err, gchar **err_info);
 static void nstrace_close(wtap *wth);
 
 static gboolean nstrace_set_start_time_v10(wtap *wth);
@@ -639,14 +599,14 @@ static gboolean nstrace_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
  * the last page of a file can be short.
  */
 #define GET_READ_PAGE_SIZE(remaining_file_size) ((gint32)((remaining_file_size>NSPR_PAGESIZE)?NSPR_PAGESIZE:remaining_file_size))
-#define GET_READ_PAGE_SIZEV3(remaining_file_size) ((gint32)((remaining_file_size>NSPR_PAGESIZE_TRACE)?NSPR_PAGESIZE_TRACE:remaining_file_size))
+
 
 static guint64 ns_hrtime2nsec(guint32 tm)
 {
     guint32    val = tm & NSPR_HRTIME_MASKTM;
     switch(tm & NSPR_HRTIME_MASKFMT)
     {
-    case NSPR_HRTIME_SEC:     return (guint64)val*1000000000;
+    case NSPR_HRTIME_SEC:    return (guint64)val*1000000000;
     case NSPR_HRTIME_MSEC:    return (guint64)val*1000000;
     case NSPR_HRTIME_USEC:    return (guint64)val*1000;
     case NSPR_HRTIME_NSEC:    return val;
@@ -684,13 +644,6 @@ int nstrace_open(wtap *wth, int *err, gchar **err_info)
         wth->file_encap = WTAP_ENCAP_NSTRACE_2_0;
         break;
 
-    case WTAP_FILE_NETSCALER_3_0:
-        wth->file_encap = WTAP_ENCAP_NSTRACE_3_0;
-        g_free(nstrace_buf);
-        nstrace_buf = (gchar *)g_malloc(NSPR_PAGESIZE_TRACE);
-        page_size = GET_READ_PAGE_SIZEV3(file_size);
-        break;
-
     default:
         *err = WTAP_ERR_UNSUPPORTED;
         *err_info = g_strdup_printf("nstrace: file type %d unsupported", wth->file_type);
@@ -726,11 +679,6 @@ int nstrace_open(wtap *wth, int *err, gchar **err_info)
         wth->subtype_read = nstrace_read_v20;
         wth->subtype_seek_read = nstrace_seek_read_v20;
         break;
-
-    case WTAP_FILE_NETSCALER_3_0:
-        wth->subtype_read = nstrace_read_v30;
-        wth->subtype_seek_read = nstrace_seek_read_v30;
-        break;
     }
     wth->subtype_close = nstrace_close;
 
@@ -789,7 +737,6 @@ int nstrace_open(wtap *wth, int *err, gchar **err_info)
 
 nspm_signature_func(10)
 nspm_signature_func(20)
-nspm_signature_func(30)
 
 /*
 ** Check signature and return the version number of the signature.
@@ -819,13 +766,9 @@ nspm_signature_version(wtap *wth, gchar *nstrace_buf, gint32 len)
 #define sigv20p    ((nspr_signature_v20_t*)dp)
             if ((sigv20p->sig_RecordType == NSPR_SIGNATURE_V20) &&
                 (sigv20p->sig_RecordSize <= len) &&
-                ((gint32)sizeof(NSPR_SIGSTR_V20) <= len))
-            {
-                if (!nspm_signature_isv20(sigv20p->sig_Signature))
-                    return WTAP_FILE_NETSCALER_2_0;
-                else if (!nspm_signature_isv30(sigv20p->sig_Signature))
-                    return WTAP_FILE_NETSCALER_3_0;
-            }
+                ((gint32)sizeof(NSPR_SIGSTR_V20) <= len) &&
+                (!nspm_signature_isv20(sigv20p->sig_Signature)))
+                return WTAP_FILE_NETSCALER_2_0;
 #undef    sigv20p
         }
     }
@@ -896,8 +839,7 @@ static gboolean nstrace_set_start_time(wtap *wth)
         return nstrace_set_start_time_v10(wth);
     else if (wth->file_type == WTAP_FILE_NETSCALER_2_0)
         return nstrace_set_start_time_v20(wth);
-    else if (wth->file_type == WTAP_FILE_NETSCALER_3_0)
-        return nstrace_set_start_time_v20(wth);
+
     return FALSE;
 }
 
@@ -1048,17 +990,6 @@ static gboolean nstrace_read_v10(wtap *wth, int *err, gchar **err_info, gint64 *
 #define TIMEDEFV24(fp,type) TIMEDEFV23(fp,type)
 #define TIMEDEFV25(fp,type) TIMEDEFV24(fp,type)
 #define TIMEDEFV26(fp,type) TIMEDEFV24(fp,type)
-
-#define TIMEDEFV30(fp,type) \
-    do {                                                        \
-        wth->phdr.presence_flags |= WTAP_HAS_TS;                \
-        /* access _AbsTimeHr as a 64bit value */                \
-        nsg_creltime = pletohll(fp->type##_AbsTimeHr);                  \
-        wth->phdr.ts.secs = (guint32) (nsg_creltime / 1000000000);      \
-        wth->phdr.ts.nsecs = (guint32) (nsg_creltime % 1000000000);     \
-    }while(0)
-
-
 #define PPSIZEDEFV20(phdr,pp,ver) \
     do {\
         (phdr)->presence_flags |= WTAP_HAS_CAP_LEN;\
@@ -1086,16 +1017,6 @@ static gboolean nstrace_read_v10(wtap *wth, int *err, gchar **err_info, gint64 *
 #define FPSIZEDEFV25(phdr,fp,ver) FPSIZEDEFV20(phdr,fp,ver)
 #define FPSIZEDEFV26(phdr,fp,ver) FPSIZEDEFV20(phdr,fp,ver)
 
-#define FPSIZEDEFV30(phdr,fp,ver)\
-    do {\
-        (phdr)->len = pletohs(&fp->fp_PktSizeOrg) + nspr_pktracefull_v##ver##_s;\
-        (phdr)->caplen = nspr_getv20recordsize((nspr_hd_v20_t *)fp);\
-        if ((phdr)->len != (phdr)->caplen)\
-            {\
-            (phdr)->presence_flags |= WTAP_HAS_CAP_LEN;\
-        }\
-        }while(0)
-
 #define PACKET_DESCRIBE(phdr,FPTIMEDEF,SIZEDEF,ver,enumprefix,type,structname,TYPE)\
     do {\
         nspr_##structname##_t *fp= (nspr_##structname##_t*)&nstrace_buf[nstrace_buf_offset];\
@@ -1221,112 +1142,6 @@ static gboolean nstrace_read_v20(wtap *wth, int *err, gchar **err_info, gint64 *
 
 #undef PACKET_DESCRIBE
 
-#define PACKET_DESCRIBE(phdr,FPTIMEDEF,SIZEDEF,ver,enumprefix,type,structname,TYPE)\
-    do {\
-    nspr_##structname##_t *fp = (nspr_##structname##_t *) &nstrace_buf[nstrace_buf_offset];\
-    TIMEDEFV##ver(fp,type);\
-    SIZEDEF##ver((phdr),fp,ver);\
-    TRACE_V##ver##_REC_LEN_OFF((phdr),enumprefix,type,structname);\
-    (phdr)->pseudo_header.nstr.rec_type = NSPR_HEADER_VERSION##TYPE;\
-    buffer_assure_space(wth->frame_buffer, (phdr)->caplen);\
-    *data_offset = nstrace->xxx_offset + nstrace_buf_offset;\
-    while (nstrace_tmpbuff_off < nspr_##structname##_s) {\
-        nstrace_tmpbuff[nstrace_tmpbuff_off++] = nstrace_buf[nstrace_buf_offset++];\
-    }\
-    nst_dataSize = nspr_getv20recordsize(hdp);\
-    rec_size = nst_dataSize - nstrace_tmpbuff_off;\
-    nsg_nextPageOffset = ((nstrace_buf_offset + rec_size) >= NSPR_PAGESIZE_TRACE) ?\
-    ((nstrace_buf_offset + rec_size) - (NSPR_PAGESIZE_TRACE - 1)) : 0;\
-    while (nsg_nextPageOffset) {\
-        while (nstrace_buf_offset < NSPR_PAGESIZE_TRACE) {\
-            nstrace_tmpbuff[nstrace_tmpbuff_off++] = nstrace_buf[nstrace_buf_offset++];\
-        }\
-        nstrace_buflen = NSPR_PAGESIZE_TRACE;\
-        nstrace->xxx_offset += nstrace_buflen;\
-        bytes_read = file_read(nstrace_buf, NSPR_PAGESIZE_TRACE, wth->fh);\
-        if (bytes_read != NSPR_PAGESIZE_TRACE) {\
-            return FALSE;\
-        } else {\
-            nstrace_buf_offset = 0;\
-        }\
-        rec_size = nst_dataSize - nstrace_tmpbuff_off;\
-        nsg_nextPageOffset = ((nstrace_buf_offset + rec_size) >= NSPR_PAGESIZE_TRACE) ?\
-        ((nstrace_buf_offset + rec_size) - (NSPR_PAGESIZE_TRACE- 1)): 0;\
-    } \
-    while (nstrace_tmpbuff_off < nst_dataSize) {\
-        nstrace_tmpbuff[nstrace_tmpbuff_off++] = nstrace_buf[nstrace_buf_offset++];\
-    }\
-    memcpy(buffer_start_ptr(wth->frame_buffer), nstrace_tmpbuff, (phdr)->caplen);\
-    nstrace->nstrace_buf_offset = nstrace_buf_offset;\
-    nstrace->nstrace_buflen = nstrace_buflen = NSPR_PAGESIZE_TRACE;\
-    nstrace->nsg_creltime = nsg_creltime;\
-    return TRUE;\
-} while(0)
-
-static gboolean nstrace_read_v30(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
-{
-    nstrace_t *nstrace = (nstrace_t *)wth->priv;
-    guint64 nsg_creltime = nstrace->nsg_creltime;
-    gchar *nstrace_buf = nstrace->pnstrace_buf;
-    gint32 nstrace_buf_offset = nstrace->nstrace_buf_offset;
-    gint32 nstrace_buflen = nstrace->nstrace_buflen;
-    guint8 nstrace_tmpbuff[65536];
-    guint32 nstrace_tmpbuff_off=0,nst_dataSize=0,rec_size=0,nsg_nextPageOffset=0;
-    nspr_hd_v20_t *hdp;
-    int bytes_read;
-    *err = 0;
-    *err_info = NULL;
-
-    do
-    {
-        while ((nstrace_buf_offset < NSPR_PAGESIZE_TRACE) &&
-            nstrace_buf[nstrace_buf_offset])
-        {
-            hdp = (nspr_hd_v20_t *) &nstrace_buf[nstrace_buf_offset];
-            switch (hdp->phd_RecordType)
-            {
-            #define GENERATE_CASE_V30(phdr,type,acttype) \
-        case NSPR_PDPKTRACEFULLTX_V##type:\
-        case NSPR_PDPKTRACEFULLTXB_V##type:\
-        case NSPR_PDPKTRACEFULLRX_V##type:\
-        case NSPR_PDPKTRACEFULLNEWRX_V##type:\
-        PACKET_DESCRIBE(phdr, TIMEDEF, FPSIZEDEFV,type,v##type##_full,fp,pktracefull_v##type,acttype);
-
-            GENERATE_CASE_V30(&wth->phdr,30, 300);
-            #undef GENERATE_CASE_V30
-
-
-                case NSPR_ABSTIME_V20:
-                {
-                    nstrace_buf_offset += nspr_getv20recordsize(hdp);
-                    ns_setabstime(nstrace, pletohl(&((nspr_abstime_v20_t *) &nstrace_buf[nstrace_buf_offset])->abs_Time), pletohs(&((nspr_abstime_v20_t *) &nstrace_buf[nstrace_buf_offset])->abs_RelTime));
-                    break;
-                }
-
-                case NSPR_RELTIME_V20:
-                {
-                    ns_setrelativetime(nstrace, pletohs(&((nspr_abstime_v20_t *) &nstrace_buf[nstrace_buf_offset])->abs_RelTime));
-                    nstrace_buf_offset += nspr_getv20recordsize(hdp);
-                    break;
-                }
-
-                default:
-                {
-                    nstrace_buf_offset += nspr_getv20recordsize(hdp);
-                    break;
-                }
-            }
-        }
-        nstrace_buf_offset = 0;
-        nstrace->xxx_offset += nstrace_buflen;
-        nstrace_buflen = NSPR_PAGESIZE_TRACE;
-    } while((nstrace_buflen > 0) && (bytes_read = file_read(nstrace_buf, nstrace_buflen, wth->fh)) && (bytes_read == nstrace_buflen));
-
-    return FALSE;
-}
-
-#undef PACKET_DESCRIBE
-
 static gboolean nstrace_seek_read_v10(wtap *wth, gint64 seek_off,
     struct wtap_pkthdr *phdr, Buffer *buf, int length,
     int *err, gchar **err_info)
@@ -1470,50 +1285,6 @@ static gboolean nstrace_seek_read_v20(wtap *wth, gint64 seek_off,
     return TRUE;
 }
 
-
-static gboolean nstrace_seek_read_v30(wtap *wth, gint64 seek_off,
-    struct wtap_pkthdr *phdr, Buffer *buf, int length,
-    int *err, gchar **err_info)
-{
-    guint8 *pd;
-    int bytes_read;
-
-    *err = 0;
-
-    if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1)
-        return FALSE;
-
-    /*
-    ** Read the packet data.
-    */
-    buffer_assure_space(buf, length);
-    pd = buffer_start_ptr(buf);
-    bytes_read = file_read(pd, length, wth->random_fh);
-    if (bytes_read != length) {
-        *err = file_error(wth->random_fh, err_info);
-        if (*err == 0)
-            *err = WTAP_ERR_SHORT_READ;
-        return FALSE;
-    }
-
-#define GENERATE_CASE_V30(phdr,type,acttype) \
-    case NSPR_PDPKTRACEFULLTX_V##type:\
-    case NSPR_PDPKTRACEFULLTXB_V##type:\
-    case NSPR_PDPKTRACEFULLRX_V##type:\
-    case NSPR_PDPKTRACEFULLNEWRX_V##type:\
-    TRACE_V##type##_REC_LEN_OFF((phdr),v##type##_full,fp,pktracefull_v##type);\
-        (phdr)->pseudo_header.nstr.rec_type = NSPR_HEADER_VERSION##acttype;\
-        break;
-
-        switch ((( nspr_hd_v20_t*)pd)->phd_RecordType)
-        {
-            GENERATE_CASE_V30(phdr,30, 300);
-        }
-
-    return TRUE;
-}
-
-
 /*
 ** Netscaler trace format close routines.
 */
@@ -1552,15 +1323,6 @@ int nstrace_20_dump_can_write_encap(int encap)
     return WTAP_ERR_UNSUPPORTED_ENCAP;
 }
 
-/* Returns 0 if we could write the specified encapsulation type,
-** an error indication otherwise. */
-int nstrace_30_dump_can_write_encap(int encap)
-{
-    if (encap == WTAP_ENCAP_NSTRACE_3_0)
-        return 0;
-
-    return WTAP_ERR_UNSUPPORTED_ENCAP;
-}
 
 /* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on
 ** failure */
index 44020371d197104d18dd7478aa91412a49a443c2..6ca9e608a0b6a4b73ee4eff7d63b84d2ca0cfc4b 100644 (file)
 #define NSPR_PDPKTRACEPARTRX_V26    0xA6    /* Received packets before NIC pipelining */
 #define NSPR_PDPKTRACEPARTNEWRX_V26     0xA7    /* Received packets after NIC pipelining */
 
-/* Jumbo Frame Support */
-#define NSPR_PDPKTRACEFULLTX_V30    0xA8    /* Transmitted */
-#define NSPR_PDPKTRACEFULLTXB_V30  0xA9   /* In transmit buffer */
-#define NSPR_PDPKTRACEFULLRX_V30    0xAA    /* Received packets before NIC pipelining */
-#define NSPR_PDPKTRACEFULLNEWRX_V30 0xAB    /* Received packets after NIC pipelining */
-
-
 /* Record types */
 #define        NSPR_HEADER_VERSION100 0x10
 #define        NSPR_HEADER_VERSION200 0x20
 #define NSPR_HEADER_VERSION204 0x24
 #define NSPR_HEADER_VERSION205 0x25
 #define NSPR_HEADER_VERSION206 0x26
-#define NSPR_HEADER_VERSION300 0x30
-
 int nstrace_open(wtap *wth, int *err, gchar **err_info);
 int nstrace_10_dump_can_write_encap(int encap);
 int nstrace_20_dump_can_write_encap(int encap);
-int nstrace_30_dump_can_write_encap(int encap);
 
 gboolean nstrace_dump_open(wtap_dumper *wdh, int *err);
 
index 306df1658516717aace85e8ae74532d46aad3cfd..181a11071112dc1558bd894bfeb73d24f2bb4f03 100644 (file)
@@ -617,10 +617,6 @@ static struct encap_type_info encap_table_base[] = {
 
        /* WTAP_ENCAP_WIRESHARK_UPPER_PDU */
        { "Wireshark Upper PDU export", "wireshark-upper-pdu" },
-
-       /* WTAP_ENCAP_NSTRACE_3_0 */
-       { "NetScaler Encapsulation 3.0 of Ethernet", "nstrace30" },
-
 };
 
 WS_DLL_LOCAL
index 005fe1c7c4b578c3bea607ca3676d5c239f652f0..59c34f42a0a3802d5d74fe99d0e8be30f6d985a5 100644 (file)
@@ -249,8 +249,6 @@ extern "C" {
 #define WTAP_ENCAP_BLUETOOTH_LE_LL              155
 #define WTAP_ENCAP_WIRESHARK_UPPER_PDU          156
 #define WTAP_ENCAP_STANAG_4607                  157
-#define WTAP_ENCAP_NSTRACE_3_0                  158
-
 
 #define WTAP_NUM_ENCAP_TYPES                    wtap_get_num_encap_types()
 
@@ -323,7 +321,6 @@ extern "C" {
 #define WTAP_FILE_VWR_ETH                       63
 #define WTAP_FILE_CAMINS                        64
 #define WTAP_FILE_STANAG_4607                   65
-#define WTAP_FILE_NETSCALER_3_0                 66
 
 #define WTAP_NUM_FILE_TYPES                     wtap_get_num_file_types()