void proto_reg_handoff_nettl(void) { dissector_handle_t nettl_handle; /* * Get handles for the Ethernet, Token Ring, FDDI, and RAW dissectors. */ eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); tr_handle = find_dissector("tr"); lapb_handle = find_dissector("lapb"); x25_handle = find_dissector("x.25"); sctp_handle = find_dissector("sctp"); data_handle = find_dissector("data"); wtap_dissector_table = find_dissector_table("wtap_encap"); ip_proto_dissector_table = find_dissector_table("ip.proto"); tcp_subdissector_table = find_dissector_table("tcp.port"); nettl_handle = create_dissector_handle(dissect_nettl, proto_nettl); dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_ETHERNET, nettl_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_TOKEN_RING, nettl_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_FDDI, nettl_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_RAW_IP, nettl_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_RAW_ICMP, nettl_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_RAW_ICMPV6, nettl_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_RAW_TELNET, nettl_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_X25, nettl_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_UNKNOWN, nettl_handle); }
void proto_reg_handoff_llc(void) { dissector_handle_t llc_handle; /* * Get handles for the BPDU, Ethernet, FDDI, Token Ring and * Turbocell dissectors. */ bpdu_handle = find_dissector("bpdu"); eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); eth_withfcs_handle = find_dissector("eth_withfcs"); fddi_handle = find_dissector("fddi"); tr_handle = find_dissector("tr"); turbo_handle = find_dissector("turbocell"); mesh_handle = find_dissector("mesh"); data_handle = find_dissector("data"); /* * Get the Ethertype dissector table. */ ethertype_subdissector_table = find_dissector_table("ethertype"); hpteam_subdissector_table = find_dissector_table("llc.hpteam_pid"); llc_handle = find_dissector("llc"); dissector_add_uint("wtap_encap", WTAP_ENCAP_ATM_RFC1483, llc_handle); dissector_add_uint("sll.ltype", LINUX_SLL_P_802_2, llc_handle); /* RFC 2043 */ dissector_add_uint("ppp.protocol", PPP_LLC, llc_handle); /* RFC 2353 */ dissector_add_uint("udp.port", UDP_PORT_LLC1, llc_handle); dissector_add_uint("udp.port", UDP_PORT_LLC2, llc_handle); dissector_add_uint("udp.port", UDP_PORT_LLC3, llc_handle); dissector_add_uint("udp.port", UDP_PORT_LLC4, llc_handle); dissector_add_uint("udp.port", UDP_PORT_LLC5, llc_handle); /* IP-over-FC when we have the full FC frame */ dissector_add_uint("fc.ftype", FC_FTYPE_IP, llc_handle); dissector_add_uint("atm.aal5.type", TRAF_LLCMX, llc_handle); /* * BACNET-over-ARCNET is really BACNET-over-802.2 LLC-over-ARCNET, * apparently. */ dissector_add_uint("arcnet.protocol_id", ARCNET_PROTO_BACNET, llc_handle); dissector_add_uint("ethertype", ETHERTYPE_JUMBO_LLC, llc_handle); dissector_add_uint("juniper.proto", JUNIPER_PROTO_LLC, llc_handle); dissector_add_uint("juniper.proto", JUNIPER_PROTO_LLC_SNAP, llc_handle); /* * Register all the fields for PIDs for various OUIs. */ if (oui_info_table != NULL) g_hash_table_foreach(oui_info_table, register_hf, NULL); }
void proto_reg_handoff_rtsp(void) { static dissector_handle_t rtsp_handle; static gboolean rtsp_prefs_initialized = FALSE; /* * Variables to allow for proper deletion of dissector registration when * the user changes port from the gui. */ static guint saved_rtsp_tcp_port; static guint saved_rtsp_tcp_alternate_port; if (!rtsp_prefs_initialized) { rtsp_handle = find_dissector("rtsp"); rtp_handle = find_dissector("rtp"); rtcp_handle = find_dissector("rtcp"); rdt_handle = find_dissector("rdt"); media_type_dissector_table = find_dissector_table("media_type"); rtsp_prefs_initialized = TRUE; } else { dissector_delete("tcp.port", saved_rtsp_tcp_port, rtsp_handle); dissector_delete("tcp.port", saved_rtsp_tcp_alternate_port, rtsp_handle); } /* Set our port number for future use */ dissector_add("tcp.port", global_rtsp_tcp_port, rtsp_handle); dissector_add("tcp.port", global_rtsp_tcp_alternate_port, rtsp_handle); saved_rtsp_tcp_port = global_rtsp_tcp_port; saved_rtsp_tcp_alternate_port = global_rtsp_tcp_alternate_port; }
void proto_reg_handoff_redback(void) { osinl_incl_subdissector_table = find_dissector_table("osinl.incl"); osinl_excl_subdissector_table = find_dissector_table("osinl.excl"); ipv4_handle = find_dissector("ip"); data_handle = find_dissector("data"); ethnofcs_handle = find_dissector("eth_withoutfcs"); clnp_handle = find_dissector("clnp"); arp_handle = find_dissector("arp"); ppp_handle = find_dissector("ppp"); ppphdlc_handle = find_dissector("ppp_hdlc"); dissector_add_uint("wtap_encap", WTAP_ENCAP_REDBACK, redback_handle); }
void proto_reg_handoff_nhrp(void) { dissector_handle_t nhrp_handle; data_handle = find_dissector("data"); osinl_subdissector_table = find_dissector_table("osinl"); osinl_excl_subdissector_table = find_dissector_table("osinl.excl"); ethertype_subdissector_table = find_dissector_table("ethertype"); nhrp_handle = create_dissector_handle(dissect_nhrp, proto_nhrp); dissector_add("ip.proto", IP_PROTO_NARP, nhrp_handle); dissector_add("gre.proto", GRE_NHRP, nhrp_handle); dissector_add("llc.iana_pid", IANA_PID_MARS_NHRP_CONTROL, nhrp_handle); }
/* If this dissector uses sub-dissector registration add a registration routine. This format is required because a script is used to find these routines and create the code that calls these routines. */ void proto_reg_handoff_msrp(void) { msrp_handle = find_dissector("msrp"); dissector_add_handle("tcp.port", msrp_handle); /* for "decode-as" */ heur_dissector_add("tcp", dissect_msrp_heur, proto_msrp); media_type_dissector_table = find_dissector_table("media_type"); }
void proto_reg_handoff_packetlogger (void) { dissector_handle_t packetlogger_handle; packetlogger_handle = find_dissector (PFNAME); hci_h1_table = find_dissector_table("hci_h1.type"); data_handle = find_dissector("data"); dissector_add_uint ("wtap_encap", WTAP_ENCAP_PACKETLOGGER, packetlogger_handle); }
void proto_reg_handoff_hsr(void) { dissector_handle_t hsr_frame_handle; hsr_frame_handle = create_dissector_handle(dissect_hsr_frame, proto_hsr); dissector_add_uint("ethertype", ETHERTYPE_HSR, hsr_frame_handle); ethertype_subdissector_table = find_dissector_table("ethertype"); data_handle = find_dissector("data"); }
void proto_reg_handoff_ayiya(void) { dissector_handle_t ayiya_handle; ayiya_handle = find_dissector("ayiya"); dissector_add_uint("udp.port", UDP_PORT_AYIYA, ayiya_handle); ip_dissector_table = find_dissector_table("ip.proto"); }
void proto_reg_handoff_tcap(void) { data_handle = find_dissector("data"); ansi_tcap_handle = find_dissector("ansi_tcap"); ber_oid_dissector_table = find_dissector_table("ber.oid"); #include "packet-tcap-dis-tab.c" }
void proto_reg_handoff_symantec(void) { dissector_handle_t symantec_handle; ethertype_dissector_table = find_dissector_table("ethertype"); symantec_handle = create_dissector_handle(dissect_symantec, proto_symantec); dissector_add_uint("wtap_encap", WTAP_ENCAP_SYMANTEC, symantec_handle); }
void proto_reg_handoff_ap1394(void) { dissector_handle_t ap1394_handle; data_handle = find_dissector("data"); ethertype_subdissector_table = find_dissector_table("ethertype"); ap1394_handle = create_dissector_handle(dissect_ap1394, proto_ap1394); dissector_add_uint("wtap_encap", WTAP_ENCAP_APPLE_IP_OVER_IEEE1394, ap1394_handle); }
void proto_reg_handoff_tzsp(void) { dissector_add_uint("udp.port", UDP_PORT_TZSP, tzsp_handle); /* Get the data dissector for handling unknown encapsulation types. */ data_handle = find_dissector("data"); /* Register this protocol as an ecapsulation type. */ dissector_add_uint("wtap_encap", WTAP_ENCAP_TZSP, tzsp_handle); encap_dissector_table = find_dissector_table("wtap_encap"); }
void proto_reg_handoff_3com_xns(void) { dissector_handle_t our_xns_handle; retix_bpdu_handle = find_dissector("rbpdu"); data_handle = find_dissector("data"); ethertype_subdissector_table = find_dissector_table("ethertype"); our_xns_handle = create_dissector_handle(dissect_3com_xns, proto_3com_xns); dissector_add_uint("llc.dsap", 0x80, our_xns_handle); }
void proto_reg_handoff_sll(void) { dissector_handle_t sll_handle; /* * Get handles for the IPX and LLC dissectors. */ gre_dissector_table = find_dissector_table("gre.proto"); data_handle = find_dissector("data"); sll_handle = create_dissector_handle(dissect_sll, proto_sll); dissector_add_uint("wtap_encap", WTAP_ENCAP_SLL, sll_handle); }
void proto_reg_handoff_ppcap(void) { ppcap_handle = find_dissector("ppcap"); mtp3_handle = find_dissector("mtp3"); /* calling the protocol MTP3 */ tcap_handle = find_dissector("tcap"); /* calling the protocol TCAP */ bssap_handle = find_dissector("bssap"); /* calling the protocol BSSAP */ ranap_handle = find_dissector("ranap"); /* calling the protocol RANAP */ h248_handle = find_dissector("h248"); /* calling the protocol H248 */ sip_handle = find_dissector("sip"); /* calling the protocol SIP */ sccp_handle = find_dissector("sccp"); /* calling the protocol SCCP */ data_handle = find_dissector("data"); /* calling the protocol DATA */ sccp_ssn_dissector_table = find_dissector_table("sccp.ssn"); }
/* If this dissector uses sub-dissector registration add a registration routine. This format is required because a script is used to find these routines and create the code that calls these routines. */ void proto_reg_handoff_multipart(void) { dissector_handle_t multipart_handle; /* * When we cannot display the data, call the data dissector. * When there is no dissector for the given media, call the media dissector. */ data_handle = find_dissector("data"); media_handle = find_dissector("media"); gssapi_handle = find_dissector("gssapi"); /* * Get the content type and Internet media type table */ media_type_dissector_table = find_dissector_table("media_type"); /* * Handle for multipart dissection */ multipart_handle = create_dissector_handle( dissect_multipart, proto_multipart); dissector_add_string("media_type", "multipart/mixed", multipart_handle); dissector_add_string("media_type", "multipart/related", multipart_handle); dissector_add_string("media_type", "multipart/alternative", multipart_handle); dissector_add_string("media_type", "multipart/form-data", multipart_handle); dissector_add_string("media_type", "multipart/report", multipart_handle); dissector_add_string("media_type", "multipart/signed", multipart_handle); dissector_add_string("media_type", "multipart/encrypted", multipart_handle); /* * Supply an entry to use for unknown multipart subtype. * See RFC 2046, section 5.1.3 */ dissector_add_string("media_type", "multipart/", multipart_handle); }
void register_decode_as(decode_as_t* reg) { dissector_table_t decode_table; /* Ensure valid functions */ g_assert(reg->populate_list); g_assert(reg->reset_value); g_assert(reg->change_value); decode_table = find_dissector_table(reg->table_name); if (decode_table != NULL) { dissector_table_allow_decode_as(decode_table); } decode_as_list = g_list_prepend(decode_as_list, reg); }
/*--- proto_reg_handoff_pcap ---------------------------------------*/ void proto_reg_handoff_pcap(void) { static gboolean prefs_initialized = FALSE; static range_t *ssn_range; if (! prefs_initialized) { pcap_handle = find_dissector("pcap"); sccp_ssn_table = find_dissector_table("sccp.ssn"); prefs_initialized = TRUE; #include "packet-pcap-dis-tab.c" } else { dissector_delete_uint_range("sccp.ssn", ssn_range, pcap_handle); g_free(ssn_range); } ssn_range = range_copy(global_ssn_range); dissector_add_uint_range("sccp.ssn", ssn_range, pcap_handle); }
guint pref_unstash(pref_t *pref, gpointer unstash_data_p) { pref_unstash_data_t *unstash_data = (pref_unstash_data_t *)unstash_data_p; dissector_table_t sub_dissectors = NULL; dissector_handle_t handle = NULL; /* Revert the preference to its saved value. */ switch (pref->type) { case PREF_DECODE_AS_UINT: if (*pref->varp.uint != pref->stashed_val.uint) { unstash_data->module->prefs_changed = TRUE; if (unstash_data->handle_decode_as) { if (*pref->varp.uint != pref->default_val.uint) { dissector_reset_uint(pref->name, *pref->varp.uint); } } *pref->varp.uint = pref->stashed_val.uint; if (unstash_data->handle_decode_as) { sub_dissectors = find_dissector_table(pref->name); if (sub_dissectors != NULL) { handle = dissector_table_get_dissector_handle(sub_dissectors, (gchar*)unstash_data->module->title); if (handle != NULL) { dissector_change_uint(pref->name, *pref->varp.uint, handle); } } } } break; case PREF_UINT: if (*pref->varp.uint != pref->stashed_val.uint) { unstash_data->module->prefs_changed = TRUE; *pref->varp.uint = pref->stashed_val.uint; } break; case PREF_BOOL: if (*pref->varp.boolp != pref->stashed_val.boolval) { unstash_data->module->prefs_changed = TRUE; *pref->varp.boolp = pref->stashed_val.boolval; } break; case PREF_ENUM: if (*pref->varp.enump != pref->stashed_val.enumval) { unstash_data->module->prefs_changed = TRUE; *pref->varp.enump = pref->stashed_val.enumval; } break; case PREF_STRING: case PREF_FILENAME: case PREF_DIRNAME: if (strcmp(*pref->varp.string, pref->stashed_val.string) != 0) { unstash_data->module->prefs_changed = TRUE; g_free(*pref->varp.string); *pref->varp.string = g_strdup(pref->stashed_val.string); } break; case PREF_DECODE_AS_RANGE: if (!ranges_are_equal(*pref->varp.range, pref->stashed_val.range)) { guint32 i, j; unstash_data->module->prefs_changed = TRUE; if (unstash_data->handle_decode_as) { sub_dissectors = find_dissector_table(pref->name); if (sub_dissectors != NULL) { handle = dissector_table_get_dissector_handle(sub_dissectors, (gchar*)unstash_data->module->title); if (handle != NULL) { /* Delete all of the old values from the dissector table */ for (i = 0; i < (*pref->varp.range)->nranges; i++) { for (j = (*pref->varp.range)->ranges[i].low; j < (*pref->varp.range)->ranges[i].high; j++) { dissector_delete_uint(pref->name, j, handle); decode_build_reset_list(pref->name, dissector_table_get_type(sub_dissectors), GUINT_TO_POINTER(j), NULL, NULL); } dissector_delete_uint(pref->name, (*pref->varp.range)->ranges[i].high, handle); decode_build_reset_list(pref->name, dissector_table_get_type(sub_dissectors), GUINT_TO_POINTER((*pref->varp.range)->ranges[i].high), NULL, NULL); } } } } g_free(*pref->varp.range); *pref->varp.range = range_copy(pref->stashed_val.range); if (unstash_data->handle_decode_as) { if ((sub_dissectors != NULL) && (handle != NULL)) { /* Add new values to the dissector table */ for (i = 0; i < (*pref->varp.range)->nranges; i++) { for (j = (*pref->varp.range)->ranges[i].low; j < (*pref->varp.range)->ranges[i].high; j++) { dissector_change_uint(pref->name, j, handle); decode_build_reset_list(pref->name, dissector_table_get_type(sub_dissectors), GUINT_TO_POINTER(j), NULL, NULL); } dissector_change_uint(pref->name, (*pref->varp.range)->ranges[i].high, handle); decode_build_reset_list(pref->name, dissector_table_get_type(sub_dissectors), GUINT_TO_POINTER((*pref->varp.range)->ranges[i].high), NULL, NULL); } } } } break; case PREF_RANGE: if (!ranges_are_equal(*pref->varp.range, pref->stashed_val.range)) { unstash_data->module->prefs_changed = TRUE; g_free(*pref->varp.range); *pref->varp.range = range_copy(pref->stashed_val.range); } break; case PREF_COLOR: *pref->varp.colorp = pref->stashed_val.color; break; case PREF_STATIC_TEXT: case PREF_UAT: case PREF_CUSTOM: break; case PREF_OBSOLETE: g_assert_not_reached(); break; } return 0; }
void proto_reg_handoff_pcap_pktdata(void) { wtap_encap_table = find_dissector_table("wtap_encap"); }
void proto_reg_handoff_packetlogger (void) { hci_h1_table = find_dissector_table("hci_h1.type"); dissector_add_uint ("bluetooth.encap", WTAP_ENCAP_PACKETLOGGER, packetlogger_handle); }