ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: RE: [Ethereal-dev] Light weight resolver library dissector

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Terletsky Oleg <oleg.terletsky@xxxxxxxxxxxx>
Date: Mon, 4 Aug 2003 17:26:49 -0400
Here is updated packet-lwres.c

Thanks,
Oleg.


-----Original Message-----
From: Guy Harris [mailto:guy@xxxxxxxxxxxx]
Sent: Monday, August 04, 2003 4:51 AM
To: Terletsky Oleg
Cc: 'ethereal-dev@xxxxxxxxxxxx'
Subject: Re: [Ethereal-dev] Light weight resolver library dissector


On Thu, Jul 31, 2003 at 01:00:54AM -0400, Terletsky Oleg wrote:
> Attached zip file includes everything you need to build it as plugin
> library.

Some compiler warnings:

packet-lwres.c: In function `dissect_getnamebyaddr_request':
packet-lwres.c:434: warning: unused parameter `pinfo'
packet-lwres.c: In function `dissect_getnamebyaddr_response':
packet-lwres.c:486: warning: unused parameter `pinfo'
packet-lwres.c: In function `dissect_getaddrsbyname_request':
packet-lwres.c:571: warning: unused parameter `pinfo'
packet-lwres.c: In function `dissect_getaddrsbyname_response':
packet-lwres.c:731: warning: assignment discards `const' from pointer
    target type
packet-lwres.c:627: warning: unused parameter `pinfo'
packet-lwres.c: In function `dissect_a_records':
packet-lwres.c:785: warning: comparison between signed and unsigned
packet-lwres.c:765: warning: unused parameter `pinfo'
packet-lwres.c: In function `dissect_srv_records':
packet-lwres.c:839: warning: comparison between signed and unsigned
packet-lwres.c:819: warning: unused parameter `pinfo'
packet-lwres.c: In function `dissect_mx_records':
packet-lwres.c:918: warning: comparison between signed and unsigned
packet-lwres.c:897: warning: unused parameter `pinfo'
packet-lwres.c: In function `dissect_ns_records':
packet-lwres.c:974: warning: comparison between signed and unsigned
packet-lwres.c:959: warning: unused variable `nsname'
packet-lwres.c:955: warning: unused parameter `pinfo'
packet-lwres.c: In function `dissect_rdata_request':
packet-lwres.c:1000: warning: unused parameter `pinfo'
packet-lwres.c: In function `dissect_rdata_response':
packet-lwres.c:1065: warning: unused variable `siglen'
packet-lwres.c: In function `dissect_noop':
packet-lwres.c:1170: warning: unused parameter `tvb'
packet-lwres.c:1170: warning: unused parameter `pinfo'
packet-lwres.c:1170: warning: unused parameter `lwres_tree'
packet-lwres.c:1170: warning: unused parameter `type'
packet-lwres.c: In function `dissect_lwres':
packet-lwres.c:1207: warning: unused variable `data_tvb'
packet-lwres.c: At top level:
packet-lwres.c:148: warning: `hf_srv_dname' defined but not used
packet-lwres.c:198: warning: `lwres_handle' defined but not used

The "unused parameter" warnings are probably best eliminated by getting
rid of the function parameter in question, as those functions aren't
called through pointers that force them to take those arguments. 

The "discards `const'" warnings can be eliminated by making "addr" a
"const guint8 *".

The "unused variable" warnings look as if they're probably best
eliminated by getting rid of the variables in question.

The "defined but not used" warning for "lwres_handle" is best eliminated
by getting rid of the static "lwres_handle" variable at the beginning of
"packet-lwres.c".

"hf_srv_dname", however, might be intended for a field that really
should exist - does it, or should that variable just be eliminated?

Also, C++-style // comments are used - some C compilers (e.g., IBM's
XLC) don't like them, so C89-style comments should be used instead.

Attachment: packet-lwres.c
Description: Binary data