1 /* gnome-netinfo - A GUI Interface for network utilities
2  * Copyright (C) 2002, 2003 by German Poo-Caaman~o
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18 
19 #include <glib.h>
20 
21 #include "nettool.h"
22 
23 #define NOT_AVAILABLE _("not available")
24 #define DELAY_STATS 1000  /* 1 second */
25 
26 /* Solaris store the MTU in ifr_metric, and doesn't have
27    ifr_mtu define */
28 #if !defined(ifr_mtu)
29 #  define ifr_mtu  ifr_ifru.ifru_metric
30 #endif
31 
32 typedef enum {
33 	   INFO_INTERFACE_OTHER,
34 	   INFO_INTERFACE_ETH,
35 	   INFO_INTERFACE_WLAN,
36 	   INFO_INTERFACE_PPP,
37 	   INFO_INTERFACE_PLIP,
38 	   INFO_INTERFACE_IRLAN,
39 	   INFO_INTERFACE_LO,
40 	   INFO_INTERFACE_UNKNOWN
41 } InfoInterfaceType;
42 
43 typedef struct {
44 	   const gchar       *name;
45 	   InfoInterfaceType  type;
46 	   const gchar       *icon;
47 	   const gchar       *prefix;
48 	   GdkPixbuf         *pixbuf;
49 } InfoInterfaceDescription;
50 
51 void   info_do (const gchar * nic, Netinfo * info);
52 void   info_set_nic (Netinfo * info, const gchar *nic);
53 gchar *info_get_nic (Netinfo * info);
54 void   info_load_iface (Netinfo *info);
55 
56 void   info_nic_changed (GtkWidget *combo, gpointer data);
57 
58 void   info_get_nic_information (const gchar *nic, Netinfo *info);
59 void   info_copy_to_clipboard (Netinfo * netinfo, gpointer user_data);
60