Home page logo

nmap-dev logo Nmap Development mailing list archives

Re: Cleaning the Win build
From: Gisle Vanem <gvanem () broadpark no>
Date: Thu, 28 Apr 2011 13:32:07 +0200

Sorry about the late reply; I've been swamped in work, work and more work.

"Fyodor" <fyodor () insecure org> wrote:

Also, a number of headers files (let's call them #2) require
definitions from another header file (#2) in order to work at all.  Is
it better to just include #2 (with protection defines to ensure they
don't get included twice) in #1, or require all other headers to know
that they must include #2 first if they are going to include #1?  The
latter reduces header file depth, but it can make finding a working
header file set and order a pain when you have a lot of includes.

I do build Wireshark regularily. This is a huge project compared to Nmap
and friends (1644 .c-files and 870 .h-files). In this projects, the latter method is used.
Though keep in mind that we need to be able to build some of the Nmap
tree separately.  In particular, Nsock and Nbase are used in other
projects too (like Ncrack).

Okay, but now I see that Ncrack includes nbase and nsock in it's local source tree.
If we modify the nbase/nsock headers in Nmap's SVN-repo, I guess we don't need to
update nbase/nsock headers in Ncracks' repo. But as those 2 copies of file-sets
are kept on users SVN-repos, they seems to be doing dual work and just adding to the
confusion. Not a big deal for me, but why couldn't nbase/nsock be physically kept outside Nmap/Ncrack source-trees? Maybe Subversion is able to do that..

3. All system-headers should be included ahead of local ones.

That makes sense.  I suppose you would want the "real" system headers,
then things like nbase/nsock, than the true locals.

Yes, but I'll leave that for a later patch. See below.

5. Do we need for 2 winfix.cc files? Except for the option-stuff (NmapOps/NpingOps),
 could these be merged and put into libnetutil/?

Yeah, I think it would be better to merge those.

Again, I'll leave that for later.

If we can do at least 1-4 in small steps, I would be happy. Comments

I agree that small steps are preferable for things like this.  If you
can start with a patch for just one of the issues, it is easier to
discuss and integrate.

These are my changes in the attached patch:

1) Deleted 'nping\nping_winconfig.h' since it's contents is already covered by mswin32\config_win.h. And 'NPING_PLATFORM' is unused
 now. It would be the same as 'NMAP_PLATFORM' anyway.
 Also deleted 'ncat\config_win.h' for the same reason.

2) Changed backward slashes ('\') into Unix slashes ('/') in nmap.h,
 nmap_error.h, nping\output.h, nping\stats.h

Not much ATM, but a small start.


Attachment: diffs-11.txt

Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]