1 /* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
2 * vim: ts=4 sw=4 noet ai cindent syntax=c
4 * Conky, a system monitor, based on torsmo
6 * Any original torsmo code is licensed under the BSD license
8 * All code written since the fork of torsmo is licensed under the GPL
10 * Please see COPYING for details
12 * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
13 * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al.
15 * All rights reserved.
17 * This program is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program. If not, see <http://www.gnu.org/licenses/>.
34 #include <sys/socket.h> /* struct sockaddr */
39 long long last_read_recv, last_read_trans;
40 long long recv, trans;
41 double recv_speed, trans_speed;
43 #if defined(__linux__)
45 #endif /* __linux__ */
46 double net_rec[15], net_trans[15];
47 // wireless extensions
56 extern struct net_stat netstats[];
58 struct net_stat *get_net_stat(const char *, void *, void *);
60 void parse_net_stat_arg(struct text_object *, const char *, void *);
61 void parse_net_stat_bar_arg(struct text_object *, const char *, void *);
62 void print_downspeed(struct text_object *, char *, int);
63 void print_downspeedf(struct text_object *, char *, int);
64 void print_upspeed(struct text_object *, char *, int);
65 void print_upspeedf(struct text_object *, char *, int);
66 void print_totaldown(struct text_object *, char *, int);
67 void print_totalup(struct text_object *, char *, int);
68 void print_addr(struct text_object *, char *, int);
70 void print_addrs(struct text_object *, char *, int);
71 #endif /* __linux__ */
73 void parse_net_stat_graph_arg(struct text_object *, const char *, void *);
74 void print_downspeedgraph(struct text_object *, char *, int);
75 void print_upspeedgraph(struct text_object *, char *, int);
79 void print_wireless_essid(struct text_object *, char *, int);
80 void print_wireless_mode(struct text_object *, char *, int);
81 void print_wireless_bitrate(struct text_object *, char *, int);
82 void print_wireless_ap(struct text_object *, char *, int);
83 void print_wireless_link_qual(struct text_object *, char *, int);
84 void print_wireless_link_qual_max(struct text_object *, char *, int);
85 void print_wireless_link_qual_perc(struct text_object *, char *, int);
86 void print_wireless_link_bar(struct text_object *, char *, int);
87 #endif /* HAVE_IWLIB */
88 #endif /* __linux__ */
90 void clear_net_stats(void);
92 void parse_if_up_arg(struct text_object *, const char *);
93 int interface_up(struct text_object *);
94 void free_if_up(struct text_object *);
96 void free_dns_data(void);
97 int update_dns_data(void);
98 void parse_nameserver_arg(struct text_object *, const char *);
99 void print_nameserver(struct text_object *, char *, int);
101 #endif /* _NET_STAT_H */