Hi; i make a new dissecotr but when i use it a message
arror appear in COL_INFO and in tree window. The error
is: Dissector Bug Protocol LLCSTLB:proto.c:1187 failed
assertion "(guint)hfindex <gpa.info.len"]
LLCTLB is my dissector; here is the code od
packet-LLCTLB.c it puts COL_INFO and PROCOL_INFO well.
COde: ethereal 0.10.14
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <glib.h>
#include <epan/packet.h>
#include "etypes.h"
void proto_reg_handoff_LLCTLB(void);
static int proto_LLCTLB=-1;
static int hf_LLCTLB_SNR=-1;
static gint ett_LLCTLB=-1;
static void
dissect_LLCTLB(tvbuff_t *tvb,packet_info
*pinfo,proto_tree *tree)
{
proto_item *tp,*t0;
proto_tree *LLCTLB_tree;
guint8 SNR;
pinfo->current_proto="LLCTLB";
if(check_col(pinfo->cinfo,COL_PROTOCOL))
col_set_str(pinfo->cinfo,COL_PROTOCOL,"LLCTLB");
if(check_col(pinfo->cinfo,COL_INFO))
col_clear(pinfo->cinfo,COL_INFO);
if(check_col(pinfo->cinfo,COL_INFO))
col_set_str(pinfo->cinfo,COL_INFO,"ListenBeacon");
SNR=tvb_get_guint8(tvb,0);
tvb_set_reported_length(tvb,1);
if(tree) {
tp=proto_tree_add_protocol_format(tree,proto_LLCTLB,tvb,0,1,"ListenBeacon");
LLCTLB_tree=proto_item_add_subtree(tp,ett_LLCTLB);
t0=proto_tree_add_uint(LLCTLB_tree,hf_LLCTLB_SNR,tvb,0,1,SNR);
}
}
void
proto_register_LLCTLB_(void) {
static hf_register_info hf[]= {
{ &hf_LLCTLB_SNR,
{
"SNR","LLCTLB.SNR",FT_UINT8,BASE_DEC,NULL,0x00,"
",HFILL}
},
};
static gint *ett[]= {
&ett_LLCTLB,
};
proto_LLCTLB=proto_register_protocol(" ListenBeacon
"," LLCTLB "," LLCTLB ");
proto_register_field_array(proto_LLCTLB,hf,array_length(hf));
proto_register_subtree_array(ett,array_length(ett));
}
void proto_reg_handoff_LLCTLB(void)
{
dissector_handle_t LLCTLB_handle;
LLCTLB_handle=create_dissector_handle(dissect_LLCTLB,proto_LLCTLB);
dissector_add("ethertype",ETHERTYPE_LLCTLB,LLCTLB_handle);
}
______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com