2 * interfaces.h - Source for interface discovery code
4 * Farsight Helper functions
5 * Copyright (C) 2006 Youness Alaoui <kakaroto@kakaroto.homelinux.net>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef __INTERFACES_H__
23 #define __INTERFACES_H__
27 * @short_description: Utility functions to discover local network interfaces
28 * @include: interfaces.h
31 * These utility functions allow the discovery of local network interfaces
32 * in a portable manner, they also allow finding the local ip addresses or
33 * the address allocated to a network interface.
42 * nice_interfaces_get_ip_for_interface:
43 * @interface_name: name of local interface
45 * Retreives the IPv4 address of an interface by its name
47 * Returns: a newly-allocated string with the IP address
49 gchar
* nice_interfaces_get_ip_for_interface (gchar
*interface_name
);
53 * nice_interfaces_get_local_ips:
54 * @include_loopback: Include any loopback devices
56 * Get a list of local ipv4 interface addresses
58 * Returns: a newly-allocated #GList of strings. The caller must free it.
61 GList
* nice_interfaces_get_local_ips (gboolean include_loopback
);
65 * nice_interfaces_get_local_interfaces:
67 * Get the list of local interfaces
69 * Returns: a newly-allocated #GList of strings. The caller must free it.
71 GList
* nice_interfaces_get_local_interfaces (void);