diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2012-11-16 14:27:14 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2012-11-16 14:27:14 +0000 |
| commit | fb50d4028b8fb7ef474cd58df672fa699aa338d3 (patch) | |
| tree | 36bf7015be6f09a48c296c80904a5289e946a535 /cpp/include | |
| parent | 384aa602a1d54734f76d1d0fc59ef41d2415e03b (diff) | |
| download | qpid-python-fb50d4028b8fb7ef474cd58df672fa699aa338d3.tar.gz | |
QPID-3351: Provide ability to specify the network interfaces
Added functions to find machines network interface names and addresses
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1410362 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/include')
| -rw-r--r-- | cpp/include/qpid/sys/SystemInfo.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cpp/include/qpid/sys/SystemInfo.h b/cpp/include/qpid/sys/SystemInfo.h index 7e5d372300..ec0e653881 100644 --- a/cpp/include/qpid/sys/SystemInfo.h +++ b/cpp/include/qpid/sys/SystemInfo.h @@ -53,6 +53,25 @@ QPID_COMMON_EXTERN bool getLocalHostname (Address &address); QPID_COMMON_EXTERN void getLocalIpAddresses (uint16_t port, std::vector<Address> &addrList); /** + * Get the names of all the network interfaces connected to + * this host. + * @param names Receives the list of interface names + */ +QPID_COMMON_EXTERN void getInterfaceNames(std::vector<std::string>& names ); + +/** + * Get strings for each of the IP addresses associated with a named network + * interface. + * If there is no interface of that name an empty list will be returned. + * + * @param interface The name of the network interface + * @param addresses The list of the strings for the IP addresses are pushed on the back of this parameter + * to get just the list you need to clear the vector before using it. + * @return true if an interface of the correct name was found, false otherwise + */ +QPID_COMMON_EXTERN bool getInterfaceAddresses(const std::string& interface, std::vector<std::string>& addresses); + +/** * Retrieve system identifiers and versions. This is information that can * generally be retrieved via POSIX uname(). * |
