Merging upstream version 0.8.0 (Closes: #639729, #761971).
[debian/lxpanel.git] / plugins / netstat / netstat.h
CommitLineData
f8c25730
DB
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"
89173f95 8#include "plugin.h"
f8c25730
DB
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. */
18struct statusicon;
19
20struct pgui {
21 GtkWidget *dlg;
22 GtkWidget *pentry;
23};
24
25typedef 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
56typedef struct netdevice_node {
57 netdevice info;
58 struct netdevice_node *prev;
59 struct netdevice_node *next;
60} NETDEVLIST;
61typedef NETDEVLIST *NETDEVLIST_PTR;
62
63typedef 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
72typedef struct {
73 GtkWidget *mainw;
89173f95 74 LXPanel *panel;
f8c25730
DB
75 FNETD *fnetd;
76 char *fixcmd;
77 gint ttag;
89173f95 78 gboolean use_theme;
f8c25730
DB
79} netstat;
80
81typedef struct {
82 netstat *ns;
83 NETDEVLIST_PTR netdev_list;
84} netdev_info;
85
86typedef struct {
87 netdev_info *ni;
88 GIOChannel *gio;
89 ap_info *apinfo;
90 char *ifname;
91} ap_setting;
92
93#endif