parts are still covered by the GPL, and NOT by the Lesser General Public
License or any other license.
-If you integrate all or part of Wireshark into your own application, then
+If you integrate all or part of Wireshark into your own application, then
that application must be released under a license compatible with the GPL.
The full text of the GNU GPL and the other applicable licenses follows.
Copyright (c) 1988, 1992, 1993
The Regents of the University of California. All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Copyright (c) 2003 Markus Friedl. All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
Copyright (c) 2003 Endace Technology Ltd, Hamilton, New Zealand.
All rights reserved.
-
+
This software and documentation has been developed by Endace Technology Ltd.
along with the DAG PCI network capture cards. For further information please
visit http://www.endace.com/.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
+
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-
+
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
3. The name of Endace Technology Ltd may not be used to endorse or promote
products derived from this software without specific prior written
permission.
-
+
THIS SOFTWARE IS PROVIDED BY ENDACE TECHNOLOGY LTD ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
3. Neither the name of the project nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
+
+ Copyright (c) 1993-2009, Paul Mattes.
+ Copyright (c) 1990, Jeff Sparkes.
+ Copyright (c) 1989, Georgia Tech Research Corporation (GTRC), Atlanta, GA
+ 30332.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Paul Mattes, Jeff Sparkes, GTRC nor the names of
+ their contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY PAUL MATTES, JEFF SPARKES AND GTRC "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL PAUL MATTES, JEFF SPARKES OR GTRC BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
} tn_opt;
static void
-check_for_tn3270(packet_info *pinfo _U_, const char *optname, const char *terminaltype)
+check_tn3270_model(packet_info *pinfo _U_, const char *terminaltype)
{
-
- if (strcmp(optname,"Terminal Type") != 0) {
- return;
- }
-
+ int model;
+ char str_model[2];
if ((strcmp(terminaltype,"IBM-3278-2-E") == 0) || (strcmp(terminaltype,"IBM-3278-2") == 0) ||
(strcmp(terminaltype,"IBM-3278-3") == 0) || (strcmp(terminaltype,"IBM-3278-4") == 0) ||
(strcmp(terminaltype,"IBM-3278-5") == 0) || (strcmp(terminaltype,"IBM-3277-2") == 0) ||
(strcmp(terminaltype,"IBM-3279-3") == 0) || (strcmp(terminaltype,"IBM-3279-4") == 0) ||
(strcmp(terminaltype,"IBM-3279-2-E") == 0) || (strcmp(terminaltype,"IBM-3279-2") == 0) ||
- (strcmp(terminaltype,"IBM-3279-4-E") == 0))
- add_tn3270_conversation(pinfo, 0);
+ (strcmp(terminaltype,"IBM-3279-4-E") == 0)) {
+ str_model[0] = terminaltype[9];
+ str_model[1] = '\0';
+ model = atoi(str_model);
+ add_tn3270_conversation(pinfo, 0, model);
+ }
+}
+static void
+check_for_tn3270(packet_info *pinfo _U_, const char *optname, const char *terminaltype)
+{
+ if (strcmp(optname,"Terminal Type") != 0) {
+ return;
+ }
+ check_tn3270_model(pinfo, terminaltype);
}
static void
case TN3270_REGIME_IS:
if (cmd == TN3270_REGIME_ARE) {
proto_tree_add_text(tree, tvb, offset, 1, "ARE");
- add_tn3270_conversation(pinfo, 0);
+ add_tn3270_conversation(pinfo, 0, 0);
} else {
proto_tree_add_text(tree, tvb, offset, 1, "IS");
}
if (datalen > 0) {
proto_tree_add_text(tree, tvb, offset + 1, datalen, "%s",
tvb_format_text(tvb, offset + 1, datalen));
+ check_tn3270_model(pinfo, tvb_format_text(tvb, offset + 1, datalen));
offset += datalen;
len -= datalen;
}
proto_tree_add_text(tree, tvb, offset, 1, "REJECT");
break;
case TN3270_REQUEST:
- add_tn3270_conversation(pinfo, 1);
+ add_tn3270_conversation(pinfo, 1, 0);
proto_tree_add_text(tree, tvb, offset, 1, "REQUEST");
device_type = tvb_get_guint8(tvb, offset-1);
if (device_type == TN3270_DEVICE_TYPE) {
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
+/*
+ * The DECODE_BADDR macro comes from ctlr.c in X3270 and has the following licence:
+ *
+ * Copyright (c) 1993-2009, Paul Mattes.
+ * Copyright (c) 1990, Jeff Sparkes.
+ * Copyright (c) 1989, Georgia Tech Research Corporation (GTRC), Atlanta, GA
+ * 30332.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the names of Paul Mattes, Jeff Sparkes, GTRC nor the names of
+ * their contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PAUL MATTES, JEFF SPARKES AND GTRC "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL PAUL MATTES, JEFF SPARKES OR GTRC BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define DECODE_BADDR(c1, c2) \
+ ((((c1) & 0xC0) == 0x00) ? \
+ (((c1) & 0x3F) << 8) | (c2) : \
+ (((c1) & 0x3F) << 6) | ((c2) & 0x3F))
#ifdef HAVE_CONFIG_H
# include "config.h"
static int hf_tn3270_begin_end_flags1=-1;
static int hf_tn3270_begin_end_flags2=-1;
static int hf_tn3270_bsc=-1;
-static int hf_tn3270_buffer_x=-1;
-static int hf_tn3270_buffer_y=-1;
+static int hf_tn3270_buffer_address=-1;
static int hf_tn3270_c_cav=-1;
static int hf_tn3270_cc=-1;
static int hf_tn3270_character_code=-1;
tn3270_conv_info_t *tn3270_info_items;
+guint8 ROWS, COLS, MAXROWS, MAXCOLS;
+
gint dissect_orders_and_data(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset);
typedef struct hf_items {
dissect_outbound_3270ds(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset,
gint sf_length)
{
- int start=offset;
+ int start=offset;
int cmd;
proto_tree_add_item(tn3270_tree,
(sf_length - 9),
FALSE);
offset+=(sf_length - 9);
-
+
return (offset - start);
}
dissect_sba(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset)
{
int start = offset;
- proto_tree_add_item(tn3270_tree,
- hf_tn3270_buffer_x,
- tvb, offset,
- 1,
- FALSE);
- offset++;
- proto_tree_add_item(tn3270_tree,
- hf_tn3270_buffer_y,
+ guint8 x, y;
+ int buffer_addr=0;
+ proto_item *ti;
+
+ x = tvb_get_guint8(tvb, offset);
+ y = tvb_get_guint8(tvb, offset+1);
+ buffer_addr = DECODE_BADDR(x,y);
+
+ ti = proto_tree_add_item(tn3270_tree,
+ hf_tn3270_buffer_address,
tvb, offset,
- 1,
+ 2,
FALSE);
- offset++;
+ proto_item_append_text(ti, " (Row %u, Column %u for %ux%u Display)",
+ (buffer_addr / COLS) + 1, (buffer_addr % COLS) + 1, ROWS, COLS);
+ offset+=2;
return (offset - start);
}
break;
/* case PT:*/
case IC:
+ break;
case EW:
+ ROWS=24;
+ COLS=80;
+ break;
case EWA:
+ ROWS=MAXROWS;
+ COLS=MAXCOLS;
break;
-/* return (offset - start);*/
default:
proto_tree_add_text(tn3270_tree, tvb, offset, 1, "Bogus value: %u", order_code);
offset ++;
}
void
-add_tn3270_conversation(packet_info *pinfo, int tn3270e)
+add_tn3270_conversation(packet_info *pinfo, int tn3270e, int model)
{
conversation_t *conversation;
tn3270_conv_info_t *tn3270_info = NULL;
tn3270_info_items = tn3270_info;
}
+ /* The maximum rows/cols is tied to the 3270 model number */
+ switch (model) {
+ case 4:
+ MAXROWS = 32;
+ MAXCOLS = 80;
+ break;
+ case 5:
+ MAXROWS = 27;
+ MAXCOLS = 132;
+ break;
+ case 2:
+ default:
+ MAXROWS = 24;
+ MAXCOLS = 80;
+ }
+ ROWS = 24;
+ COLS = 80;
+
tn3270_info->extended = tn3270e;
}
FT_UINT8, BASE_HEX, VALS(vals_attention_identification_bytes), 0x0,
NULL, HFILL }},
- { &hf_tn3270_buffer_x,
- { "Buffer X", "tn3270.buffer_x",
- FT_UINT8, BASE_HEX, NULL, 0x0,
- NULL, HFILL }},
- { &hf_tn3270_buffer_y,
- { "Buffer Y", "tn3270.buffer_y",
- FT_UINT8, BASE_HEX, NULL, 0x0,
+ { &hf_tn3270_buffer_address,
+ { "Buffer Address", "tn3270.buffer_address",
+ FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }},
/* Self Defining Parameters */
/* END - 5.11 - Load Format Storage */
/* 5.12 - Load Line Type */
- { &hf_tn3270_load_line_type_command,
+ { &hf_tn3270_load_line_type_command,
{ "Line Type Command", "tn3270.load_line_type_command",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }},
gint extended;
} tn3270_conv_info_t;
-void add_tn3270_conversation(packet_info *pinfo, int tn3270e);
+void add_tn3270_conversation(packet_info *pinfo, int tn3270e, int model);
int find_tn3270_conversation(packet_info *pinfo);
#endif