2 * interfaces.h - Source for interface discovery code
4 * Farsight Helper functions
5 * Copyright (C) 2006 Youness Alaoui <kakaroto@kakaroto.homelinux.net>
6 * Copyright (C) 2008-2009 Collabora, Nokia
7 * Contact: Youness Alaoui
8 * Copyright (C) 2008-2009 Nokia Corporation. All rights reserved.
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 #ifndef __INTERFACES_H__
26 #define __INTERFACES_H__
30 * @short_description: Utility functions to discover local network interfaces
31 * @include: interfaces.h
34 * These utility functions allow the discovery of local network interfaces
35 * in a portable manner, they also allow finding the local ip addresses or
36 * the address allocated to a network interface.
45 * nice_interfaces_get_ip_for_interface:
46 * @interface_name: name of local interface
48 * Retreives the IPv4 address of an interface by its name
50 * Returns: a newly-allocated string with the IP address
52 gchar
* nice_interfaces_get_ip_for_interface (gchar
*interface_name
);
56 * nice_interfaces_get_local_ips:
57 * @include_loopback: Include any loopback devices
59 * Get a list of local ipv4 interface addresses
61 * Returns: a newly-allocated #GList of strings. The caller must free it.
64 GList
* nice_interfaces_get_local_ips (gboolean include_loopback
);
68 * nice_interfaces_get_local_interfaces:
70 * Get the list of local interfaces
72 * Returns: a newly-allocated #GList of strings. The caller must free it.
74 GList
* nice_interfaces_get_local_interfaces (void);