Remove declartion of nonexistent myerror.
Add some missing noreturn and format attributes.
Fix some format string mismatches (int versus long int).
Use an fprintf and abort instead of Nsock's fatal.

In preparation for move to Nbase.
Move CHECKED_FD_SET and CHECKED_FD_CLR to Nbase.
Use CHECKED_FD_SET and CHECKED_FD_CLR in ultra_scan.
Break up the maxSocketsAllowed assignment.
Limit maxSocketsAllowed to FD_SETSIZE.

At high scan rates, there was nothing to prevent trying to set or clear
socket descriptors above FD_SETSIZE, which is usually around 1024. I got
a reliable assertion failures with the command
	nmap -sT -p- --min-rate 100000 scanme.nmap.org
The problem only affected -sT scans. A similar protection was added to
Nsock in r15808.
Switch to an o.proto option instead of o.udp and o.sctp.

This eliminates the ambiguity that could exist when, say, both o.udp and
o.sctp were both set. The code would use whichever it happened to test
first. This also makes TCP mode explicit with IPPROTO_TCP.
Break out separate SCTP tests for half-open sockets.

These should have different behavior than TCP.
http://seclists.org/nmap-dev/2013/q1/227
Quit on EOF in non-TCP mode.

Apparently SCTP can't have the same kind of half-open sockets that TCP
has. When one direction is closed, we can't do anything further with the
socket.
http://seclists.org/nmap-dev/2013/q1/227
XFAIL some tests having to do with EOF handling.

http://seclists.org/nmap-dev/2013/q1/227
Remove a close that made a test unreliable.
Whitespace.
Update ip-geolocation-geoplugin.nse for a new data format.

The response seems to be plain JSON now, with nothing extraneous.
Reported by Robin Wood.
http://seclists.org/nmap-dev/2013/q1/232
Allow CRLF line endings in upnp.lua

Only LF was supported before. Reported by kaito.
http://seclists.org/nmap-dev/2013/q1/221
Remove stray semicolon.
Add a defer buffer to HostGroupState.

This allows some targets to be skipped over yet remembered so they can
be dealt with later. The idea is that because ping groups are not
allowed
to have duplicate IPs, we continue searching for non-duplicates in order
to fill up a ping group, then return to what were formerly duplicates.
This prevents potentially large ping groups from being split into small
groups.

For example, if the list of targets is
        A B C D A B E A F G
the ping groups used to be
        (A B C D) (A B E) (A F G)
but now they are
        (A B C D E F G) (A B) (A]

A similar thing can be done for port scan hostgroups, but this already
does most of the work because ping groups are generally bigger than
hostgroups and have pretty much the same restrictions.
Limit the number of HostGroupState targets we will defer.

This prevents potentially reading (and buffering) every input host while
looking for more targets to fill up the current hostgroup. One of the
criteria that can split hostgroups is interface. Suppose you have an
input list of targets whose interfaces are
	eth0 eth0 eth0 wlan0 wlan0 wlan0 wlan0 wlan0 wlan0...
The first three eth0 will go in the first group, and then the following
wlan0 will start to be buffered while we look for more eth0. But we will
only look ahead 64 targets, then go ahead and scan the three eth0.
CHANGELOG for host deferral.