2 This file is part of GNUnet.
3 Copyright (C) 2010-2015, 2018 GNUnet e.V.
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
21 * @file network type characterization
22 * @author Christian Grothoff
23 * @author Matthias Wachs
25 * @defgroup nt network type characterization
29 #ifndef GNUNET_NT_LIB_H
30 #define GNUNET_NT_LIB_H
33 * Types of networks (with separate quotas) we support.
35 enum GNUNET_NetworkType
38 * Category of last resort.
40 GNUNET_NT_UNSPECIFIED = 0,
43 * Loopback (same host).
45 GNUNET_NT_LOOPBACK = 1,
53 * Wide area network (i.e. Internet)
58 * Wireless LAN (i.e. 802.11abgn)
68 * Number of network types supported by ATS
70 #define GNUNET_NT_COUNT 6
75 * Convert a `enum GNUNET_NetworkType` to a string
77 * @param net the network type
78 * @return a string or NULL if invalid
81 GNUNET_NT_to_string (enum GNUNET_NetworkType net);
85 * Handle for the LAN Characterization library.
87 struct GNUNET_NT_InterfaceScanner;
91 * Returns where the address is located: loopback, LAN or WAN.
93 * @param is handle from #GNUNET_ATS_interface_scanner_init()
95 * @param addrlen address length
96 * @return type of the network the address belongs to
98 enum GNUNET_NetworkType
99 GNUNET_NT_scanner_get_type (struct GNUNET_NT_InterfaceScanner *is,
100 const struct sockaddr *addr,
105 * Initialize the address characterization client handle.
107 * @return scanner handle, NULL on error
109 struct GNUNET_NT_InterfaceScanner *
110 GNUNET_NT_scanner_init (void);
114 * Terminate interface scanner.
116 * @param is scanner we are done with
119 GNUNET_NT_scanner_done (struct GNUNET_NT_InterfaceScanner *is);
124 /** @} */ /* end of group */