~mateo-salta/nitroshare/nitroshare

« back to all changes in this revision

Viewing changes to include/util/network.h

  • Committer: Nathan Osman
  • Date: 2012-06-29 22:01:55 UTC
  • Revision ID: admin@quickmediasolutions.com-20120629220155-ogwrn9fxxve9wyw1
Moved a TON of the broadcast and discovery code around, creating separate classes for each and partially implementing their use in the first start wizard.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
namespace Network {
25
25
 
26
 
    enum AddressType {
27
 
        IPAddress,
28
 
        BroadcastAddress
29
 
    };
30
 
 
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);
 
26
    /* Attempts to find the first IPv4 address on the provided interface,
 
27
       optionally returning the IP, broadcast, and / or netmask if desired. */
 
28
    bool FindIPv4Address(QNetworkInterface, QHostAddress * = NULL, QHostAddress * = NULL, QHostAddress * = NULL);
34
29
 
35
30
    // Determines if the provided network interface is suitable for use
36
31
    bool IsInterfaceUsable(QNetworkInterface);