~mateo-salta/nitroshare/nitroshare

« back to all changes in this revision

Viewing changes to include/util/network.h

  • Committer: Nathan Osman
  • Date: 2012-06-21 04:03:47 UTC
  • Revision ID: admin@quickmediasolutions.com-20120621040347-pqzg5zrqoolv532y
Did some more internal reorganization of the network code to make things a bit more robust.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#define NETWORK_H
19
19
 
20
20
#include <QHostAddress>
 
21
#include <QList>
21
22
#include <QNetworkInterface>
22
23
 
23
24
namespace Network {
24
25
 
25
26
    enum AddressType {
26
 
        NoAddress,
27
27
        IPAddress,
28
28
        BroadcastAddress
29
29
    };
30
30
 
31
 
    bool FindIPv4Address(QNetworkInterface, AddressType = NoAddress, QHostAddress * = NULL);
32
 
    bool FindIPv4Address(AddressType, QHostAddress &);
 
31
    // Attempts to find the first IPv4 address for either the provided
 
32
    // network interface or the most suitable interface that could be found
 
33
    bool FindIPv4Address(QNetworkInterface, AddressType, QHostAddress * = NULL);
 
34
 
 
35
    // Determines if the provided network interface is suitable for use
33
36
    bool IsInterfaceUsable(QNetworkInterface);
 
37
 
 
38
    // Retrieves a list of all usable network interfaces
 
39
    QList<QNetworkInterface> FindUsableInterfaces();
 
40
 
 
41
    // Selects the first network interface from the usable list
34
42
    QString FindUsableInterface();
 
43
 
 
44
    // Gets the current network interface
 
45
    QNetworkInterface GetCurrentInterface();
35
46
}
36
47
 
37
48
#endif // NETWORK_H