diff options
Diffstat (limited to 'epan/dissectors/packet-fc.c')
-rw-r--r-- | epan/dissectors/packet-fc.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index 82a5bd69dc..e4a5b512be 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -233,6 +233,31 @@ fc_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, c return 1; } +static const char* fc_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) +{ + if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_FC)) + return "fc.id"; + + return CONV_FILTER_INVALID; +} + +static hostlist_dissector_info_t fc_host_dissector_info = {&fc_host_get_filter_type}; + +static int +fc_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) +{ + conv_hash_t *hash = (conv_hash_t*) pit; + const fc_hdr *fchdr=(const fc_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, &fchdr->s_id, 0, TRUE, 1, pinfo->fd->pkt_len, &fc_host_dissector_info, PT_NONE); + add_hostlist_table_data(hash, &fchdr->d_id, 0, FALSE, 1, pinfo->fd->pkt_len, &fc_host_dissector_info, PT_NONE); + + return 1; +} + const value_string fc_fc4_val[] = { {FC_TYPE_BLS, "Basic Link Svc"}, {FC_TYPE_ELS, "Ext Link Svc"}, @@ -1607,7 +1632,7 @@ proto_register_fc(void) fcsof_handle = register_dissector("fcsof", dissect_fcsof, proto_fcsof); - register_conversation_table(proto_fc, TRUE, fc_conversation_packet); + register_conversation_table(proto_fc, TRUE, fc_conversation_packet, fc_hostlist_packet, NULL); } |