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
76 * Convert a `enum GNUNET_NetworkType` to a string
78 * @param net the network type
79 * @return a string or NULL if invalid
82 GNUNET_NT_to_string (enum GNUNET_NetworkType net);
86 * Handle for the LAN Characterization library.
88 struct GNUNET_NT_InterfaceScanner;
92 * Returns where the address is located: loopback, LAN or WAN.
94 * @param is handle from #GNUNET_ATS_interface_scanner_init()
96 * @param addrlen address length
97 * @return type of the network the address belongs to
99 enum GNUNET_NetworkType
100 GNUNET_NT_scanner_get_type (struct GNUNET_NT_InterfaceScanner *is,
101 const struct sockaddr *addr,
106 * Initialize the address characterization client handle.
108 * @return scanner handle, NULL on error
110 struct GNUNET_NT_InterfaceScanner *
111 GNUNET_NT_scanner_init (void);
115 * Terminate interface scanner.
117 * @param is scanner we are done with
120 GNUNET_NT_scanner_done (struct GNUNET_NT_InterfaceScanner *is);
125 /** @} */ /* end of group */