Пример #1
0
void proto_register_mqpcf(void)
{
    expert_module_t *expert_mqpcf;

    static hf_register_info hf[] =
    {
        { &hf_mqpcf_cfh_type     , { "Type.....", "mqpcf.cfh.type"      , FT_UINT32, BASE_DEC, VALS(&GET_VALSV(mqcft)), 0x0, "CFH type", HFILL }},
        { &hf_mqpcf_cfh_length   , { "Length...", "mqpcf.cfh.length"    , FT_UINT32, BASE_DEC, NULL, 0x0, "CFH length", HFILL }},
        { &hf_mqpcf_cfh_version  , { "Version..", "mqpcf.cfh.version"   , FT_UINT32, BASE_DEC, NULL, 0x0, "CFH version", HFILL }},
        { &hf_mqpcf_cfh_command  , { "Command..", "mqpcf.cfh.command"   , FT_UINT32, BASE_DEC, VALS(&GET_VALSV(mqcmd)), 0x0, "CFH command", HFILL }},
        { &hf_mqpcf_cfh_MsgSeqNbr, { "MsgSeqNbr", "mqpcf.cfh.MsgSeqNbr" , FT_UINT32, BASE_DEC, NULL, 0x0, "CFH message sequence number", HFILL }},
        { &hf_mqpcf_cfh_control  , { "Control..", "mqpcf.cfh.control"   , FT_UINT32, BASE_DEC, NULL, 0x0, "CFH control", HFILL }},
        { &hf_mqpcf_cfh_compcode , { "CompCode.", "mqpcf.cfh.compcode"  , FT_UINT32, BASE_DEC, VALS(&GET_VALSV(mqcc)), 0x0, "CFH completion code", HFILL }},
        { &hf_mqpcf_cfh_reason   , { "ReasCode.", "mqpcf.cfh.reasoncode", FT_UINT32, BASE_DEC, VALS(&GET_VALSV(mqrc)), 0x0, "CFH reason code", HFILL }},
        { &hf_mqpcf_cfh_ParmCount, { "ParmCount", "mqpcf.cfh.ParmCount" , FT_UINT32, BASE_DEC, NULL, 0x0, "CFH parameter count", HFILL }},

        { &hf_mq_pcf_prmtyp      , { "ParmTyp..", "mqpcf.parm.type"      , FT_UINT32 , BASE_DEC, VALS(&GET_VALSV(PrmTyp)), 0x0, "MQPCF parameter type", HFILL }},
        { &hf_mq_pcf_prmlen      , { "ParmLen..", "mqpcf.parm.len"       , FT_UINT32 , BASE_DEC, NULL, 0x0, "MQPCF parameter length", HFILL }},
        { &hf_mq_pcf_prmid       , { "ParmID...", "mqpcf.parm.id"        , FT_UINT32 , BASE_DEC, VALS(&GET_VALSV(PrmId)), 0x0, "MQPCF parameter id", HFILL }},
        { &hf_mq_pcf_prmidnovals , { "ParmID...", "mqpcf.parm.idNoVals"  , FT_UINT32 , BASE_HEX_DEC, NULL, 0x0, "MQPCF parameter id No Vals", HFILL }},
        { &hf_mq_pcf_filterop    , { "FilterOP.", "mqpcf.filter.op"      , FT_UINT32 , BASE_DEC, VALS(&GET_VALSV(FilterOP)), 0x0, "MQPCF Filter operator", HFILL }},
        { &hf_mq_pcf_prmccsid    , { "ParmCCSID", "mqpcf.parm.ccsid"     , FT_UINT32 , BASE_DEC | BASE_RANGE_STRING, RVALS(&GET_VALRV(ccsid)), 0x0, "MQPCF parameter ccsid", HFILL }},
        { &hf_mq_pcf_prmstrlen   , { "ParmStrLn", "mqpcf.parm.strlen"    , FT_UINT32 , BASE_DEC, NULL, 0x0, "MQPCF parameter strlen", HFILL }},
        { &hf_mq_pcf_prmcount    , { "ParmCount", "mqpcf.parm.count"     , FT_UINT32 , BASE_DEC, NULL, 0x0, "MQPCF parameter count", HFILL }},
        { &hf_mq_pcf_prmunused   , { "ParmUnuse", "mqpcf.parm.unused"    , FT_UINT32 , BASE_DEC, NULL, 0x0, "MQPCF parameter unused", HFILL }},
        { &hf_mq_pcf_string      , { "String...", "mqpcf.parm.string"    , FT_STRINGZ, BASE_NONE, NULL, 0x0, "MQPCF parameter string", HFILL }},
        { &hf_mq_pcf_stringlist  , { "StrList..", "mqpcf.parm.stringlist", FT_STRINGZ, BASE_NONE, NULL, 0x0, "MQPCF parameter string list", HFILL }},
        { &hf_mq_pcf_int         , { "Integer..", "mqpcf.parm.int"       , FT_INT32  , BASE_DEC, NULL, 0x0, "MQPCF parameter int", HFILL }},
        { &hf_mq_pcf_intlist     , { "IntList..", "mqpcf.parm.intlist"   , FT_INT32  , BASE_DEC, NULL, 0x0, "MQPCF parameter int list", HFILL }},
        { &hf_mq_pcf_bytestring  , { "ByteStr..", "mqpcf.parm.bytestring", FT_BYTES  , BASE_NONE, NULL, 0x0, "MQPCF parameter byte string", HFILL }},
        { &hf_mq_pcf_int64       , { "Int64....", "mqpcf.parm.int64"     , FT_INT64  , BASE_DEC, NULL, 0x0, "MQPCF parameter int64", HFILL }},
        { &hf_mq_pcf_int64list   , { "Int64List", "mqpcf.parm.int64list" , FT_INT64  , BASE_DEC, NULL, 0x0, "MQPCF parameter int64 list", HFILL }},
    };
    static gint *ett[] =
    {
        &ett_mqpcf,
        &ett_mqpcf_prm,
        &ett_mqpcf_cfh,
    };
    static ei_register_info ei[] =
    {
        { &ei_mq_pcf_prmln0, { "mqpcf.parm.len0"     , PI_MALFORMED, PI_ERROR, "MQPCF Parameter length is 0", EXPFILL }},
        { &ei_mq_pcf_MaxInt, { "mqpcf.parm.IntList"  , PI_UNDECODED, PI_WARN , "MQPCF Parameter Integer list exhausted", EXPFILL }},
        { &ei_mq_pcf_MaxStr, { "mqpcf.parm.StrList"  , PI_UNDECODED, PI_WARN , "MQPCF Parameter String list exhausted", EXPFILL }},
        { &ei_mq_pcf_MaxI64, { "mqpcf.parm.Int64List", PI_UNDECODED, PI_WARN , "MQPCF Parameter Int64 list exhausted", EXPFILL }},
        { &ei_mq_pcf_MaxPrm, { "mqpcf.parm.MaxPrm"   , PI_UNDECODED, PI_WARN , "MQPCF Max number of parameter exhausted", EXPFILL }},
        { &ei_mq_pcf_PrmCnt, { "mqpcf.parm.PrmCnt"   , PI_UNDECODED, PI_WARN , "MQPCF Unkn Parm Cnt Length invalid", EXPFILL }},
    };

    module_t *mq_pcf_module;

    proto_mqpcf = proto_register_protocol("WebSphere MQ Programmable Command Formats", "MQ PCF", "mqpcf");
    proto_register_field_array(proto_mqpcf, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

    expert_mqpcf = expert_register_protocol(proto_mqpcf);
    expert_register_field_array(expert_mqpcf, ei, array_length(ei));

    mq_pcf_module = prefs_register_protocol(proto_mqpcf, NULL);
    prefs_register_uint_preference(mq_pcf_module, "maxprm",
        "Set the maximun number of parameter in the PCF to decode",
        "When dissecting PCF there can be a lot of parameters."
        " You can limit the number of parameter decoded, before it continue with the next PCF.",
        10, &mq_pcf_maxprm);
    prefs_register_uint_preference(mq_pcf_module, "maxlst",
        "Set the maximun number of Parameter List that are displayed",
        "When dissecting a parameter of a PCFm, if it is a StringList, IntegerList or Integer64 List, "
        " You can limit the number of element displayed, before it continue with the next Parameter.",
        10, &mq_pcf_maxlst);

}
void
proto_register_sss(void)
{
    static hf_register_info hf_sss[] = {
        { &hf_buffer_size,
        { "Buffer Size", "sss.buffer", FT_UINT32, BASE_DEC, NULL, 0x0,
          NULL, HFILL }},

        { &hf_ping_version,
        { "Ping Version", "sss.ping_version", FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }},

        { &hf_flags,
        { "Flags", "sss.flags", FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }},

        { &hf_context,
        { "Context", "sss.context", FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }},

        { &hf_frag_handle,
        { "Fragment Handle", "sss.frag_handle", FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }},

        { &hf_length,
        { "Length", "sss.length", FT_UINT32, BASE_DEC, NULL, 0x0,
          NULL, HFILL }},

        { &hf_verb,
        { "Verb",    "sss.verb",
          FT_UINT32,    BASE_HEX,   VALS(sss_verb_enum),   0x0,
          NULL, HFILL }},

        { &hf_user,
        { "User",    "sss.user",
          FT_STRING,    BASE_NONE,   NULL,   0x0,
          NULL, HFILL }},

        { &hf_secret,
        { "Secret ID",    "sss.secret",
          FT_STRING,    BASE_NONE,   NULL,   0x0,
          NULL, HFILL }},

        { &hf_sss_version,
        { "SecretStore Protocol Version", "sss.version", FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }},

        { &hf_return_code,
        { "Return Code", "sss.return_code", FT_UINT32, BASE_HEX, VALS(sss_errors_enum), 0x0,
          NULL, HFILL }},

        { &hf_enc_cred,
        { "Encrypted Credential",    "sss.enc_cred",
          FT_BYTES,    BASE_NONE,   NULL,   0x0,
          NULL, HFILL }},

        { &hf_enc_data,
        { "Encrypted Data",    "sss.enc_data",
          FT_BYTES,    BASE_NONE,   NULL,   0x0,
          NULL, HFILL }},

        { &hfbit1,
        { "Enhanced Protection", "ncp.sss_bit1", FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL }},

        { &hfbit2,
        { "Create ID", "ncp.sss_bit2", FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL }},

        { &hfbit3,
        { "Remove Lock", "ncp.sss_bit3", FT_BOOLEAN, 32, NULL, 0x00000004, NULL, HFILL }},

        { &hfbit4,
        { "Repair", "ncp.sss_bit4", FT_BOOLEAN, 32, NULL, 0x00000008, NULL, HFILL }},

        { &hfbit5,
        { "Unicode", "ncp.sss_bit5", FT_BOOLEAN, 32, NULL, 0x00000010, NULL, HFILL }},

        { &hfbit6,
        { "EP Master Password Used", "ncp.sss_bit6", FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL }},

        { &hfbit7,
        { "EP Password Used", "ncp.sss_bit7", FT_BOOLEAN, 32, NULL, 0x00000040, NULL, HFILL }},

        { &hfbit8,
        { "Set Tree Name", "ncp.sss_bit8", FT_BOOLEAN, 32, NULL, 0x00000080, NULL, HFILL }},

        { &hfbit9,
        { "Get Context", "ncp.sss_bit9", FT_BOOLEAN, 32, NULL, 0x00000100, NULL, HFILL }},

        { &hfbit10,
        { "Destroy Context", "ncp.sss_bit10", FT_BOOLEAN, 32, NULL, 0x00000200, NULL, HFILL }},

        { &hfbit11,
        { "Not Defined", "ncp.sss_bit11", FT_BOOLEAN, 32, NULL, 0x00000400, NULL, HFILL }},

        { &hfbit12,
        { "Not Defined", "ncp.sss_bit12", FT_BOOLEAN, 32, NULL, 0x00000800, NULL, HFILL }},

        { &hfbit13,
        { "Not Defined", "ncp.sss_bit13", FT_BOOLEAN, 32, NULL, 0x00001000, NULL, HFILL }},

        { &hfbit14,
        { "Not Defined", "ncp.sss_bit14", FT_BOOLEAN, 32, NULL, 0x00002000, NULL, HFILL }},

        { &hfbit15,
        { "Not Defined", "ncp.sss_bit15", FT_BOOLEAN, 32, NULL, 0x00004000, NULL, HFILL }},

        { &hfbit16,
        { "Not Defined", "ncp.sss_bit16", FT_BOOLEAN, 32, NULL, 0x00008000, NULL, HFILL }},

        { &hfbit17,
        { "EP Lock", "ncp.sss_bit17", FT_BOOLEAN, 32, NULL, 0x00010000, NULL, HFILL }},

        { &hfbit18,
        { "Not Initialized", "ncp.sss_bit18", FT_BOOLEAN, 32, NULL, 0x00020000, NULL, HFILL }},

        { &hfbit19,
        { "Enhanced Protection", "ncp.sss_bit19", FT_BOOLEAN, 32, NULL, 0x00040000, NULL, HFILL }},

        { &hfbit20,
        { "Store Not Synced", "ncp.sss_bit20", FT_BOOLEAN, 32, NULL, 0x00080000, NULL, HFILL }},

        { &hfbit21,
        { "Admin Last Modified", "ncp.sss_bit21", FT_BOOLEAN, 32, NULL, 0x00100000, NULL, HFILL }},

        { &hfbit22,
        { "EP Password Present", "ncp.sss_bit22", FT_BOOLEAN, 32, NULL, 0x00200000, NULL, HFILL }},

        { &hfbit23,
        { "EP Master Password Present", "ncp.sss_bit23", FT_BOOLEAN, 32, NULL, 0x00400000, NULL, HFILL }},

        { &hfbit24,
        { "MP Disabled", "ncp.sss_bit24", FT_BOOLEAN, 32, NULL, 0x00800000, NULL, HFILL }},

        { &hfbit25,
        { "Not Defined", "ncp.sss_bit25", FT_BOOLEAN, 32, NULL, 0x01000000, NULL, HFILL }},

        { &hfbit26,
        { "Not Defined", "ncp.sss_bit26", FT_BOOLEAN, 32, NULL, 0x02000000, NULL, HFILL }},

        { &hfbit27,
        { "Not Defined", "ncp.sss_bit27", FT_BOOLEAN, 32, NULL, 0x04000000, NULL, HFILL }},

        { &hfbit28,
        { "Not Defined", "ncp.sss_bit28", FT_BOOLEAN, 32, NULL, 0x08000000, NULL, HFILL }},

        { &hfbit29,
        { "Not Defined", "ncp.sss_bit29", FT_BOOLEAN, 32, NULL, 0x10000000, NULL, HFILL }},

        { &hfbit30,
        { "Not Defined", "ncp.sss_bit30", FT_BOOLEAN, 32, NULL, 0x20000000, NULL, HFILL }},

        { &hfbit31,
        { "Not Defined", "ncp.sss_bit31", FT_BOOLEAN, 32, NULL, 0x40000000, NULL, HFILL }},

        { &hfbit32,
        { "Not Defined", "ncp.sss_bit32", FT_BOOLEAN, 32, NULL, 0x80000000, NULL, HFILL }},

    };

        static gint *ett[] = {
            &ett_sss,
        };

        static ei_register_info ei[] = {
            { &ei_return_code, { "sss.return_code.expert", PI_RESPONSE_CODE, PI_NOTE, "SSS Error", EXPFILL }},
        };

        expert_module_t* expert_sss;
        /*module_t *sss_module;*/

        proto_sss = proto_register_protocol("Novell SecretStore Services", "SSS", "sss");
        proto_register_field_array(proto_sss, hf_sss, array_length(hf_sss));
        proto_register_subtree_array(ett, array_length(ett));
        expert_sss = expert_register_protocol(proto_sss);
        expert_register_field_array(expert_sss, ei, array_length(ei));
}
Пример #3
0
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.");
}
Пример #4
0
/* Register the protocol with Wireshark */
void proto_register_1722a (void)
{
    expert_module_t *expert_1722a;

    static hf_register_info hf[] =
    {
        { &hf_1722a_mrfield,
            { "AVBTP Media Clock Restart", "ieee1722a.mrfield",
              FT_BOOLEAN, 8, NULL, IEEE_1722A_MR_MASK, NULL, HFILL }
        },
        { &hf_1722a_tvfield,
            { "Source Timestamp Valid", "ieee1722a.tvfield",
              FT_BOOLEAN, 8, NULL, IEEE_1722A_TV_MASK, NULL, HFILL }
            },
        { &hf_1722a_seqnum,
            { "Sequence Number", "ieee1722a.seqnum",
              FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }
        },
        { &hf_1722a_tufield,
            { "AVBTP Timestamp Uncertain", "ieee1722a.tufield",
              FT_BOOLEAN, 8, NULL, IEEE_1722A_TU_MASK, NULL, HFILL }
        },
        { &hf_1722a_stream_id,
            { "Stream ID", "ieee1722a.stream_id",
              FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL }
        },
        { &hf_1722a_avbtp_timestamp,
            { "AVBTP Timestamp", "ieee1722a.avbtp_timestamp",
              FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }
        },
        { &hf_1722a_format_info,
            { "Format Info", "ieee1722a.format_info",
              FT_UINT8, BASE_HEX, VALS(format_info_vals), 0x00, NULL, HFILL }
        },
        { &hf_1722a_nominal_sample_rate,
            { "Nominal Sample Rate", "ieee1722a.nominal_sample_rate",
              FT_UINT8, BASE_HEX, VALS(sample_rate_type_vals), IEEE_1722A_NOM_SAMPLE_RATE_MASK, NULL, HFILL }
        },
        { &hf_1722a_bit_depth,
            { "Bit Depth", "ieee1722a.bit_depth",
              FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }
        },
        { &hf_1722a_stream_data_length,
            { "Stream Data Length", "ieee1722a.stream_data_len",
              FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }
        },
        { &hf_1722a_sparse_timestamp,
            { "Sparse Timestamp Mode", "ieee1722a.sparse_timestamp",
              FT_BOOLEAN, 8, NULL, IEEE_1722A_SP_MASK, NULL, HFILL }
        },
        { &hf_1722a_evtfield,
            { "EVT", "ieee1722a.evtfield",
              FT_UINT8, BASE_HEX, NULL, IEEE_1722A_EVT_MASK, NULL, HFILL }
        },
        { &hf_1722a_channels_per_frame,
            { "Channels per Frame", "ieee1722a.channels_per_frame",
              FT_UINT16, BASE_DEC, NULL, IEEE_1722A_CHANNEL_PER_FRAME_MASK, NULL, HFILL }
        },
        { &hf_1722a_data,
            { "Audio Data", "ieee1722a.data",
              FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }
        },
        { &hf_1722a_sample,
            { "Sample Data", "ieee1722a.data.sample.sampledata",
              FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }
        },
        { &hf_1722a_crf_type,
            { "Type", "ieee1722a.type",
              FT_UINT16, BASE_HEX, VALS(clock_reference_format_type_vals), 0x00, NULL, HFILL }
        },
        { &hf_1722a_clock_frequency,
            { "Clock Frequency", "ieee1722a.clock_frequency",
              FT_UINT8, BASE_HEX, VALS(clock_frequency_type_vals), 0x00, NULL, HFILL }
        },
        { &hf_1722a_clock_multiplier,
            { "Clock Multiplier", "ieee1722a.clock_multiplier",
              FT_UINT8, BASE_HEX, VALS(clock_multiplier_type_vals), 0x00, NULL, HFILL }
        },
        { &hf_1722a_timestamp_interval,
            { "Timestamp Interval", "ieee1722a.timestamp_interval",
              FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }
        },
        { &hf_1722a_crf_timestamp,
            { "Timestamps", "ieee1722a.crf_timestamps",
              FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }
        },
        { &hf_1722a_crf_timestamp_data,
            { "Timestamp Data", "ieee1722a.crf_timestamp_data",
              FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL }
        }
    };

    static ei_register_info ei[] = {
        { &ei_sample_width,                 { "1722a.expert.sample_width_zero", PI_PROTOCOL, PI_WARN, "Wrong value for Sample Width", EXPFILL }},
        { &ei_channels_per_frame,           { "1722a.expert.channels_per_frame_zero", PI_PROTOCOL, PI_WARN, "Wrong value for parameter Channels per Frame", EXPFILL }},
        { &ei_unknown_parameter,            { "1722a.expert.unknown_parameter", PI_PROTOCOL, PI_WARN, "Unknown parameter", EXPFILL }},
        { &ei_format_info,                  { "1722a.expert.format_info", PI_PROTOCOL, PI_WARN, "Format Info Value Reserved", EXPFILL }},
        { &ei_clock_reference_type,         { "1722a.expert.clock_reference_format_type", PI_PROTOCOL, PI_WARN, "The CRF type is not supported", EXPFILL }}
    };

    static gint *ett[] =
    {
        &ett_1722a,
        &ett_1722a_audio,
        &ett_1722a_sample,
        &ett_1722a_crf_timestamp
    };

    /* Register the protocol name and description */
    proto_1722a = proto_register_protocol(
        "IEEE 1722a Protocol", /* name */
        "1722A",               /* short name */
        "1722a"                /* abbrev */
        );

    /* Required function calls to register the header fields and subtrees used */
    proto_register_field_array(proto_1722a, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

    expert_1722a = expert_register_protocol(proto_1722a);
    expert_register_field_array(expert_1722a, ei, array_length(ei));
}
Пример #5
0
/* Register all the bits needed with the filtering engine */
void
proto_register_pgm(void)
{
  static hf_register_info hf[] = {
    { &hf_pgm_main_sport,
      { "Source Port", "pgm.hdr.sport", FT_UINT16, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_main_dport,
      { "Destination Port", "pgm.hdr.dport", FT_UINT16, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_port,
      { "Port", "pgm.port", FT_UINT16, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_main_type,
      { "Type", "pgm.hdr.type", FT_UINT8, BASE_HEX,
	  VALS(type_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_main_opts,
      { "Options", "pgm.hdr.opts", FT_UINT8, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_main_opts_opt,
      { "Options", "pgm.hdr.opts.opt", FT_BOOLEAN, 8,
	  TFS(&opts_present), PGM_OPT, NULL, HFILL }},
    { &hf_pgm_main_opts_netsig,
      { "Network Significant Options", "pgm.hdr.opts.netsig",
	  FT_BOOLEAN, 8,
	  TFS(&opts_present), PGM_OPT_NETSIG, NULL, HFILL }},
    { &hf_pgm_main_opts_varlen,
      { "Variable length Parity Packet Option", "pgm.hdr.opts.varlen",
	  FT_BOOLEAN, 8,
	  TFS(&opts_present), PGM_OPT_VAR_PKTLEN, NULL, HFILL }},
    { &hf_pgm_main_opts_parity,
      { "Parity", "pgm.hdr.opts.parity", FT_BOOLEAN, 8,
	  TFS(&opts_present), PGM_OPT_PARITY, NULL, HFILL }},
    { &hf_pgm_main_cksum,
      { "Checksum", "pgm.hdr.cksum", FT_UINT16, BASE_HEX,
        NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_main_cksum_bad,
      { "Bad Checksum", "pgm.hdr.cksum_bad", FT_BOOLEAN, BASE_NONE,
        NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_main_gsi,
      { "Global Source Identifier", "pgm.hdr.gsi", FT_BYTES, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_main_tsdulen,
      { "Transport Service Data Unit Length", "pgm.hdr.tsdulen", FT_UINT16,
	  BASE_DEC, NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_spm_sqn,
      { "Sequence number", "pgm.spm.sqn", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_spm_trail,
      { "Trailing Edge Sequence Number", "pgm.spm.trail", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_spm_lead,
      { "Leading Edge Sequence Number", "pgm.spm.lead", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_spm_pathafi,
      { "Path NLA AFI", "pgm.spm.pathafi", FT_UINT16, BASE_DEC,
	  VALS(afn_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_spm_res,
      { "Reserved", "pgm.spm.res", FT_UINT16, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_spm_path,
      { "Path NLA", "pgm.spm.path", FT_IPv4, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_spm_path6,
      { "Path NLA", "pgm.spm.path", FT_IPv6, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
#if 0
    { &hf_pgm_data_sqn,
      { "Data Packet Sequence Number", "pgm.data.sqn", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
#endif
#if 0
    { &hf_pgm_data_trail,
      { "Trailing Edge Sequence Number", "pgm.data.trail", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
#endif
    { &hf_pgm_nak_sqn,
      { "Requested Sequence Number", "pgm.nak.sqn", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_nak_srcafi,
      { "Source NLA AFI", "pgm.nak.srcafi", FT_UINT16, BASE_DEC,
	  VALS(afn_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_nak_srcres,
      { "Reserved", "pgm.nak.srcres", FT_UINT16, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_nak_src,
      { "Source NLA", "pgm.nak.src", FT_IPv4, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_nak_src6,
      { "Source NLA", "pgm.nak.src", FT_IPv6, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_nak_grpafi,
      { "Multicast Group AFI", "pgm.nak.grpafi", FT_UINT16, BASE_DEC,
	  VALS(afn_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_nak_grpres,
      { "Reserved", "pgm.nak.grpres", FT_UINT16, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_nak_grp,
      { "Multicast Group NLA", "pgm.nak.grp", FT_IPv4, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_nak_grp6,
      { "Multicast Group NLA", "pgm.nak.grp", FT_IPv6, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_poll_sqn,
      { "Sequence Number", "pgm.poll.sqn", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_poll_round,
      { "Round", "pgm.poll.round", FT_UINT16, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_poll_subtype,
      { "Subtype", "pgm.poll.subtype", FT_UINT16, BASE_HEX,
	  VALS(poll_subtype_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_poll_pathafi,
      { "Path NLA AFI", "pgm.poll.pathafi", FT_UINT16, BASE_DEC,
	  VALS(afn_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_poll_res,
      { "Reserved", "pgm.poll.res", FT_UINT16, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_poll_path,
      { "Path NLA", "pgm.poll.path", FT_IPv4, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_poll_path6,
      { "Path NLA", "pgm.poll.path", FT_IPv6, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_poll_backoff_ivl,
      { "Back-off Interval", "pgm.poll.backoff_ivl", FT_UINT32, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_poll_rand_str,
      { "Random String", "pgm.poll.rand_str", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_poll_matching_bmask,
      { "Matching Bitmask", "pgm.poll.matching_bmask", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_polr_sqn,
      { "Sequence Number", "pgm.polr.sqn", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_polr_round,
      { "Round", "pgm.polr.round", FT_UINT16, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_polr_res,
      { "Reserved", "pgm.polr.res", FT_UINT16, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_ack_sqn,
      { "Maximum Received Sequence Number", "pgm.ack.maxsqn", FT_UINT32,
	  BASE_HEX, NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_ack_bitmap,
      { "Packet Bitmap", "pgm.ack.bitmap", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_type,
      { "Type", "pgm.opts.type", FT_UINT8, BASE_HEX,
          VALS(opt_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_opt_len,
      { "Length", "pgm.opts.len", FT_UINT8, BASE_DEC,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_tlen,
      { "Total Length", "pgm.opts.tlen", FT_UINT16, BASE_DEC,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_genopt_end,
      { "Option end", "pgm.genopts.end", FT_BOOLEAN, 8,
          TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
    { &hf_pgm_genopt_type,
      { "Type", "pgm.genopts.type", FT_UINT8, BASE_HEX,
          VALS(opt_vals), 0x7f, NULL, HFILL }},
    { &hf_pgm_genopt_len,
      { "Length", "pgm.genopts.len", FT_UINT8, BASE_DEC,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_genopt_opx,
      { "Option Extensibility Bits", "pgm.genopts.opx", FT_UINT8, BASE_HEX,
          VALS(opx_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_opt_parity_prm_po,
      { "Parity Parameters", "pgm.opts.parity_prm.op", FT_UINT8, BASE_HEX,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_parity_prm_prmtgsz,
      { "Transmission Group Size", "pgm.opts.parity_prm.prm_grp",
          FT_UINT32, BASE_HEX,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_join_res,
      { "Reserved", "pgm.opts.join.res", FT_UINT8, BASE_HEX,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_join_minjoin,
      { "Minimum Sequence Number", "pgm.opts.join.min_join",
          FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_parity_grp_res,
      { "Reserved", "pgm.opts.parity_prm.op", FT_UINT8, BASE_HEX,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_parity_grp_prmgrp,
      { "Transmission Group Size", "pgm.opts.parity_prm.prm_grp",
          FT_UINT32, BASE_HEX,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_nak_res,
      { "Reserved", "pgm.opts.nak.op", FT_UINT8, BASE_HEX,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_nak_list,
      { "List", "pgm.opts.nak.list", FT_BYTES, BASE_NONE,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccdata_res,
      { "Reserved", "pgm.opts.ccdata.res", FT_UINT8, BASE_DEC,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccdata_tsp,
      { "Time Stamp", "pgm.opts.ccdata.tstamp", FT_UINT16, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccdata_afi,
      { "Acker AFI", "pgm.opts.ccdata.afi", FT_UINT16, BASE_DEC,
	  VALS(afn_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccdata_res2,
      { "Reserved", "pgm.opts.ccdata.res2", FT_UINT16, BASE_DEC,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccdata_acker,
      { "Acker", "pgm.opts.ccdata.acker", FT_IPv4, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccdata_acker6,
      { "Acker", "pgm.opts.ccdata.acker", FT_IPv6, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccfeedbk_res,
      { "Reserved", "pgm.opts.ccdata.res", FT_UINT8, BASE_DEC,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccfeedbk_tsp,
      { "Time Stamp", "pgm.opts.ccdata.tstamp", FT_UINT16, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccfeedbk_afi,
      { "Acker AFI", "pgm.opts.ccdata.afi", FT_UINT16, BASE_DEC,
	  VALS(afn_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccfeedbk_lossrate,
      { "Loss Rate", "pgm.opts.ccdata.lossrate", FT_UINT16, BASE_HEX,
          NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccfeedbk_acker,
      { "Acker", "pgm.opts.ccdata.acker", FT_IPv4, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_ccfeedbk_acker6,
      { "Acker", "pgm.opts.ccdata.acker", FT_IPv6, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_nak_bo_ivl_res,
      { "Reserved", "pgm.opts.nak_bo_ivl.res", FT_UINT8, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_nak_bo_ivl_bo_ivl,
      { "Back-off Interval", "pgm.opts.nak_bo_ivl.bo_ivl", FT_UINT32, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_nak_bo_ivl_bo_ivl_sqn,
      { "Back-off Interval Sequence Number", "pgm.opts.nak_bo_ivl.bo_ivl_sqn", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_nak_bo_rng_res,
      { "Reserved", "pgm.opts.nak_bo_rng.res", FT_UINT8, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_nak_bo_rng_min_bo_ivl,
      { "Min Back-off Interval", "pgm.opts.nak_bo_rng.min_bo_ivl", FT_UINT32, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_nak_bo_rng_max_bo_ivl,
      { "Max Back-off Interval", "pgm.opts.nak_bo_rng.max_bo_ivl", FT_UINT32, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_redirect_res,
      { "Reserved", "pgm.opts.redirect.res", FT_UINT8, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_redirect_afi,
      { "DLR AFI", "pgm.opts.redirect.afi", FT_UINT16, BASE_DEC,
	  VALS(afn_vals), 0x0, NULL, HFILL }},
    { &hf_pgm_opt_redirect_res2,
      { "Reserved", "pgm.opts.redirect.res2", FT_UINT16, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_redirect_dlr,
      { "DLR", "pgm.opts.redirect.dlr", FT_IPv4, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_redirect_dlr6,
      { "DLR", "pgm.opts.redirect.dlr", FT_IPv6, BASE_NONE,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_fragment_res,
      { "Reserved", "pgm.opts.fragment.res", FT_UINT8, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_fragment_first_sqn,
      { "First Sequence Number", "pgm.opts.fragment.first_sqn", FT_UINT32, BASE_HEX,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_fragment_offset,
      { "Fragment Offset", "pgm.opts.fragment.fragment_offset", FT_UINT32, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }},
    { &hf_pgm_opt_fragment_total_length,
      { "Total Length", "pgm.opts.fragment.total_length", FT_UINT32, BASE_DEC,
	  NULL, 0x0, NULL, HFILL }}
  };
  static gint *ett[] = {
	&ett_pgm,
	&ett_pgm_optbits,
	&ett_pgm_spm,
	&ett_pgm_data,
	&ett_pgm_nak,
	&ett_pgm_poll,
	&ett_pgm_polr,
	&ett_pgm_ack,
	&ett_pgm_opts,
	&ett_pgm_opts_join,
	&ett_pgm_opts_parityprm,
	&ett_pgm_opts_paritygrp,
	&ett_pgm_opts_naklist,
	&ett_pgm_opts_ccdata,
	&ett_pgm_opts_nak_bo_ivl,
	&ett_pgm_opts_nak_bo_rng,
	&ett_pgm_opts_redirect,
	&ett_pgm_opts_fragment
  };
  static ei_register_info ei[] = {
	{ &ei_pgm_opt_type, { "pgm.opts.type.invalid", PI_PROTOCOL, PI_WARN, "Invalid option", EXPFILL }},
	{ &ei_pgm_opt_tlen, { "pgm.opts.tlen.invalid", PI_PROTOCOL, PI_WARN, "Total Length invalid", EXPFILL }},
	{ &ei_pgm_genopt_len, { "pgm.genopts.len.invalid", PI_PROTOCOL, PI_WARN, "Option length invalid", EXPFILL }},
	{ &ei_address_format_invalid, { "pgm.address_format_invalid", PI_PROTOCOL, PI_WARN, "Can't handle this address format", EXPFILL }},
  };

  module_t *pgm_module;
  expert_module_t* expert_pgm;

  proto_pgm = proto_register_protocol("Pragmatic General Multicast",
				       "PGM", "pgm");

  proto_register_field_array(proto_pgm, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_pgm = expert_register_protocol(proto_pgm);
  expert_register_field_array(expert_pgm, ei, array_length(ei));

	/* subdissector code */
  subdissector_table = register_dissector_table("pgm.port",
		"PGM port", FT_UINT16, BASE_DEC);
  register_heur_dissector_list("pgm", &heur_subdissector_list);

  /*
   * Register configuration preferences for UDP encapsulation
   * (Note: Initially the ports are set to zero and the ports
   *        are not registered so the dissecting of PGM
   *        encapsulated in UDP packets is off by default;
   *        dissector_add_handle is called so that pgm
   *        is available for 'decode-as'
   */
  pgm_module = prefs_register_protocol(proto_pgm, proto_reg_handoff_pgm);

  prefs_register_bool_preference(pgm_module, "check_checksum",
	        "Check the validity of the PGM checksum when possible",
		"Whether to check the validity of the PGM checksum",
	        &pgm_check_checksum);

  prefs_register_uint_preference(pgm_module, "udp.encap_ucast_port",
		"PGM Encap Unicast Port (standard is 3055)",
		"PGM Encap is PGM packets encapsulated in UDP packets"
		" (Note: This option is off, i.e. port is 0, by default)",
		10, &udp_encap_ucast_port);

  prefs_register_uint_preference(pgm_module, "udp.encap_mcast_port",
		"PGM Encap Multicast Port (standard is 3056)",
		"PGM Encap is PGM packets encapsulated in UDP packets"
		" (Note: This option is off, i.e. port is 0, by default)",
		10, &udp_encap_mcast_port);

}
Пример #6
0
void
proto_register_hpsw(void)
{
    static hf_register_info hf[] = {
        { &hf_hpsw_version,
          { "Version", "hpsw.version", FT_UINT8, BASE_HEX,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_type,
          { "Type", "hpsw.type", FT_UINT8, BASE_HEX,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_tlvtype,
          { "Type", "hpsw.tlv_type", FT_UINT8, BASE_HEX,
            VALS(hpsw_tlv_type_vals), 0x0, NULL, HFILL }},
        { &hf_hpsw_tlvlength,
          { "Length", "hpsw.tlv_len", FT_UINT8, BASE_DEC,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_device_name,
          { "Device Name", "hpsw.device_name", FT_STRING, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_device_version,
          { "Version", "hpsw.device_version", FT_STRING, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_config_name,
          { "Config Name", "hpsw.config_name", FT_STRING, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_root_mac_addr,
          { "Root MAC Addr", "hpsw.root_mac_addr", FT_ETHER, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_ip_addr,
          { "IP Addr", "hpsw.ip_addr", FT_IPv4, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_field_6,
          { "Field 6", "hpsw.field_6", FT_UINT16, BASE_HEX,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_domain,
          { "Domain", "hpsw.domain", FT_STRING, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_field_8,
          { "Field 8", "hpsw.field_8", FT_UINT16, BASE_HEX,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_field_9,
          { "Field 9", "hpsw.field_9", FT_UINT16, BASE_HEX,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_field_10,
          { "Field 10", "hpsw.field_10", FT_UINT32, BASE_HEX,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_neighbor_mac_addr,
          { "MAC Addr", "hpsw.neighbor_mac_addr", FT_ETHER, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_field_12,
          { "Field 12", "hpsw.field_12", FT_UINT8, BASE_HEX,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_own_mac_addr,
          { "Own MAC Addr", "hpsw.own_mac_addr", FT_ETHER, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_device_id,
          { "Device ID", "hpsw.device_id", FT_ETHER, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_device_id_data,
          { "Data", "hpsw.device_id_data", FT_BYTES, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
        { &hf_hpsw_data,
          { "Data", "hpsw.data", FT_BYTES, BASE_NONE,
            NULL, 0x0, NULL, HFILL }},
    };

    static gint *ett[] = {
        &ett_hpsw,
        &ett_hpsw_tlv
    };

    static ei_register_info ei[] = {
        { &ei_hpsw_tlvlength_bad, { "hpsw.tlv_len.bad", PI_PROTOCOL, PI_WARN, "Bad length", EXPFILL }},
    };

    expert_module_t* expert_hpsw;

    proto_hpsw = proto_register_protocol( "HP Switch Protocol", "HPSW", "hpsw");
    proto_register_field_array(proto_hpsw, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_hpsw = expert_register_protocol(proto_hpsw);
    expert_register_field_array(expert_hpsw, ei, array_length(ei));

    register_dissector("hpsw", dissect_hpsw, proto_hpsw);
}
Пример #7
0
void
proto_register_wifi_display(void)
{
  static hf_register_info hf[] = {
    { &hf_wfd_subelem_id,
      { "Subelement ID", "wifi_display.subelem.id",
        FT_UINT8, BASE_DEC, VALS(wfd_subelem_ids), 0, NULL, HFILL }},
    { &hf_wfd_subelem_len,
      { "Length", "wifi_display.subelem.length",
        FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_type,
      { "Device type", "wifi_display.subelem.dev_info.type",
        FT_UINT16, BASE_DEC, VALS(wfd_dev_info_types), 0x0003, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_coupled_sink_source,
      { "Coupled sink operation supported by WFD source",
        "wifi_display.subelem.dev_info.coupled_sink_by_source",
        FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_coupled_sink_sink,
      { "Coupled sink operation supported by WFD sink",
        "wifi_display.subelem.dev_info.coupled_sink_by_sink",
        FT_BOOLEAN, 16, NULL, 0x0008, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_available,
      { "Available for WFD Session", "wifi_display.subelem.dev_info.available",
        FT_UINT16, BASE_DEC, VALS(wfd_dev_info_avail), 0x0030, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_wsd,
      { "WFD Service Discovery", "wifi_display.subelem.dev_info.wsd",
        FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_pc,
      { "Preferred Connectivity", "wifi_display.subelem.dev_info.pc",
        FT_UINT16, BASE_DEC, VALS(wfd_dev_info_pc), 0x0080, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_content_protection,
      { "Content Protection using HDCP2.0",
        "wifi_display.subelem.dev_info.content_protection",
        FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_time_sync,
      { "Time Synchronization using 802.1AS",
        "wifi_display.subelem.dev_info.time_sync",
        FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_audio_unsupp_pri_sink,
      { "Audio un-supported at Primary sink",
        "wifi_display.subelem.session.audio_unsupp_pri_sink",
        FT_BOOLEAN, 16, NULL, 0x0400, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_audio_only_supp_source,
      { "Audio only support af WFD source",
        "wifi_display.subelem.session.audio_only_supp_source",
        FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_tdls_persistent_group,
      { "TDLS Persistent Group",
        "wifi_display.subelem.session.tdls_persistent_group",
        FT_BOOLEAN, 16, NULL, 0x1000, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_tdls_persistent_group_reinvoke,
      { "TDLS Persistent Group Re-invoke",
        "wifi_display.subelem.session.tdls_persistent_group_reinvoke",
        FT_BOOLEAN, 16, NULL, 0x2000, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_reserved,
      { "Reserved", "wifi_display.subelem.session.reserved",
        FT_UINT16, BASE_DEC, NULL, 0xc000, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_control_port,
      { "Session Management Control Port",
        "wifi_display.subelem.dev_info.control_port",
        FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_dev_info_max_throughput,
      { "WFD Device Maximum Throughput (Mbps)",
        "wifi_display.subelem.dev_info.max_throughput",
        FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_assoc_bssid,
      { "Associated BSSID", "wifi_display.subelem.assoc_bssid.bssid",
        FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_coupled_sink_status_bitmap,
      { "Coupled Sink Status bitmap",
        "wifi_display.subelem.coupled_sink.status",
        FT_UINT8, BASE_DEC, VALS(wfd_coupled_sink_status_bitmap), 0x03,
        NULL, HFILL }},
    { &hf_wfd_subelem_coupled_sink_reserved,
      { "Reserved", "wifi_display.subelem.coupled_sink.reserved",
        FT_UINT8, BASE_DEC, NULL, 0xfc, NULL, HFILL }},
    { &hf_wfd_subelem_coupled_sink_mac_addr,
      { "Coupled Sink MAC Address",
        "wifi_display.subelem.coupled_sink.mac_addr",
        FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_session_descr_len,
      { "Descriptor length",
        "wifi_display.subelem.session.descr_len",
        FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_addr,
      { "Device address",
        "wifi_display.subelem.session.device_address",
        FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_session_assoc_bssid,
      { "Associated BSSID",
        "wifi_display.subelem.session.associated_bssid",
        FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_type,
      { "Device type", "wifi_display.subelem.session.type",
        FT_UINT16, BASE_DEC, VALS(wfd_dev_info_types), 0x0003, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_coupled_sink_source,
      { "Coupled sink operation supported by WFD source",
        "wifi_display.subelem.session.coupled_sink_by_source",
        FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_coupled_sink_sink,
      { "Coupled sink operation supported by WFD sink",
        "wifi_display.subelem.session.coupled_sink_by_sink",
        FT_BOOLEAN, 16, NULL, 0x0008, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_available,
      { "Available for WFD Session", "wifi_display.subelem.session.available",
        FT_UINT16, BASE_DEC, VALS(wfd_dev_info_avail), 0x0030, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_wsd,
      { "WFD Service Discovery", "wifi_display.subelem.session.wsd",
        FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_pc,
      { "Preferred Connectivity", "wifi_display.subelem.session.pc",
        FT_UINT16, BASE_DEC, VALS(wfd_dev_info_pc), 0x0080, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_content_protection,
      { "Content Protection using HDCP2.0",
        "wifi_display.subelem.session.content_protection",
        FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_time_sync,
      { "Time Synchronization using 802.1AS",
        "wifi_display.subelem.session.time_sync",
        FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_audio_unsupp_pri_sink,
      { "Audio un-supported at Primary sink",
        "wifi_display.subelem.session.audio_unsupp_pri_sink",
        FT_BOOLEAN, 16, NULL, 0x0400, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_audio_only_supp_source,
      { "Audio only support af WFD source",
        "wifi_display.subelem.session.audio_only_supp_source",
        FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_tdls_persistent_group,
      { "TDLS Persistent Group",
        "wifi_display.subelem.session.tdls_persistent_group",
        FT_BOOLEAN, 16, NULL, 0x1000, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_tdls_persistent_group_reinvoke,
      { "TDLS Persistent Group Re-invoke",
        "wifi_display.subelem.session.tdls_persistent_group_reinvoke",
        FT_BOOLEAN, 16, NULL, 0x2000, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_reserved,
      { "Reserved", "wifi_display.subelem.session.reserved",
        FT_UINT16, BASE_DEC, NULL, 0xc000, NULL, HFILL }},
    { &hf_wfd_subelem_session_dev_info_max_throughput,
      { "WFD Device Maximum Throughput (Mbps)",
        "wifi_display.subelem.session.max_throughput",
        FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_session_coupled_sink_status_bitmap,
      { "Coupled Sink Status bitmap",
        "wifi_display.subelem.session.coupled_sink_status",
        FT_UINT8, BASE_DEC, VALS(wfd_coupled_sink_status_bitmap), 0x03,
        NULL, HFILL }},
    { &hf_wfd_subelem_session_coupled_sink_reserved,
      { "Reserved", "wifi_display.subelem.session.coupled_sink.reserved",
        FT_UINT8, BASE_DEC, NULL, 0xfc, NULL, HFILL }},
    { &hf_wfd_subelem_session_coupled_sink_addr,
      { "Coupled peer sink address",
        "wifi_display.subelem.session.coupled_peer_sink_addr",
        FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_session_extra_info,
      { "Extra info in the end of descriptor",
        "wifi_display.subelem.session.extra_info",
        FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
    { &hf_wfd_subelem_ext_capab,
      { "WFD Extended Capability Bitmap",
        "wifi_display.subelem.ext_capab",
        FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
    { &hf_wfd_subelem_ext_capab_uibc,
      { "User Input Back Channel(UIBC)",
        "wifi_display.subelem.ext_capab.uibc",
        FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0001, NULL, HFILL }},
    { &hf_wfd_subelem_ext_capab_i2c_read_write,
      { "I2C Read/Write",
        "wifi_display.subelem.ext_capab.i2c_read_write",
        FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0002, NULL, HFILL }},
    { &hf_wfd_subelem_ext_capab_preferred_display_mode,
      { "Preferred Display Mode",
        "wifi_display.subelem.ext_capab.preferred_display_mode",
        FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0004, NULL, HFILL }},
    { &hf_wfd_subelem_ext_capab_standby_resume_control,
      { "Standby and Resume Control",
        "wifi_display.subelem.ext_capab.standby_resume_control",
        FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x008, NULL, HFILL }},
    { &hf_wfd_subelem_ext_capab_tdls_persistent,
      { "TDLS Persistent",
        "wifi_display.subelem.ext_capab.tdls_persistent",
        FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0010, NULL, HFILL }},
    { &hf_wfd_subelem_ext_capab_tdls_persistent_bssid,
      { "TDLS Persistent BSSID",
        "wifi_display.subelem.ext_capab.tdls_persistent_bssid",
        FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0020, NULL, HFILL }},
    { &hf_wfd_subelem_ext_capab_reserved,
      { "Reserved", "wifi_display.subelem.ext_capab.reserved",
        FT_UINT16, BASE_HEX, NULL, 0xffc0, NULL, HFILL }},
    { &hf_wfd_subelem_alt_mac_addr,
      { "Alternative MAC Address", "wifi_display.subelem.alt_mac_addr",
        FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }},
  };
  static gint *ett[] = {
    &ett_wfd_subelem,
    &ett_wfd_dev_info_descr
  };

  static ei_register_info ei[] = {
      { &ei_wfd_subelem_len_invalid, { "wifi_display.subelem.length.invalid", PI_MALFORMED, PI_ERROR, "Subelement length invalid", EXPFILL }},
      { &ei_wfd_subelem_session_descr_invalid, { "wifi_display.subelem.session.descr_invalid", PI_MALFORMED, PI_ERROR, "Invalid WFD Device Info Descriptor", EXPFILL }},
      { &ei_wfd_subelem_id, { "wifi_display.subelem.id.unknown", PI_PROTOCOL, PI_WARN, "Unknown subelement payload", EXPFILL }},
  };

  expert_module_t* expert_wifi_display;

  proto_wifi_display = proto_register_protocol("Wi-Fi Display", "WFD", "wifi_display");
  proto_register_field_array(proto_wifi_display, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

  expert_wifi_display = expert_register_protocol(proto_wifi_display);
  expert_register_field_array(expert_wifi_display, ei, array_length(ei));
}
Пример #8
0
void
proto_register_forces(void)
{
    module_t *forces_module;
    expert_module_t* expert_forces;

    /* Setup list of header fields  See Section 1.6.1 for details*/
    static hf_register_info hf[] = {
        {   &hf_forces_version,
            {   "Version", "forces.flags.version",
                FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL
            }
        },
        {   &hf_forces_rsvd,
            {   "Rsvd", "forces.flags.rsvd",
                FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL
            }
        },
        {   &hf_forces_messagetype,
            {   "Message Type", "forces.messagetype",
                FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_length,
            {   "Header Length", "forces.length",
                FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_sid,
            {   "Source ID", "forces.sid",
                FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_did,
            {   "Destination ID", "forces.did",
                FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_correlator,
            {   "Correlator", "forces.correlator",
                FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_tlv_type,
            {   "Type", "forces.tlv.type",
                FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_tlv_length,
            {   "Length", "forces.tlv.length",
                FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        /*flags*/
        {   &hf_forces_flags,
            {   "Flags", "forces.Flags",
                FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_flags_ack,
            {   "ACK indicator", "forces.flags.ack",
                FT_UINT32, BASE_DEC, VALS(main_header_flags_ack_vals), 0xC0000000, NULL, HFILL
            }
        },
        {   &hf_forces_flags_pri,
            {   "Priority", "forces.flags.pri",
                FT_UINT32, BASE_DEC, NULL, 0x38000000, NULL, HFILL
            }
        },
        {   &hf_forces_flags_rsrvd,
            {   "Rsrvd", "forces.Flags",
                FT_UINT32, BASE_DEC,NULL, 0x07000000, NULL, HFILL
            }
        },
        {   &hf_forces_flags_em,
            {   "Execution mode", "forces.flags.em",
                FT_UINT32, BASE_DEC, VALS(main_header_flags_em_vals), 0x00C00000, NULL, HFILL
            }
        },
        {   &hf_forces_flags_at,
            {   "Atomic Transaction", "forces.flags.at",
                FT_UINT32, BASE_DEC, VALS(main_header_flags_at_vals), 0x00200000, NULL, HFILL
            }
        },
        {   &hf_forces_flags_tp,
            {   "Transaction phase", "forces.flags.tp",
                FT_UINT32, BASE_DEC, VALS(main_header_flags_tp_vals), 0x00180000, NULL, HFILL
            }
        },
        {   &hf_forces_flags_reserved,
            {   "Reserved", "forces.flags.reserved",
                FT_UINT32, BASE_DEC,NULL, 0x0007ffff, NULL, HFILL
            }
        },
        /*LFBSelectTLV*/
        {   &hf_forces_lfbselect_tlv_type_lfb_classid,
            {   "Class ID", "forces.lfbselect.tlv.type.lfb.classid",
                FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_lfbselect_tlv_type_lfb_instanceid,
            {   "Instance ID", "forces.fbselect.tlv.type.lfb.instanceid",
                FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL
            }
        },
        /*Operation TLV*/
        {   &hf_forces_lfbselect_tlv_type_operation_type,
            {   "Type", "forces.lfbselect.tlv.type.operation.type",
                FT_UINT16, BASE_DEC, VALS(operation_type_vals), 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_lfbselect_tlv_type_operation_length,
            {   "Length", "forces.lfbselect.tlv.type.operation.length",
                FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_lfbselect_tlv_type_operation_path_type,
            {   "Type", "forces.lfbselect.tlv.type.operation.path.type",
                FT_UINT16, BASE_DEC, VALS(tlv_type_vals), 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_lfbselect_tlv_type_operation_path_length,
            {   "Length", "forces.lfbselect.tlv.type.operation.path.length",
                FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_lfbselect_tlv_type_operation_path_data,
            {   "Data", "forces.lfbselect.tlv.type.operation.path.data",
                FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_lfbselect_tlv_type_operation_path_flags,
            {   "Path Data Flags", "forces.lfbselect.tlv.type.operation.path.data.flags",
                FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_lfbselect_tlv_type_operation_path_flags_selector,
            {   "Selector", "forces.lfbselect.tlv.type.operation.path.data.flags.selector",
                FT_UINT16, BASE_HEX, NULL, 0x80, NULL, HFILL
            }
        },
        {   &hf_forces_lfbselect_tlv_type_operation_path_flags_reserved,
            {   "Reserved", "forces.lfbselect.tlv.type.operation.path.data.flags.reserved",
                FT_UINT16, BASE_HEX, NULL, 0x7F, NULL, HFILL
            }
        },
        {   &hf_forces_lfbselect_tlv_type_operation_path_IDcount,
            {   "Path Data IDcount", "forces.lfbselect.tlv.type.operation.path.data.IDcount",
                FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_lfbselect_tlv_type_operation_path_IDs,
            {   "Path Data IDs", "forces.lfbselect.tlv.type.operation.path.data.IDs",
                FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        /*Meta data TLV*/
        {   &hf_forces_redirect_tlv_meta_data_tlv_type,
            {   "Type", "forces.redirect.tlv.meta.data.tlv.type",
                FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_redirect_tlv_meta_data_tlv_length,
            {   "Length", "forces.redirect.tlv.meta.data.tlv.length",
                FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_redirect_tlv_meta_data_tlv_meta_data_ilv,
            {   "Meta Data ILV", "forces.redirect.tlv.meta.data.tlv.meta.data.ilv",
                FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_redirect_tlv_meta_data_tlv_meta_data_ilv_id,
            {   "ID", "forces.redirect.tlv.meta.data.tlv.meta.data.ilv.id",
                FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_redirect_tlv_meta_data_tlv_meta_data_ilv_length,
            {   "Length", "forces.redirect.tlv.meta.data.tlv.meta.data.ilv.length",
                FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_redirect_tlv_redirect_data_tlv_type,
            {   "Type", "forces.redirect.tlv.redirect.data.tlv.type",
                FT_UINT16, BASE_DEC, VALS(tlv_type_vals), 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_redirect_tlv_redirect_data_tlv_length,
            {   "Length", "forces.redirect.tlv.redirect.data.tlv.length",
                FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_asresult_association_setup_result,
            {   "Association Setup Result", "forces.teardown.reason",
                FT_UINT32, BASE_DEC, VALS(association_setup_result_at_vals), 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_astreason_tlv_teardown_reason,
            {   "AStreason TLV TearDonw Reason", "forces.astreason.tlv.teardonw.reason",
                FT_UINT32, BASE_DEC, VALS(teardown_reason_at_vals), 0x0, NULL, HFILL
            }
        },
        {   &hf_forces_unknown_tlv,
            {   "Data", "forces.unknown.tlv",
                FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
            }
        }
    };

    /* Setup protocol subtree array */
    static gint *ett[] = {
        &ett_forces,
        &ett_forces_main_header,
        &ett_forces_flags,
        &ett_forces_tlv,
        &ett_forces_lfbselect_tlv_type,
        &ett_forces_lfbselect_tlv_type_operation,
        &ett_forces_lfbselect_tlv_type_operation_path,
        &ett_forces_lfbselect_tlv_type_operation_path_data,
        &ett_forces_lfbselect_tlv_type_operation_path_data_path,
        &ett_forces_lfbselect_tlv_type_operation_path_selector,
        &ett_forces_path_data_tlv,
        &ett_forces_path_data_tlv_flags,
        &ett_forces_redirect_tlv_type,
        &ett_forces_redirect_tlv_meta_data_tlv,
        &ett_forces_redirect_tlv_redirect_data_tlv,
        &ett_forces_redirect_tlv_meta_data_tlv_meta_data_ilv,
        &ett_forces_asresult_tlv,
        &ett_forces_astreason_tlv,
        &ett_forces_unknown_tlv
    };

    static ei_register_info ei[] = {
        { &ei_forces_length, { "forces.length.bad", PI_PROTOCOL, PI_WARN, "ForCES Header length is wrong", EXPFILL }},
        { &ei_forces_tlv_type, { "forces.tlv.type.unknown", PI_PROTOCOL, PI_WARN, "Bogus: The Main_TLV type is unknown", EXPFILL }},
        { &ei_forces_tlv_length, { "forces.tlv.length.bad", PI_PROTOCOL, PI_WARN, "Bogus TLV length", EXPFILL }},
        { &ei_forces_lfbselect_tlv_type_operation_path_length, { "forces.lfbselect.tlv.type.operation.path.length.bad", PI_PROTOCOL, PI_WARN, "Bogus TLV length", EXPFILL }},
        { &ei_forces_lfbselect_tlv_type_operation_type, { "forces.lfbselect.tlv.type.operation.type.unsupported", PI_PROTOCOL, PI_WARN, "ForCES Operation TLV is not supported", EXPFILL }},
        { &ei_forces_redirect_tlv_redirect_data_tlv_length, { "forces.redirect.tlv.redirect.data.tlv.length.bad", PI_PROTOCOL, PI_WARN, "Redirect Data TLV length is wrong", EXPFILL }},
    };

    /* Register the protocol name and description */
    proto_forces = proto_register_protocol("Forwarding and Control Element Separation Protocol", "ForCES", "forces");

    /* Required function calls to register the header fields and subtrees used */
    proto_register_field_array(proto_forces, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_forces = expert_register_protocol(proto_forces);
    expert_register_field_array(expert_forces, ei, array_length(ei));

    forces_module = prefs_register_protocol(proto_forces,proto_reg_handoff_forces);

    prefs_register_uint_preference(forces_module, "tcp_alternate_port",
                                   "TCP port",
                                   "Decode packets on this TCP port as ForCES",
                                   10, &forces_alternate_tcp_port);

    prefs_register_uint_preference(forces_module, "udp_alternate_port",
                                   "UDP port",
                                   "Decode packets on this UDP port as ForCES",
                                   10, &forces_alternate_udp_port);

    prefs_register_uint_preference(forces_module, "sctp_high_prio_port",
                                   "SCTP High Priority channel port",
                                   "Decode packets on this sctp port as ForCES",
                                   10, &forces_alternate_sctp_high_prio_channel_port);

    prefs_register_uint_preference(forces_module, "sctp_med_prio_port",
                                   "SCTP Meidium Priority channel port",
                                   "Decode packets on this sctp port as ForCES",
                                   10, &forces_alternate_sctp_med_prio_channel_port);

    prefs_register_uint_preference(forces_module, "sctp_low_prio_port",
                                   "SCTP Low Priority channel port",
                                   "Decode packets on this sctp port as ForCES",
                                   10, &forces_alternate_sctp_low_prio_channel_port);
}
Пример #9
0
/*--- proto_register_cmip ----------------------------------------------*/
void proto_register_cmip(void) {

  /* List of fields */
  static hf_register_info hf[] = {
    { &hf_cmip_actionType_OID,
      { "actionType", "cmip.actionType_OID",
        FT_STRING, BASE_NONE, NULL, 0,
        NULL, HFILL }},
    { &hf_cmip_eventType_OID,
      { "eventType", "cmip.eventType_OID",
        FT_STRING, BASE_NONE, NULL, 0,
        NULL, HFILL }},
    { &hf_cmip_attributeId_OID,
      { "attributeId", "cmip.attributeId_OID",
        FT_STRING, BASE_NONE, NULL, 0,
        NULL, HFILL }},
    { &hf_cmip_errorId_OID,
      { "errorId", "cmip.errorId_OID",
        FT_STRING, BASE_NONE, NULL, 0,
        NULL, HFILL }},
   { &hf_DiscriminatorConstruct,
      { "DiscriminatorConstruct", "cmip.DiscriminatorConstruct",
        FT_UINT32, BASE_DEC, NULL, 0,
        NULL, HFILL }},
    { &hf_Destination,
      { "Destination", "cmip.Destination",
        FT_UINT32, BASE_DEC, NULL, 0,
        NULL, HFILL }},
    { &hf_NameBinding,
      { "NameBinding", "cmip.NameBinding",
        FT_STRING, BASE_NONE, NULL, 0,
        NULL, HFILL }},
    { &hf_ObjectClass,
      { "ObjectClass", "cmip.ObjectClass",
        FT_UINT32, BASE_DEC, VALS(cmip_ObjectClass_vals), 0,
        NULL, HFILL }},

#include "packet-cmip-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_cmip,
#include "packet-cmip-ettarr.c"
  };

  static ei_register_info ei[] = {
     { &ei_wrong_spdu_type, { "cmip.wrong_spdu_type", PI_PROTOCOL, PI_ERROR, "Internal error: wrong spdu type", EXPFILL }},
  };

  expert_module_t* expert_cmip;

  /* Register protocol */
  proto_cmip = proto_register_protocol(PNAME, PSNAME, PFNAME);
  new_register_dissector("cmip", dissect_cmip, proto_cmip);

  /* Register fields and subtrees */
  proto_register_field_array(proto_cmip, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_cmip = expert_register_protocol(proto_cmip);
  expert_register_field_array(expert_cmip, ei, array_length(ei));

#include "packet-cmip-dis-tab.c"
    oid_add_from_string("discriminatorId(1)","2.9.3.2.7.1");

  attribute_id_dissector_table = register_dissector_table("cmip.attribute_id", "CMIP Attribute Id", FT_UINT32, BASE_DEC);

}
Пример #10
0
void
proto_register_ftp(void)
{
    static hf_register_info hf[] = {
        { &hf_ftp_response,
          { "Response",           "ftp.response",
            FT_BOOLEAN, BASE_NONE, NULL, 0x0,
            "TRUE if FTP response", HFILL }},

        { &hf_ftp_request,
          { "Request",            "ftp.request",
            FT_BOOLEAN, BASE_NONE, NULL, 0x0,
            "TRUE if FTP request", HFILL }},

        { &hf_ftp_request_command,
          { "Request command",    "ftp.request.command",
            FT_STRING,  BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_ftp_request_arg,
          { "Request arg",        "ftp.request.arg",
            FT_STRING,  BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_ftp_response_code,
          { "Response code",      "ftp.response.code",
            FT_UINT32,   BASE_DEC|BASE_EXT_STRING, &response_table_ext, 0x0,
            NULL, HFILL }},

        { &hf_ftp_response_arg,
          { "Response arg",      "ftp.response.arg",
            FT_STRING,  BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_ftp_pasv_ip,
          { "Passive IP address", "ftp.passive.ip",
            FT_IPv4, BASE_NONE, NULL,0x0,
            "Passive IP address (check NAT)", HFILL}},

        { &hf_ftp_pasv_port,
          { "Passive port", "ftp.passive.port",
            FT_UINT16, BASE_DEC, NULL,0x0,
            "Passive FTP server port", HFILL }},

        { &hf_ftp_pasv_nat,
          {"Passive IP NAT", "ftp.passive.nat",
           FT_BOOLEAN, BASE_NONE, NULL, 0x0,
           "NAT is active SIP and passive IP different", HFILL }},

        { &hf_ftp_active_ip,
          { "Active IP address", "ftp.active.cip",
            FT_IPv4, BASE_NONE, NULL, 0x0,
            "Active FTP client IP address", HFILL }},

        { &hf_ftp_active_port,
          {"Active port", "ftp.active.port",
           FT_UINT16, BASE_DEC, NULL, 0x0,
           "Active FTP client port", HFILL }},

        { &hf_ftp_active_nat,
          { "Active IP NAT", "ftp.active.nat",
            FT_BOOLEAN, BASE_NONE, NULL, 0x0,
            "NAT is active", HFILL}},

        { &hf_ftp_eprt_af,
          { "Extended active address family", "ftp.eprt.af",
            FT_UINT8, BASE_DEC, VALS(eprt_af_vals), 0,
            NULL, HFILL }},

        { &hf_ftp_eprt_ip,
          { "Extended active IP address", "ftp.eprt.ip",
            FT_IPv4, BASE_NONE, NULL, 0,
            "Extended active FTP client IPv4 address", HFILL }},

        { &hf_ftp_eprt_ipv6,
          { "Extended active IPv6 address", "ftp.eprt.ipv6",
            FT_IPv6, BASE_NONE, NULL, 0,
            "Extended active FTP client IPv6 address", HFILL }},

        { &hf_ftp_eprt_port,
          { "Extended active port", "ftp.eprt.port",
            FT_UINT16, BASE_DEC, NULL, 0,
            "Extended active FTP client listener port", HFILL }},

        { &hf_ftp_epsv_ip,
          { "Extended passive IPv4 address", "ftp.epsv.ip",
            FT_IPv4, BASE_NONE, NULL, 0,
            "Extended passive FTP server IPv4 address", HFILL }},

        { &hf_ftp_epsv_ipv6,
          { "Extended passive IPv6 address", "ftp.epsv.ipv6",
            FT_IPv6, BASE_NONE, NULL, 0,
            "Extended passive FTP server IPv6 address", HFILL }},

        { &hf_ftp_epsv_port,
          { "Extended passive port", "ftp.epsv.port",
            FT_UINT16, BASE_DEC, NULL, 0,
            "Extended passive FTP server port", HFILL }}

    };
    static gint *ett[] = {
        &ett_ftp,
        &ett_ftp_reqresp
    };

    static ei_register_info ei[] = {
        { &ei_ftp_eprt_args_invalid, { "ftp.eprt.args_invalid", PI_MALFORMED, PI_WARN, "EPRT arguments must have the form: |<family>|<addr>|<port>|", EXPFILL }},
        { &ei_ftp_epsv_args_invalid, { "ftp.epsv.args_invalid", PI_MALFORMED, PI_WARN, "EPSV arguments must have the form (|||<port>|)", EXPFILL }},
    };

    expert_module_t* expert_ftp;

    proto_ftp = proto_register_protocol("File Transfer Protocol (FTP)", "FTP", "ftp");

    register_dissector("ftp", dissect_ftp, proto_ftp);
    proto_ftp_data = proto_register_protocol("FTP Data", "FTP-DATA", "ftp-data");
    register_dissector("ftp-data", dissect_ftpdata, proto_ftp_data);
    proto_register_field_array(proto_ftp, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_ftp = expert_register_protocol(proto_ftp);
    expert_register_field_array(expert_ftp, ei, array_length(ei));
}
Пример #11
0
void proto_register_sap(void)
{

    static hf_register_info hf[] = {
    { &hf_sap_flags,
        { "Flags",         "sap.flags",
        FT_UINT8, BASE_HEX, NULL, 0x0,
        "Bits in the beginning of the SAP header", HFILL }},

    { &hf_sap_flags_v,
        { "Version Number",         "sap.flags.v",
        FT_UINT8, BASE_DEC, VALS(mcast_sap_ver), MCAST_SAP_VERSION_MASK,
        "3 bit version field in the SAP header", HFILL }},

    { &hf_sap_flags_a,
        { "Address Type",           "sap.flags.a",
        FT_BOOLEAN, 8, TFS(&mcast_sap_address_type), MCAST_SAP_BIT_A,
        "Originating source address type", HFILL }},

    { &hf_sap_flags_r,
        { "Reserved",               "sap.flags.r",
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), MCAST_SAP_BIT_R,
        NULL, HFILL }},

    { &hf_sap_flags_t,
        { "Message Type",           "sap.flags.t",
        FT_BOOLEAN, 8, TFS(&mcast_sap_message_type), MCAST_SAP_BIT_T,
        "Announcement type", HFILL }},

    { &hf_sap_flags_e,
        { "Encryption Bit",         "sap.flags.e",
        FT_BOOLEAN, 8, TFS(&mcast_sap_crypt_type), MCAST_SAP_BIT_E,
        NULL, HFILL }},

    { &hf_sap_flags_c,
        { "Compression Bit",         "sap.flags.c",
        FT_BOOLEAN, 8, TFS(&mcast_sap_comp_type), MCAST_SAP_BIT_C,
        NULL, HFILL }},

    { &hf_auth_data,
        { "Authentication data",     "sap.auth",
        FT_NONE, BASE_NONE, NULL, 0x0,
        NULL, HFILL }},

    { &hf_auth_flags,
        { "Authentication data flags", "sap.auth.flags",
        FT_UINT8, BASE_HEX, NULL, 0x0,
        NULL, HFILL }},

    { &hf_auth_flags_v,
        { "Version Number",         "sap.auth.flags.v",
        FT_UINT8, BASE_DEC, VALS(mcast_sap_auth_ver), MCAST_SAP_VERSION_MASK,
        NULL, HFILL }},

    { &hf_auth_flags_p,
        { "Padding Bit",            "sap.auth.flags.p",
        FT_BOOLEAN, 8, TFS(&mcast_sap_auth_pad), MCAST_SAP_AUTH_BIT_P,
        NULL, HFILL }},

    { &hf_auth_flags_t,
        { "Authentication Type",         "sap.auth.flags.t",
        FT_UINT8, BASE_DEC, VALS(mcast_sap_auth_type), MCAST_SAP_AUTH_TYPE_MASK,
        NULL, HFILL }},

        /* Generated from convert_proto_tree_add_text.pl */
        { &hf_sap_auth_len, { "Authentication Length", "sap.auth.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_sap_message_identifier_hash, { "Message Identifier Hash", "sap.message_identifier_hash", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_sap_originating_source_ipv4, { "Originating Source", "sap.originating_source", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_sap_originating_source_ipv6, { "Originating Source", "sap.originating_source", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_sap_auth_subheader, { "Authentication subheader", "sap.auth.subheader", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_sap_auth_data_padding, { "Authentication data padding", "sap.auth.data_padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_sap_auth_data_padding_len, { "Authentication data pad count (bytes)", "sap.auth.data_padding.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_sap_payload_type, { "Payload type", "sap.payload_type", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    };
    static gint *ett[] = {
        &ett_sap,
        &ett_sap_flags,
        &ett_sap_auth,
        &ett_sap_authf,
    };

    static ei_register_info ei[] = {
        { &ei_sap_compressed_and_encrypted, { "sap.compressed_and_encrypted", PI_UNDECODED, PI_WARN, "The rest of the packet is compressed and encrypted", EXPFILL }},
        { &ei_sap_encrypted, { "sap.encrypted", PI_UNDECODED, PI_WARN, "The rest of the packet is encrypted", EXPFILL }},
        { &ei_sap_compressed, { "sap.compressed", PI_UNDECODED, PI_WARN, "The rest of the packet is compressed", EXPFILL }},

        /* Generated from convert_proto_tree_add_text.pl */
        { &ei_sap_bogus_authentication_or_pad_length, { "sap.bogus_authentication_or_pad_length", PI_PROTOCOL, PI_WARN, "Bogus authentication length", EXPFILL }},
    };

    expert_module_t* expert_sap;

    proto_sap = proto_register_protocol("Session Announcement Protocol", "SAP", "sap");

    proto_register_field_array(proto_sap, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_sap = expert_register_protocol(proto_sap);
    expert_register_field_array(expert_sap, ei, array_length(ei));
}
Пример #12
0
void
proto_register_adb(void)
{
    module_t         *module;
    expert_module_t  *expert_module;

    static hf_register_info hf[] = {
        { &hf_command,
            { "Command",                         "adb.command",
            FT_UINT32, BASE_HEX, VALS(command_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_argument_0,
            { "Argument 0",                      "adb.argument.0",
            FT_UINT32, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_argument_1,
            { "Argument 0",                      "adb.argument.1",
            FT_UINT32, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_data_length,
            { "Data Length",                      "adb.data_length",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_data_crc32,
            { "Data CRC32",                      "adb.data_crc32",
            FT_UINT32, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_magic,
            { "Magic",                           "adb.magic",
            FT_UINT32, BASE_HEX, VALS(magic_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_version,
            { "Version",                         "adb.version",
            FT_UINT32, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_max_data,
            { "Max Data",                        "adb.max_data",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_auth_type,
            { "Type",                            "adb.auth_type",
            FT_UINT32, BASE_HEX, VALS(auth_type_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_online,
            { "Online",                          "adb.online",
            FT_BOOLEAN, 32, TFS(&tfs_no_yes), 0x00,
            NULL, HFILL }
        },
        { &hf_sequence,
            { "Sequence",                        "adb.sequence",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_zero,
            { "Zero",                            "adb.zero",
            FT_UINT32, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_local_id,
            { "Local ID",                        "adb.local_id",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_remote_id,
            { "Remote ID",                       "adb.remote_id",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_data,
            { "Data",                            "adb.data",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_service,
            { "Service",                         "adb.service",
            FT_STRING, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_data_fragment,
            { "Data Fragment",                   "adb.data_fragment",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_service_start_in_frame,
            { "Service Start in Frame",          "adb.service_start_in_frame",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_close_local_in_frame,
            { "Local Service Close in Frame",    "adb.close_local_in_frame",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_close_remote_in_frame,
            { "Remote Service Close in Frame",   "adb.close_remote_in_frame",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_command_in_frame,
            { "Command in Frame",                "adb.command_in_frame",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_completed_in_frame,
            { "Completed in Frame",              "adb.completed_in_frame",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_connection_info,
            { "Info",                            "adb.connection_info",
            FT_STRINGZ, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        }
    };

    static gint *ett[] = {
        &ett_adb,
        &ett_adb_arg0,
        &ett_adb_arg1,
        &ett_adb_crc,
        &ett_adb_magic
    };

    static ei_register_info ei[] = {
        { &ei_invalid_magic,          { "adb.expert.invalid_magic", PI_PROTOCOL, PI_WARN, "Invalid Magic", EXPFILL }},
        { &ei_invalid_crc,            { "adb.expert.crc_error", PI_PROTOCOL, PI_ERROR, "CRC32 Error", EXPFILL }},
    };

    command_info         = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
    service_info         = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());

    proto_adb = proto_register_protocol("Android Debug Bridge", "ADB", "adb");
    adb_handle = register_dissector("adb", dissect_adb, proto_adb);

    proto_register_field_array(proto_adb, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_module = expert_register_protocol(proto_adb);
    expert_register_field_array(expert_module, ei, array_length(ei));

    module = prefs_register_protocol(proto_adb, NULL);
    prefs_register_static_text_preference(module, "version",
            "ADB protocol version is compatible prior to: adb 1.0.31",
            "Version of protocol supported by this dissector.");
}
Пример #13
0
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));
}
Пример #14
0
/*--- proto_register_rtse -------------------------------------------*/
void proto_register_rtse(void) {

  /* List of fields */
  static hf_register_info hf[] =
  {
    /* Fragment entries */
    { &hf_rtse_segment_data,
      { "RTSE segment data", "rtse.segment", FT_NONE, BASE_NONE,
	NULL, 0x00, NULL, HFILL } },
    { &hf_rtse_fragments,
      { "RTSE fragments", "rtse.fragments", FT_NONE, BASE_NONE,
	NULL, 0x00, NULL, HFILL } },
    { &hf_rtse_fragment,
      { "RTSE fragment", "rtse.fragment", FT_FRAMENUM, BASE_NONE,
	NULL, 0x00, NULL, HFILL } },
    { &hf_rtse_fragment_overlap,
      { "RTSE fragment overlap", "rtse.fragment.overlap", FT_BOOLEAN,
	BASE_NONE, NULL, 0x0, NULL, HFILL } },
    { &hf_rtse_fragment_overlap_conflicts,
      { "RTSE fragment overlapping with conflicting data",
	"rtse.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE,
	NULL, 0x0, NULL, HFILL } },
    { &hf_rtse_fragment_multiple_tails,
      { "RTSE has multiple tail fragments",
	"rtse.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE,
	NULL, 0x0, NULL, HFILL } },
    { &hf_rtse_fragment_too_long_fragment,
      { "RTSE fragment too long", "rtse.fragment.too_long_fragment",
	FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
    { &hf_rtse_fragment_error,
      { "RTSE defragmentation error", "rtse.fragment.error", FT_FRAMENUM,
	BASE_NONE, NULL, 0x00, NULL, HFILL } },
    { &hf_rtse_fragment_count,
      { "RTSE fragment count", "rtse.fragment.count", FT_UINT32, BASE_DEC,
	NULL, 0x00, NULL, HFILL } },
    { &hf_rtse_reassembled_in,
      { "Reassembled RTSE in frame", "rtse.reassembled.in", FT_FRAMENUM, BASE_NONE,
	NULL, 0x00, "This RTSE packet is reassembled in this frame", HFILL } },
    { &hf_rtse_reassembled_length,
      { "Reassembled RTSE length", "rtse.reassembled.length", FT_UINT32, BASE_DEC,
	NULL, 0x00, "The total length of the reassembled payload", HFILL } },

#include "packet-rtse-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_rtse,
    &ett_rtse_unknown,
    &ett_rtse_fragment,
    &ett_rtse_fragments,
#include "packet-rtse-ettarr.c"
  };

  static ei_register_info ei[] = {
     { &ei_rtse_dissector_oid_not_implemented, { "rtse.dissector_oid_not_implemented", PI_UNDECODED, PI_WARN, "RTSE: Dissector for OID not implemented", EXPFILL }},
     { &ei_rtse_unknown_rtse_pdu, { "rtse.unknown_rtse_pdu", PI_UNDECODED, PI_WARN, "Unknown RTSE PDU", EXPFILL }},
  };

  expert_module_t* expert_rtse;
  module_t *rtse_module;

  /* Register protocol */
  proto_rtse = proto_register_protocol(PNAME, PSNAME, PFNAME);
  new_register_dissector("rtse", dissect_rtse, proto_rtse);
  /* Register fields and subtrees */
  proto_register_field_array(proto_rtse, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_rtse = expert_register_protocol(proto_rtse);
  expert_register_field_array(expert_rtse, ei, array_length(ei));
  register_init_routine (&rtse_reassemble_init);
  rtse_module = prefs_register_protocol_subtree("OSI", proto_rtse, NULL);

  prefs_register_bool_preference(rtse_module, "reassemble",
				 "Reassemble segmented RTSE datagrams",
				 "Whether segmented RTSE datagrams should be reassembled."
				 " To use this option, you must also enable"
				 " \"Allow subdissectors to reassemble TCP streams\""
				 " in the TCP protocol settings.", &rtse_reassemble);

  rtse_oid_dissector_table = register_dissector_table("rtse.oid", "RTSE OID Dissectors", FT_STRING, BASE_NONE);
  oid_table=g_hash_table_new(g_str_hash, g_str_equal);


}
Пример #15
0
/* Register the protocol with Wireshark */
void
proto_register_sccpmg(void)
{
	/* Setup list of header fields */
	static hf_register_info hf[] = {
	  { &hf_sccpmg_message_type,
	    { "Message Type", "sccpmg.message_type",
	      FT_UINT8, BASE_HEX, VALS(sccpmg_message_type_values), 0x0,
	      NULL, HFILL}},
	  { &hf_sccpmg_affected_ssn,
	    { "Affected SubSystem Number", "sccpmg.ssn",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL}},
	  { &hf_sccpmg_affected_itu_pc,
	    { "Affected Point Code", "sccpmg.pc",
	      FT_UINT16, BASE_DEC, NULL, ITU_PC_MASK,
	      NULL, HFILL}},
	  { &hf_sccpmg_affected_japan_pc,
	    { "Affected Point Code", "sccpmg.pc",
	      FT_UINT16, BASE_DEC, NULL, 0x0,
	      NULL, HFILL}},
	  { &hf_sccpmg_affected_ansi_pc,
	    { "Affected Point Code", "sccpmg.ansi_pc",
	      FT_STRING, BASE_NONE, NULL, 0x0,
	      NULL, HFILL}},
	  { &hf_sccpmg_affected_chinese_pc,
	    { "Affected Point Code", "sccpmg.chinese_pc",
	      FT_STRING, BASE_NONE, NULL, 0x0,
	      NULL, HFILL}},
	  { &hf_sccpmg_affected_pc_network,
	    { "Affected PC Network", "sccpmg.network",
	      FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK,
	      NULL, HFILL}},
	  { &hf_sccpmg_affected_pc_cluster,
	    { "Affected PC Cluster", "sccpmg.cluster",
	      FT_UINT24, BASE_DEC, NULL, ANSI_CLUSTER_MASK,
	      NULL, HFILL}},
	  { &hf_sccpmg_affected_pc_member,
	    { "Affected PC Member", "sccpmg.member",
	      FT_UINT24, BASE_DEC, NULL, ANSI_MEMBER_MASK,
	      NULL, HFILL}},
	  { &hf_sccpmg_smi,
	    { "Subsystem Multiplicity Indicator", "sccpmg.smi",
	      FT_UINT8, BASE_DEC, NULL, SCCPMG_SMI_MASK,
	      NULL, HFILL}},
	  { &hf_sccpmg_congestion_level,
	    { "SCCP Congestion Level (ITU)", "sccpmg.congestion",
	      FT_UINT8, BASE_DEC, NULL, ITU_SCCPMG_CONGESTION_MASK,
	      NULL, HFILL}}
	};

	/* Setup protocol subtree array */
	static gint *ett[] = {
		&ett_sccpmg,
		&ett_sccpmg_affected_pc
	};

	static ei_register_info ei[] = {
		{ &ei_sccpmg_unknown_msg, { "sccpmg.unknown_msg", PI_UNDECODED, PI_WARN, "Unknown message", EXPFILL }},
	};

	expert_module_t* expert_sccpmg;

	/* Register the protocol name and description */
	proto_sccpmg = proto_register_protocol("Signalling Connection Control Part Management",
					       "SCCPMG", "sccpmg");

	/* Required function calls to register the header fields and subtrees
	   used */
	proto_register_field_array(proto_sccpmg, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
	expert_sccpmg = expert_register_protocol(proto_sccpmg);
	expert_register_field_array(expert_sccpmg, ei, array_length(ei));
}
Пример #16
0
void proto_register_roofnet(void)
{
  static hf_register_info hf[] = {
    /* Roofnet Header */
    { &hf_roofnet_version,
      { "Version", "roofnet.version",
      FT_UINT8, BASE_DEC, NULL, 0x0, "Roofnet Version", HFILL }
    },

    { &hf_roofnet_type,
      { "Type", "roofnet.type",
	FT_UINT8, BASE_DEC, VALS(roofnet_pt_vals), 0x0, "Roofnet Message Type", HFILL }
    },

    { &hf_roofnet_nlinks,
      { "Number of Links", "roofnet.nlinks",
	FT_UINT8, BASE_DEC, NULL, 0x0, "Roofnet Number of Links", HFILL }
    },

    { &hf_roofnet_next,
      { "Next Link", "roofnet.next",
	FT_UINT8, BASE_DEC, NULL, 0x0, "Roofnet Next Link to Use", HFILL }
    },

    { &hf_roofnet_ttl,
      { "Time To Live", "roofnet.ttl",
	FT_UINT16, BASE_DEC, NULL, 0x0, "Roofnet Time to Live", HFILL }
    },

    { &hf_roofnet_cksum,
      { "Checksum", "roofnet.cksum",
	FT_UINT16, BASE_DEC, NULL, 0x0, "Roofnet Header Checksum", HFILL }
    },

    { &hf_roofnet_flags,
      { "Flags", "roofnet.flags",
	FT_UINT16, BASE_DEC, VALS(roofnet_flags_vals), 0x0, "Roofnet Flags", HFILL }
    },

    { &hf_roofnet_data_length,
      { "Data Length", "roofnet.datalength",
	FT_UINT16, BASE_DEC, NULL, 0x0, "Data Payload Length", HFILL }
    },

    { &hf_roofnet_query_dst,
      { "Query Dst", "roofnet.querydst",
	FT_IPv4, BASE_NONE, NULL, 0x0, "Roofnet Query Destination", HFILL }
    },

    { &hf_roofnet_seq,
      { "Seq", "roofnet.seq",
	FT_UINT32, BASE_DEC, NULL, 0x0, "Roofnet Sequential Number", HFILL }
    },

#if 0
    { &hf_roofnet_links,
      { "Links", "roofnet.links",
      FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
    },
#endif

    { &hf_roofnet_link_src,
      { "Source IP", "roofnet.link.src",
      FT_IPv4, BASE_NONE, NULL, 0x0, "Roofnet Message Source", HFILL }
    },

    { &hf_roofnet_link_forward,
      { "Forward", "roofnet.link.forward",
	FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
    },

    { &hf_roofnet_link_rev,
      { "Rev", "roofnet.link.rev",
	FT_UINT32, BASE_DEC, NULL, 0x0, "Revision Number", HFILL }
    },

    { &hf_roofnet_link_seq,
      { "Seq", "roofnet.link.seq",
	FT_UINT32, BASE_DEC, NULL, 0x0, "Link Sequential Number", HFILL }
    },

    { &hf_roofnet_link_age,
      { "Age", "roofnet.link.age",
	FT_UINT32, BASE_DEC, NULL, 0x0, "Information Age", HFILL }
    },

    { &hf_roofnet_link_dst,
      { "Dst IP", "roofnet.link.dst",
	FT_IPv4, BASE_NONE, NULL, 0x0, "Roofnet Message Destination", HFILL }
    }
  };

  /* setup protocol subtree array */
  static gint *ett[] = {
    &ett_roofnet,
    &ett_roofnet_link
  };

  static ei_register_info ei[] = {
     { &ei_roofnet_too_many_links, { "roofnet.too_many_links", PI_MALFORMED, PI_ERROR, "Too many links", EXPFILL }},
  };

  expert_module_t* expert_roofnet;

  proto_roofnet = proto_register_protocol(
				"Roofnet Protocol", /* Name */
				"Roofnet",	    /* Short Name */
				"roofnet"	    /* Abbrev */
				);

  proto_register_field_array(proto_roofnet, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_roofnet = expert_register_protocol(proto_roofnet);
  expert_register_field_array(expert_roofnet, ei, array_length(ei));
}
Пример #17
0
/*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 ei_register_info ei[] = {
        { &ei_zbee_sec_encrypted_payload, { "zbee_sec.encrypted_payload", PI_UNDECODED, PI_WARN, "Encrypted Payload", EXPFILL }},
    };

    expert_module_t* expert_zbee_sec;

    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,
                               &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));
    expert_zbee_sec = expert_register_protocol(proto);
    expert_register_field_array(expert_zbee_sec, ei, array_length(ei));

    /* Register the init routine. */
    register_init_routine(proto_init_zbee_security);
} /* zbee_security_register */
Пример #18
0
void proto_register_pw_satop(void)
{
	static hf_register_info hf[] = {
		{ &hf_cw	,{"Control Word"		,"pwsatop.cw"
				,FT_NONE			,BASE_NONE		,NULL
				,0				,NULL			,HFILL }},

		{&hf_cw_bits03,{"Bits 0 to 3"			,"pwsatop.cw.bits03"
				,FT_UINT8			,BASE_DEC		,NULL
				,0xf0				,NULL			,HFILL }},

		{&hf_cw_l,	{"L bit: TDM payload state"	,"pwsatop.cw.lbit"
				,FT_UINT8			,BASE_DEC		,VALS(pwc_vals_cw_l_bit)
				,0x08				,NULL			,HFILL }},

		{&hf_cw_r,	{"R bit: Local CE-bound IWF"	,"pwsatop.cw.rbit"
				,FT_UINT8			,BASE_DEC		,VALS(pwc_vals_cw_r_bit)
				,0x04				,NULL			,HFILL }},

		{&hf_cw_rsv,	{"Reserved"			,"pwsatop.cw.rsv"
				,FT_UINT8			,BASE_DEC		,NULL
				,0x03				,NULL			,HFILL }},

		{&hf_cw_frg,	{"Fragmentation"		,"pwsatop.cw.frag"
				,FT_UINT8			,BASE_DEC		,VALS(pwc_vals_cw_frag)
				,0xc0				,NULL			,HFILL }},

		{&hf_cw_len,	{"Length"			,"pwsatop.cw.length"
				,FT_UINT8			,BASE_DEC		,NULL
				,0x3f				,NULL			,HFILL }},

		{&hf_cw_seq,	{"Sequence number"		,"pwsatop.cw.seqno"
				,FT_UINT16			,BASE_DEC		,NULL
				,0				,NULL			,HFILL }},

		{&hf_payload	,{"TDM payload"			,"pwsatop.payload"
				,FT_BYTES			,BASE_NONE		,NULL
				,0				,NULL			,HFILL }},

		{&hf_payload_l	,{"TDM payload length"		,"pwsatop.payload.len"
				,FT_INT32			,BASE_DEC		,NULL
				,0				,NULL			,HFILL }}
	};

	static gint *ett_array[] = {
		&ett
	};
	static ei_register_info ei[] = {
		{ &ei_cw_packet_size_too_small, { "pwsatop.packet_size_too_small", PI_MALFORMED, PI_ERROR, "PW packet size (%d) is too small to carry sensible information", EXPFILL }},
		{ &ei_cw_bits03, { "pwsatop.cw.bits03.not_zero", PI_MALFORMED, PI_ERROR, "Bits 0..3 of Control Word must be 0", EXPFILL }},
		{ &ei_cw_rsv, { "pwsatop.cw.rsv.not_zero", PI_MALFORMED, PI_ERROR, "RSV bits of Control Word must be 0", EXPFILL }},
		{ &ei_cw_frg, { "pwsatop.cw.frag.not_allowed", PI_MALFORMED, PI_ERROR, "Fragmentation of payload is not allowed for SAToP", EXPFILL }},
		{ &ei_payload_size_invalid, { "pwsatop.payload.size_invalid", PI_MALFORMED, PI_ERROR, "Bad Length: too small", EXPFILL }},
		{ &ei_payload_size_invalid_undecoded, { "pwsatop.payload.undecoded", PI_UNDECODED, PI_NOTE, "SAToP payload: omitted to conserve bandwidth", EXPFILL }},
	};
	expert_module_t* expert_pwsatop;

	proto = proto_register_protocol(pwc_longname_pw_satop, shortname, "pwsatopcw");
	proto_register_field_array(proto, hf, array_length(hf));
	proto_register_subtree_array(ett_array, array_length(ett_array));
	expert_pwsatop = expert_register_protocol(proto);
	expert_register_field_array(expert_pwsatop, ei, array_length(ei));
	register_dissector("pw_satop_udp", dissect_pw_satop_udp, proto);
	return;
}
Пример #19
0
void
proto_register_fip(void)
{
    /* Setup list of header fields  See Section 1.6.1 for details*/
    static hf_register_info hf[] = {
        /*
         * FIP header fields.
         */
        { &hf_fip_ver,
          { "Version", "fip.ver",
            FT_UINT8, BASE_DEC, NULL, 0xf0,
            NULL, HFILL}},

        { &hf_fip_reserved12,
          { "Reserved", "fip.reserved",
            FT_UINT16, BASE_HEX, NULL, 0x0fff,
            NULL, HFILL}},

        { &hf_fip_op,
          { "Opcode", "fip.opcode",
            FT_UINT16, BASE_HEX, VALS(fip_opcodes), 0,
            NULL, HFILL}},

        { &hf_fip_reserved8,
          { "Reserved", "fip.reserved",
            FT_UINT8, BASE_HEX, NULL, 0x0,
            NULL, HFILL}},

        { &hf_fip_disc_subcode,
          { "Discovery Subcode", "fip.disc_subcode",
            FT_UINT8, BASE_HEX, VALS(fip_disc_subcodes), 0,
            NULL, HFILL}},

        { &hf_fip_ls_subcode,
          { "Link Service Subcode", "fip.ls.subcode",
            FT_UINT8, BASE_HEX, VALS(fip_ls_subcodes), 0,
            NULL, HFILL}},

        { &hf_fip_ctrl_subcode,
          { "Control Subcode", "fip.ctrl_subcode",
            FT_UINT8, BASE_HEX, VALS(fip_ctrl_subcodes), 0,
            NULL, HFILL}},

        { &hf_fip_vlan_subcode,
          { "VLAN Subcode", "fip.vlan_subcode",
            FT_UINT8, BASE_HEX, VALS(fip_vlan_subcodes), 0,
            NULL, HFILL}},

        { &hf_fip_vn2vn_subcode,
          { "VN2VN Subcode", "fip.vn2vn_subcode",
            FT_UINT8, BASE_HEX, VALS(fip_vn2vn_subcodes), 0,
            NULL, HFILL}},

        { &hf_fip_hex_subcode,
          { "Unknown Subcode", "fip.subcode",
            FT_UINT8, BASE_HEX, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_dlen,
          { "Length of Descriptors (words)", "fip.dl_len",
            FT_UINT16, BASE_DEC, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_flags,
          { "Flags", "fip.flags",
            FT_UINT16, BASE_HEX, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_flag_fpma,
          { "Fabric Provided MAC addr", "fip.flags.fpma",
            FT_BOOLEAN, 16, NULL, FIP_FL_FPMA,
            NULL, HFILL}},

        { &hf_fip_flag_spma,
          { "Server Provided MAC addr", "fip.flags.spma",
            FT_BOOLEAN, 16, NULL, FIP_FL_SPMA,
            NULL, HFILL}},

        { &hf_fip_flag_rec_p2p,
          { "REC/P2P", "fip.flags.rec_p2p",
            FT_BOOLEAN, 16, NULL, FIP_FL_REC_P2P,
            NULL, HFILL}},

        { &hf_fip_flag_avail,
          { "Available", "fip.flags.available",
            FT_BOOLEAN, 16, NULL, FIP_FL_AVAIL,
            NULL, HFILL}},

        { &hf_fip_flag_sol,
          { "Solicited", "fip.flags.sol",
            FT_BOOLEAN, 16, NULL, FIP_FL_SOL,
            NULL, HFILL}},

        { &hf_fip_flag_fport,
          { "F_Port", "fip.flags.fport",
            FT_BOOLEAN, 16, NULL, FIP_FL_FPORT,
            NULL, HFILL}},

        { &hf_fip_desc_type,
          { "Descriptor Type", "fip.desc_type",
            FT_UINT8, BASE_HEX, VALS(fip_desc_types), 0,
            NULL, HFILL}},

        { &hf_fip_desc_len,
          { "Descriptor Length (words)", "fip.desc_len",
            FT_UINT8, BASE_DEC, NULL, 0,
            NULL, HFILL}},

        /*
         * Various descriptor fields.
         */
        { &hf_fip_desc_pri,
          { "Priority", "fip.pri",
            FT_UINT8, BASE_DEC, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_mac,
          { "MAC Address", "fip.mac",
            FT_ETHER, BASE_NONE, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_map,
          { "FC-MAP-OUI", "fip.map",
            FT_BYTES, SEP_DOT, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_name,
          { "Switch or Node Name", "fip.name",
            FT_FCWWN, BASE_NONE, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_fab_vfid,
          { "VFID", "fip.fab.vfid",
            FT_UINT16, BASE_DEC, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_fab_map,
          { "FC-MAP", "fip.fab.map",
            FT_BYTES, SEP_DOT, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_fab_name,
          { "Fabric Name", "fip.fab.name",
            FT_FCWWN, BASE_NONE, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_fcoe_size,
          { "Max FCoE frame size", "fip.fcoe_size",
            FT_UINT16, BASE_DEC, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_vn_mac,
          { "VN_Port MAC Address", "fip.vn.mac",
            FT_ETHER, BASE_NONE, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_vn_fid,
          { "VN_Port FC_ID", "fip.vn.fc_id",
            FT_UINT32, BASE_HEX, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_vn_wwpn,
          { "Port Name", "fip.vn.pwwn",
            FT_FCWWN, BASE_NONE, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_fka,
          { "FKA_ADV_Period", "fip.fka",
            FT_UINT32, BASE_DEC, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_vend,
          { "Vendor-ID", "fip.vendor",
            FT_BYTES, BASE_NONE, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_vend_data,
          { "Vendor-specific data", "fip.vendor.data",
            FT_BYTES, BASE_NONE, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_vlan,
          { "VLAN", "fip.vlan",
            FT_UINT16, BASE_DEC, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_fc4f_types,
          { "FC4 Types", "fip.fc4f.types",
            FT_UINT32, BASE_HEX, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_desc_fcp_feat,
          { "FCP Features", "fip.fc4f.feat.fcp",
            FT_UINT32, BASE_HEX, NULL, 0xf,
            NULL, HFILL}},

        { &hf_fip_type_ip,
          { "IP", "fip.fc4f.ip",
            FT_BOOLEAN, 32, NULL, 1 << 5,
            NULL, HFILL}},

        { &hf_fip_type_fcp,
          { "FCP", "fip.fc4f.fcp",
            FT_BOOLEAN, 32, NULL, 1 << 8,
            NULL, HFILL}},

        { &hf_fip_type_gs3,
          { "GS3", "fip.fc4f.gs3",
            FT_BOOLEAN, 32, NULL, 1 << 0,
            NULL, HFILL}},

        { &hf_fip_fcp_feat_t,
          { "FCP Target", "fip.fc4f.feat.fcp.target",
            FT_BOOLEAN, 32, NULL, 1,
            NULL, HFILL}},

        { &hf_fip_fcp_feat_i,
          { "FCP Initiator", "fip.fc4f.feat.fcp.initiator",
            FT_BOOLEAN, 32, NULL, 2,
            NULL, HFILL}},

        { &hf_fip_desc_unk,
          { "Unknown Descriptor", "fip.desc_unk",
            FT_BYTES, BASE_NONE, NULL, 0,
            NULL, HFILL}},

        { &hf_fip_descriptors,
          { "Descriptors", "fip.descriptors",
            FT_BYTES, BASE_NONE, NULL, 0,
            NULL, HFILL}},

    };
    static gint *ett[] = {
        &ett_fip,
        &ett_fip_flags,
        &ett_fip_dt_pri,
        &ett_fip_dt_mac,
        &ett_fip_dt_map,
        &ett_fip_dt_name,
        &ett_fip_dt_fab,
        &ett_fip_dt_mdl,
        &ett_fip_dt_caps,
        &ett_fip_dt_vn,
        &ett_fip_dt_fka,
        &ett_fip_dt_vend,
        &ett_fip_dt_vlan,
        &ett_fip_dt_fc4f,
        &ett_fip_dt_fc4f_types,
        &ett_fip_dt_fcp_feat,
        &ett_fip_dt_unk
    };

    static ei_register_info ei[] = {
        { &ei_fip_descriptors, { "fip.descriptors.length_error", PI_MALFORMED, PI_ERROR, "Descriptor [length error]", EXPFILL }},
    };

    expert_module_t* expert_fip;

    /* Register the protocol name and description */
    proto_fip = proto_register_protocol("FCoE Initialization Protocol",
        "FIP", "fip");

    /* Required function calls to register the header fields and
     * subtrees used */
    proto_register_field_array(proto_fip, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_fip = expert_register_protocol(proto_fip);
    expert_register_field_array(expert_fip, ei, array_length(ei));
}
Пример #20
0
void
proto_register_ath(void)
{

  expert_module_t* expert_ath;

  static hf_register_info hf[] = {
    { &hf_ath_begin,
      { "Begin",  "ath.begin", FT_STRING, BASE_NONE, NULL, 0x0, "Begin mark",
        HFILL }
    },
    { &hf_ath_padding,
      { "Padding",  "ath.padding", FT_UINT16, BASE_HEX, NULL, 0x0, NULL,
        HFILL }
    },
    { &hf_ath_length,
      { "Length",  "ath.length", FT_UINT32, BASE_DEC, NULL, 0x0, "Data Length",
        HFILL }
    },
    { &hf_ath_alive,
      { "Alive Time",  "ath.alive", FT_UINT64, BASE_DEC, NULL, 0x0, "Alive Time counter",
        HFILL }
    },
    { &hf_ath_port,
      { "Port",  "ath.port", FT_UINT32, BASE_DEC, NULL, 0x0, "RMI Port",
        HFILL }
    },
    { &hf_ath_sport,
      { "Secure Port",  "ath.sport", FT_INT32, BASE_DEC, NULL, 0x0, "RMI Secure Port",
        HFILL }
    },
    { &hf_ath_uport,
      { "UDP Port",  "ath.uport", FT_INT32, BASE_DEC, NULL, 0x0, "RMI UDP Port",
        HFILL }
    },
    { &hf_ath_hlen,
      { "Host Length",  "ath.hlen", FT_INT8, BASE_DEC, NULL, 0x0, "Host IP Length",
        HFILL }
    },
    { &hf_ath_ipv4,
      { "Host",  "ath.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, "IPv4 Host",
        HFILL }
    },
    { &hf_ath_ipv6,
      { "Host",  "ath.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "IPv6 Host",
        HFILL }
    },
    { &hf_ath_clen,
      { "Command Length",  "ath.clen", FT_INT32, BASE_DEC, NULL, 0x0, "Command Length for members",
        HFILL }
    },
    { &hf_ath_comm,
      { "Command",  "ath.comm", FT_STRING, BASE_NONE, NULL, 0x0, "Command for members",
        HFILL }
    },
    { &hf_ath_dlen,
      { "Domain Length",  "ath.dlen", FT_INT32, BASE_DEC, NULL, 0x0, "Cluster Domain Length",
        HFILL }
    },
    { &hf_ath_domain,
      { "Domain",  "ath.domain", FT_STRING, BASE_NONE, NULL, 0x0, "Cluster Domain",
        HFILL }
    },
    { &hf_ath_unique,
      { "uniqueId",  "ath.unique", FT_BYTES, BASE_NONE, NULL, 0x0, "UniqueID identifier",
        HFILL }
    },
    { &hf_ath_plen,
      { "Payload Length",  "ath.plen", FT_INT32, BASE_DEC, NULL, 0x0, "Packet Payload Length",
        HFILL }
    },
    { &hf_ath_payload,
      { "Payload",  "ath.payload", FT_STRING, BASE_NONE, NULL, 0x0, "Packet Payload",
        HFILL }
    },
    { &hf_ath_end,
      { "End",  "ath.end", FT_STRING, BASE_NONE, NULL, 0x0, "End mark",
        HFILL }
    },
  };

  static ei_register_info ei[] = {
    { &ei_ath_hlen_invalid, { "ath.hlen.invalid", PI_MALFORMED, PI_ERROR, "Decode aborted: invalid IP length", EXPFILL }},
    { &ei_ath_hmark_invalid, { "ath.hmark.invalid", PI_MALFORMED, PI_ERROR, "Decode aborted: not an ATH packet", EXPFILL }},
  };

  static gint *ett[] = {
    &ett_ath,
  };

  proto_ath = proto_register_protocol("Apache Tribes Heartbeat Protocol", "ATH", "ath");
  proto_register_field_array(proto_ath, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_ath = expert_register_protocol(proto_ath);
  expert_register_field_array(expert_ath, ei, array_length(ei));

}
Пример #21
0
void
proto_register_hci_mon(void)
{
    module_t *module;
    expert_module_t  *expert_module;

    static hf_register_info hf[] = {
        {  &hf_adapter_id,
            { "Adapter ID",                      "hci_mon.adapter_id",
            FT_UINT16, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        {  &hf_opcode,
            { "Opcode",                          "hci_mon.opcode",
            FT_UINT16, BASE_HEX | BASE_EXT_STRING, &hci_mon_opcode_vals_ext, 0x00,
            NULL, HFILL }
        },
        {  &hf_type,
            { "Type",                            "hci_mon.type",
            FT_UINT8, BASE_HEX | BASE_EXT_STRING, &type_vals_ext, 0x00,
            NULL, HFILL }
        },
        {  &hf_bus,
            { "Bus",                             "hci_mon.bus",
            FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bus_vals_ext, 0x00,
            NULL, HFILL }
        },
        { &hf_bd_addr,
          { "BD_ADDR",                           "hci_mon.bd_addr",
            FT_ETHER, BASE_NONE, NULL, 0x0,
            NULL, HFILL}
        },
        { &hf_name,
          { "Adapter Name",                      "hci_mon.adapter_name",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL}
        }
    };

    static ei_register_info ei[] = {
        { &ei_unknown_data, { "hci_mon.unknown_data", PI_PROTOCOL, PI_WARN, "Unknown data", EXPFILL }},
    };

    static gint *ett[] = {
        &ett_hci_mon,
    };

    proto_hci_mon = proto_register_protocol("Bluetooth Linux Monitor Transport", "HCI_MON", "hci_mon");
    proto_register_field_array(proto_hci_mon, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    hci_mon_handle = register_dissector("hci_mon", dissect_hci_mon, proto_hci_mon);

    expert_module = expert_register_protocol(proto_hci_mon);
    expert_register_field_array(expert_module, ei, array_length(ei));

    adapter_to_disconnect_in_frame = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());

    module = prefs_register_protocol(proto_hci_mon, NULL);
    prefs_register_static_text_preference(module, "bthci_mon.version",
            "Bluetooth Linux Monitor Transport introduced in BlueZ 5.x",
            "Version of protocol supported by this dissector.");
}
Пример #22
0
void
proto_register_ppi_antenna(void) {
    static hf_register_info hf[] = {
        { &hf_ppi_antenna_version,
          { "Header revision", "ppi_antenna.version",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            "Version of ppi_antenna header format", HFILL } },
        { &hf_ppi_antenna_pad,
          { "Header pad", "ppi_antenna.pad",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            "Padding", HFILL } },
        { &hf_ppi_antenna_length,
          { "Header length", "ppi_antenna.length",
            FT_UINT16, BASE_DEC, NULL, 0x0,
            "Length of header including version, pad, length and data fields", HFILL } },
        /* This setups the "Antenna flags" hex dropydown thing */
        { &hf_ppi_antenna_flags,
          { "Antenna flags", "ppi_antenna.antenna_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0, "Bitmask indicating polarity, etc", HFILL } },
        { &hf_ppi_antenna_present,
          { "Present", "ppi_antenna.present",
            FT_UINT32, BASE_HEX, NULL, 0x0, "Bitmask indicating which fields are present", HFILL } },

        /* This first set is for the base_tag_header.it_present bitfield */
#define PPI_ANTENNA_MASK_FLAGS      0x00000001  /* 0 */
#define PPI_ANTENNA_MASK_GAINDB     0x00000002  /* 1 */
#define PPI_ANTENNA_MASK_HORIZBW    0x00000004  /* 2 */
#define PPI_ANTENNA_MASK_VERTBW     0x00000008  /* 3 */
#define PPI_ANTENNA_MASK_PGAIN      0x00000010  /* 4 */
#define PPI_ANTENNA_MASK_BEAMID     0x00000020  /* 5 */
#define PPI_ANTENNA_MASK_RES7       0x00000080  /* 7 */
#define PPI_ANTENNA_MASK_SERIALNUM  0x04000000  /* 26 */
#define PPI_ANTENNA_MASK_MODELSTR   0x08000000  /* 27 */
#define PPI_ANTENNA_MASK_DESCSTR    0x10000000  /* 28 */
#define PPI_ANTENNA_MASK_APPID      0x20000000  /* 29 */
#define PPI_ANTENNA_MASK_APPDATA    0x40000000  /* 30 */
#define PPI_ANTENNA_MASK_EXT        0x80000000  /* 31 */

        /*This second set is for the AntennaFlags bitfield. */
#define PPI_ANTENNAFLAGS_MASK_MIMO              0x00000001  /* 0 */
#define PPI_ANTENNAFLAGS_MASK_HPOL              0x00000002  /* 1 */
#define PPI_ANTENNAFLAGS_MASK_VPOL              0x00000004  /* 2 */
#define PPI_ANTENNAFLAGS_MASK_CPOL_L            0x00000008  /* 3 */
#define PPI_ANTENNAFLAGS_MASK_CPOL_R            0x00000010  /* 4 */
#define PPI_ANTENNAFLAGS_MASK_STEER_ELEC        0x00010000  /* 16 */
#define PPI_ANTENNAFLAGS_MASK_STEER_MECH        0x00020000  /* 17 */


        /* Boolean 'present' flags */
        { &hf_ppi_antenna_present_flags,
          { "flags", "ppi_antenna.present.flags",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_FLAGS,
            "Specifies if the flags bitfield is present", HFILL } },
        { &hf_ppi_antenna_present_gaindb,
          { "gaindb", "ppi_antenna.present.gaindb",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_GAINDB,
            "Specifies if the antenna gain field  is present", HFILL } },
        { &hf_ppi_antenna_present_horizbw,
          { "horizbw", "ppi_antenna.present.horizbw",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_HORIZBW,
            "Specifies if the horizontal beamwidth field is present", HFILL } },
        { &hf_ppi_antenna_present_vertbw,
          { "vertbw", "ppi_antenna.present.vertbw",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_VERTBW,
            "Specifies if the vertical beamwidth field is present", HFILL } },
        { &hf_ppi_antenna_present_pgain,
          { "pgain", "ppi_antenna.present.pgain",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_PGAIN,
            "Specifies if the precision gain field is present", HFILL } },
        { &hf_ppi_antenna_present_beamid,
          { "beamid", "ppi_antenna.present.beamid",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_BEAMID,
            "Specifies if the BeamID field is present", HFILL } },
        { &hf_ppi_antenna_present_serialnum,
          { "serialnum", "ppi_antenna.present.serialnum",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_SERIALNUM,
            "Specifies if the serial num is present", HFILL } },
        { &hf_ppi_antenna_present_modelname,
          { "modelname", "ppi_antenna.present.modelname",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_MODELSTR,
            "Specifies if the model name is present", HFILL } },
        { &hf_ppi_antenna_present_descstr,
          { "Description", "ppi_antenna.present.descr",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_DESCSTR,
            "Specifies if the description string is present", HFILL } },

        { &hf_ppi_antenna_present_appspecific_num,
          { "appid", "ppi_antenna.present.appid",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_APPID,
            "Specifies if the application specific field id is present", HFILL } },

        { &hf_ppi_antenna_present_appspecific_data,
          { "appdata", "ppi_antenna.present.appdata",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_APPDATA,
            "Specifies if the application specific data field  is present", HFILL } },

        { &hf_ppi_antenna_present_ext,
          { "ext", "ppi_antenna.present.ext",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_EXT,
            "Specifies if there are any extensions to the header present", HFILL } },

        /*Here we switch to the antennflags bits*/
        /* Boolean AntennaFlags' flags */
        { &hf_ppi_antennaflags_mimo,
          { "mimo", "ppi_antenna.antennaflags.mimo",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_MIMO,
            "Antenna is part of MIMO system", HFILL } },
        { &hf_ppi_antennaflags_horizpol,
          { "horizontally polarized", "ppi_antenna.antennaflags.horizpol",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_HPOL,
            "Specifies if the antenna is horizontally polarized", HFILL } },

        { &hf_ppi_antennaflags_vertpol,
          { "vertically polarized", "ppi_antenna.antennaflags.vertpol",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_VPOL,
            "Specifies if the antenna is vertically polarized", HFILL } },

        { &hf_ppi_antennaflags_circpol_l,
          { "circularly polarized left", "ppi_antenna.antennaflags.circpol_l",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_CPOL_L,
            "Specifies if the antenna is circularly polarized, left handed", HFILL } },

        { &hf_ppi_antennaflags_circpol_r,
          { "circularly polarized right", "ppi_antenna.antennaflags.circpol_r",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_CPOL_R,
            "Specifies if the antenna is circularly polarized, right handed", HFILL } },

        { &hf_ppi_antennaflags_steer_elec,
          { "electrically steerable", "ppi_antenna.antennaflags.steer_elec",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_STEER_ELEC,
            "Specifies if the antenna is electrically steerable", HFILL } },

        { &hf_ppi_antennaflags_steer_mech,
          { "mechanically steerable", "ppi_antenna.antennaflags.steer_mech",
            FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_STEER_MECH,
            "Specifies if the antenna is mechanically steerable", HFILL } },

        /* Now we get to the actual data fields */
        { &hf_ppi_antenna_gaindb,
          { "Gain (dBi)", "ppi_antenna.gaindb",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            "Gain of antenna (dBi)", HFILL } },
        { &hf_ppi_antenna_horizbw,
          { "HorizBw", "ppi_antenna.horizbw",
            FT_DOUBLE, BASE_NONE, NULL, 0x0,
            "Horizontal beamwidth", HFILL } },
        { &hf_ppi_antenna_vertbw,
          { "VertBw", "ppi_antenna.vertbw",
            FT_DOUBLE, BASE_NONE, NULL, 0x0,
            "Vertical beamwidth", HFILL } },
        { &hf_ppi_antenna_pgain,
          { "Precision Gain (dBi)", "ppi_antenna.pgain",
            FT_DOUBLE, BASE_NONE, NULL, 0x0,
            NULL, HFILL } },
        { &hf_ppi_antenna_beamid,
          { "BeamID", "ppi_antenna.beamid",
            FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL } },

        { &hf_ppi_antenna_serialnum,
          { "SerialNumber", "ppi_antenna.serialnum",
            FT_STRING,  BASE_NONE, NULL, 0x0,
            NULL, HFILL } } ,
        { &hf_ppi_antenna_modelname,
          { "ModelName", "ppi_antenna.modelname",
            FT_STRING,  BASE_NONE, NULL, 0x0,
            NULL, HFILL } } ,
        { &hf_ppi_antenna_descstr,
          { "Description", "ppi_antenna.descr",
            FT_STRING,  BASE_NONE, NULL, 0x0,
            NULL, HFILL } } ,
        { &hf_ppi_antenna_appspecific_num,
          { "Application Specific id", "ppi_antenna.appid",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL } },
        { &hf_ppi_antenna_appspecific_data,
          { "Application specific data", "ppi_antenna.appdata",
            FT_BYTES, BASE_NONE, NULL, 0x0,
            NULL, HFILL } },
    };
    static gint *ett[] = {
        &ett_ppi_antenna,
        &ett_ppi_antenna_present,
        &ett_ppi_antennaflags
    };

    static ei_register_info ei[] = {
        { &ei_ppi_antenna_present_bit, { "ppi_antenna.present.unknown_bit", PI_PROTOCOL, PI_WARN, "Error: PPI-ANTENNA: unknown bit set in present field.", EXPFILL }},
    };

    expert_module_t* expert_ppi_antenna;

    proto_ppi_antenna = proto_register_protocol("PPI antenna decoder", "PPI antenna Decoder", "ppi_antenna");
    proto_register_field_array(proto_ppi_antenna, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_ppi_antenna = expert_register_protocol(proto_ppi_antenna);
    expert_register_field_array(expert_ppi_antenna, ei, array_length(ei));
    register_dissector("ppi_antenna", dissect_ppi_antenna, proto_ppi_antenna);

}
Пример #23
0
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 }},
	};

	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 }},
		{ &ei_incomplete, { "frame.incomplete", PI_UNDECODED, PI_NOTE, "Incomplete dissector", 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, DISSECTOR_TABLE_ALLOW_DUPLICATE);
	wtap_fts_rec_dissector_table = register_dissector_table("wtap_fts_rec",
	    "Wiretap file type for file-type-specific records", FT_UINT32, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE);
	register_capture_dissector_table("wtap_encap", "Wiretap encapsulation type");

	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);
	prefs_register_bool_preference(frame_module, "disable_packet_size_limited_in_summary",
	    "Disable 'packet size limited during capture' message in summary",
	    "Whether or not 'packet size limited during capture' message in shown in Info column.",
	    &disable_packet_size_limited_in_summary);

	frame_tap=register_tap("frame");
}
Пример #24
0
void
proto_register_macctrl(void)
{
  static hf_register_info hf[] = {
    { &hf_macctrl_opcode,
      { "Opcode", "macc.opcode", FT_UINT16, BASE_HEX,
        VALS(opcode_vals), 0x0, "MAC Control Opcode", HFILL}},

    { &hf_macctrl_timestamp,
      { "Timestamp", "macc.timestamp", FT_UINT32, BASE_DEC,
        NULL, 0x0, "MAC Control Timestamp", HFILL }},

    { &hf_macctrl_pause_time,
      { "pause_time", "macc.pause_time", FT_UINT16, BASE_DEC,
        NULL, 0x0, "MAC control PAUSE frame pause_time", HFILL }},

    { &hf_macctrl_cbfc_enbv,
      { "CBFC Class Enable Vector", "macc.cbfc.enbv", FT_UINT16, BASE_HEX,
        NULL, 0x0, NULL, HFILL }},

    { &hf_macctrl_cbfc_enbv_c0,
      { "C0", "macc.cbfc.enbv.c0", FT_BOOLEAN, 16,
        NULL, 0x01, NULL, HFILL }},

    { &hf_macctrl_cbfc_enbv_c1,
      { "C1", "macc.cbfc.enbv.c1", FT_BOOLEAN, 16,
        NULL, 0x02, NULL, HFILL }},

    { &hf_macctrl_cbfc_enbv_c2,
      { "C2", "macc.cbfc.enbv.c2", FT_BOOLEAN, 16,
        NULL, 0x04, NULL, HFILL }},

    { &hf_macctrl_cbfc_enbv_c3,
      { "C3", "macc.cbfc.enbv.c3", FT_BOOLEAN, 16,
        NULL, 0x08, NULL, HFILL }},

    { &hf_macctrl_cbfc_enbv_c4,
      { "C4", "macc.cbfc.enbv.c4", FT_BOOLEAN, 16,
        NULL, 0x10, NULL, HFILL }},

    { &hf_macctrl_cbfc_enbv_c5,
      { "C5", "macc.cbfc.enbv.c5", FT_BOOLEAN, 16,
        NULL, 0x20, NULL, HFILL }},

    { &hf_macctrl_cbfc_enbv_c6,
      { "C6", "macc.cbfc.enbv.c6", FT_BOOLEAN, 16,
        NULL, 0x40, NULL, HFILL }},

    { &hf_macctrl_cbfc_enbv_c7,
      { "C7", "macc.cbfc.enbv.c7", FT_BOOLEAN, 16,
        NULL, 0x80, NULL, HFILL }},

    { &hf_macctrl_cbfc_pause_time_c0,
      { "C0", "macc.cbfc.pause_time.c0", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_macctrl_cbfc_pause_time_c1,
      { "C1", "macc.cbfc.pause_time.c1", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_macctrl_cbfc_pause_time_c2,
      { "C2", "macc.cbfc.pause_time.c2", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_macctrl_cbfc_pause_time_c3,
      { "C3", "macc.cbfc.pause_time.c3", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_macctrl_cbfc_pause_time_c4,
      { "C4", "macc.cbfc.pause_time.c4", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_macctrl_cbfc_pause_time_c5,
      { "C5", "macc.cbfc.pause_time.c5", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_macctrl_cbfc_pause_time_c6,
      { "C6", "macc.cbfc.pause_time.c6", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_macctrl_cbfc_pause_time_c7,
      { "C7", "macc.cbfc.pause_time.c7", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_reg_flags,
      { "Flags", "macc.reg.flags", FT_UINT8, BASE_HEX,
        VALS(reg_flags_vals), 0x00, NULL, HFILL }},

    { &hf_reg_req_grants,
      { "Pending Grants", "macc.regreq.grants", FT_UINT8, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_reg_grants,
      { "Echoed Pending Grants", "macc.reg.grants", FT_UINT8, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_reg_port,
      { "Assigned Port (LLID)", "macc.reg.assignedport", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_reg_ack_port,
      { "Echoed Assigned Port (LLID)", "macc.regack.assignedport", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_reg_time,
      { "Sync Time", "macc.reg.synctime", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

    { &hf_reg_ack_time,
      { "Echoed Sync Time", "macc.regack.synctime", FT_UINT16, BASE_DEC,
        NULL, 0x00, NULL, HFILL }}
  };

  static gint *ett[] = {
        &ett_macctrl,
        &ett_macctrl_cbfc_enbv,
        &ett_macctrl_cbfc_pause_times
  };

  static ei_register_info ei[] = {
      { &ei_macctrl_opcode, { "macc.opcode.unknown", PI_PROTOCOL, PI_WARN, "Unknown opcode", EXPFILL }},
      { &ei_macctrl_cbfc_enbv, { "macc.cbfc.enbv.not_zero", PI_PROTOCOL, PI_WARN, "8 MSbs of ENBV must be 0", EXPFILL }},
      { &ei_macctrl_dst_address, { "macc.dst_address_invalid", PI_PROTOCOL, PI_WARN, "Destination address must be 01-80-C2-00-00-01", EXPFILL }},
  };

  expert_module_t* expert_macctrl;

  proto_macctrl = proto_register_protocol("MAC Control", "MACC", "macc");
  proto_register_field_array(proto_macctrl, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_macctrl = expert_register_protocol(proto_macctrl);
  expert_register_field_array(expert_macctrl, ei, array_length(ei));
}
Пример #25
0
/*--- 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, "P1 Unknown Content (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);
  new_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);
}
Пример #26
0
void
proto_register_dtp(void)
{
	static hf_register_info hf[] = {
	{ &hf_dtp_version,
		{ "Version",	"dtp.version", FT_UINT8, BASE_DEC,
		NULL, 0x0, NULL, HFILL }},

	{ &hf_dtp_domain,
		{ "Domain",	"dtp.domain", FT_STRING, BASE_NONE,
		NULL, 0x0, NULL, HFILL }},

	{ &hf_dtp_tlvtype,
		{ "Type",	"dtp.tlv_type", FT_UINT16, BASE_HEX,
		VALS(dtp_tlv_type_vals), 0x0, NULL, HFILL }},

	{ &hf_dtp_tlvlength,
		{ "Length",	"dtp.tlv_len", FT_UINT16, BASE_DEC,
		NULL, 0x0, NULL, HFILL }},

	{ &hf_dtp_tos,
		{ "Trunk Operating Status", "dtp.tos", FT_UINT8, BASE_HEX,
		VALS(dtp_tos_vals), DTP_TOS_MASK, NULL, HFILL }},

	{ &hf_dtp_tas,
		{ "Trunk Administrative Status", "dtp.tas", FT_UINT8, BASE_HEX,
		VALS(dtp_tas_vals), DTP_TAS_MASK, NULL, HFILL }},

	{ &hf_dtp_tot,
		{ "Trunk Operating Type", "dtp.tot", FT_UINT8, BASE_HEX,
		VALS(dtp_tot_vals), DTP_TOT_MASK, NULL, HFILL }},

	{ &hf_dtp_tat,
		{ "Trunk Administrative Type", "dtp.tat", FT_UINT8, BASE_HEX,
		VALS(dtp_tat_vals), DTP_TAT_MASK, NULL, HFILL }},

	{ &hf_dtp_senderid,
		{ "Sender ID", "dtp.senderid", FT_ETHER, BASE_NONE,
		NULL, 0x0, "MAC Address of neighbor", HFILL }},

	};

	static gint *ett[] = {
		&ett_dtp,
		&ett_dtp_tlv,
		&ett_dtp_status,
		&ett_dtp_type,
	};

	static ei_register_info ei[] = {
	{ &ei_dtp_tlv_length_too_short,
		{ "dtp.tlv_len.too_short", PI_MALFORMED, PI_ERROR,
		  "Indicated length is less than the minimum length", EXPFILL }},

	{ &ei_dtp_tlv_length_invalid,
		{ "dtp.tlv_len.invalid", PI_MALFORMED, PI_ERROR,
		  "Indicated length does not correspond to this record type", EXPFILL }},

	{ &ei_dtp_truncated,
		{ "dtp.truncated", PI_MALFORMED, PI_ERROR,
		  "DTP message is truncated prematurely", EXPFILL }}

	};

	expert_module_t *expert_dtp;

	proto_dtp = proto_register_protocol("Dynamic Trunk Protocol", "DTP", "dtp");
	proto_register_field_array(proto_dtp, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));

	expert_dtp = expert_register_protocol(proto_dtp);
	expert_register_field_array(expert_dtp, ei, array_length(ei));
}
Пример #27
0
void
proto_register_mpeg_sect(void)
{
    static hf_register_info hf[] = {
        { &hf_mpeg_sect_table_id, {
            "Table ID", "mpeg_sect.tid",
            FT_UINT8, BASE_HEX, VALS(mpeg_sect_table_id_vals), 0, NULL, HFILL
        } },

        { &hf_mpeg_sect_syntax_indicator, {
            "Syntax indicator", "mpeg_sect.syntax_indicator",
            FT_UINT16, BASE_DEC, NULL, MPEG_SECT_SYNTAX_INDICATOR_MASK, NULL, HFILL
        } },

        { &hf_mpeg_sect_reserved, {
            "Reserved", "mpeg_sect.reserved",
            FT_UINT16, BASE_HEX, NULL, MPEG_SECT_RESERVED_MASK, NULL, HFILL
        } },

        { &hf_mpeg_sect_length, {
            "Length", "mpeg_sect.len",
            FT_UINT16, BASE_DEC, NULL, MPEG_SECT_LENGTH_MASK, NULL, HFILL
        } },

        { &hf_mpeg_sect_crc, {
            "CRC 32", "mpeg_sect.crc",
            FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
        } }
    };

    static gint *ett[] = {
        &ett_mpeg_sect
    };

    static ei_register_info ei[] = {
        { &ei_mpeg_sect_crc, { "mpeg_sect.crc.invalid", PI_CHECKSUM, PI_WARN, "Invalid CRC", EXPFILL }},
    };

    module_t *mpeg_sect_module;
    expert_module_t* expert_mpeg_sect;

    proto_mpeg_sect = proto_register_protocol("MPEG2 Section", "MPEG SECT", "mpeg_sect");
    register_dissector("mpeg_sect", dissect_mpeg_sect, proto_mpeg_sect);

    proto_register_field_array(proto_mpeg_sect, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_mpeg_sect = expert_register_protocol(proto_mpeg_sect);
    expert_register_field_array(expert_mpeg_sect, ei, array_length(ei));

    mpeg_sect_module = prefs_register_protocol(proto_mpeg_sect, NULL);

    prefs_register_bool_preference(mpeg_sect_module,
        "verify_crc",
        "Verify the section CRC",
        "Whether the section dissector should verify the CRC",
        &mpeg_sect_check_crc);

    mpeg_sect_tid_dissector_table = register_dissector_table("mpeg_sect.tid",
                                 "MPEG SECT Table ID",
                                 FT_UINT8, BASE_HEX);

}
Пример #28
0
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));
}