void proto_register_nflog(void) { static hf_register_info hf[] = { /* Header */ { &hf_nflog_family, { "Family", "nflog.family", FT_UINT8, BASE_DEC, VALS(_linux_family_vals), 0x00, NULL, HFILL } }, { &hf_nflog_version, { "Version", "nflog.version", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_nflog_resid, { "Resource id", "nflog.res_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_nflog_encoding, { "Encoding", "nflog.encoding", FT_UINT32, BASE_HEX, VALS(_encoding_vals), 0x00, NULL, HFILL } }, /* TLV */ { &hf_nflog_tlv, { "TLV", "nflog.tlv", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_nflog_tlv_length, { "Length", "nflog.tlv_length", FT_UINT16, BASE_DEC, NULL, 0x00, "TLV Length", HFILL } }, { &hf_nflog_tlv_type, { "Type", "nflog.tlv_type", FT_UINT16, BASE_DEC, VALS(nflog_tlv_vals), 0x7fff, "TLV Type", HFILL } }, /* TLV values */ { &hf_nflog_tlv_prefix, { "Prefix", "nflog.prefix", FT_STRINGZ, BASE_NONE, NULL, 0x00, "TLV Prefix Value", HFILL } }, { &hf_nflog_tlv_uid, { "UID", "nflog.uid", FT_INT32, BASE_DEC, NULL, 0x00, "TLV UID Value", HFILL } }, { &hf_nflog_tlv_gid, { "GID", "nflog.gid", FT_INT32, BASE_DEC, NULL, 0x00, "TLV GID Value", HFILL } }, { &hf_nflog_tlv_timestamp, { "Timestamp", "nflog.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, "TLV Timestamp Value", HFILL } }, { &hf_nflog_tlv_unknown, { "Value", "nflog.tlv_value", FT_BYTES, BASE_NONE, NULL, 0x00, "TLV Value", HFILL } }, }; static gint *ett[] = { &ett_nflog, &ett_nflog_tlv }; module_t *pref; proto_nflog = proto_register_protocol("Linux Netfilter NFLOG", "NFLOG", "nflog"); pref = prefs_register_protocol(proto_nflog, NULL); prefs_register_enum_preference(pref, "byte_order_type", "Byte Order", "Byte Order", &nflog_byte_order, byte_order_types, FALSE); register_dissector("nflog", dissect_nflog, proto_nflog); proto_register_field_array(proto_nflog, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); }
/* Register Wimax FCH Protocol */ void proto_register_wimax_fch(void) { /* TLV display */ static hf_register_info hf[] = { { &hf_fch_used_subchannel_group0, { "Sub-Channel Group 0", "wmx.fch.subchannel_group0", FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_0, NULL, HFILL } }, { &hf_fch_used_subchannel_group1, { "Sub-Channel Group 1", "wmx.fch.subchannel_group1", FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_1, NULL, HFILL } }, { &hf_fch_used_subchannel_group2, { "Sub-Channel Group 2", "wmx.fch.subchannel_group2", FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_2, NULL, HFILL } }, { &hf_fch_used_subchannel_group3, { "Sub-Channel Group 3", "wmx.fch.subchannel_group3", FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_3, NULL, HFILL } }, { &hf_fch_used_subchannel_group4, { "Sub-Channel Group 4", "wmx.fch.subchannel_group4", FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_4, NULL, HFILL } }, { &hf_fch_used_subchannel_group5, { "Sub-Channel Group 5", "wmx.fch.subchannel_group5", FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_5, NULL, HFILL } }, { &hf_fch_reserved_1, { "Reserved", "wmx.fch.reserved1", FT_UINT24, BASE_DEC, NULL, FCH_RESERVED_1, NULL, HFILL } }, { &hf_fch_repetition_coding_indication, { "Repetition Coding Indication", "wmx.fch.repetition_coding_indication", FT_UINT24, BASE_DEC, VALS(repetition_coding_indications), REPETITION_CODING_INDICATION, NULL, HFILL } }, { &hf_fch_coding_indication, { "Coding Indication", "wmx.fch.coding_indication", FT_UINT24, BASE_DEC, VALS(coding_indications), CODING_INDICATION, NULL, HFILL } }, { &hf_fch_dlmap_length, { "DL Map Length", "wmx.fch.dl_map_length", FT_UINT24, BASE_DEC, NULL, DL_MAP_LENGTH, NULL, HFILL } }, { &hf_fch_reserved_2, { "Reserved", "wmx.fch.reserved2", FT_UINT24, BASE_DEC, NULL, FCH_RESERVED_2, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_wimax_fch_decoder, }; proto_wimax_fch_decoder = proto_wimax; /* register the field display messages */ proto_register_field_array(proto_wimax_fch_decoder, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("wimax_fch_burst_handler", dissect_wimax_fch_decoder, -1); }
void proto_register_wai(void) { static hf_register_info hf[] = { { &hf_wai_version, { "Version", "wai.version", FT_UINT16, BASE_DEC, NULL, 0x0, "Version of authentication infrastructure", HFILL }}, { &hf_wai_type, { "Type", "wai.type", FT_UINT8, BASE_HEX, VALS(wai_type_names), 0x0, "Protocol type", HFILL }}, { &hf_wai_subtype, { "Subtype", "wai.subtype", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wai_subtype_names_ext, 0x0, NULL, HFILL }}, { &hf_wai_reserved, { "Reserved", "wai.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_length, { "Length", "wai.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wai_seq, { "Sequence number", "wai.seq", FT_UINT16, BASE_DEC, NULL, 0x0, "Packet sequence number", HFILL }}, { &hf_wai_fragm_seq, { "Fragment sequence number", "wai.fragm.seq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wai_flag, { "Flag", "wai.flag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_data, { "Data", "wai.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_bk_rekeying_flag, {"BK rekeying", "wai.bk.rekeying.flag", FT_BOOLEAN, 8, TFS (&wai_bk_rekeying_flag), FLAG_BIT0, "BK rekeying flag", HFILL }}, { &hf_wai_preauthentication_flag, {"Pre-Authentication", "wai.preauthentication.flag", FT_BOOLEAN, 8, TFS (&wai_preauthentication_flag), FLAG_BIT1, "Pre-Authentication flag", HFILL }}, { &hf_wai_certificate_flag, {"Certificate", "wai.certificate.flag", FT_BOOLEAN, 8, TFS (&wai_certificate_flag), FLAG_BIT2, "Certificate flag", HFILL }}, { &hf_wai_optional_flag, {"Optional", "wai.optional.flag", FT_BOOLEAN, 8, TFS (&wai_optional_flag), FLAG_BIT3, "Optional flag", HFILL }}, { &hf_wai_usk_rekeying_flag, {"USK rekeying", "wai.usk.rekeying.flag", FT_BOOLEAN, 8, TFS (&wai_usk_rekeying_flag), FLAG_BIT4, "USK rekeying flag", HFILL }}, { &hf_wai_negotiation_flag, {"STA negotiation", "wai.negotiation.flag", FT_BOOLEAN, 8, TFS (&wai_negotiation_flag), FLAG_BIT5, "STA negotiation flag", HFILL }}, { &hf_wai_revoking_flag, {"STA revoking", "wai.revoking.flag", FT_BOOLEAN, 8, TFS (&wai_revoking_flag), FLAG_BIT6, "STA revoking flag", HFILL }}, { &hf_wai_reserved_flag, {"Reserved", "wai.reserved.flag", FT_BOOLEAN, 8, TFS (&wai_reserved_flag), FLAG_BIT7, "Reserved flag", HFILL }}, { &hf_wai_cert, {"Certificate", "wai.cert", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_cert_id, {"Id", "wai.cert.id", FT_UINT16, BASE_HEX, NULL, 0x0, "Certificate Id", HFILL }}, { &hf_wai_cert_data, {"Data", "wai.cert.data", FT_BYTES, BASE_NONE, NULL, 0x0, "Certificate data", HFILL }}, { &hf_wai_cert_len, {"Length", "wai.cert.len", FT_UINT16, BASE_DEC, NULL, 0x0, "Certificate length", HFILL }}, { &hf_wai_addid, {"ADDID", "wai.addid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_ae_mac, {"AE MAC", "wai.ae.mac", FT_ETHER, BASE_NONE, NULL, 0x0, "AE MAC address", HFILL }}, { &hf_wai_asue_mac, {"ASUE MAC", "wai.asue.mac", FT_ETHER, BASE_NONE, NULL, 0x0, "ASUE MAC address", HFILL }}, { &hf_wai_bkid, {"BKID", "wai.bkid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_uskid, {"USKID", "wai.uskid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_wie, {"WIE from ASUE", "wai.wie", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_message_auth_code, {"Message Authentication Code", "wai.message.auth.code", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_mskid, {"MSKID/STAKeyID", "wai.mskid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_data_pack_num, {"Data packet number", "wai.data.packet.num", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_key_data, {"Key Data", "wai.key.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_key_data_len, {"Length", "wai.key.data.len", FT_UINT8, BASE_DEC, NULL, 0x0, "Key data length", HFILL }}, { &hf_wai_key_data_content, {"Content", "wai.key.data.content", FT_BYTES, BASE_NONE, NULL, 0x0, "Key data content", HFILL }}, { &hf_wai_key_ann_id, {"Key Announcement Identifier", "wai.key.ann.id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_auth_id, {"Authentication Identifier", "wai.auth.id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_identity, {"Identifier", "wai.identity", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_identity_id, {"Id", "wai.identity.id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_identity_len, {"Length", "wai.identity.len", FT_UINT16, BASE_DEC, NULL, 0x0, "Identity length", HFILL }}, { &hf_wai_identity_data, {"Data", "wai.identity.data", FT_BYTES, BASE_NONE, NULL, 0x0, "Identity data", HFILL }}, { &hf_wai_ecdh, {"ECDH Parameter", "wai.ecdhp", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_ecdh_id, {"ID", "wai.edch.id", FT_UINT8, BASE_HEX, NULL, 0x0, "ECDH Parameter Identifier", HFILL }}, { &hf_wai_ecdh_len, {"Length", "wai.ecdh.len", FT_UINT16, BASE_DEC, NULL, 0x0, "ECDH Parameter Length", HFILL }}, { &hf_wai_ecdh_content, {"Content", "wai.ecdh.content", FT_BYTES, BASE_NONE, NULL, 0x0, "ECDH Parameter Content", HFILL }}, { &hf_wai_counter, {"Replay counter", "wai.counter", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sta_key_id, {"STAKeyID", "wai.sta.key.id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_challenge, {"Challenge", "wai.challenge", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_cert_ver, {"Multiple Certificate Verification Result", "wai.cert.ver", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_nonce, {"Nonce", "wai.nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_ver_res, {"Verification result", "wai.ver.res", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sign_alg, {"Signature Algorithm", "wai.sign.alg", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_hash_alg_id, {"Hash Algorithm Identifier", "wai.hash.alg.id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sign_alg_id, {"Signature Algorithm Identifier", "wai.sign.alg.id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_param, {"Parameter", "wai.param", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_param_id, {"Parameter Identifier", "wai.param.id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_param_content, {"Parameter Content", "wai.param.content", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sign_val, {"Signature Value", "wai.sign.val", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sign_content, {"Signature Content", "wai.sign.content", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sign, {"Signature", "wai.sign", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_identity_list, {"ASU List trusted by ASUE", "wai.identity_list", FT_BYTES, BASE_NONE, NULL, 0x0, "Identity list", HFILL }}, { &hf_wai_reserved_byte, {"Reserved", "wai.reserved.byte", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_no_of_ids, {"Number of Identities", "wai.no.of.ids", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wai_access_res, {"Access result", "wai.access_result", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_fragments, {"Message fragments", "wai.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment, {"Message fragment", "wai.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_overlap, {"Message fragment overlap", "wai.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_overlap_conflicts, {"Message fragment overlapping with conflicting data", "wai.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_multiple_tails, {"Message has multiple tail fragments", "wai.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_too_long_fragment, {"Message fragment too long", "wai.fragment.too_long_fragment", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_error, {"Message defragmentation error", "wai.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_count, {"Message fragment count", "wai.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_wai_reassembled_in, {"Reassembled in", "wai.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_reassembled_length, {"Reassembled length", "wai.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }} }; static gint *ett[] = { &ett_wai, &ett_wai_data, &ett_wai_flags, &ett_wai_certificate, &ett_wai_mac, &ett_wai_identity, &ett_wai_key_data, &ett_wai_ecdh_param, &ett_wai_certificate_verification, &ett_wai_identity_list, &ett_wai_sign, &ett_wai_sign_alg, &ett_wai_sign_val, &ett_wai_parameter, &ett_wai_fragment, &ett_wai_fragments }; proto_wai = proto_register_protocol("WAI Protocol", "WAI", "wai"); register_init_routine(&wai_reassemble_init); proto_register_field_array(proto_wai, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("wai", dissect_wai, proto_wai); }
/*FUNCTION:------------------------------------------------------ * NAME * zbee_security_register * DESCRIPTION * Called by proto_register_zbee_nwk() to initialize the security * dissectors. * PARAMETERS * module_t zbee_prefs - Prefs module to load preferences under. * RETURNS * none *--------------------------------------------------------------- */ void zbee_security_register(module_t *zbee_prefs, int proto) { static hf_register_info hf[] = { { &hf_zbee_sec_key_id, { "Key Id", "zbee.sec.key", FT_UINT8, BASE_HEX, VALS(zbee_sec_key_names), ZBEE_SEC_CONTROL_KEY, NULL, HFILL }}, { &hf_zbee_sec_nonce, { "Extended Nonce", "zbee.sec.ext_nonce", FT_BOOLEAN, 8, NULL, ZBEE_SEC_CONTROL_NONCE, NULL, HFILL }}, { &hf_zbee_sec_counter, { "Frame Counter", "zbee.sec.counter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_zbee_sec_src64, { "Extended Source", "zbee.sec.src64", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_zbee_sec_key_seqno, { "Key Sequence Number", "zbee.sec.key_seqno", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_zbee_sec_mic, { "Message Integrity Code", "zbee.sec.mic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_zbee_sec_key_origin, { "Key Origin", "zbee.sec.key.origin", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; static gint *ett[] = { &ett_zbee_sec, &ett_zbee_sec_control }; static uat_field_t key_uat_fields[] = { UAT_FLD_CSTRING(uat_key_records, string, "Key", "A 16-byte key in hexadecimal with optional dash-,\n" "colon-, or space-separator characters, or a\n" "a 16-character string in double-quotes."), UAT_FLD_VS(uat_key_records, byte_order, "Byte Order", byte_order_vals, "Byte order of key."), UAT_FLD_LSTRING(uat_key_records, label, "Label", "User label for key."), UAT_END_FIELDS }; /* If no prefs module was supplied, register our own. */ if (zbee_prefs == NULL) { zbee_prefs = prefs_register_protocol(proto, NULL); } /* Register preferences */ prefs_register_enum_preference(zbee_prefs, "seclevel", "Security Level", "Specifies the security level to use in the\n" "decryption process. This value is ignored\n" "for ZigBee 2004 and unsecured networks.", &gPREF_zbee_sec_level, zbee_sec_level_enums, FALSE); zbee_sec_key_table_uat = uat_new("Pre-configured Keys", sizeof(uat_key_record_t), "zigbee_pc_keys", TRUE, (void*) &uat_key_records, &num_uat_key_records, UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */ NULL, /* TODO: ptr to help manual? */ uat_key_record_copy_cb, uat_key_record_update_cb, uat_key_record_free_cb, NULL, /* TODO: post_update */ key_uat_fields ); prefs_register_uat_preference(zbee_prefs, "key_table", "Pre-configured Keys", "Pre-configured link or network keys.", zbee_sec_key_table_uat); proto_register_field_array(proto, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register the init routine. */ register_init_routine(proto_init_zbee_security); } /* zbee_security_register */
void proto_register_usb_dfu(void) { module_t *module; expert_module_t *expert_module; static hf_register_info hf[] = { { &hf_setup_command, { "Command", "usbdfu.command", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &command_vals_ext, 0x0, NULL, HFILL } }, { &hf_response, { "Response", "usbdfu.response", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &command_vals_ext, 0x0, NULL, HFILL } }, { &hf_command_in_frame, { "Command Frame", "usbdfu.command_frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_setup_unused, { "Unused", "usbdfu.unused", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_setup_interface, { "Interface", "usbdfu.interface", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_setup_length, { "Length", "usbdfu.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_setup_block_number, { "Block Number", "usbdfu.block_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_setup_timeout, { "Timeout", "usbdfu.timeout", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_state, { "State", "usbdfu.state", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &state_vals_ext, 0x0, NULL, HFILL } }, { &hf_status, { "Status", "usbdfu.status", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &status_vals_ext, 0x0, NULL, HFILL } }, { &hf_iString, { "iString", "usbdfu.iString", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_poll_timeout, { "Poll Timeout", "usbdfu.poll_timeout", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_data, { "Data", "usbdfu.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_usb_dfu_descriptor, { "DFU Descriptor", "usbdfu.descriptor", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bmAttributes_reserved, { "Reserved", "usbdfu.descriptor.bmAttributes.reserved", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bmAttributes_WillDetach, { "Will Detach", "usbdfu.descriptor.bmAttributes.WillDetach", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bmAttributes_ManifestationTolerant, { "Manifestation Tolerant", "usbdfu.descriptor.bmAttributes.ManifestationTolerant", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bmAttributes_CanUpload, { "Can Upload", "usbdfu.descriptor.bmAttributes.CanUpload", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bmAttributes_CanDownload, { "Can Download", "usbdfu.descriptor.bmAttributes.CanDownload", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_usb_dfu_descriptor_wDetachTimeOut, { "wDetachTimeOut", "usbdfu.descriptor.wDetachTimeOut", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usb_dfu_descriptor_wTransferSize, { "wTransferSize", "usbdfu.descriptor.wTransferSize", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bcdDFUVersion, { "bcdDFUVersion", "usbdfu.descriptor.bcdDFUVersion", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } } }; static ei_register_info ei[] = { { &ei_unexpected_response, { "usb_dfu.unexpected_response", PI_PROTOCOL, PI_ERROR, "Unexpected response for this command", EXPFILL }}, { &ei_unknown_data, { "usb_dfu.unknown_data", PI_PROTOCOL, PI_NOTE, "Unknown data", EXPFILL }}, { &ei_unexpected_data, { "usb_dfu.unexpected_data", PI_PROTOCOL, PI_WARN, "Unexpected data", EXPFILL }}, { &ei_invalid_command_for_request_type, { "usb_dfu.invalid_command_for_request_type", PI_PROTOCOL, PI_WARN, "Invalid command for this Request Type", EXPFILL }}, { &ei_descriptor_invalid_length, { "usb_dfu.descriptor.invalid_length", PI_PROTOCOL, PI_WARN, "Invalid Length", EXPFILL }}, }; static gint *ett[] = { &ett_usb_dfu, &ett_usb_dfu_descriptor, &ett_command }; command_info = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); proto_usb_dfu = proto_register_protocol("USB Device Firmware Upgrade ", "USB DFU", "usbdfu"); proto_register_field_array(proto_usb_dfu, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); usb_dfu_handle = new_register_dissector("usb_dfu", dissect_usb_dfu, proto_usb_dfu); expert_module = expert_register_protocol(proto_usb_dfu); expert_register_field_array(expert_module, ei, array_length(ei)); module = prefs_register_protocol(proto_usb_dfu, NULL); prefs_register_static_text_preference(module, "version", "USB DFU Specification 1.1", "Version of protocol supported by this dissector."); }
void proto_register_ax25_nol3(void) { module_t *ax25_nol3_module; /* Setup list of header fields */ #if 0 /* not used ? */ static hf_register_info hf[] = { { &hf_text, { "Text", "ax25_nol3.text", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; #endif static hf_register_info hf_dx[] = { { &hf_dx_report, { "DX", "ax25_nol3.dx", FT_STRING, BASE_NONE, NULL, 0x0, "DX cluster", HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_ax25_nol3, &ett_dx, }; /* Register the protocol name and description */ proto_ax25_nol3 = proto_register_protocol("AX.25 no Layer 3", "AX.25 no L3", "ax25_nol3"); /* Required function calls to register the header fields and subtrees used */ /* proto_register_field_array( proto_ax25_nol3, hf, array_length(hf ) ); */ proto_register_subtree_array( ett, array_length( ett ) ); /* Register preferences module */ ax25_nol3_module = prefs_register_protocol( proto_ax25_nol3, NULL); /* Register any preference */ prefs_register_bool_preference(ax25_nol3_module, "showaprs", "Decode the APRS info field", "Enable decoding of the payload as APRS.", &gPREF_APRS ); prefs_register_bool_preference(ax25_nol3_module, "showcluster", "Decode DX cluster info field", "Enable decoding of the payload as DX cluster info.", &gPREF_DX ); /* Register the sub-protocol name and description */ proto_dx = proto_register_protocol("DX cluster", "DX", "dx"); /* Register the dissector */ register_dissector( "dx", dissect_dx, proto_dx); /* Register the header fields */ proto_register_field_array( proto_dx, hf_dx, array_length( hf_dx ) ); /* Register the subtrees used */ /* proto_register_subtree_array( ett_dx, array_length( ett_dx ) ); */ }
void proto_register_tpkt(void) { static hf_register_info hf[] = { { &hf_tpkt_version, { "Version", "tpkt.version", FT_UINT8, BASE_DEC, NULL, 0x0, "Version, only version 3 is defined", HFILL } }, { &hf_tpkt_reserved, { "Reserved", "tpkt.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, "Reserved, should be 0", HFILL } }, { &hf_tpkt_length, { "Length", "tpkt.length", FT_UINT16, BASE_DEC, NULL, 0x0, "Length of data unit, including this header", HFILL } }, { &hf_tpkt_continuation_data, { "Continuation data", "tpkt.continuation_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; static gint *ett[] = { &ett_tpkt, }; module_t *tpkt_module; proto_tpkt = proto_register_protocol("TPKT - ISO on TCP - RFC1006", "TPKT", "tpkt"); proto_tpkt_ptr = find_protocol_by_id(proto_tpkt); proto_register_field_array(proto_tpkt, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("tpkt", dissect_tpkt, proto_tpkt); tpkt_module = prefs_register_protocol(proto_tpkt, NULL); prefs_register_bool_preference(tpkt_module, "desegment", "Reassemble TPKT messages spanning multiple TCP segments", "Whether the TPKT dissector should reassemble messages spanning multiple TCP segments. " "To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &tpkt_desegment); }
int main(void) { int grades[] = { 75 }; printf("Number of elements is %zd\n", array_length(grades)); }
/* Register the protocol with Wireshark */ void proto_register_mip(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_mip_type, { "Message Type", "mip.type", FT_UINT8, BASE_DEC, VALS(mip_types), 0, "Mobile IP Message type.", HFILL } }, { &hf_mip_flags, {"Flags", "mip.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_mip_s, {"Simultaneous Bindings", "mip.s", FT_BOOLEAN, 8, NULL, 128, "Simultaneous Bindings Allowed", HFILL } }, { &hf_mip_b, {"Broadcast Datagrams", "mip.b", FT_BOOLEAN, 8, NULL, 64, "Broadcast Datagrams requested", HFILL } }, { &hf_mip_d, { "Co-located Care-of Address", "mip.d", FT_BOOLEAN, 8, NULL, 32, "MN using Co-located Care-of address", HFILL } }, { &hf_mip_m, {"Minimal Encapsulation", "mip.m", FT_BOOLEAN, 8, NULL, 16, "MN wants Minimal encapsulation", HFILL } }, { &hf_mip_g, {"GRE", "mip.g", FT_BOOLEAN, 8, NULL, 8, "MN wants GRE encapsulation", HFILL } }, { &hf_mip_v, { "Van Jacobson", "mip.v", FT_BOOLEAN, 8, NULL, 4, NULL, HFILL } }, { &hf_mip_t, { "Reverse Tunneling", "mip.t", FT_BOOLEAN, 8, NULL, 2, "Reverse tunneling requested", HFILL } }, { &hf_mip_x, { "Reserved", "mip.x", FT_BOOLEAN, 8, NULL, 1, NULL, HFILL } }, { &hf_mip_code, { "Reply Code", "mip.code", FT_UINT8, BASE_DEC, VALS(mip_reply_codes), 0, "Mobile IP Reply code.", HFILL } }, { &hf_mip_life, { "Lifetime", "mip.life", FT_UINT16, BASE_DEC, NULL, 0, "Mobile IP Lifetime.", HFILL } }, { &hf_mip_homeaddr, { "Home Address", "mip.homeaddr", FT_IPv4, BASE_NONE, NULL, 0, "Mobile Node's home address.", HFILL } }, { &hf_mip_haaddr, { "Home Agent", "mip.haaddr", FT_IPv4, BASE_NONE, NULL, 0, "Home agent IP Address.", HFILL } }, { &hf_mip_coa, { "Care of Address", "mip.coa", FT_IPv4, BASE_NONE, NULL, 0, "Care of Address.", HFILL } }, { &hf_mip_ident, { "Identification", "mip.ident", FT_BYTES, BASE_NONE, NULL, 0, "MN Identification.", HFILL } }, { &hf_mip_ext_type, { "Extension Type", "mip.ext.type", FT_UINT8, BASE_DEC, VALS(mip_ext_types), 0, "Mobile IP Extension Type.", HFILL } }, { &hf_mip_gaext_stype, { "Gen Auth Ext SubType", "mip.ext.auth.subtype", FT_UINT8, BASE_DEC, VALS(mip_gaext_stypes), 0, "Mobile IP Auth Extension Sub Type.", HFILL } }, { &hf_mip_ext_len, { "Extension Length", "mip.ext.len", FT_UINT16, BASE_DEC, NULL, 0, "Mobile IP Extension Length.", HFILL } }, { &hf_mip_ext, { "Extension", "mip.extension", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_mip_aext_spi, { "SPI", "mip.auth.spi", FT_UINT32, BASE_HEX, NULL, 0, "Authentication Header Security Parameter Index.", HFILL } }, { &hf_mip_aext_auth, { "Authenticator", "mip.auth.auth", FT_BYTES, BASE_NONE, NULL, 0, "Authenticator.", HFILL } }, { &hf_mip_next_nai, { "NAI", "mip.nai", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_mip_rext_flags, {"Rev Ext Flags", "mip.ext.rev.flags", FT_UINT16, BASE_HEX, NULL, 0x0, "Revocation Support Extension Flags", HFILL} }, { &hf_mip_rext_i, { "'I' bit Support", "mip.ext.rev.i", FT_BOOLEAN, 16, NULL, 32768, "Agent supports Inform bit in Revocation", HFILL } }, { &hf_mip_rext_reserved, { "Reserved", "mip.ext.rev.reserved", FT_UINT16, BASE_HEX, NULL, 0x7fff, NULL, HFILL } }, { &hf_mip_rext_tstamp, { "Timestamp", "mip.ext.rev.tstamp", FT_UINT32, BASE_DEC, NULL, 0, "Revocation Timestamp of Sending Agent", HFILL } }, { &hf_mip_rev_reserved, { "Reserved", "mip.rev.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_mip_rev_a, { "Home Agent", "mip.rev.a", FT_BOOLEAN, 16, NULL, 32768, "Revocation sent by Home Agent", HFILL } }, { &hf_mip_rev_i, { "Inform", "mip.rev.i", FT_BOOLEAN, 16, NULL, 16384, "Inform Mobile Node", HFILL } }, { &hf_mip_rev_reserved2, { "Reserved", "mip.rev.reserved2", FT_UINT16, BASE_HEX, NULL, 0x3fff, NULL, HFILL}}, { &hf_mip_hda, { "Home Domain Address", "mip.rev.hda", FT_IPv4, BASE_NONE, NULL, 0, "Revocation Home Domain IP Address", HFILL } }, { &hf_mip_fda, { "Foreign Domain Address", "mip.rev.fda", FT_IPv4, BASE_NONE, NULL, 0, "Revocation Foreign Domain IP Address", HFILL } }, { &hf_mip_revid, { "Revocation Identifier", "mip.revid", FT_UINT32, BASE_DEC, NULL, 0, "Revocation Identifier of Initiating Agent", HFILL } }, { &hf_mip_ack_reserved, { "Reserved", "mip.ack.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, { &hf_mip_ack_i, { "Inform", "mip.ack.i", FT_BOOLEAN, 16, NULL, 32768, "Inform Mobile Node", HFILL } }, { &hf_mip_ack_reserved2, { "Reserved", "mip.ack.reserved2", FT_UINT16, BASE_HEX, NULL, 0x7fff, NULL, HFILL}}, { &hf_mip_dhaext_stype, { "DynHA Ext SubType", "mip.ext.dynha.subtype", FT_UINT8, BASE_DEC, VALS(mip_dhaext_stypes), 0, "Dynamic HA Extension Sub-type", HFILL } }, { &hf_mip_dhaext_addr, { "DynHA Home Agent", "mip.ext.dynha.ha", FT_IPv4, BASE_NONE, NULL, 0, "Dynamic Home Agent IP Address", HFILL } }, { &hf_mip_mstrext_stype, { "MsgStr Ext SubType", "mip.ext.msgstr.subtype", FT_UINT8, BASE_DEC, VALS(mip_mstrext_stypes), 0, "Message String Extension Sub-type", HFILL } }, { &hf_mip_mstrext_text, { "MsgStr Text", "mip.ext.msgstr.text", FT_STRING, BASE_NONE, NULL, 0, "Message String Extension Text", HFILL } }, { &hf_mip_nattt_nexthdr, { "NATTT NextHeader", "mip.nattt.nexthdr", FT_UINT8, BASE_DEC, VALS(mip_nattt_nexthdr), 0, "NAT Traversal Tunnel Next Header.", HFILL } }, { &hf_mip_nattt_reserved, { "Reserved", "mip.nattt.reserved", FT_UINT16, BASE_HEX, NULL , 0x0, NULL, HFILL } }, { &hf_mip_utrqext_stype, { "UDP TunReq Ext SubType", "mip.ext.utrq.subtype", FT_UINT8, BASE_DEC, VALS(mip_utrqext_stypes), 0, "UDP Tunnel Request Extension Sub-type", HFILL } }, { &hf_mip_utrqext_reserved1, { "Reserved 1", "mip.ext.utrq.reserved1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mip_utrqext_flags, { "UDP TunReq Ext Flags", "mip.ext.utrq.flags", FT_UINT8, BASE_HEX, NULL, 0x0, "UDP Tunnel Request Extension Flags", HFILL } }, { &hf_mip_utrqext_f, { "Req Forced", "mip.ext.utrq.f", FT_BOOLEAN, 8, NULL, 128, "MN wants to Force UDP Tunneling", HFILL } }, { &hf_mip_utrqext_r, { "FA Registration Required", "mip.ext.utrq.r", FT_BOOLEAN, 8, NULL, 64, "Registration through FA Required", HFILL } }, { &hf_mip_utrqext_reserved2, { "Reserved 2", "mip.ext.utrq.reserved2", FT_UINT8, BASE_HEX, NULL, 0x3f, NULL, HFILL } }, { &hf_mip_utrqext_encap_type, { "UDP Encap Type", "mip.ext.utrq.encaptype", FT_UINT8, BASE_DEC, VALS(mip_utrqext_encap_types), 0, "UDP Encapsulation Type", HFILL } }, { &hf_mip_utrqext_reserved3, { "Reserved 3", "mip.ext.utrq.reserved3", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mip_utrpext_stype, { "UDP TunRep Ext SubType", "mip.ext.utrp.subtype", FT_UINT8, BASE_DEC, VALS(mip_utrpext_stypes), 0, "UDP Tunnel Reply Extension Sub-type", HFILL } }, { &hf_mip_utrpext_code, { "UDP TunRep Code", "mip.ext.utrp.code", FT_UINT8, BASE_DEC, VALS(mip_utrpext_codes), 0, "UDP Tunnel Reply Code", HFILL } }, { &hf_mip_utrpext_flags, { "UDP TunRep Ext Flags", "mip.ext.utrp.flags", FT_UINT16, BASE_HEX, NULL, 0x0, "UDP Tunnel Request Extension Flags", HFILL } }, { &hf_mip_utrpext_f, { "Rep Forced", "mip.ext.utrp.f", FT_BOOLEAN, 16, NULL, 32768, "HA wants to Force UDP Tunneling", HFILL } }, { &hf_mip_utrpext_reserved, { "Reserved", "mip.ext.utrp.reserved", FT_UINT16, BASE_HEX, NULL, 0x7fff, NULL, HFILL } }, { &hf_mip_utrpext_keepalive, { "Keepalive Interval", "mip.ext.utrp.keepalive", FT_UINT16, BASE_DEC, NULL, 0, "NAT Keepalive Interval", HFILL } }, { &hf_mip_pmipv4nonskipext_stype, { "Sub-type", "mip.ext.pmipv4nonskipext.subtype", FT_UINT8, BASE_DEC, VALS(mip_pmipv4nonskipext_stypes), 0, "PMIPv4 Skippable Extension Sub-type", HFILL } }, { &hf_mip_pmipv4nonskipext_pernodeauthmethod, { "Per-Node Authentication Method", "mip.ext.pmipv4nonskipext.pernodeauthmethod", FT_UINT8, BASE_DEC, VALS(mip_pmipv4nonskipext_pernodeauthmethod_types), 0, NULL, HFILL } }, { &hf_mip_pmipv4skipext_stype, { "Sub-type", "mip.ext.pmipv4skipext.subtype", FT_UINT8, BASE_DEC, VALS(mip_pmipv4skipext_stypes), 0, "PMIPv4 Non-skippable Extension Sub-type", HFILL } }, { &hf_mip_pmipv4skipext_interfaceid, { "Interface ID", "mip.ext.pmipv4skipext.interfaceid", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_mip_pmipv4skipext_deviceid_type, { "ID-Type", "mip.ext.pmipv4skipext.deviceid_type", FT_UINT8, BASE_DEC, VALS(mip_pmipv4skipext_deviceid_types), 0, "Device ID-Type", HFILL } }, { &hf_mip_pmipv4skipext_deviceid_id, { "Identifier", "mip.ext.pmipv4skipext.deviceid_id", FT_BYTES, BASE_NONE, NULL, 0, "Device ID Identifier", HFILL } }, { &hf_mip_pmipv4skipext_subscriberid_type, { "ID-Type", "mip.ext.pmipv4skipext.subscriberid_type", FT_UINT8, BASE_DEC, VALS(mip_pmipv4skipext_subscriberid_types), 0, "Subscriber ID-Type", HFILL } }, { &hf_mip_pmipv4skipext_subscriberid_id, { "Identifier", "mip.ext.pmipv4skipext.subscriberid_id", FT_BYTES, BASE_NONE, NULL, 0, "Subscriber ID Identifier", HFILL } }, { &hf_mip_pmipv4skipext_accesstechnology_type, { "Access Technology Type", "mip.ext.pmipv4skipext.accesstechnology_type", FT_UINT8, BASE_DEC, VALS(mip_pmipv4skipext_accesstechnology_types), 0, NULL, HFILL } }, { &hf_mip_cvse_reserved, { "CVSE Reserved", "mip.ext.cvse.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mip_cvse_vendor_org_id, { "CVSE Vendor/org ID", "mip.ext.cvse.vendor_id", FT_UINT32, BASE_DEC, VALS(sminmpec_values), 0, NULL, HFILL } }, { &hf_mip_cvse_verizon_cvse_type , { "Verizon CVSE Type", "mip.ext.cvse.verizon_type", FT_UINT16, BASE_DEC, VALS(mip_cvse_verizon_cvse_types), 0, NULL, HFILL } }, { &hf_mip_cvse_vendor_cvse_type , { "Vendor CVSE Type", "mip.ext.cvse.vendor_type", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mip_cvse_vendor_cvse_value , { "Vendor CVSE Value", "mip.ext.cvse.vendor_value", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_mip, &ett_mip_flags, &ett_mip_ext, &ett_mip_exts, &ett_mip_pmipv4_ext, }; /* Register the protocol name and description */ proto_mip = proto_register_protocol("Mobile IP", "Mobile IP", "mip"); /* Register the dissector by name */ register_dissector("mip", dissect_mip, proto_mip); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_mip, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); }
void proto_register_pagp(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_pagp_version_number, { "Version", "pagp.version", FT_UINT8, BASE_HEX, VALS(pdu_vers), 0x0, "Identifies the PAgP PDU version: 1 = Info, 2 = Flush", HFILL }}, { &hf_pagp_flags, { "Flags", "pagp.flags", FT_UINT8, BASE_HEX, NULL, 0x0, "Information flags", HFILL }}, { &hf_pagp_flags_slow_hello, { "Slow Hello", "pagp.flags.slowhello", FT_BOOLEAN, 8, TFS(&tfs_yes_no), PAGP_FLAGS_SLOW_HELLO, "1 = using Slow Hello, 0 = Slow Hello disabled", HFILL }}, { &hf_pagp_flags_auto_mode, { "Auto Mode", "pagp.flags.automode", FT_BOOLEAN, 8, TFS(&automode), PAGP_FLAGS_AUTO_MODE, "1 = Auto Mode enabled, 0 = Desirable Mode", HFILL }}, { &hf_pagp_flags_consistent_state, { "Consistent State", "pagp.flags.state", FT_BOOLEAN, 8, NULL, PAGP_FLAGS_CONSISTENT_STATE, "1 = Consistent State, 0 = Not Ready", HFILL }}, { &hf_pagp_local_device_id, { "Local Device ID", "pagp.localdevid", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_pagp_local_learn_cap, { "Local Learn Capability", "pagp.localearncap", FT_UINT8, BASE_HEX, VALS(learn_cap), 0x0, NULL, HFILL }}, { &hf_pagp_local_port_priority, { "Local Port Hot Standby Priority", "pagp.localportpri", FT_UINT8, BASE_DEC, NULL, 0x0, "The local hot standby priority assigned to this port", HFILL }}, { &hf_pagp_local_sent_port_ifindex, { "Local Sent Port ifindex", "pagp.localsentportifindex", FT_UINT32, BASE_DEC, NULL, 0x0, "The interface index of the local port used to send PDU", HFILL }}, { &hf_pagp_local_group_capability, { "Local Group Capability", "pagp.localgroupcap", FT_UINT32, BASE_HEX, NULL, 0x0, "The local group capability", HFILL }}, { &hf_pagp_local_group_ifindex, { "Local Group ifindex", "pagp.localgroupifindex", FT_UINT32, BASE_DEC, NULL, 0x0, "The local group interface index", HFILL }}, { &hf_pagp_partner_device_id, { "Partner Device ID", "pagp.partnerdevid", FT_ETHER, BASE_NONE, NULL, 0x0, "Remote Device ID (MAC)", HFILL }}, { &hf_pagp_partner_learn_cap, { "Partner Learn Capability", "pagp.partnerlearncap", FT_UINT8, BASE_HEX, VALS(learn_cap), 0x0, "Remote learn capability", HFILL }}, { &hf_pagp_partner_port_priority, { "Partner Port Hot Standby Priority", "pagp.partnerportpri", FT_UINT8, BASE_DEC, NULL, 0x0, "Remote port priority", HFILL }}, { &hf_pagp_partner_sent_port_ifindex, { "Partner Sent Port ifindex", "pagp.partnersentportifindex", FT_UINT32, BASE_DEC, NULL, 0x0, "Remote port interface index sent", HFILL }}, { &hf_pagp_partner_group_capability, { "Partner Group Capability", "pagp.partnergroupcap", FT_UINT32, BASE_HEX, NULL, 0x0, "Remote group capability", HFILL }}, { &hf_pagp_partner_group_ifindex, { "Partner Group ifindex", "pagp.partnergroupifindex", FT_UINT32, BASE_DEC, NULL, 0x0, "Remote group interface index", HFILL }}, { &hf_pagp_partner_count, { "Partner Count", "pagp.partnercount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_pagp_num_tlvs, { "Number of TLVs", "pagp.numtlvs", FT_UINT16, BASE_DEC, NULL, 0x0, "Number of TLVs following", HFILL }}, { &hf_pagp_tlv, { "Type", "pagp.tlv", FT_UINT16, BASE_DEC, VALS(tlv_types), 0x0, "Type/Length/Value", HFILL }}, { &hf_pagp_tlv_length, { "Length", "pagp.tlv_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_pagp_tlv_device_name, { "Device Name", "pagp.tlvdevname", FT_STRING, BASE_NONE, NULL, 0x0, "sysName of device", HFILL }}, { &hf_pagp_tlv_port_name, { "Physical Port Name", "pagp.tlvportname", FT_STRING, BASE_NONE, NULL, 0x0, "Name of port used to send PDU", HFILL }}, { &hf_pagp_tlv_agport_mac, { "Agport MAC Address", "pagp.tlvagportmac", FT_ETHER, BASE_NONE, NULL, 0x0, "Source MAC on frames for this aggregate", HFILL }}, { &hf_pagp_flush_local_device_id, { "Flush Local Device ID", "pagp.flushlocaldevid", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_pagp_flush_partner_device_id, { "Flush Partner Device ID", "pagp.flushpartnerdevid", FT_ETHER, BASE_NONE, NULL, 0x0, "Flush remote device ID", HFILL }}, { &hf_pagp_flush_transaction_id, { "Transaction ID", "pagp.transid", FT_UINT32, BASE_HEX, NULL, 0x0, "Flush transaction ID", HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_pagp, &ett_pagp_flags, &ett_pagp_tlvs, }; static ei_register_info ei[] = { { &ei_pagp_tlv_length, { "pagp.tlv_length.invalid", PI_PROTOCOL, PI_WARN, "Invalid TLV length", EXPFILL }}, }; expert_module_t* expert_pagp; /* Register the protocol name and description */ proto_pagp = proto_register_protocol("Port Aggregation Protocol", "PAGP", "pagp"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_pagp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_pagp = expert_register_protocol(proto_pagp); expert_register_field_array(expert_pagp, ei, array_length(ei)); }
void proto_register_chdr(void) { static hf_register_info hf[] = { { &hf_chdr, { "CHDR", "chdr.hdr", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_chdr_is_extension, { "CHDR is extension", "chdr.is_extension", FT_BOOLEAN, BASE_NONE, NULL, 0x80, NULL, HFILL } }, { &hf_chdr_reserved, { "CHDR reserved", "chdr.reserved", FT_BOOLEAN, BASE_NONE, NULL, 0x40, NULL, HFILL } }, { &hf_chdr_has_time, { "CHDR has time", "chdr.has_time", FT_BOOLEAN, BASE_NONE, NULL, 0x20, NULL, HFILL } }, { &hf_chdr_eob, { "CHDR end of burst", "chdr.eob", FT_BOOLEAN, BASE_NONE, NULL, 0x10, NULL, HFILL } }, { &hf_chdr_sequence, { "CHDR sequence", "chdr.sequence", FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL } }, { &hf_chdr_packet_size, { "CHDR packet size", "chdr.packet_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_chdr_stream_id, { "CHDR stream id", //name "chdr.stream_id", //abbr FT_IPv4, //type BASE_NONE, //display NULL, //strings 0x0, //bitmask NULL, //brief description HFILL // id } }, { &hf_chdr_src_dev, { "CHDR source device", //name "chdr.src_dev", //abbr FT_UINT8, //type BASE_DEC, //display NULL, //strings 0x0, //bitmask NULL, //brief description HFILL // id } }, { &hf_chdr_src_ep, { "CHDR source endpoint", //name "chdr.src_ep", //abbr FT_UINT8, //type BASE_DEC, //display NULL, //strings 0x0, //bitmask NULL, //brief description HFILL // id } }, { &hf_chdr_dst_dev, { "CHDR destination device", //name "chdr.dst_dev", //abbr FT_UINT8, //type BASE_DEC, //display NULL, //strings 0x0, //bitmask NULL, //brief description HFILL // id } }, { &hf_chdr_dst_ep, { "CHDR destination endpoint", //name "chdr.dst_ep", //abbr FT_UINT8, //type BASE_DEC, //display NULL, //strings 0x0, //bitmask NULL, //brief description HFILL // id } }, { &hf_chdr_timestamp, { "CHDR timestamp", //name "chdr.timestamp", //abbr FT_UINT64, //type BASE_DEC, //display NULL, //strings 0x0, //bitmask NULL, //brief description HFILL } }, }; static gint *ett[] = { &ett_chdr, &ett_chdr_id }; proto_chdr = proto_register_protocol("UHD CHDR", "CHDR", "chdr"); proto_register_field_array(proto_chdr, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("chdr", dissect_chdr, proto_chdr); }
void proto_register_uasip(void) { module_t *uasip_module; static hf_register_info hf_uasip[] = { { &hf_uasip_opcode, { "Opcode", "uasip.opcode", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &uaudp_opcode_str_ext, 0x0, "UA/SIP Opcode", HFILL } }, { &hf_uasip_version, { "Version", "uasip.version", FT_UINT8, BASE_DEC, NULL, 0x0, "UA/SIP Version", HFILL } }, { &hf_uasip_window_size, { "Window Size", "uasip.window_size", FT_UINT8, BASE_DEC, NULL, 0x0, "UA/SIP Window Size", HFILL } }, { &hf_uasip_mtu, { "MTU", "uasip.mtu", FT_UINT8, BASE_DEC, NULL, 0x0, "UA/SIP MTU", HFILL } }, { &hf_uasip_udp_lost, { "UDP Lost", "uasip.udp_lost", FT_UINT8, BASE_DEC, NULL, 0x0, "UA/SIP Lost", HFILL } }, { &hf_uasip_udp_lost_reinit, { "UDP lost reinit", "uasip.udp_lost_reinit", FT_UINT8, BASE_DEC, NULL, 0x0, "UA/SIP Lost Re-Init", HFILL } }, { &hf_uasip_keepalive, { "Keepalive", "uasip.keepalive", FT_UINT8, BASE_DEC, NULL, 0x0, "UA/SIP Keepalive", HFILL } }, { &hf_uasip_qos_ip_tos, { "QoS IP TOS", "uasip.qos_ip_tos", FT_UINT8, BASE_DEC, NULL, 0x0, "UA/SIP QoS IP TOS", HFILL } }, { &hf_uasip_qos_8021_vlid, { "QoS 802.1 VLID", "uasip.qos_8021_vlid", FT_UINT8, BASE_DEC, NULL, 0x0, "UA/SIP QoS 802.1 VLID", HFILL } }, { &hf_uasip_qos_8021_pri, { "QoS 802.1 PRI", "uasip.qos_8021_pri", FT_UINT8, BASE_DEC, NULL, 0x0, "UA/SIP QoS 802.1 PRI", HFILL } }, { &hf_uasip_expseq, { "Sequence Number (expected)", "uasip.expseq", FT_UINT16, BASE_DEC, NULL, 0x0, "UA/SIP Expected Sequence Number", HFILL } }, { &hf_uasip_sntseq, { "Sequence Number (sent)", "uasip.sntseq", FT_UINT16, BASE_DEC, NULL, 0x0, "UA/SIP Sent Sequence Number", HFILL } }, }; static gint *ett[] = { &ett_uasip, }; proto_uasip = proto_register_protocol("UA/SIP Protocol", "UASIP", "uasip"); register_dissector("uasip", dissect_uasip, proto_uasip); proto_register_field_array(proto_uasip, hf_uasip, array_length(hf_uasip)); proto_register_subtree_array(ett, array_length(ett)); uasip_module = prefs_register_protocol(proto_uasip, proto_reg_handoff_uasip); prefs_register_bool_preference(uasip_module, "aplication_octet_stream", "Try to decode application/octet-stream as UASIP", "UA SIP Protocol enabled", &uasip_enabled); prefs_register_bool_preference(uasip_module, "noesip", "Try to decode SIP NOE", "NOE SIP Protocol", &noesip_enabled); prefs_register_string_preference(uasip_module, "proxy_ipaddr", "Proxy IP Address", "IPv4 address of the proxy (Invalid values will be ignored)", &pref_proxy_ipaddr_s); #if 0 uasip_tap = register_tap("uasip"); #endif }
/* Register the protocol with Wireshark */ void proto_register_mrp_mvrp(void) { static hf_register_info hf[] = { { &hf_mvrp_proto_id, { "Protocol Version", "mrp-mvrp.protocol_version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mvrp_message, /* Message is a group of fields */ { "Message", "mrp-mvrp.message", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_mvrp_attribute_type, { "Attribute Type", "mrp-mvrp.attribute_type", FT_UINT8, BASE_DEC, VALS(attribute_type_vals), 0x0, NULL, HFILL } }, { &hf_mvrp_attribute_length, { "Attribute Length", "mrp-mvrp.attribute_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mvrp_attribute_list, /* AttributeList is a group of fields */ { "Attribute List", "mrp-mvrp.attribute_list", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_mvrp_vector_attribute, /* VectorAttribute is a group of fields */ { "Vector Attribute", "mrp-mvrp.vector_attribute", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_mvrp_vector_header, { "Vector Header", "mrp-mvrp.vector_header", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mvrp_leave_all_event, { "Leave All Event", "mrp-mvrp.leave_all_event", FT_UINT16, BASE_DEC, VALS(leave_all_vals), MVRP_LEAVE_ALL_EVENT_MASK, NULL, HFILL } }, { &hf_mvrp_number_of_values, { "Number of Values", "mrp-mvrp.number_of_values", FT_UINT16, BASE_DEC, NULL, MVRP_NUMBER_OF_VALUES_MASK, NULL, HFILL } }, { &hf_mvrp_first_value, /* FirstValue is a group of fields */ { "First Value", "mrp-mvrp.first_value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_mvrp_vid, { "VLAN ID", "mrp-mvrp.vid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mvrp_three_packed_event, { "Attribute Event", "mrp-msrp.three_packed_event", FT_UINT8, BASE_DEC, VALS(three_packed_vals), 0x0, NULL, HFILL } }, { &hf_mvrp_end_mark, { "End Mark", "mrp-mvrp.end_mark", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_mvrp, &ett_msg, &ett_attr_list, &ett_vect_attr, &ett_vector_header, &ett_first_value }; /* Register the protocol name and description */ proto_mvrp = proto_register_protocol("Multiple VLAN Registration Protocol", "MRP-MVRP", "mrp-mvrp"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_mvrp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); }
void proto_register_brdwlk(void) { /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_brdwlk_sof, {"SOF", "brdwlk.sof", FT_UINT8, BASE_HEX, VALS(brdwlk_sof_vals), 0xF0, NULL, HFILL}}, { &hf_brdwlk_eof, {"EOF", "brdwlk.eof", FT_UINT8, BASE_HEX, VALS(brdwlk_eof_vals), 0x0F, NULL, HFILL}}, { &hf_brdwlk_error, {"Error", "brdwlk.error", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_brdwlk_pktcnt, {"Packet Count", "brdwlk.pktcnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_brdwlk_drop, {"Packet Dropped", "brdwlk.drop", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_brdwlk_vsan, {"VSAN", "brdwlk.vsan", FT_UINT16, BASE_DEC, NULL, 0xFFF, NULL, HFILL}}, { &hf_brdwlk_plen, {"Original Packet Length", "brdwlk.plen", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, { &hf_brdwlk_error_plp, {"Packet Length Present", "brdwlk.error.plp", FT_BOOLEAN, 8, TFS(&tfs_error_plp), 0x01, NULL, HFILL}}, { &hf_brdwlk_error_ef, {"Empty Frame", "brdwlk.error.ef", FT_BOOLEAN, 8, TFS(&tfs_error_ef), 0x02, NULL, HFILL}}, { &hf_brdwlk_error_nd, {"No Data", "brdwlk.error.nd", FT_BOOLEAN, 8, TFS(&tfs_error_nd), 0x04, NULL, HFILL}}, { &hf_brdwlk_error_tr, {"Truncated", "brdwlk.error.tr", FT_BOOLEAN, 8, TFS(&tfs_error_tr), 0x08, NULL, HFILL}}, { &hf_brdwlk_error_badcrc, {"CRC", "brdwlk.error.crc", FT_BOOLEAN, 8, TFS(&tfs_error_crc), 0x10, NULL, HFILL}}, { &hf_brdwlk_error_ff, {"Fifo Full", "brdwlk.error.ff", FT_BOOLEAN, 8, TFS(&tfs_error_ff), 0x20, NULL, HFILL}}, { &hf_brdwlk_error_jumbo, {"Jumbo FC Frame", "brdwlk.error.jumbo", FT_BOOLEAN, 8, TFS(&tfs_error_jumbo), 0x40, NULL, HFILL}}, { &hf_brdwlk_error_ctrl, {"Ctrl Char Inside Frame", "brdwlk.error.ctrl", FT_BOOLEAN, 8, TFS(&tfs_error_ctrl), 0x80, NULL, HFILL}}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_brdwlk, &ett_brdwlk_error, }; /* Register the protocol name and description */ proto_brdwlk = proto_register_protocol("Boardwalk", "Boardwalk", "brdwlk"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_brdwlk, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_init_routine(&brdwlk_init); }
void proto_register_epmd(void) { static hf_register_info hf[] = { { &hf_epmd_len, { "Length", "epmd.len", FT_UINT16, BASE_DEC, NULL, 0x0, "Message Length", HFILL }}, { &hf_epmd_type, { "Type", "epmd.type", FT_UINT8, BASE_DEC, VALS(message_types), 0x0, "Message Type", HFILL }}, { &hf_epmd_result, { "Result", "epmd.result", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_epmd_tcp_port, { "TCP Port", "epmd.tcp_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_epmd_creation, { "Creation", "epmd.creation", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_epmd_dist_high, { "Dist High", "epmd.dist_high", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_epmd_dist_low, { "Dist Low", "epmd.dist_low", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_epmd_name_len, { "Name Length", "epmd.name_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_epmd_name, { "Name", "epmd.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_epmd_elen, { "Elen", "epmd.elen", FT_UINT16, BASE_DEC, NULL, 0x0, "Extra Length", HFILL }}, { &hf_epmd_edata, { "Edata", "epmd.edata", FT_BYTES, BASE_NONE, NULL, 0x0, "Extra Data", HFILL }}, { &hf_epmd_names, { "Names", "epmd.names", FT_BYTES, BASE_NONE, NULL, 0x0, "List of names", HFILL }} }; static gint *ett[] = { &ett_epmd, }; proto_epmd = proto_register_protocol("EPMD Protocol", "EPMD", "epmd"); proto_register_field_array(proto_epmd, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); new_register_dissector("epmd", dissect_epmd, proto_epmd); }
void proto_register_irc(void) { static hf_register_info hf[] = { { &hf_irc_response, { "Response", "irc.response", FT_STRING, STR_ASCII, NULL, 0x0, "Line of response message", HFILL }}, { &hf_irc_request, { "Request", "irc.request", FT_STRING, STR_ASCII, NULL, 0x0, "Line of request message", HFILL }}, { &hf_irc_request_prefix, { "Prefix", "irc.request.prefix", FT_STRING, STR_ASCII, NULL, 0x0, "Request prefix", HFILL }}, { &hf_irc_request_command, { "Command", "irc.request.command", FT_STRING, STR_ASCII, NULL, 0x0, "Request command", HFILL }}, { &hf_irc_request_command_param, { "Parameter", "irc.request.command_parameter", FT_STRING, STR_ASCII, NULL, 0x0, "Request command parameter", HFILL }}, { &hf_irc_request_trailer, { "Trailer", "irc.request.trailer", FT_STRING, STR_ASCII, NULL, 0x0, "Request trailer", HFILL }}, { &hf_irc_response_prefix, { "Prefix", "irc.response.prefix", FT_STRING, STR_ASCII, NULL, 0x0, "Response prefix", HFILL }}, { &hf_irc_response_command, { "Command", "irc.response.command", FT_STRING, STR_ASCII, NULL, 0x0, "Response command", HFILL }}, { &hf_irc_response_num_command, { "Command", "irc.response.num_command", FT_UINT16, BASE_DEC, NULL, 0x0, "Response (numeric) command", HFILL }}, { &hf_irc_response_command_param, { "Parameter", "irc.response.command_parameter", FT_STRING, STR_ASCII, NULL, 0x0, "Response command parameter", HFILL }}, { &hf_irc_response_trailer, { "Trailer", "irc.response.trailer", FT_STRING, STR_ASCII, NULL, 0x0, "Response trailer", HFILL }}, { &hf_irc_ctcp, { "CTCP Data", "irc.ctcp", FT_STRING, STR_ASCII, NULL, 0x0, "Placeholder to dissect CTCP data", HFILL }} }; static gint *ett[] = { &ett_irc, &ett_irc_request, &ett_irc_request_command, &ett_irc_response, &ett_irc_response_command }; static ei_register_info ei[] = { { &ei_irc_missing_end_delimiter, { "irc.missing_end_delimiter", PI_MALFORMED, PI_ERROR, "Missing ending tag delimiter (0x01)", EXPFILL }}, { &ei_irc_tag_data_invalid, { "irc.tag_data_invalid", PI_PROTOCOL, PI_WARN, "Tag data outside of NOTICE or PRIVMSG command", EXPFILL }}, { &ei_irc_prefix_missing_ending_space, { "irc.prefix_missing_ending_space", PI_MALFORMED, PI_ERROR, "Prefix missing ending <space>", EXPFILL }}, { &ei_irc_request_command, { "irc.request.command.missing", PI_MALFORMED, PI_ERROR, "Request has no command", EXPFILL }}, { &ei_irc_numeric_request_command, { "irc.request.command.numeric", PI_PROTOCOL, PI_WARN, "Numeric command not allowed in request", EXPFILL }}, { &ei_irc_response_command, { "irc.response.command.missing", PI_MALFORMED, PI_ERROR, "Response has no command", EXPFILL }}, }; expert_module_t* expert_irc; proto_irc = proto_register_protocol("Internet Relay Chat", "IRC", "irc"); proto_register_field_array(proto_irc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_irc = expert_register_protocol(proto_irc); expert_register_field_array(expert_irc, ei, array_length(ei)); /* compile patterns */ ws_mempbrk_compile(&pbrk_tag_delimiter, TAG_DELIMITER); }
void proto_register_clnp(void) { static hf_register_info hf[] = { { &hf_clnp_id, { "Network Layer Protocol Identifier", "clnp.nlpi", FT_UINT8, BASE_HEX, VALS(nlpid_vals), 0x0, NULL, HFILL }}, { &hf_clnp_length, { "HDR Length", "clnp.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_version, { "Version", "clnp.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_ttl, { "Holding Time", "clnp.ttl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_type, { "PDU Type", "clnp.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_cnf_segmentation, { "Segmentation permitted", "clnp.cnf.segmentation", FT_BOOLEAN, 8, TFS(&tfs_yes_no), CNF_SEG_OK, NULL, HFILL }}, { &hf_clnp_cnf_more_segments, { "More segments", "clnp.cnf.more_segments", FT_BOOLEAN, 8, TFS(&tfs_yes_no), CNF_MORE_SEGS, NULL, HFILL }}, { &hf_clnp_cnf_report_error, { "Report error if PDU discarded", "clnp.cnf.report_error", FT_BOOLEAN, 8, TFS(&tfs_yes_no), CNF_ERR_OK, NULL, HFILL }}, { &hf_clnp_cnf_type, { "Type", "clnp.cnf.type", FT_UINT8, BASE_DEC, VALS(npdu_type_vals), CNF_TYPE, NULL, HFILL }}, { &hf_clnp_pdu_length, { "PDU length", "clnp.pdu.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_checksum, { "Checksum", "clnp.checksum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_dest_length, { "DAL", "clnp.dsap.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_dest, { "DA", "clnp.dsap", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_src_length, { "SAL", "clnp.ssap.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_src, { "SA", "clnp.ssap", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_atntt, { "ATN traffic type", "clnp.atn.tt", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_atnsc, { "ATN security classification", "clnp.atn.sc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_segment_overlap, { "Segment overlap", "clnp.segment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Segment overlaps with other segments", HFILL }}, { &hf_clnp_segment_overlap_conflict, { "Conflicting data in segment overlap", "clnp.segment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Overlapping segments contained conflicting data", HFILL }}, { &hf_clnp_segment_multiple_tails, { "Multiple tail segments found", "clnp.segment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Several tails were found when reassembling the packet", HFILL }}, { &hf_clnp_segment_too_long_segment, { "Segment too long", "clnp.segment.toolongsegment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Segment contained data past end of packet", HFILL }}, { &hf_clnp_segment_error, { "Reassembly error", "clnp.segment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Reassembly error due to illegal segments", HFILL }}, { &hf_clnp_segment_count, { "Segment count", "clnp.segment.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_segment, { "CLNP Segment", "clnp.segment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_segments, { "CLNP Segments", "clnp.segments", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_clnp_reassembled_in, { "Reassembled CLNP in frame", "clnp.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This CLNP packet is reassembled in this frame", HFILL }}, { &hf_clnp_reassembled_length, { "Reassembled CLNP length", "clnp.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The total length of the reassembled payload", HFILL }} }; static gint *ett[] = { &ett_clnp, &ett_clnp_type, &ett_clnp_segments, &ett_clnp_segment, &ett_clnp_disc_pdu, }; module_t *clnp_module; proto_clnp = proto_register_protocol(PROTO_STRING_CLNP, "CLNP", "clnp"); proto_register_field_array(proto_clnp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("clnp", dissect_clnp, proto_clnp); register_heur_dissector_list("clnp", &clnp_heur_subdissector_list); register_init_routine(clnp_reassemble_init); clnp_module = prefs_register_protocol(proto_clnp, NULL); prefs_register_uint_preference(clnp_module, "tp_nsap_selector", "NSAP selector for Transport Protocol (last byte in hex)", "NSAP selector for Transport Protocol (last byte in hex)", 16, &tp_nsap_selector); prefs_register_bool_preference(clnp_module, "always_decode_transport", "Always try to decode NSDU as transport PDUs", "Always try to decode NSDU as transport PDUs", &always_decode_transport); prefs_register_bool_preference(clnp_module, "reassemble", "Reassemble segmented CLNP datagrams", "Whether segmented CLNP datagrams should be reassembled", &clnp_reassemble); prefs_register_bool_preference(clnp_module, "decode_atn_options", "Decode ATN security label", "Whether ATN security label should be decoded", &clnp_decode_atn_options); }
/* Register the protocol with Wireshark */ void proto_register_mason(void) { static hf_register_info hf[] = { { &hf_mason_version, { "Version", "mason.version", FT_UINT8, BASE_DEC, NULL, VERSION_MASK, NULL, HFILL } }, { &hf_mason_type, { "Type", "mason.type", FT_UINT8, BASE_DEC, VALS(mason_type_names), TYPE_MASK, NULL, HFILL } }, { &hf_mason_sig, { "Signed Flag", "mason.signed", FT_BOOLEAN, 8, NULL, SIG_MASK, NULL, HFILL } }, { &hf_mason_rssi, { "RSSI", "mason.rssi", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mason_rnd_id, { "Round ID", "mason.rnd_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mason_sender_id, { "Sender ID", "mason.sender_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mason_pkt_uid, { "Packet ID", "mason.packet_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mason_init_pubkey, { "Public Key", "mason.init.pubkey", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_mason_par_pubkey, { "Public Key", "mason.par.pubkey", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_mason_parack_id, { "Id", "mason.parack.id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mason_parack_pubkey, { "Public Key", "mason.parack.pubkey", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_mason_parlist_startid, { "Start Id", "mason.parlist.startid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mason_parlist_count, { "Count", "mason.parlist.count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mason_parlist_par_pubkey, { "Public Key", "mason.parlist.par.pubkey", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_mason_txreq_id, { "Id", "mason.txreq.id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mason_rsstreq_id, { "Id", "mason.rsstreq.id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mason_rsst_frag, { "Fragmented", "mason.rsst.frag", FT_BOOLEAN, 8, NULL, 0x0, NULL, HFILL } }, { &hf_mason_rsst_len, { "Length", "mason.rsst.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mason_rsst_data, { "Data", "mason.rsst.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } } }; static gint *ett[] = { &ett_mason, &ett_init, &ett_par, &ett_parack, &ett_parlist, &ett_parlist_data, &ett_parlist_par, &ett_txreq, &ett_meas, &ett_rsstreq, &ett_rsst }; proto_mason = proto_register_protocol("Mason Protocol", "Mason", "mason"); proto_register_field_array(proto_mason, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); }
void proto_register_rmi(void) { static hf_register_info hf[] = { { &hf_rmi_magic, { "Magic", "rmi.magic", FT_UINT32, BASE_HEX, NULL, 0x0, "RMI Header Magic", HFILL }}, { &hf_rmi_version, { "Version", "rmi.version", FT_UINT16, BASE_DEC, NULL, 0x0, "RMI Protocol Version", HFILL }}, { &hf_rmi_protocol, { "Protocol","rmi.protocol", FT_UINT8, BASE_HEX, VALS(rmi_protocol_str), 0x0, "RMI Protocol Type", HFILL }}, { &hf_rmi_inputmessage, { "Input Stream Message", "rmi.inputstream.message", FT_UINT8, BASE_HEX, VALS(rmi_input_message_str), 0x0, "RMI Inputstream Message Token", HFILL }}, { &hf_rmi_outputmessage, { "Output Stream Message", "rmi.outputstream.message", FT_UINT8, BASE_HEX, VALS(rmi_output_message_str), 0x0, "RMI Outputstream Message token", HFILL }}, { &hf_rmi_epid_length, { "Length", "rmi.endpoint_id.length", FT_UINT16, BASE_DEC, NULL, 0x0, "RMI Endpointidentifier Length", HFILL }}, { &hf_rmi_epid_hostname, { "Hostname", "rmi.endpoint_id.hostname", FT_STRING, BASE_NONE, NULL, 0x0, "RMI Endpointidentifier Hostname", HFILL }}, { &hf_rmi_epid_port, { "Port", "rmi.endpoint_id.port", FT_UINT16, BASE_DEC, NULL, 0x0, "RMI Endpointindentifier Port", HFILL }}, { &hf_ser_magic, { "Magic", "rmi.ser.magic", FT_UINT16, BASE_HEX, NULL, 0x0, "Java Serialization Magic", HFILL }}, { &hf_ser_version, { "Version", "rmi.ser.version", FT_UINT16, BASE_DEC, NULL, 0x0, "Java Serialization Version", HFILL }}, }; static gint *ett[] = { &ett_rmi, &ett_rmi_magic, &ett_rmi_version, &ett_rmi_inputmessage, &ett_rmi_outputmessage, &ett_rmi_epid_length, &ett_rmi_epid_hostname, &ett_rmi_epid_port, &ett_ser, }; proto_rmi = proto_register_protocol("Java RMI", "RMI", "rmi"); proto_ser = proto_register_protocol("Java Serialization", "Serialization", "serialization"); proto_register_field_array(proto_rmi, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); }
void proto_register_jpeg(void) { static hf_register_info hf[] = { { &hf_rtp_jpeg_main_hdr, { "Main Header", "jpeg.main_hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_main_hdr_ts, { "Type Specific", "jpeg.main_hdr.ts", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_main_hdr_offs, { "Fragment Offset", "jpeg.main_hdr.offset", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_main_hdr_type, { "Type", "jpeg.main_hdr.type", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_main_hdr_q, { "Q", "jpeg.main_hdr.q", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_main_hdr_width, { "Width", "jpeg.main_hdr.width", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_main_hdr_height, { "Height", "jpeg.main_hdr.height", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_restart_hdr, { "Restart Marker Header", "jpeg.restart_hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_restart_hdr_interval, { "Restart Interval", "jpeg.restart_hdr.interval", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_restart_hdr_f, { "F", "jpeg.restart_hdr.f", FT_UINT16, BASE_DEC, NULL, 0x8000, NULL, HFILL }}, { &hf_rtp_jpeg_restart_hdr_l, { "L", "jpeg.restart_hdr.l", FT_UINT16, BASE_DEC, NULL, 0x4000, NULL, HFILL }}, { &hf_rtp_jpeg_restart_hdr_count, { "Restart Count", "jpeg.restart_hdr.count", FT_UINT16, BASE_DEC, NULL, 0x3FFF, NULL, HFILL }}, { &hf_rtp_jpeg_qtable_hdr, { "Quantization Table Header", "jpeg.qtable_hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_qtable_hdr_mbz, { "MBZ", "jpeg.qtable_hdr.mbz", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_qtable_hdr_prec, { "Precision", "jpeg.qtable_hdr.precision", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_qtable_hdr_length, { "Length", "jpeg.qtable_hdr.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_qtable_hdr_data, { "Quantization Table Data", "jpeg.qtable_hdr.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rtp_jpeg_payload, { "Payload", "jpeg.payload", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, }; static gint *ett[] = { &ett_jpeg, }; proto_jpeg = proto_register_protocol("RFC 2435 JPEG","JPEG","jpeg"); proto_register_field_array(proto_jpeg, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); }
/*--- proto_register_p1 -------------------------------------------*/ void proto_register_p1(void) { /* List of fields */ static hf_register_info hf[] = { /* "Created by defining PDU in .cnf */ { &hf_p1_MTABindArgument_PDU, { "MTABindArgument", "p1.MTABindArgument", FT_UINT32, BASE_DEC, VALS(p1_MTABindArgument_vals), 0, "p1.MTABindArgument", HFILL }}, { &hf_p1_MTABindResult_PDU, { "MTABindResult", "p1.MTABindResult", FT_UINT32, BASE_DEC, VALS(p1_MTABindResult_vals), 0, "p1.MTABindResult", HFILL }}, { &hf_p1_MTABindError_PDU, { "MTABindError", "p1.MTABindError", FT_UINT32, BASE_DEC, VALS(p1_MTABindError_vals), 0, "p1.MTABindError", HFILL }}, { &hf_p1_MTS_APDU_PDU, { "MTS-APDU", "p1.MTS_APDU", FT_UINT32, BASE_DEC, VALS(p1_MTS_APDU_vals), 0, "p1.MTS_APDU", HFILL }}, #include "packet-p1-hfarr.c" }; /* List of subtrees */ static gint *ett[] = { &ett_p1, &ett_p3, &ett_p1_content_unknown, &ett_p1_bilateral_information, &ett_p1_additional_information, &ett_p1_unknown_standard_extension, &ett_p1_unknown_extension_attribute_type, &ett_p1_unknown_tokendata_type, #include "packet-p1-ettarr.c" }; static ei_register_info ei[] = { { &ei_p1_unknown_extension_attribute_type, { "p1.unknown.extension_attribute_type", PI_UNDECODED, PI_WARN, "Unknown extension-attribute-type", EXPFILL }}, { &ei_p1_unknown_standard_extension, { "p1.unknown.standard_extension", PI_UNDECODED, PI_WARN, "Unknown standard-extension", EXPFILL }}, { &ei_p1_unknown_built_in_content_type, { "p1.unknown.built_in_content_type", PI_UNDECODED, PI_WARN, "Unknown built-in content-type", EXPFILL }}, { &ei_p1_unknown_tokendata_type, { "p1.unknown.tokendata_type", PI_UNDECODED, PI_WARN, "Unknown tokendata-type", EXPFILL }}, }; expert_module_t* expert_p1; module_t *p1_module; /* Register protocol */ proto_p1 = proto_register_protocol(PNAME, PSNAME, PFNAME); register_dissector("p1", dissect_p1, proto_p1); proto_p3 = proto_register_protocol("X.411 Message Access Service", "P3", "p3"); /* Register fields and subtrees */ proto_register_field_array(proto_p1, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_p1 = expert_register_protocol(proto_p1); expert_register_field_array(expert_p1, ei, array_length(ei)); p1_extension_dissector_table = register_dissector_table("p1.extension", "P1-EXTENSION", FT_UINT32, BASE_DEC); p1_extension_attribute_dissector_table = register_dissector_table("p1.extension-attribute", "P1-EXTENSION-ATTRIBUTE", FT_UINT32, BASE_DEC); p1_tokendata_dissector_table = register_dissector_table("p1.tokendata", "P1-TOKENDATA", FT_UINT32, BASE_DEC); /* Register our configuration options for P1, particularly our port */ p1_module = prefs_register_protocol_subtree("OSI/X.400", proto_p1, prefs_register_p1); prefs_register_uint_preference(p1_module, "tcp.port", "P1 TCP Port", "Set the port for P1 operations (if other" " than the default of 102)", 10, &global_p1_tcp_port); register_ber_syntax_dissector("P1 Message", proto_p1, dissect_p1_mts_apdu); }
void proto_register_bacnet(void) { static hf_register_info hf[] = { { &hf_bacnet_version, { "Version", "bacnet.version", FT_UINT8, BASE_DEC, NULL, 0, "BACnet Version", HFILL } }, { &hf_bacnet_control, { "Control", "bacnet.control", FT_UINT8, BASE_HEX, NULL, 0, "BACnet Control", HFILL } }, { &hf_bacnet_control_net, { "NSDU contains", "bacnet.control_net", FT_BOOLEAN, 8, TFS(&control_net_set_high), BAC_CONTROL_NET, "BACnet Control", HFILL } }, { &hf_bacnet_control_res1, { "Reserved", "bacnet.control_res1", FT_BOOLEAN, 8, TFS(&control_res_high), BAC_CONTROL_RES1, "BACnet Control", HFILL } }, { &hf_bacnet_control_dest, { "Destination Specifier", "bacnet.control_dest", FT_BOOLEAN, 8, TFS(&control_dest_high), BAC_CONTROL_DEST, "BACnet Control", HFILL } }, { &hf_bacnet_control_res2, { "Reserved", "bacnet.control_res2", FT_BOOLEAN, 8, TFS(&control_res_high), BAC_CONTROL_RES2, "BACnet Control", HFILL } }, { &hf_bacnet_control_src, { "Source specifier", "bacnet.control_src", FT_BOOLEAN, 8, TFS(&control_src_high), BAC_CONTROL_SRC, "BACnet Control", HFILL } }, { &hf_bacnet_control_expect, { "Expecting Reply", "bacnet.control_expect", FT_BOOLEAN, 8, TFS(&control_expect_high), BAC_CONTROL_EXPECT, "BACnet Control", HFILL } }, { &hf_bacnet_control_prio_high, { "Priority", "bacnet.control_prio_high", FT_BOOLEAN, 8, TFS(&control_prio_high_high), BAC_CONTROL_PRIO_HIGH, "BACnet Control", HFILL } }, { &hf_bacnet_control_prio_low, { "Priority", "bacnet.control_prio_low", FT_BOOLEAN, 8, TFS(&control_prio_low_high), BAC_CONTROL_PRIO_LOW, "BACnet Control", HFILL } }, { &hf_bacnet_dnet, { "Destination Network Address", "bacnet.dnet", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_bacnet_dlen, { "Destination MAC Layer Address Length", "bacnet.dlen", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_bacnet_dadr_eth, { "Destination ISO 8802-3 MAC Address", "bacnet.dadr_eth", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_bacnet_dadr_mstp, { "DADR", "bacnet.dadr_mstp", FT_UINT8, BASE_DEC, NULL, 0, "Destination MS/TP or ARCNET MAC Address", HFILL } }, { &hf_bacnet_dadr_tmp, { "Unknown Destination MAC", "bacnet.dadr_tmp", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_bacnet_snet, { "Source Network Address", "bacnet.snet", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_bacnet_slen, { "Source MAC Layer Address Length", "bacnet.slen", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_bacnet_sadr_eth, { "SADR", "bacnet.sadr_eth", FT_ETHER, BASE_NONE, NULL, 0, "Source ISO 8802-3 MAC Address", HFILL } }, { &hf_bacnet_sadr_mstp, { "SADR", "bacnet.sadr_mstp", FT_UINT8, BASE_DEC, NULL, 0, "Source MS/TP or ARCNET MAC Address", HFILL } }, { &hf_bacnet_sadr_tmp, { "Unknown Source MAC", "bacnet.sadr_tmp", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_bacnet_hopc, { "Hop Count", "bacnet.hopc", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_bacnet_mesgtyp, { "Network Layer Message Type", "bacnet.mesgtyp", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_bacnet_vendor, { "Vendor ID", "bacnet.vendor", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_bacnet_perf, { "Performance Index", "bacnet.perf", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_bacnet_rejectreason, { "Reject Reason", "bacnet.rejectreason", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_bacnet_rportnum, { "Number of Port Mappings", "bacnet.rportnum", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_bacnet_pinfolen, { "Port Info Length", "bacnet.pinfolen", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_bacnet_pinfo, { "Port Inf", "bacnet.pinfo", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_bacnet_portid, { "Port ID", "bacnet.portid", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_bacnet_term_time_value, { "Termination Time Value (seconds)", "bacnet.term_time_value", FT_UINT8, BASE_DEC, NULL, 0, "Termination Time Value", HFILL } } }; static gint *ett[] = { &ett_bacnet, &ett_bacnet_control, }; proto_bacnet = proto_register_protocol("Building Automation and Control Network NPDU", "BACnet", "bacnet"); proto_register_field_array(proto_bacnet, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("bacnet", dissect_bacnet, proto_bacnet); bacnet_dissector_table = register_dissector_table("bacnet.vendor", "BACnet Vendor Identifier", FT_UINT8, BASE_HEX); }
/* Register the protocol with Wireshark */ void proto_register_1722(void) { static hf_register_info hf[] = { { &hf_1722_cdfield, { "Control/Data Indicator", "ieee1722.cdfield", FT_BOOLEAN, 8, NULL, IEEE_1722_CD_MASK, NULL, HFILL } }, { &hf_1722_subtype, { "AVBTP Subtype", "ieee1722.subtype", FT_UINT8, BASE_HEX, NULL, IEEE_1722_SUBTYPE_MASK, NULL, HFILL } }, { &hf_1722_svfield, { "AVBTP Stream ID Valid", "ieee1722.svfield", FT_BOOLEAN, 8, NULL, IEEE_1722_SV_MASK, NULL, HFILL } }, { &hf_1722_verfield, { "AVBTP Version", "ieee1722.verfield", FT_UINT8, BASE_HEX, NULL, IEEE_1722_VER_MASK, NULL, HFILL } }, { &hf_1722_mrfield, { "AVBTP Media Reset", "ieee1722.mrfield", FT_UINT8, BASE_DEC, NULL, IEEE_1722_MR_MASK, NULL, HFILL } }, { &hf_1722_gvfield, { "AVBTP Gateway Info Valid", "ieee1722.gvfield", FT_BOOLEAN, 8, NULL, IEEE_1722_GV_MASK, NULL, HFILL } }, { &hf_1722_tvfield, { "Source Timestamp Valid", "ieee1722.tvfield", FT_BOOLEAN, 8, NULL, IEEE_1722_TV_MASK, NULL, HFILL } }, { &hf_1722_seqnum, { "Sequence Number", "ieee1722.seqnum", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_1722_tufield, { "AVBTP Timestamp Uncertain", "ieee1722.tufield", FT_BOOLEAN, 8, NULL, IEEE_1722_TU_MASK, NULL, HFILL } }, { &hf_1722_stream_id, { "Stream ID", "ieee1722.stream_id", FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_1722_avbtp_timestamp, { "AVBTP Timestamp", "ieee1722.avbtp_timestamp", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_1722_gateway_info, { "Gateway Info", "ieee1722.gateway_info", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_1722_packet_data_length, { "1394 Packet Data Length", "ieee1722.packet_data_len", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_1722_tag, { "1394 Packet Format Tag", "ieee1722.tag", FT_UINT8, BASE_HEX, NULL, IEEE_1722_TAG_MASK, NULL, HFILL } }, { &hf_1722_channel, { "1394 Packet Channel", "ieee1722.channel", FT_UINT8, BASE_HEX, NULL, IEEE_1722_CHANNEL_MASK, NULL, HFILL } }, { &hf_1722_tcode, { "1394 Packet Tcode", "ieee1722.tcode", FT_UINT8, BASE_HEX, NULL, IEEE_1722_TCODE_MASK, NULL, HFILL } }, { &hf_1722_sy, { "1394 App-specific Control", "ieee1722.sy", FT_UINT8, BASE_HEX, NULL, IEEE_1722_SY_MASK, NULL, HFILL } }, { &hf_1722_sid, { "Source ID", "ieee1722.sid", FT_UINT8, BASE_HEX, NULL, IEEE_1722_SID_MASK, NULL, HFILL } }, { &hf_1722_dbs, { "Data Block Size", "ieee1722.dbs", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_1722_fn, { "Fraction Number", "ieee1722.fn", FT_UINT8, BASE_HEX, NULL, IEEE_1722_FN_MASK, NULL, HFILL } }, { &hf_1722_qpc, { "Quadlet Padding Count", "ieee1722.qpc", FT_UINT8, BASE_HEX, NULL, IEEE_1722_QPC_MASK, NULL, HFILL } }, { &hf_1722_sph, { "Source Packet Header", "ieee1722.sph", FT_BOOLEAN, 8, NULL, IEEE_1722_SPH_MASK, NULL, HFILL } }, { &hf_1722_dbc, { "Data Block Continuity", "ieee1722.dbc", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_1722_fmt, { "Format ID", "ieee1722.fmt", FT_UINT8, BASE_HEX, NULL, IEEE_1722_FMT_MASK, NULL, HFILL } }, { &hf_1722_fdf, { "Format Dependent Field", "ieee1722.fdf", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_1722_syt, { "SYT", "ieee1722.syt", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_1722_data, { "Audio Data", "ieee1722.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_1722_label, { "Label", "ieee1722.data.sample.label", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_1722_sample, { "Sample", "ieee1722.data.sample.sampledata", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, }; static gint *ett[] = { &ett_1722, &ett_1722_audio, &ett_1722_sample }; /* Register the protocol name and description */ proto_1722 = proto_register_protocol("IEEE 1722 Protocol", "IEEE1722", "ieee1722"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_1722, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); }
void proto_register_swift(void) { static hf_register_info hf[] = { /* Global */ { &hf_swift_receiving_channel, { "Receiving Channel", "swift.receiving.channel", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_swift_message_type, { "Message Type", "swift.message.type", FT_UINT8, BASE_DEC, VALS(message_type_names), 0x0, NULL, HFILL } }, /* 00 Handshake */ { &hf_swift_handshake_channel, { "Handshake Channel", "swift.handshake.channel", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* 01 Data */ { &hf_swift_data_bin_id, { "Data Bin ID", "swift.data.bin_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_swift_data_payload, { "Data Payload", "swift.data.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* 02 Ack */ { &hf_swift_ack_bin_id, { "Ack Bin ID", "swift.ack.bin_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_swift_ack_timestamp, { "Timestamp", "swift.ack.timestamp", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* 03 Have */ { &hf_swift_have_bin_id, { "Have Bin ID", "swift.have.bin_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* 04 Hash */ { &hf_swift_hash_bin_id, { "Hash Bin ID", "swift.hash.bin_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_swift_hash_value, { "Hash Value", "swift.hash.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* 05 PEX+ */ { &hf_swift_pexplus_ip, { "PEX+ IP Address", "swift.pex_plus.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_swift_pexplus_port, { "PEX+ Port", "swift.pex_plus.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* 06 PEX- */ { &hf_swift_pexminus_ip, { "PEX- IP Address", "swift.pex_minus.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_swift_pexminus_port, { "PEX- Port", "swift.pex_minus.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* 07 Signed Hash */ { &hf_swift_signed_hash_bin_id, { "Signed Hash Bin ID", "swift.signed_hash.bin_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_swift_signed_hash_value, { "Signed Hash Value", "swift.signed_hash.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_swift_signed_hash_signature, { "Signed Hash Signature", "swift.signed_hash.signature", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* 08 Hint */ { &hf_swift_hint_bin_id, { "Hint Bin ID", "swift.hint.bin_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_swift }; proto_swift = proto_register_protocol ( "swift: the multiparty transport protocol", /* name */ "swift", /* short name */ "swift" /* abbrev */ ); proto_register_field_array(proto_swift, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("swift", dissect_swift, proto_swift); }
void proto_register_who(void) { static hf_register_info hf[] = { { &hf_who_vers, { "Version", "who.vers", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_who_type, { "Type", "who.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_who_sendtime, { "Send Time", "who.sendtime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_who_recvtime, { "Receive Time", "who.recvtime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_who_hostname, { "Hostname", "who.hostname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_loadav_5, { "Load Average Over Past 5 Minutes", "who.loadav_5", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_loadav_10, { "Load Average Over Past 10 Minutes", "who.loadav_10", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_loadav_15, { "Load Average Over Past 15 Minutes", "who.loadav_15", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_boottime, { "Boot Time", "who.boottime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_who_whoent, { "Who utmp Entry", "who.entry", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_tty, { "TTY Name", "who.tty", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_uid, { "User ID", "who.uid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_timeon, { "Time On", "who.timeon", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_who_idle, { "Time Idle", "who.idle", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_who, &ett_whoent, }; proto_who = proto_register_protocol("Who", "WHO", "who"); proto_register_field_array(proto_who, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); }
void proto_register_frame(void) { static hf_register_info hf[] = { { &hf_frame_arrival_time, { "Arrival Time", "frame.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, "Absolute time when this frame was captured", HFILL }}, { &hf_frame_shift_offset, { "Time shift for this packet", "frame.offset_shift", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "Time shift applied to this packet", HFILL }}, { &hf_frame_arrival_time_epoch, { "Epoch Time", "frame.time_epoch", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "Epoch time when this frame was captured", HFILL }}, { &hf_frame_time_delta, { "Time delta from previous captured frame", "frame.time_delta", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_frame_time_delta_displayed, { "Time delta from previous displayed frame", "frame.time_delta_displayed", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_frame_time_relative, { "Time since reference or first frame", "frame.time_relative", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "Time relative to time reference or first frame", HFILL }}, { &hf_frame_time_reference, { "This is a Time Reference frame", "frame.ref_time", FT_NONE, BASE_NONE, NULL, 0x0, "This frame is a Time Reference frame", HFILL }}, { &hf_frame_number, { "Frame Number", "frame.number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_frame_len, { "Frame length on the wire", "frame.len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_frame_capture_len, { "Frame length stored into the capture file", "frame.cap_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_frame_md5_hash, { "Frame MD5 Hash", "frame.md5_hash", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_frame_p2p_dir, { "Point-to-Point Direction", "frame.p2p_dir", FT_INT8, BASE_DEC, VALS(p2p_dirs), 0x0, NULL, HFILL }}, { &hf_link_number, { "Link Number", "frame.link_nr", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_frame_file_off, { "File Offset", "frame.file_off", FT_INT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_frame_marked, { "Frame is marked", "frame.marked", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Frame is marked in the GUI", HFILL }}, { &hf_frame_ignored, { "Frame is ignored", "frame.ignored", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Frame is ignored by the dissectors", HFILL }}, { &hf_frame_protocols, { "Protocols in frame", "frame.protocols", FT_STRING, BASE_NONE, NULL, 0x0, "Protocols carried by this frame", HFILL }}, { &hf_frame_color_filter_name, { "Coloring Rule Name", "frame.coloring_rule.name", FT_STRING, BASE_NONE, NULL, 0x0, "The frame matched the coloring rule with this name", HFILL }}, { &hf_frame_color_filter_text, { "Coloring Rule String", "frame.coloring_rule.string", FT_STRING, BASE_NONE, NULL, 0x0, "The frame matched this coloring rule string", HFILL }}, { &hf_frame_interface_id, { "Interface id", "frame.interface_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_frame_pack_flags, { "Packet flags", "frame.packet_flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_frame_pack_direction, { "Direction", "frame.packet_flags_direction", FT_UINT32, BASE_HEX, VALS(&packet_word_directions), PACKET_WORD_DIRECTION_MASK, NULL, HFILL }}, { &hf_frame_pack_reception_type, { "Reception type", "frame.packet_flags_reception_type", FT_UINT32, BASE_DEC, VALS(&packet_word_reception_types), PACKET_WORD_RECEPTION_TYPE_MASK, NULL, HFILL }}, { &hf_frame_pack_fcs_length, { "FCS length", "frame.packet_flags_fcs_length", FT_UINT32, BASE_DEC, NULL, PACKET_WORD_FCS_LENGTH_MASK, NULL, HFILL }}, { &hf_frame_pack_reserved, { "Reserved", "frame.packet_flags_reserved", FT_UINT32, BASE_DEC, NULL, PACKET_WORD_RESERVED_MASK, NULL, HFILL }}, { &hf_frame_pack_crc_error, { "CRC error", "frame.packet_flags_crc_error", FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_CRC_ERR_MASK, NULL, HFILL }}, { &hf_frame_pack_wrong_packet_too_long_error, { "Packet too long error", "frame.packet_flags_packet_too_error", FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_PACKET_TOO_LONG_ERR_MASK, NULL, HFILL }}, { &hf_frame_pack_wrong_packet_too_short_error, { "Packet too short error", "frame.packet_flags_packet_too_short_error", FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_PACKET_TOO_SHORT_ERR_MASK, NULL, HFILL }}, { &hf_frame_pack_wrong_inter_frame_gap_error, { "Wrong interframe gap error", "frame.packet_flags_wrong_inter_frame_gap_error", FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_WRONG_INTER_FRAME_GAP_ERR_MASK, NULL, HFILL }}, { &hf_frame_pack_unaligned_frame_error, { "Unaligned frame error", "frame.packet_flags_unaligned_frame_error", FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_UNALIGNED_FRAME_ERR_MASK, NULL, HFILL }}, { &hf_frame_pack_start_frame_delimiter_error, { "Start frame delimiter error", "frame.packet_flags_start_frame_delimiter_error", FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_START_FRAME_DELIMITER_ERR_MASK, NULL, HFILL }}, { &hf_frame_pack_preamble_error, { "Preamble error", "frame.packet_flags_preamble_error", FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_PREAMBLE_ERR_MASK, NULL, HFILL }}, { &hf_frame_pack_symbol_error, { "Symbol error", "frame.packet_flags_symbol_error", FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_SYMBOL_ERR_MASK, NULL, HFILL }}, { &hf_comments_text, { "Comment", "frame.comment", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_frame_num_p_prot_data, { "Number of per-protocol-data", "frame.p_prot_data", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static hf_register_info hf_encap = { &hf_frame_wtap_encap, { "Encapsulation type", "frame.encap_type", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}; static gint *ett[] = { &ett_frame, &ett_flags, &ett_comments }; static ei_register_info ei[] = { { &ei_comments_text, { "frame.comment.expert", PI_COMMENTS_GROUP, PI_COMMENT, "Formatted comment", EXPFILL }}, { &ei_arrive_time_out_of_range, { "frame.time_invalid", PI_SEQUENCE, PI_NOTE, "Arrival Time: Fractional second out of range (0-1000000000)", EXPFILL }}, }; module_t *frame_module; expert_module_t* expert_frame; if (hf_encap.hfinfo.strings == NULL) { int encap_count = wtap_get_num_encap_types(); value_string *arr; int i; hf_encap.hfinfo.strings = arr = g_new(value_string, encap_count+1); for (i = 0; i < encap_count; i++) { arr[i].value = i; arr[i].strptr = wtap_encap_string(i); } arr[encap_count].value = 0; arr[encap_count].strptr = NULL; } wtap_encap_dissector_table = register_dissector_table("wtap_encap", "Wiretap encapsulation type", FT_UINT32, BASE_DEC); proto_frame = proto_register_protocol("Frame", "Frame", "frame"); proto_pkt_comment = proto_register_protocol("Packet comments", "Pkt_Comment", "pkt_comment"); proto_register_field_array(proto_frame, hf, array_length(hf)); proto_register_field_array(proto_frame, &hf_encap, 1); proto_register_subtree_array(ett, array_length(ett)); expert_frame = expert_register_protocol(proto_frame); expert_register_field_array(expert_frame, ei, array_length(ei)); register_dissector("frame",dissect_frame,proto_frame); /* You can't disable dissection of "Frame", as that would be tantamount to not doing any dissection whatsoever. */ proto_set_cant_toggle(proto_frame); /* Our preferences */ frame_module = prefs_register_protocol(proto_frame, NULL); prefs_register_bool_preference(frame_module, "show_file_off", "Show File Offset", "Show offset of frame in capture file", &show_file_off); prefs_register_bool_preference(frame_module, "force_docsis_encap", "Treat all frames as DOCSIS frames", "Treat all frames as DOCSIS Frames", &force_docsis_encap); prefs_register_bool_preference(frame_module, "generate_md5_hash", "Generate an MD5 hash of each frame", "Whether or not MD5 hashes should be generated for each frame, useful for finding duplicate frames.", &generate_md5_hash); prefs_register_bool_preference(frame_module, "generate_epoch_time", "Generate an epoch time entry for each frame", "Whether or not an Epoch time entry should be generated for each frame.", &generate_epoch_time); prefs_register_bool_preference(frame_module, "generate_bits_field", "Show the number of bits in the frame", "Whether or not the number of bits in the frame should be shown.", &generate_bits_field); frame_tap=register_tap("frame"); }
void proto_register_netmon_802_11(void) { static const value_string phy_type[] = { { PHY_TYPE_UNKNOWN, "Unknown" }, { PHY_TYPE_FHSS, "802.11 FHSS" }, { PHY_TYPE_DSSS, "802.11 DSSS" }, { PHY_TYPE_IR_BASEBAND, "802.11 IR" }, { PHY_TYPE_OFDM, "802.11a" }, { PHY_TYPE_HR_DSSS, "802.11b" }, { PHY_TYPE_ERP, "802.11g" }, { PHY_TYPE_HT, "802.11n" }, { PHY_TYPE_VHT, "802.11ac" }, { 0, NULL }, }; static hf_register_info hf[] = { { &hf_netmon_802_11_version, { "Header revision", "netmon_802_11.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_netmon_802_11_length, { "Header length", "netmon_802_11.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_netmon_802_11_op_mode, { "Operation mode", "netmon_802_11.op_mode", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_netmon_802_11_op_mode_sta, { "Station mode", "netmon_802_11.op_mode.sta", FT_UINT32, BASE_HEX, NULL, OP_MODE_STA, NULL, HFILL } }, { &hf_netmon_802_11_op_mode_ap, { "AP mode", "netmon_802_11.op_mode.ap", FT_UINT32, BASE_HEX, NULL, OP_MODE_AP, NULL, HFILL } }, { &hf_netmon_802_11_op_mode_sta_ext, { "Extensible station mode", "netmon_802_11.op_mode.sta_ext", FT_UINT32, BASE_HEX, NULL, OP_MODE_STA_EXT, NULL, HFILL } }, { &hf_netmon_802_11_op_mode_mon, { "Monitor mode", "netmon_802_11.op_mode.on", FT_UINT32, BASE_HEX, NULL, OP_MODE_MON, NULL, HFILL } }, #if 0 { &hf_netmon_802_11_flags, { "Flags", "netmon_802_11.flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #endif { &hf_netmon_802_11_phy_type, { "PHY type", "netmon_802_11.phy_type", FT_UINT32, BASE_DEC, VALS(phy_type), 0x0, NULL, HFILL } }, { &hf_netmon_802_11_channel, { "Channel", "netmon_802_11.channel", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_netmon_802_11_frequency, { "Center frequency", "netmon_802_11.frequency", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_netmon_802_11_rssi, { "RSSI", "netmon_802_11.rssi", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_netmon_802_11_datarate, { "Data rate", "netmon_802_11.datarate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* * XXX - is this host, or MAC, time stamp? * It might be a FILETIME. */ { &hf_netmon_802_11_timestamp, { "Timestamp", "netmon_802_11.timestamp", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, }; static gint *ett[] = { &ett_netmon_802_11, &ett_netmon_802_11_op_mode }; proto_netmon_802_11 = proto_register_protocol("NetMon 802.11 capture header", "NetMon 802.11", "netmon_802_11"); proto_register_field_array(proto_netmon_802_11, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); }
/* register the protocol with Wireshark */ void proto_register_iwarp_ddp_rdmap(void) { /* setup list of header fields */ static hf_register_info hf[] = { /* DDP */ { &hf_iwarp_ddp, { "DDP header", "iwarp_ddp", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_iwarp_ddp_control_field, { "DDP control field", "iwarp_ddp.control_field", FT_NONE, BASE_NONE, NULL, 0x0, "DDP Control Field", HFILL } }, { &hf_iwarp_ddp_tagged_header, { "Tagged buffer model", "iwarp_ddp.tagged", FT_NONE, BASE_NONE, NULL, 0x0, "DDP Tagged Buffer Model Header", HFILL} }, { &hf_iwarp_ddp_untagged_header, { "Untagged buffer model", "iwarp_ddp.untagged", FT_NONE, BASE_NONE, NULL, 0x0, "DDP Untagged Buffer Model Header", HFILL} }, { &hf_iwarp_ddp_t_flag, { "Tagged flag", "iwarp_ddp.tagged_flag", FT_BOOLEAN, 8, NULL, DDP_TAGGED_FLAG, NULL, HFILL} }, { &hf_iwarp_ddp_l_flag, { "Last flag", "iwarp_ddp.last_flag", FT_BOOLEAN, 8, NULL, DDP_LAST_FLAG, NULL, HFILL} }, { &hf_iwarp_ddp_rsvd, { "Reserved", "iwarp_ddp.rsvd", FT_UINT8, BASE_HEX, NULL, DDP_RSVD, NULL, HFILL} }, { &hf_iwarp_ddp_dv, { "DDP protocol version", "iwarp_ddp.dv", FT_UINT8, BASE_DEC, NULL, DDP_DV, NULL, HFILL} }, { &hf_iwarp_ddp_rsvdulp, { "Reserved for use by the ULP", "iwarp_ddp.rsvdulp", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_ddp_stag, { "(Data Sink) Steering Tag", "iwarp_ddp.stag", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_ddp_to, { "(Data Sink) Tagged offset", "iwarp_ddp.tagged_offset", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_ddp_qn, { "Queue number", "iwarp_ddp.qn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_ddp_msn, { "Message sequence number", "iwarp_ddp.msn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_ddp_mo, { "Message offset", "iwarp_ddp.mo", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL} }, /* RDMAP */ { &hf_iwarp_rdma, { "RDMAP header", "iwarp_rdma", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_rdma_control_field, { "RDMAP control field", "iwarp_rdma.control_field", FT_NONE, BASE_NONE, NULL, 0x0, "RDMA Control Field", HFILL} }, { &hf_iwarp_rdma_version, { "Version", "iwarp_rdma.version", FT_UINT8, BASE_DEC, NULL, RDMA_RV, "RDMA Version Field", HFILL} }, { &hf_iwarp_rdma_rsvd, { "Reserved", "iwarp_rdma.rsv", FT_UINT8, BASE_HEX, NULL, RDMA_RSV, "RDMA Control Field Reserved", HFILL} }, { &hf_iwarp_rdma_opcode, { "OpCode", "iwarp_rdma.opcode", FT_UINT8, BASE_HEX, VALS(rdmap_messages), RDMA_OPCODE, "RDMA OpCode Field", HFILL} }, { &hf_iwarp_rdma_reserved, { "Reserved", "iwarp_rdma.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_rdma_inval_stag, { "Invalidate STag", "iwarp_rdma.inval_stag", FT_UINT32, BASE_DEC, NULL, 0x0, "RDMA Invalidate STag", HFILL} }, { &hf_iwarp_rdma_rr_header, { "Read request", "iwarp_rdma.rr", FT_NONE, BASE_NONE, NULL, 0x0, "RDMA Read Request Header", HFILL} }, { &hf_iwarp_rdma_terminate_header, { "Terminate", "iwarp_rdma.terminate", FT_NONE, BASE_NONE, NULL, 0x0, "RDMA Terminate Header", HFILL} }, { &hf_iwarp_rdma_sinkstag, { "Data Sink STag", "iwarp_rdma.sinkstag", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_rdma_sinkto, { "Data Sink Tagged Offset", "iwarp_rdma.sinkto", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_rdma_rdmardsz, { "RDMA Read Message Size", "iwarp_rdma.rdmardsz", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_rdma_srcstag, { "Data Source STag", "iwarp_rdma.srcstag", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_rdma_srcto, { "Data Source Tagged Offset", "iwarp_rdma.srcto", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_rdma_term_ctrl, { "Terminate Control", "iwarp_rdma.term_ctrl", FT_NONE, BASE_NONE, NULL, 0x0, "RDMA Terminate Control Field", HFILL} }, { &hf_iwarp_rdma_term_layer, { "Layer", "iwarp_rdma.term_layer", FT_UINT8, BASE_HEX, VALS(layer_names), IWARP_LAYER, "Terminate Control Field: Layer", HFILL} }, { &hf_iwarp_rdma_term_etype_rdma, { "Error Types for RDMA layer", "iwarp_rdma.term_etype_rdma", FT_UINT8, BASE_HEX, VALS(rdma_etype_names), IWARP_ETYPE, "Terminate Control Field: Error Type", HFILL} }, { &hf_iwarp_rdma_term_etype_ddp, { "Error Types for DDP layer", "iwarp_rdma.term_etype_ddp", FT_UINT8, BASE_HEX, VALS(ddp_etype_names), IWARP_ETYPE, "Terminate Control Field: Error Type", HFILL} }, { &hf_iwarp_rdma_term_etype_llp, { "Error Types for LLP layer", "iwarp_rdma.term_etype_llp", FT_UINT8, BASE_HEX, NULL, IWARP_ETYPE, "Terminate Control Field: Error Type", HFILL} }, { &hf_iwarp_rdma_term_etype, { "Error Types", "iwarp_rdma.term_etype", FT_UINT8, BASE_HEX, NULL, IWARP_ETYPE, "Terminate Control Field: Error Type", HFILL} }, { &hf_iwarp_rdma_term_errcode_rdma, { "Error Code for RDMA layer", "iwarp_rdma.term_errcode_rdma", FT_UINT8, BASE_HEX, VALS(rdma_errcode_names), 0x0, "Terminate Control Field: Error Code", HFILL} }, { &hf_iwarp_rdma_term_errcode_ddp_tagged, { "Error Code for DDP Tagged Buffer", "iwarp_rdma.term_errcode_ddp_tagged", FT_UINT8, BASE_HEX, VALS(ddp_errcode_tagged_names), 0x0, "Terminate Control Field: Error Code", HFILL} }, { &hf_iwarp_rdma_term_errcode_ddp_untagged, { "Error Code for DDP Untagged Buffer", "iwarp_rdma.term_errcode_ddp_untagged", FT_UINT8, BASE_HEX, VALS(ddp_errcode_untagged_names), 0x0, "Terminate Control Field: Error Code", HFILL} }, { &hf_iwarp_rdma_term_errcode, { "Error Code", "iwarp_rdma.term_errcode", FT_UINT8, BASE_HEX, NULL, 0x0, "Terminate Control Field: Error Code", HFILL} }, { &hf_iwarp_rdma_term_errcode_llp, { "Error Code for LLP layer", "iwarp_rdma.term_errcode_llp", FT_UINT8, BASE_HEX, NULL, 0x0, "Terminate Control Field: Lower Layer Protocol Error Code", HFILL} }, { &hf_iwarp_rdma_term_hdrct, { "Header control bits", "iwarp_rdma.term_hdrct", FT_NONE, BASE_NONE, NULL, 0x0, "Terminate Control Field: Header control bits", HFILL} }, { &hf_iwarp_rdma_term_hdrct_m, { "M bit", "iwarp_rdma.term_hdrct_m", FT_UINT8, BASE_HEX, NULL, IWARP_HDRCT_M, "Header control bit m: DDP Segment Length valid", HFILL} }, { &hf_iwarp_rdma_term_hdrct_d, { "D bit", "iwarp_rdma.hdrct_d", FT_UINT8, BASE_HEX, NULL, IWARP_HDRCT_D, "Header control bit d: DDP Header Included", HFILL} }, { &hf_iwarp_rdma_term_hdrct_r, { "R bit", "iwarp_rdma.hdrct_r", FT_UINT8, BASE_HEX, NULL, IWARP_HDRCT_R, "Header control bit r: RDMAP Header Included", HFILL} }, { &hf_iwarp_rdma_term_rsvd, { "Reserved", "iwarp_rdma.term_rsvd", FT_UINT16, BASE_HEX, NULL, IWARP_TERM_RES, NULL, HFILL} }, { &hf_iwarp_rdma_term_ddp_seg_len, { "DDP Segment Length", "iwarp_rdma.term_ddp_seg_len", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_rdma_term_ddp_h, { "Terminated DDP Header", "iwarp_rdma.term_ddp_h", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} }, { &hf_iwarp_rdma_term_rdma_h, { "Terminated RDMA Header", "iwarp_rdma.term_rdma_h", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} } }; /* setup protocol subtree array */ static gint *ett[] = { &ett_iwarp_ddp_rdmap, /* DDP */ &ett_iwarp_ddp, &ett_iwarp_ddp_control_field, &ett_iwarp_ddp_tagged_header, &ett_iwarp_ddp_untagged_header, /* RDMAP */ &ett_iwarp_rdma, &ett_iwarp_rdma_control_field, &ett_iwarp_rdma_rr_header, &ett_iwarp_rdma_terminate_header, &ett_iwarp_rdma_term_ctrl, &ett_iwarp_rdma_term_hdrct }; /* register the protocol name and description */ proto_iwarp_ddp_rdmap = proto_register_protocol( "iWARP Direct Data Placement and Remote Direct Memory Access Protocol", "IWARP_DDP_RDMAP", "iwarp_ddp_rdmap"); /* required function calls to register the header fields and subtrees */ proto_register_field_array(proto_iwarp_ddp_rdmap, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("iwarp_ddp_rdmap", dissect_iwarp_ddp_rdmap, proto_iwarp_ddp_rdmap); }
void proto_register_ses(void) { static hf_register_info hf[] = { { &hf_ses_type, { "SPDU Type", "ses.type", FT_UINT8, BASE_DEC, VALS(ses_vals), 0x0, NULL, HFILL } }, { &hf_ses_type_0, { "SPDU Type", "ses.type", FT_UINT8, BASE_DEC, VALS(ses_category0_vals), 0x0, NULL, HFILL } }, { &hf_ses_length, { "Length", "ses.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ses_version, { "Version", "ses.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ses_reserved, { "Reserved", "ses.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_called_ss_user_reference, { "Called SS User Reference", "ses.called_ss_user_reference", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_calling_ss_user_reference, { "Calling SS User Reference", "ses.calling_ss_user_reference", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_common_reference, { "Common Reference", "ses.common_reference", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_additional_reference_information, { "Additional Reference Information", "ses.additional_reference_information", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_release_token, { "release token", "ses.release_token", FT_BOOLEAN, 8, NULL, RELEASE_TOKEN, NULL, HFILL } }, { &hf_major_activity_token, { "major/activity token", "ses.major.token", FT_BOOLEAN, 8, NULL, MAJOR_ACTIVITY_TOKEN, NULL, HFILL } }, { &hf_synchronize_minor_token, { "synchronize minor token", "ses.synchronize_token", FT_BOOLEAN, 8, NULL, SYNCHRONIZE_MINOR_TOKEN, NULL, HFILL } }, { &hf_data_token, { "data token", "ses.data_token", FT_BOOLEAN, 8, NULL, DATA_TOKEN, "data token", HFILL } }, { &hf_able_to_receive_extended_concatenated_SPDU, { "Able to receive extended concatenated SPDU", "ses.connect.f1", FT_BOOLEAN, 8, NULL, SES_EXT_CONT, NULL, HFILL } }, { &hf_session_user_req_flags, { "Flags", "ses.req.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_session_exception_report, { "Session exception report", "ses.exception_report.", FT_BOOLEAN, 16, NULL, SES_EXCEPTION_REPORT, NULL, HFILL } }, { &hf_data_separation_function_unit, { "Data separation function unit", "ses.data_sep", FT_BOOLEAN, 16, NULL, DATA_SEPARATION_FUNCTION_UNIT, NULL, HFILL } }, { &hf_symmetric_synchronize_function_unit, { "Symmetric synchronize function unit", "ses.symm_sync", FT_BOOLEAN, 16, NULL, SYMMETRIC_SYNCHRONIZE_FUNCTION_UNIT, NULL, HFILL } }, { &hf_typed_data_function_unit, { "Typed data function unit", "ses.typed_data", FT_BOOLEAN, 16, NULL, TYPED_DATA_FUNCTION_UNIT, NULL, HFILL } }, { &hf_exception_function_unit, { "Exception function unit", "ses.exception_data", FT_BOOLEAN, 16, NULL, EXCEPTION_FUNCTION_UNIT, NULL, HFILL } }, { &hf_capability_function_unit, { "Capability function unit", "ses.capability_data", FT_BOOLEAN, 16, NULL, CAPABILITY_DATA_FUNCTION_UNIT, NULL, HFILL } }, { &hf_negotiated_release_function_unit, { "Negotiated release function unit", "ses.negotiated_release", FT_BOOLEAN, 16, NULL, NEGOTIATED_RELEASE_FUNCTION_UNIT, NULL, HFILL } }, { &hf_activity_management_function_unit, { "Activity management function unit", "ses.activity_management", FT_BOOLEAN, 16, NULL, ACTIVITY_MANAGEMENT_FUNCTION_UNIT, NULL, HFILL } }, { &hf_resynchronize_function_unit, { "Resynchronize function unit", "ses.resynchronize", FT_BOOLEAN, 16, NULL, RESYNCHRONIZE_FUNCTION_UNIT, NULL, HFILL } }, { &hf_major_resynchronize_function_unit, { "Major resynchronize function unit", "ses.major_resynchronize", FT_BOOLEAN, 16, NULL, MAJOR_SYNCHRONIZE_FUNCTION_UNIT, NULL, HFILL } }, { &hf_minor_resynchronize_function_unit, { "Minor resynchronize function unit", "ses.minor_resynchronize", FT_BOOLEAN, 16, NULL, MINOR_SYNCHRONIZE_FUNCTION_UNIT, NULL, HFILL } }, { &hf_expedited_data_resynchronize_function_unit, { "Expedited data function unit", "ses.expedited_data", FT_BOOLEAN, 16, NULL, EXPEDITED_DATA_FUNCTION_UNIT, NULL, HFILL } }, { &hf_duplex_function_unit, { "Duplex functional unit", "ses.duplex", FT_BOOLEAN, 16, NULL, DUPLEX_FUNCTION_UNIT, NULL, HFILL } }, { &hf_half_duplex_function_unit, { "Half-duplex functional unit", "ses.half_duplex", FT_BOOLEAN, 16, NULL, HALF_DUPLEX_FUNCTION_UNIT, NULL, HFILL } }, { &hf_proposed_tsdu_maximum_size_i2r, { "Proposed TSDU Maximum Size, Initiator to Responder", "ses.proposed_tsdu_maximum_size_i2r", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_proposed_tsdu_maximum_size_r2i, { "Proposed TSDU Maximum Size, Responder to Initiator", "ses.proposed_tsdu_maximum_size_r2i", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_protocol_version_1, { "Protocol Version 1", "ses.protocol_version1", FT_BOOLEAN, 8, NULL, PROTOCOL_VERSION_1, NULL, HFILL } }, { &hf_protocol_version_2, { "Protocol Version 2", "ses.protocol_version2", FT_BOOLEAN, 8, NULL, PROTOCOL_VERSION_2, NULL, HFILL } }, { &hf_initial_serial_number, { "Initial Serial Number", "ses.initial_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_beginning_of_SSDU, { "beginning of SSDU", "ses.begininng_of_SSDU", FT_BOOLEAN, 8, NULL, BEGINNING_SPDU, NULL, HFILL } }, { &hf_end_of_SSDU, { "end of SSDU", "ses.end_of_SSDU", FT_BOOLEAN, 8, NULL, END_SPDU, NULL, HFILL } }, { &hf_release_token_setting, { "release token setting", "ses.release_token_setting", FT_UINT8, BASE_HEX, VALS(token_setting_vals), 0xC0, NULL, HFILL } }, { &hf_major_activity_token_setting, { "major/activity setting", "ses.major_activity_token_setting", FT_UINT8, BASE_HEX, VALS(token_setting_vals), 0x30, "major/activity token setting", HFILL } }, { &hf_synchronize_minor_token_setting, { "synchronize-minor token setting", "ses.synchronize_minor_token_setting", FT_UINT8, BASE_HEX, VALS(token_setting_vals), 0x0C, NULL, HFILL } }, { &hf_data_token_setting, { "data token setting", "ses.data_token_setting", FT_UINT8, BASE_HEX, VALS(token_setting_vals), 0x03, NULL, HFILL } }, { &hf_activity_identifier, { "Activity Identifier", "ses.activity_identifier", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_serial_number, { "Serial Number", "ses.serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_calling_session_selector, { "Calling Session Selector", "ses.calling_session_selector", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_called_session_selector, { "Called Session Selector", "ses.called_session_selector", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_second_serial_number, { "Second Serial Number", "ses.second_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_second_initial_serial_number, { "Second Initial Serial Number", "ses.second_initial_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_large_initial_serial_number, { "Large Initial Serial Number", "ses.large_initial_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_large_second_initial_serial_number, { "Large Second Initial Serial Number", "ses.large_second_initial_serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_connect_protocol_options_flags, { "Flags", "ses.connect.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_version_number_options_flags, { "Flags", "ses.version.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_token_item_options_flags, { "Flags", "ses.tken_item.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_enclosure_item_options_flags, { "Flags", "ses.enclosure.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, }; static gint *ett[] = { &ett_ses, &ett_ses_param, &ett_connect_protocol_options_flags, &ett_protocol_version_flags, &ett_enclosure_item_flags, &ett_token_item_flags, &ett_ses_req_options_flags, }; /* module_t *ses_module; */ proto_ses = proto_register_protocol(PROTO_STRING_SES, "SES", "ses"); proto_register_field_array(proto_ses, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* ses_module = prefs_register_protocol(proto_ses, NULL); prefs_register_bool_preference(ses_module, "desegment", "Reassemble session packets ", "Whether the session dissector should reassemble messages spanning multiple SES segments", &ses_desegment); */ /* * Register the dissector by name, so other dissectors can * grab it by name rather than just referring to it directly * (you can't refer to it directly from a plugin dissector * on Windows without stuffing it into the Big Transfer Vector). */ register_dissector("ses", dissect_ses, proto_ses); }
int64 io_waituntil2(int64 milliseconds) { #ifndef __MINGW32__ struct pollfd* p; #endif long i,j,r; if (!io_wanted_fds) return 0; #ifdef HAVE_EPOLL if (io_waitmode==EPOLL) { int n; struct epoll_event y[50]; if ((n=epoll_wait(io_master,y,50,milliseconds))==-1) return -1; int first_new = -1; int last_new = -1; for (i=n-1; i>=0; --i) { io_entry* e=array_get(&io_fds,sizeof(io_entry),y[i].data.fd); if (e) { if (y[i].events&(EPOLLERR|EPOLLHUP)) { /* error; signal whatever app is looking for */ if (e->wantread) y[i].events|=EPOLLIN; if (e->wantwrite) y[i].events|=EPOLLOUT; } #ifdef EPOLLRDNORM if (y[i].data.fd == io_master && !e->canread && (y[i].events&(EPOLLIN|EPOLLPRI|EPOLLRDNORM|EPOLLRDBAND))) { #else if (y[i].data.fd == io_master && !e->canread && (y[i].events&(EPOLLIN|EPOLLPRI))) { #endif e->canread=1; e->next_read=first_new; if(first_new == -1) last_new = y[i].data.fd; first_new=y[i].data.fd; } } } //if(n > 1) printf("n: %d\n", n); for (i=n-1; i>=0; --i) { //for (i=0; i < n; i++) { io_entry* e=array_get(&io_fds,sizeof(io_entry),y[i].data.fd); if (e) { #ifdef EPOLLRDNORM if (!e->canread && (y[i].events&(EPOLLIN|EPOLLPRI|EPOLLRDNORM|EPOLLRDBAND))) { #else if (!e->canread && (y[i].events&(EPOLLIN|EPOLLPRI))) { #endif e->canread=1; e->next_read=first_readable; first_readable=y[i].data.fd; } if (!e->canwrite && (y[i].events&EPOLLOUT)) { e->canwrite=-1; e->next_write=first_writeable; first_writeable=y[i].data.fd; } } else { epoll_ctl(io_master,EPOLL_CTL_DEL,y[i].data.fd,y+i); } } // if there are new connections, put them first... if(last_new != -1) { if(first_readable != -1) { io_entry* e=array_get(&io_fds,sizeof(io_entry),last_new); e->next_read=first_readable; } first_readable = first_new; } return n; } #endif #ifdef HAVE_KQUEUE if (io_waitmode==KQUEUE) { struct kevent y[100]; int n; struct timespec ts; ts.tv_sec=milliseconds/1000; ts.tv_nsec=(milliseconds%1000)*1000000; if ((n=kevent(io_master,0,0,y,100,milliseconds!=-1?&ts:0))==-1) return -1; for (i=n-1; i>=0; --i) { io_entry* e=array_get(&io_fds,sizeof(io_entry),y[--n].ident); #ifdef DEBUG if (!e) { e=e; } #endif if (e) { if (y[n].flags&EV_ERROR) { /* error; signal whatever app is looking for */ if (e->wantread) y[n].filter=EVFILT_READ; else if (e->wantwrite) y[n].filter=EVFILT_WRITE; } if (!e->canread && (y[n].filter==EVFILT_READ)) { e->canread=1; e->next_read=first_readable; first_readable=y[n].ident; } if (!e->canwrite && (y[n].filter==EVFILT_WRITE)) { e->canwrite=1; e->next_write=first_writeable; first_writeable=y[i].ident; } #ifdef DEBUG } else { fprintf(stderr,"got kevent on fd#%d, which is not in array!\n",y[n].ident); #endif } } return n; } #endif #ifdef HAVE_DEVPOLL if (io_waitmode==DEVPOLL) { dvpoll_t timeout; struct pollfd y[100]; int n; timeout.dp_timeout=milliseconds; timeout.dp_nfds=100; timeout.dp_fds=y; if ((n=ioctl(io_master,DP_POLL,&timeout))==-1) return -1; for (i=n-1; i>=0; --i) { io_entry* e=array_get(&io_fds,sizeof(io_entry),y[--n].fd); if (e) { if (y[n].revents&(POLLERR|POLLHUP|POLLNVAL)) { /* error; signal whatever app is looking for */ if (e->wantread) y[n].revents=POLLIN; if (e->wantwrite) y[n].revents=POLLOUT; } if (!e->canread && (y[n].revents&POLLIN)) { e->canread=1; if (e->next_read==-1) { e->next_read=first_readable; first_readable=y[n].fd; } } if (!e->canwrite && (y[n].revents&POLLOUT)) { e->canwrite=1; if (e->next_write==-1) { e->next_write=first_writeable; first_writeable=y[i].fd; } } #ifdef DEBUG } else { fprintf(stderr,"got kevent on fd#%d, which is not in array!\n",y[n].fd); #endif } } return n; } #endif #ifdef HAVE_SIGIO if (io_waitmode==_SIGIO) { siginfo_t info; struct timespec ts; int r; io_entry* e; if (alt_firstread>=0 && (e=array_get(&io_fds,sizeof(io_entry),alt_firstread)) && e->canread) return 1; if (alt_firstwrite>=0 && (e=array_get(&io_fds,sizeof(io_entry),alt_firstwrite)) && e->canwrite) return 1; if (milliseconds==-1) r=sigwaitinfo(&io_ss,&info); else { ts.tv_sec=milliseconds/1000; ts.tv_nsec=(milliseconds%1000)*1000000; r=sigtimedwait(&io_ss,&info,&ts); } switch (r) { case SIGIO: /* signal queue overflow */ signal(io_signum,SIG_DFL); goto dopoll; default: if (r==io_signum) { io_entry* e=array_get(&io_fds,sizeof(io_entry),info.si_fd); if (e) { if (info.si_band&(POLLERR|POLLHUP)) { /* error; signal whatever app is looking for */ if (e->wantread) info.si_band|=POLLIN; if (e->wantwrite) info.si_band|=POLLOUT; } if (info.si_band&POLLIN && !e->canread) { debug_printf(("io_waituntil2: enqueueing %ld in normal read queue before %ld\n",info.si_fd,first_readable)); e->canread=1; e->next_read=first_readable; first_readable=info.si_fd; } if (info.si_band&POLLOUT && !e->canwrite) { debug_printf(("io_waituntil2: enqueueing %ld in normal write queue before %ld\n",info.si_fd,first_writeable)); e->canwrite=1; e->next_write=first_writeable; first_writeable=info.si_fd; } #ifdef DEBUG } else { fprintf(stderr,"got kevent on fd#%d, which is not in array!\n",info.si_fd); #endif } } } return 1; } dopoll: #endif #ifdef __MINGW32__ DWORD numberofbytes; ULONG_PTR x; LPOVERLAPPED o; if (first_readable!=-1 || first_writeable!=-1) { fprintf(stderr,"io_waituntil2() returning immediately because first_readable(%p) or first_writeable(%p) are set\n",first_readable,first_writeable); return; } fprintf(stderr,"Calling GetQueuedCompletionStatus %p...",io_comport); if (GetQueuedCompletionStatus(io_comport,&numberofbytes,&x,&o,milliseconds==-1?milliseconds:INFINITE)) { io_entry* e=array_get(&io_fds,sizeof(io_entry),x); fprintf(stderr," OK. Got %x, e=%p\n",x,e); if (!e) return 0; e->errorcode=0; fprintf(stderr,"o=%p, e->or=%p, e->ow=%p, e->os=%p\n",o,&e->or,&e->ow,&e->os); fprintf(stderr,"e->readqueued=%d, e->writequeued=%d, e->acceptqueued=%d, e->connectqueued=%d, e->sendfilequeued=%d\n", e->readqueued,e->writequeued,e->acceptqueued,e->connectqueued,e->sendfilequeued); if (o==&e->or && e->readqueued==1) { e->readqueued=2; e->canread=1; e->bytes_read=numberofbytes; e->next_read=first_readable; first_readable=x; // printf("read %lu bytes on fd %lu: %p\n",numberofbytes,x,e); } else if (o==&e->ow && e->writequeued==1) { e->writequeued=2; e->canwrite=1; e->bytes_written=numberofbytes; e->next_write=first_writeable; first_writeable=x; } else if (o==&e->or && e->acceptqueued==1) { e->acceptqueued=2; e->canread=1; e->next_read=first_readable; first_readable=x; } else if (o==&e->ow && e->connectqueued==1) { e->connectqueued=2; e->canwrite=1; e->next_write=first_writeable; first_writeable=x; } else if (o==&e->os && e->sendfilequeued==1) { e->sendfilequeued=2; e->canwrite=1; e->bytes_written=numberofbytes; e->next_write=first_writeable; first_writeable=x; } return 1; } else { /* either the overlapped I/O request failed or we timed out */ DWORD err; io_entry* e; fprintf(stderr," failure, o=%p.\n",o); if (!o) return 0; /* timeout */ /* we got a completion packet for a failed I/O operation */ err=GetLastError(); if (err==WAIT_TIMEOUT) return 0; /* or maybe not */ e=array_get(&io_fds,sizeof(io_entry),x); if (!e) return 0; /* WTF?! */ e->errorcode=err; if (o==&e->or && (e->readqueued || e->acceptqueued)) { if (e->readqueued) e->readqueued=2; else if (e->acceptqueued) e->acceptqueued=2; e->canread=1; e->bytes_read=-1; e->next_read=first_readable; first_readable=x; } else if ((o==&e->ow || o==&e->os) && (e->writequeued || e->connectqueued || e->sendfilequeued)) { if (o==&e->ow) { if (e->writequeued) e->writequeued=2; else if (e->connectqueued) e->connectqueued=2; } else if (o==&e->os) e->sendfilequeued=2; e->canwrite=1; e->bytes_written=-1; e->next_write=first_writeable; first_writeable=x; } return 1; } #else for (i=r=0; i<array_length(&io_fds,sizeof(io_entry)); ++i) { io_entry* e=array_get(&io_fds,sizeof(io_entry),i); if (!e) return -1; e->canread=e->canwrite=0; if (e->wantread || e->wantwrite) { struct pollfd* p; if ((p=array_allocate(&io_pollfds,sizeof(struct pollfd),r))) { p->fd=i; p->events=(e->wantread?POLLIN:0) + (e->wantwrite?POLLOUT:0); ++r; } else return -1; } } p=array_start(&io_pollfds); if ((i=poll(array_start(&io_pollfds),r,milliseconds))<1) return -1; for (j=r-1; j>=0; --j) { io_entry* e=array_get(&io_fds,sizeof(io_entry),p->fd); if (p->revents&(POLLERR|POLLHUP|POLLNVAL)) { /* error; signal whatever app is looking for */ if (e->wantread) p->revents|=POLLIN; if (e->wantwrite) p->revents|=POLLOUT; } if (!e->canread && (p->revents&POLLIN)) { e->canread=1; e->next_read=first_readable; first_readable=p->fd; } if (!e->canwrite && (p->revents&POLLOUT)) { e->canwrite=1; e->next_write=first_writeable; first_writeable=p->fd; } p++; } return i; #endif }