Hi all,
few days back, i asked for any solution for how to print errors in pop-up
windows in dissector section.
I m new to computer programming & ofcause dealing with open source. Here is
an solution which i came across. Kindly give ur comments as this is not a
professional solution its just an twist of existing components.
solution :
since we can access err & err_info in wiretap for error no & error message
(they will be printed in a popup window) error message display is written
here in this case file.c for all errcode in wtap.h
so why have a err_no & err_info in our pseudo header. since info in pseudo
header we have access in dissector via pinfo. if error is there in dissector
then set this err_no & err_info & return (since dissector is void type).
we can check this this erro_no in seek_read/read & if found any err_no set
it will simplay set actual errno & err_info passed by ethereal & it will
return from seek_read/read by returning FALSE.
to me etheral works like this :
in wiretap :
1. go to open (check for file file format & do initialization) then perform
read function repeteadly untill it read a full file. (if we choose open
recent then this step is omitted)
2. go to open.
4. run read.
5. go to corresponding dissector.
5. run seek_read.
6. go to dissector.
7 run read & go to dissector until it has read whole packets.
8. now run seek read & dissectors (based on user selection )
(of cause we can speed up the operation in case of large file by having
checks eg. colum info is fed during read & not seek_read & decoding of hex
is done in seek_read not in read. so we can have checks accordingly by
knowing from where our contorl is coming (seek/read)
well this check will be applicable only for dissector which will be called
directly after seek/read i.e. after wiretap.
Kindy post ur comments is approaches like these are gud since there is no
provision of printing error in dissector right now in ethereal. or how can i
do it more refined way.
regards,
raman
----- Original Message -----
From: "Raman Singla" <ramans@xxxxxxxxxxxxxxxxxxx>
To: <jhoger@xxxxxxxxx>; "Ethereal development" <ethereal-dev@xxxxxxxxxxxx>
Sent: 2006 Jun 02 4:42 AM
Subject: Re: [Ethereal-dev] error in printing error message using
simple_dialog
> hi,
> there is a file (trace.def) which is having all the structure format
telling
> how the hexdumps should be decode for gprs messages
>
> suppose system is unable to open this file, there should be a error
message
> indicating that error file is missing.
>
> Here when i say error messages they are not with respect to packets, they
> are with respect to other issues. before becoding begins it will ensure
> these parameters & if it unable to set an working environment it will pop
up
> an error message. ofcause packet-related error will be using
proto_add_text.
>
> Similarly in wiretap (i have written for a new capture file format, if
> endian type is missing (file can be in either big/little format then it
> won't proceed further & prompt a error messsage)
>
> simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, dec_err_msg);
> does this with appropriate paramaters. but here in my case it is giving
> error on both platform linux/win.
>
> error on LINUX
> it is giving an linking error.
> epan/./libs/libethereal.so: undefined reference to 'simple_dialog'
>
> err on WINDOWS
> dissectors.lib(packet-dec.obj) : error LNK2001: unresolved external symbol
> _simp
> le_dialog
> libethereal.dll : fatal error LNK1120: 1 unresolved externals
> NMAKE : fatal error U1077: 'link' : return code '0x460'
> Stop.
> NMAKE : fatal error U1077: '"C:\Apps_32\MICROSOFT VISUAL
> STUDIO\VC98\BIN\NMAKE.E
> XE"' : return code '0x2'
> Stop.
>
> regards,
> raman
>
> ----- Original Message -----
> From: "John R." <jhoger@xxxxxxxxx>
> To: "Ethereal development" <ethereal-dev@xxxxxxxxxxxx>
> Sent: 2006 Jun 02 4:23 AM
> Subject: Re: [Ethereal-dev] error in printing error message using
> simple_dialog
>
>
> > On 6/1/06, Raman Singla <ramans@xxxxxxxxxxxxxxxxxxx> wrote:
> > > Hi,
> > >
> > > I want to use simple_dialog function defined in "gtk/simple_dialog.c"
> for
> > > printing error messages.
> >
> > Upon what event would trigger such a dialog? Every time the packet is
> > selected? It seems like a very bad idea since you would end up stuck
> > in a dialog box every time the packet is dissected. If you had a bunch
> > of these packets, you would end up stuck in dialog boxes as you try to
> > navigate between packets in the display.... yikes!
> >
> > -- John.
> > _______________________________________________
> > Ethereal-dev mailing list
> > Ethereal-dev@xxxxxxxxxxxx
> > http://www.ethereal.com/mailman/listinfo/ethereal-dev
>
> _______________________________________________
> Ethereal-dev mailing list
> Ethereal-dev@xxxxxxxxxxxx
> http://www.ethereal.com/mailman/listinfo/ethereal-dev
_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev