1 /** @file networkinterfaces.h  Information about network interfaces.
2  *
3  * @authors Copyright (c) 2017 Jaakko Keränen <jaakko.keranen@iki.fi>
4  *
5  * @par License
6  * LGPL: http://www.gnu.org/licenses/lgpl.html
7  *
8  * <small>This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or (at your
11  * option) any later version. This program is distributed in the hope that it
12  * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
14  * General Public License for more details. You should have received a copy of
15  * the GNU Lesser General Public License along with this program; if not, see:
16  * http://www.gnu.org/licenses</small>
17  */
18 
19 #ifndef LIBDENG2_NETWORKINTERFACES_H
20 #define LIBDENG2_NETWORKINTERFACES_H
21 
22 #include "de/libcore.h"
23 #include <QList>
24 #include <QHostAddress>
25 
26 namespace de {
27 namespace internal {
28 
29 /**
30  * Information abuot network interfaces.
31  *
32  * Maintains a quickly-accessible copy of the network interface data.
33  */
34 class NetworkInterfaces
35 {
36 public:
37     static NetworkInterfaces &get();
38 
39 public:
40     NetworkInterfaces();
41 
42     /**
43      * Returns a cached copy of the list of network addresses for all of the currently
44      * available network interfaces. Updated periodically in the background.
45      *
46      * @return Network interface addresses, in IPv6 format.
47      */
48     QList<QHostAddress> allAddresses() const;
49 
50 private:
51     DENG2_PRIVATE(d)
52 };
53 
54 } // namespace internal
55 } // namespace de
56 
57 #endif // LIBDENG2_NETWORKINTERFACES_H
58