1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-18 13:39:02 +00:00
Commit Graph

24 Commits

Author SHA1 Message Date
henri
b55ff2d68f Don't associate nsock logging info to a nspool.
Make current loglevel and current log callback global
to the library. Attaching them to the nsock pool doesn't
bring any benefit and prevents from logging activity in
code sections that don't have access to a pool (such as
proxy chain specification parsing).

Updated external calls and nsock tests accordingly.
2015-06-27 08:21:53 +00:00
henri
b75233ce98 Consistently renamed nsi_XXX calls into nsock_iod_XXX
This is part of the effort to make nsock expose only
nsock_ prefixed symbols and simplify the API.
2015-06-27 08:21:33 +00:00
dmiller
68409b2226 Update copyright date to 2015 2015-06-03 13:01:29 +00:00
fyodor
f6f59a7cd7 Auto regeneration with latest template files, etc. 2014-08-13 22:57:43 +00:00
henri
d13dab54c3 Replaced internal opaque types by structs. 2014-05-21 19:59:42 +00:00
henri
64fb5b3482 Added safe fd_set operations.
Only FD_SET and FD_CLR were available. Added a FD_ISSET equivalent.
Implemented them as static inline instead of macros for consistency.

These functions abort() if the FD number is higher than FD_SETSIZE
(except on windows where no check is performed).
2014-01-30 19:02:57 +00:00
henri
853aaff586 Manage expiration times via a heap queue.
This prevents nsock from iterating over the whole list of events at
each runloop, thus improving performance.

It made it necessary to have pointers from the msevents to the event
lists they belong to. The patch therefore also changes gh_list from
autonomous containers to embedded structures.

Added unit tests accordingly and cosmetic changes to make things look
more consistent.
2013-08-10 23:59:30 +00:00
fyodor
83fb10ec56 Update the Nmap copyright/license files. This isn't the new Nmap Public Source License we've been discussing on the list, but rather just a 'quick patch' to hopefully prevent some of the abuse we've been seeing from companies lately. More details on the changes will be posted to the dev list. Also, the copyright year was updated to 2013 (which is the only change to Nsock license statements). 2013-07-28 22:05:05 +00:00
david
87bab78479 Move CHECKED_FD_SET and CHECKED_FD_CLR to Nbase. 2013-02-22 00:45:57 +00:00
david
6e674f5cf5 Use an fprintf and abort instead of Nsock's fatal.
In preparation for move to Nbase.
2013-02-22 00:45:56 +00:00
david
d50afbca7d Fix some format string mismatches (int versus long int). 2013-02-22 00:45:55 +00:00
henri
3206c48aab Normalized log messages. No idea why I initially put underscores instead of spaces there. 2012-12-15 18:16:59 +00:00
henri
809f1eda68 Merged nsock-logging from nmap-exp/henri/nsock-logging/
Reworked the logging infrastructure to make it more flexible
and consistent.

Updated nmap, nping and ncat accordingly.  Nsock log level can
now be adjusted at runtime by pressing d/D in nmap.
2012-12-15 10:59:30 +00:00
fyodor
6a42ef47c0 Update the Nmap and Nsock source code headers to note new Nmap dev mailing list email address and a better URL for Nmap license. 2012-12-06 01:21:42 +00:00
henri
9865b8f828 Cleaning up: consistently get event masks from a static inline get_evmask() function. 2012-10-22 04:26:19 +00:00
henri
a111b5bcdc [NSOCK] Sandwitched pcap_read_on_nonselect() statements between #ifndef
PCAP_CAN_DO_SELECT guards to prevent them from being executed on systems that
actually provide selectable pcap descriptors.
2012-07-17 16:38:15 +00:00
henri
87fcddad2b Fixed a couple nsock problems described in
http://seclists.org/nmap-dev/2012/q3/56.  r29134 already addressed the issue but
was incomplete.

This replaces r29134 with an engine-agnostic approach, and additionally enforces
the reset of IOD flags before use or re-use.
2012-07-09 16:45:49 +00:00
david
05c713d22a Don't try to do FD_ISSET on a nonselectable pcap descriptor.
The Nsock select engine stores readiness information in a mask instead
of doing an FD_ISSET against the descriptor every time. This is a good
idea, but it removed a special case in the pre-engines code: in case
PCAP_CAN_DO_SELECT is not defined, we can't do FD_ISSET on the
descriptor because it is -1. Here we check for that occurrence and set
EV_READ in the mask so that a non-blocking pcap read can happen every
iteration.
2012-04-05 03:30:09 +00:00
david
4a541fc367 Add an assert that I am currently able to make fail. 2012-04-05 01:37:59 +00:00
fyodor
e96a7b7b24 Update the headers for each code file. This updates code copyright dates to 2012, notes the awesome NSE in the list of technology, and slightly rewords the derivative works clarification 2012-03-01 06:32:23 +00:00
henri
5f49844390 Simple comment fixes. 2012-02-02 09:52:19 +00:00
henri
9c7f72108b More code cleaning: whitespace and indentation fixes. 2012-01-20 08:26:14 +00:00
henri
fe566432c7 Minor rewordings, fixed typos. 2012-01-09 13:33:38 +00:00
henri
856cd00a17 Merged nsock-engines from nmap-exp. This rewrite of the nsock library adds
support for system-specific scalable IO notification facilities without breaking
portability. This initial version comes with an epoll(7)-based engine for Linux
and a select(2)-based fallback engine for all other operating systems.

This required an important refactoring of the library but the external API was
preserved.

The rewrite also tries to bring the coding standards of nmap to nsock.

See http://labs.unix-junkies.org/nsock_engines.html for the details.
2012-01-05 01:08:16 +00:00