*
* Laurent Deniel <deniel@worldnet.fr>
*
- * $Id: packet-fddi.c,v 1.51 2001/07/03 04:56:45 guy Exp $
+ * $Id: packet-fddi.c,v 1.55 2001/12/10 00:25:27 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#define FDDI_P_SHOST 7
static dissector_handle_t llc_handle;
+static dissector_handle_t data_handle;
static void
swap_mac_addr(u_char *swapped_addr, const u_char *orig_addr)
void
-capture_fddi(const u_char *pd, packet_counts *ld)
+capture_fddi(const u_char *pd, int len, packet_counts *ld)
{
int offset = 0, fc;
- if (!BYTES_ARE_IN_FRAME(0, FDDI_HEADER_SIZE)) {
+ if (!BYTES_ARE_IN_FRAME(0, len, FDDI_HEADER_SIZE)) {
ld->other++;
return;
}
case FDDI_FC_LLC_ASYNC + 13 :
case FDDI_FC_LLC_ASYNC + 14 :
case FDDI_FC_LLC_ASYNC + 15 :
- capture_llc(pd, offset, ld);
+ capture_llc(pd, offset, len, ld);
return;
default :
ld->other++;
u_char src_swapped[6], dst_swapped[6];
tvbuff_t *next_tvb;
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "FDDI");
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "FDDI");
fc = (int) tvb_get_guint8(tvb, FDDI_P_FC);
fc_str = fddifc_to_str(fc);
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO, fc_str);
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO, fc_str);
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_fddi, tvb, 0, FDDI_HEADER_SIZE,
return;
default :
- dissect_data(next_tvb, 0, pinfo, tree);
+ call_dissector(data_handle,next_tvb, pinfo, tree);
return;
} /* fc */
void
proto_reg_handoff_fddi(void)
{
+ dissector_handle_t fddi_handle, fddi_bitswapped_handle;
+
/*
* Get a handle for the LLC dissector.
*/
llc_handle = find_dissector("llc");
+ data_handle = find_dissector("data");
- dissector_add("wtap_encap", WTAP_ENCAP_FDDI,
- dissect_fddi_not_bitswapped, proto_fddi);
+ fddi_handle = find_dissector("fddi");
+ dissector_add("wtap_encap", WTAP_ENCAP_FDDI, fddi_handle);
+ fddi_bitswapped_handle =
+ create_dissector_handle(dissect_fddi_bitswapped, proto_fddi);
dissector_add("wtap_encap", WTAP_ENCAP_FDDI_BITSWAPPED,
- dissect_fddi_bitswapped, proto_fddi);
+ fddi_bitswapped_handle);
}