aboutsummaryrefslogtreecommitdiffstats
path: root/packet-snmp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-10 00:26:21 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-10 00:26:21 +0000
commit23319ff023bcb144347a1307b958359b5226c699 (patch)
treeb347f1669210e07039ec31051cbb2c5e82422e6b /packet-snmp.c
parenta81a607ed5e3d291940ab75dd82d28d72c222b48 (diff)
downloadwireshark-23319ff023bcb144347a1307b958359b5226c699.tar.gz
wireshark-23319ff023bcb144347a1307b958359b5226c699.tar.bz2
wireshark-23319ff023bcb144347a1307b958359b5226c699.zip
Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. svn path=/trunk/; revision=4370
Diffstat (limited to 'packet-snmp.c')
-rw-r--r--packet-snmp.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/packet-snmp.c b/packet-snmp.c
index d0b5b7ea46..f5d9503888 100644
--- a/packet-snmp.c
+++ b/packet-snmp.c
@@ -8,7 +8,7 @@
*
* See RFCs 1905, 1906, 1909, and 1910 for SNMPv2u.
*
- * $Id: packet-snmp.c,v 1.75 2001/12/03 03:59:39 guy Exp $
+ * $Id: packet-snmp.c,v 1.76 2001/12/10 00:25:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -554,8 +554,8 @@ dissect_snmp_parse_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
break;
}
- if (check_col(pinfo->fd, COL_INFO)) {
- col_add_fstr(pinfo->fd, COL_INFO,
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"ERROR: Couldn't parse %s: %s", field_name, errstr);
}
if (tree != NULL) {
@@ -569,8 +569,8 @@ static void
dissect_snmp_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, const char *message)
{
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO, message);
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO, message);
if (tree != NULL) {
proto_tree_add_text(tree, tvb, offset, 0, "%s", message);
@@ -1000,8 +1000,8 @@ dissect_common_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
pdu_type_string = val_to_str(pdu_type, pdu_types,
"Unknown PDU type %#x");
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO, pdu_type_string);
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO, pdu_type_string);
length = asn1.offset - start;
if (tree) {
proto_tree_add_text(tree, tvb, offset, length,
@@ -1476,8 +1476,8 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
int ret;
guint cls, con, tag;
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_add_str(pinfo->fd, COL_PROTOCOL, proto_name);
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_add_str(pinfo->cinfo, COL_PROTOCOL, proto_name);
if (tree) {
item = proto_tree_add_item(tree, proto, tvb, offset,
@@ -1766,8 +1766,8 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree_add_text(snmp_tree, tvb, offset, length,
"Encrypted PDU (%d bytes)", length);
g_free(cryptpdu);
- if (check_col(pinfo->fd, COL_INFO))
- col_set_str(pinfo->fd, COL_INFO, "Encrypted PDU");
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_set_str(pinfo->cinfo, COL_INFO, "Encrypted PDU");
return;
}
ret = asn1_sequence_decode(&asn1, &global_length, &length);
@@ -1863,8 +1863,8 @@ dissect_smux_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
int ret;
guint cls, con;
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "SMUX");
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMUX");
if (tree) {
item = proto_tree_add_item(tree, proto, tvb, offset,
@@ -1891,8 +1891,8 @@ dissect_smux_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (cls == ASN1_APL && con == ASN1_CON && pdu_type == SMUX_MSG_OPEN) {
pdu_type_string = val_to_str(pdu_type, smux_types,
"Unknown PDU type %#x");
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO, pdu_type_string);
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO, pdu_type_string);
length = asn1.offset - start;
if (tree) {
proto_tree_add_text(smux_tree, tvb, offset, length,
@@ -1960,8 +1960,8 @@ dissect_smux_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (cls == ASN1_APL && con == ASN1_PRI && pdu_type == SMUX_MSG_CLOSE) {
pdu_type_string = val_to_str(pdu_type, smux_types,
"Unknown PDU type %#x");
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO, pdu_type_string);
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO, pdu_type_string);
length = asn1.offset - start;
if (tree) {
proto_tree_add_text(smux_tree, tvb, offset, length,
@@ -1986,8 +1986,8 @@ dissect_smux_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (cls == ASN1_APL && con == ASN1_CON && pdu_type == SMUX_MSG_RREQ) {
pdu_type_string = val_to_str(pdu_type, smux_types,
"Unknown PDU type %#x");
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO, pdu_type_string);
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO, pdu_type_string);
length = asn1.offset - start;
if (tree) {
proto_tree_add_text(smux_tree, tvb, offset, length,
@@ -2039,8 +2039,8 @@ dissect_smux_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (cls == ASN1_APL && con == ASN1_PRI && pdu_type == SMUX_MSG_RRSP) {
pdu_type_string = val_to_str(pdu_type, smux_types,
"Unknown PDU type %#x");
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO, pdu_type_string);
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO, pdu_type_string);
length = asn1.offset - start;
if (tree) {
proto_tree_add_text(smux_tree, tvb, offset, length,
@@ -2065,8 +2065,8 @@ dissect_smux_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (cls == ASN1_APL && con == ASN1_PRI && pdu_type == SMUX_MSG_SOUT) {
pdu_type_string = val_to_str(pdu_type, smux_types,
"Unknown PDU type %#x");
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO, pdu_type_string);
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO, pdu_type_string);
length = asn1.offset - start;
if (tree) {
proto_tree_add_text(smux_tree, tvb, offset, length,