/* packet-rpudpdl.c
*
* RecordPlayer UDP Download Protocol
*/
/* include files */
#include "config.h"
#include <glib.h>
#include <epan/packet.h>
#include <epan/reassemble.h>
#include <epan/etypes.h>
#include <epan/expert.h>
#include <epan/tap.h>
#include <epan/stats_tree.h>
#include <stat_menu.h>
#include <epan/funnel.h>
#define RPUDPDL_PORT 1730
/* Define the rpudpdl proto */
static int proto_rpudpdl = -1;
static int hf_rpudpdl_sn = -1;
static int hf_rpudpdl_ssid = -1;
static int hf_rpudpdl_datasize = -1;
static int hf_rpudpdl_msgtype = -1;
static int hf_rpudpdl_msg_probe = -1;
static int hf_rpudpdl_msg_request = -1;
static int hf_rpudpdl_request_starttime = -1;
static int hf_rpudpdl_request_stoptime = -1;
static int hf_rpudpdl_request_smallfile = -1;
static int hf_rpudpdl_request_filepathlen = -1;
static int hf_rpudpdl_request_filenamelen = -1;
static int hf_rpudpdl_request_reserved = -1;
static int hf_rpudpdl_request_reserved1 = -1;
static int hf_rpudpdl_request_filepathname = -1;
static int hf_rpudpdl_sp_duration = -1;
static int hf_rpudpdl_sp_streamid = -1;
static int hf_rpudpdl_sp_mediatype = -1;
static int hf_rpudpdl_sp_videowidth = -1;
static int hf_rpudpdl_sp_videoheight = -1;
static int hf_rpudpdl_sp_reserved1 = -1;
static int hf_rpudpdl_sp_reserved2 = -1;
static gint ett_rpudpdl = -1;
static gint ett_rpudpdl_request = -1;
static gint ett_rpudpdl_streamproperty = -1;
#define MSGTYPE_PROBE 1
#define MSGTYPE_REQUEST 2
#define MSGTYPE_STREAM_PROPERTY 3
#define MSGTYPE_FRAME_DATA 4
#define MSGTYPE_ACK 5
#define MSGTYPE_SEND_DATA_END 6
#define MSGTYPE_CHECK_PARAM 7
#define MSGTYPE_PROBE_ACK 8
#define MSGTYPE_UDP_PACKET 9
#define MSGTYPE_RESEND 10
#define MSGTYPE_REFUSE 11
static const value_string msgtypenames[] = {
{ MSGTYPE_PROBE, "Probe" },
{ MSGTYPE_REQUEST, "Request" },
{ MSGTYPE_STREAM_PROPERTY, "StreamProperty" },
{ MSGTYPE_FRAME_DATA, "FrameData" },
{ MSGTYPE_ACK, "Ack" },
{ MSGTYPE_SEND_DATA_END, "SendDataEnd" },
{ MSGTYPE_CHECK_PARAM, "CheckParam" },
{ MSGTYPE_PROBE_ACK, "ProbeAck" },
{ MSGTYPE_UDP_PACKET, "UdpPacket" },
{ MSGTYPE_RESEND, "Resend" },
{ MSGTYPE_REFUSE, "Refuse" },
{ 0, NULL }
};
static dissector_handle_t data_handle;
/* A tap is basically a way of allowing other items to see whats happening as a protocol is dissected. A tap
is registered with the main program, and then called on each dissection. Some arbitrary protocol specific
data is provided with the routine that can be used. */
/* To create a tap, you first need to register a tap. A tap is registered with an integer handle, and registered
with the routine register_tap. This takes a string name with which to find it again. */
static int rpudpdl_tap = -1;
struct rpudpdl_tap_info {
guint sn;
guint ssid;
guint msgtype;
};
static void dissect_rpudpdl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint32 msgtype, ssid, sn;
gint offset = 0;
guint32 request_filepathlen, request_filenamelen;
tvbuff_t *next_tvb;
gint len, reported_len;
struct rpudpdl_tap_info *tapinfo;
if (
Wireshark自定义协议RPUDPDL(UDP下载)插件 (c版)
最新推荐文章于 2022-07-01 23:01:19 发布