ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Ethereal-dev: Re: [Ethereal-dev] Enhancement request to http dissector

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

From: "Ulf Lamping" <ulf.lamping@xxxxxx>
Date: Tue, 13 Jul 2004 15:06:19 +0200
Ethereal development <ethereal-dev@xxxxxxxxxxxx> schrieb am 13.07.04 13:55:01:
> 

As I don't know the SSL stuff, some more general tips.

> (1) Move the zillion #define's in packet-ssl.c to packet-ssl.h (a good 
> practice anyway?)

It's not necessarily a good pratice to put all defines into the corresponding header files.

If you want to provide an API type header file, it's not a good idea to put all define's into it.
It should only contain the defines needed by the API user, otherwise it makes usage of the API much more difficult.

And you will find the definitions and usage of them in the same file, which makes working with the code faster.

> (2) COPY the above mentioned functions from packet-ssl.c to 
> packet-http.c and use it them (and include packet-ssl.h for the 
> definitions).

Copying code is generally a very bad idea, unless you need to modify the copied parts heavily (if you only need a "skeleton" to start with).

In the end, there are several places where slightly the same code is used, so fixing a bug or adding new features will become a nightmare.

I've found several places in the Ethereal sources where this is true, and bringing this parts of the code back together to one place is really hard and ugly work.


Of course, this is only my personal taste (and only a general guideline), other's will have a different point of view.

Regards, ULFL

________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193