diff options
-rw-r--r-- | epan/column-utils.c | 3 | ||||
-rw-r--r-- | epan/column.c | 12 | ||||
-rw-r--r-- | epan/column_info.h | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-vlan.c | 3 |
4 files changed, 18 insertions, 1 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c index c6e6b8148b..776fb82de9 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -1225,6 +1225,9 @@ col_fill_in(packet_info *pinfo) case COL_DCE_CALL: /* done by dcerpc */ break; + case COL_8021Q_VLAN_ID: + break; + case NUM_COL_FMTS: /* keep compiler happy - shouldn't get here */ g_assert_not_reached(); break; diff --git a/epan/column.c b/epan/column.c index 17993bd7df..138d2822b8 100644 --- a/epan/column.c +++ b/epan/column.c @@ -50,7 +50,7 @@ col_format_to_string(gint fmt) { "%rd", "%ud", "%hd", "%rhd", "%uhd", "%nd", "%rnd", "%und", "%S", "%rS", "%uS", "%D", "%rD", "%uD", "%p", "%i", "%L", "%B", "%XO", "%XR", "%I", "%c", "%Xs", - "%Xd", "%V", "%x", "%e", "%H", "%P", "%y" + "%Xd", "%V", "%x", "%e", "%H", "%P", "%y", "%v" }; if (fmt < 0 || fmt >= NUM_COL_FMTS) @@ -108,6 +108,7 @@ static const gchar *dlist[NUM_COL_FMTS] = { "HP-UX Subsystem", "HP-UX Device ID", "DCE/RPC call (cn_call_id / dg_seqnum)", + "802.1Q VLAN id", }; const gchar * @@ -205,6 +206,9 @@ get_column_format_matches(gboolean *fmt_list, gint format) { case COL_DCE_CALL: fmt_list[COL_DCE_CALL] = TRUE; break; + case COL_8021Q_VLAN_ID: + fmt_list[COL_8021Q_VLAN_ID] = TRUE; + break; default: break; } @@ -422,6 +426,9 @@ get_column_longest_string(gint format) case COL_DCE_CALL: return "0000"; break; + case COL_8021Q_VLAN_ID: + return "0000"; + break; default: /* COL_INFO */ return "Source port: kerberos-master Destination port: kerberos-master"; break; @@ -568,6 +575,9 @@ get_column_format_from_str(gchar *str) { case 'y': return COL_DCE_CALL; break; + case 'v': + return COL_8021Q_VLAN_ID; + break; } cptr++; } diff --git a/epan/column_info.h b/epan/column_info.h index f3a225af39..7e510dab49 100644 --- a/epan/column_info.h +++ b/epan/column_info.h @@ -98,6 +98,7 @@ enum { COL_HPUX_SUBSYS, /* HP-UX Nettl Subsystem */ COL_HPUX_DEVID, /* HP-UX Nettl Device ID */ COL_DCE_CALL, /* DCE/RPC call id OR datagram sequence number */ + COL_8021Q_VLAN_ID, /* 802.1Q vlan ID */ NUM_COL_FMTS /* Should always be last */ }; diff --git a/epan/dissectors/packet-vlan.c b/epan/dissectors/packet-vlan.c index f2f14dc116..8367cab8d7 100644 --- a/epan/dissectors/packet-vlan.c +++ b/epan/dissectors/packet-vlan.c @@ -82,6 +82,9 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_add_fstr(pinfo->cinfo, COL_INFO, "PRI: %d CFI: %d ID: %d", (tci >> 13), ((tci >> 12) & 1), (tci & 0xFFF)); } + if ( check_col(pinfo->cinfo, COL_8021Q_VLAN_ID)) { + col_add_fstr(pinfo->cinfo, COL_8021Q_VLAN_ID, "%u", (tci & 0xFFF)); + } vlan_tree = NULL; |