Hi,
The commits below have been pushed to my brolley/dev branch in the
pcpfans repository. They collectively represent an implementation of an
active probing mode for __pmDiscoverServices() / pmfind.
This mode is activated by passing in a string of the form
probe=<address>/<maskBits>
as the 'mechanism' string to __pmDiscoverServices(). The implementation
supports inet and ipv6 addresses, for example:
"probe=192.168.1.0/24"
"probe=fe80::3e97:eff:fed9:0/112"
These correspond to the CIDR notation for a subnet range. A connection
will be attempted on each address in the range on the port indicated by
the 'service' string ("pmcd" is still the only service supported).
In order that the probing be completed in a reasonable amount of time,
each connection is attempted on its own thread (on platforms that
support pthreads). The code is sensitive to encountering limits on the
number of open fds and active threads. In addition, the user may
specifically limit the number of active threads using the additional
specification
"maxThreads=<n>"
For example:
"probe=192.168.1.0/24,maxThreads=50"
Each thread uses the minimum amount of stack supported by the system
(PTHREAD_STACK_MIN).
When using pmfind, the search spec is provided by the -m option. For
example:
pmfind -m probe=192.168.1.0/24"
pmfind -m probe=fe80::3e97:eff:fed9:0/112"
pmfind -m probe=192.168.1.0/24,maxThreads=50
I am soliciting review of the code and the user interface. All comments
and suggestions are welcome.
Dave
---------------------------------------------------------------------------
commit d4e3baa39437d6f00ef6871dc05e376e3a35c256
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Tue May 13 17:19:57 2014 -0400
Add a configure check for the presence of sem_t in <semephore.h>.
commit 5cb6494ef28bc084bd49d8c5c8192e8ac8f264dd
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Tue May 13 16:59:01 2014 -0400
Use a __pmSockAddr to count the number of active probing threads as
they finish.
commit 56113a27a1ff372feb35b1580a5c1d764621ade4
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Tue May 13 16:27:37 2014 -0400
Set a small stack size for each active probing worker thread.
THREAD_STACK_MIN appears to be sufficient.
commit 0ac32a160d472c20d058426c96a04ed3249ea7eb
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Tue May 13 15:56:20 2014 -0400
Implement a max threads control for active service probing.
Implemented as part of the mechanism string for use by
API users as well as by pmfind(1).
commit d39843cf6dbf338745aebb6421c7e7c36ef44f6c
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon May 12 14:41:59 2014 -0400
Native (non-NSPR) implementation of service probing.
Consolidates common code between the native and NSPR
implementation.
commit da42ecfddf37b1283a8aa04f55ee3aef1a9710d2
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon May 12 13:05:46 2014 -0400
Fix concurrency problem in active probing.
The size of the results list was not always guarded.
commit f1950eb25df22ba7cc2f3d32a4f27d2e04f4d21b
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon May 12 11:27:23 2014 -0400
For active probing, reduce the timeout for a conneciton in progress.
From 5 seconds to 1 second.
commit d22f8abba9262c75d458c26919fcd814d96e8edd
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon May 12 11:09:08 2014 -0400
Add some tracing for active probing.
Tracing mesages generated when fd and thread limits reached.
commit 4a64f4e67420ec38d463b5bf8b0955e76149090b
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon May 12 11:04:36 2014 -0400
Threaded probing for PCP services.
Active probing now done on a separate trhead for each address.
commit 8fb4a0c73702e4663517f78259202503e0eedf23
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Tue May 6 16:32:27 2014 -0400
__pmAddDiscoveredService() should return negative error codes.
So that they can be distinguished from the updated number of urls.
All callers updated.
commit 83f6b0c44c8eeb9d1217ad2fa4556f3254518792
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Tue May 6 14:52:44 2014 -0400
pmfind: Finalize iteration API for subnet addresses.
commit 7cab926e462e13967b178a5953e5824df8a37326
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon May 5 15:41:47 2014 -0400
New source files for active service probing.
commit e685accd03273bd8e0180313d80d159670136448
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon May 5 15:37:04 2014 -0400
Initial framework for PCP service discovery via active probing.
|