Merging upstream version 0.8.0 (Closes: #639729, #761971).
[debian/lxpanel.git] / plugins / netstat / netstat.h
1 #ifndef HAVE_FNETDAEMON_H
2 #define HAVE_FNETDAEMON_H
3
4 #include <stdio.h>
5 #include <netinet/in.h>
6 #include <gtk/gtk.h>
7 #include "wireless.h"
8 #include "plugin.h"
9
10 #define NETDEV_STAT_NORMAL 0
11 #define NETDEV_STAT_PROBLEM 1
12 #define NETDEV_STAT_RENEW 2
13 #define NETDEV_STAT_BOTHRS 3
14 #define NETDEV_STAT_SENDDATA 4
15 #define NETDEV_STAT_RECVDATA 5
16
17 /* forward declaration for UI interaction. */
18 struct statusicon;
19
20 struct pgui {
21 GtkWidget *dlg;
22 GtkWidget *pentry;
23 };
24
25 typedef struct {
26 char *ifname;
27 char *mac;
28 char *ipaddr;
29 char *dest;
30 char *bcast;
31 char *mask;
32 int flags;
33 gboolean alive;
34 gboolean enable;
35 gboolean updated;
36 gboolean plug;
37 gboolean connected;
38
39 /* wireless */
40 gboolean wireless;
41 char *protocol;
42 char *essid;
43 int quality;
44 struct pgui *pg;
45
46 int status;
47 gulong recv_bytes;
48 gulong recv_packets;
49 gulong trans_bytes;
50 gulong trans_packets;
51
52 /* systray */
53 struct statusicon *status_icon;
54 } netdevice;
55
56 typedef struct netdevice_node {
57 netdevice info;
58 struct netdevice_node *prev;
59 struct netdevice_node *next;
60 } NETDEVLIST;
61 typedef NETDEVLIST *NETDEVLIST_PTR;
62
63 typedef struct {
64 int dev_count;
65 int sockfd;
66 int iwsockfd;
67 GIOChannel *lxnmchannel;
68 FILE *netdev_fp;
69 NETDEVLIST_PTR netdevlist;
70 } FNETD;
71
72 typedef struct {
73 GtkWidget *mainw;
74 LXPanel *panel;
75 FNETD *fnetd;
76 char *fixcmd;
77 gint ttag;
78 gboolean use_theme;
79 } netstat;
80
81 typedef struct {
82 netstat *ns;
83 NETDEVLIST_PTR netdev_list;
84 } netdev_info;
85
86 typedef struct {
87 netdev_info *ni;
88 GIOChannel *gio;
89 ap_info *apinfo;
90 char *ifname;
91 } ap_setting;
92
93 #endif