There was a lot of duplicated code dedicated to this. I've consolidated
it into the new internal APIs described below.
Pushed to the brolley/dev branch of pcpfans.
--------------------------------------------------------------------------------------------------------------
commit 57736b9013bee5e2bbe3e9e7d68dfc1327589e60
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon May 26 10:15:13 2014 -0400
Use the new *AddPorts() APIs throughout as appropriate.
commit 746504515ced5fc1557f946c71287bac4cce9ef6
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Fri May 23 14:11:30 2014 -0400
New internal API functions for collecting server port numbers.
- extern int __pmServiceAddPorts(const char *, int **, int)
_PCP_HIDDEN;
determines port numbers for the named service.
- extern int __pmPMCDAddPorts(int **, int) _PCP_HIDDEN;
determines port numbers for pmcd using the PMCD_PORT
environment variable.
- extern int __pmProxyAddPorts(int **, int) _PCP_HIDDEN;
determines port numbers for pmproxy using the PMPROXY_PORT
environment variable.
- extern int __pmWebdAddPorts(int **, int) _PCP_HIDDEN;
determines port numbers for pmwebd using the new PMWEBD_PORT
environment variable.
- extern int __pmAddPorts(const char *, int **, int) _PCP_HIDDEN;
parses the given string of comma-separated port numbers.
pmfind now uses these APIs to obtain the default port numbers for
its supported services (all of the above). With this change,
pmfind now supports multiple port numbers for a service when
using the "probe" mechanism.
|