diff options
Diffstat (limited to 'epan/dissectors/packet-fddi.c')
-rw-r--r-- | epan/dissectors/packet-fddi.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/epan/dissectors/packet-fddi.c b/epan/dissectors/packet-fddi.c index e14f1bad1a..bf4652738d 100644 --- a/epan/dissectors/packet-fddi.c +++ b/epan/dissectors/packet-fddi.c @@ -170,6 +170,31 @@ fddi_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, return 1; } +static const char* fddi_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) +{ + if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_ETHER)) + return "fddi.addr"; + + return CONV_FILTER_INVALID; +} + +static hostlist_dissector_info_t fddi_host_dissector_info = {&fddi_host_get_filter_type}; + +static int +fddi_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) +{ + conv_hash_t *hash = (conv_hash_t*) pit; + const fddi_hdr *ehdr=(const fddi_hdr *)vip; + + /* Take two "add" passes per packet, adding for each direction, ensures that all + packets are counted properly (even if address is sending to itself) + XXX - this could probably be done more efficiently inside hostlist_table */ + add_hostlist_table_data(hash, &ehdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &fddi_host_dissector_info, PT_NONE); + add_hostlist_table_data(hash, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &fddi_host_dissector_info, PT_NONE); + + return 1; +} + void capture_fddi(const guchar *pd, int len, packet_counts *ld) { @@ -505,7 +530,7 @@ proto_register_fddi(void) &fddi_padding); fddi_tap = register_tap("fddi"); - register_conversation_table(proto_fddi, TRUE, fddi_conversation_packet); + register_conversation_table(proto_fddi, TRUE, fddi_conversation_packet, fddi_hostlist_packet, NULL); } void |