summaryrefslogtreecommitdiff
path: root/accel-pppd/cli
diff options
context:
space:
mode:
authorxebd <xeb@mail.ru>2022-11-01 16:20:36 +0300
committerGitHub <noreply@github.com>2022-11-01 16:20:36 +0300
commita6aa7c279d2713c6723731029092199713d21257 (patch)
treed3a00c4926246b49cb0dc86300b936ebed849254 /accel-pppd/cli
parentadfc132b96a4fbfb3a10f49e04e15c6669abf11d (diff)
parentad94c19554d7c6bb18ab2e251e4ee403ee0b7732 (diff)
downloadaccel-ppp-a6aa7c279d2713c6723731029092199713d21257.tar.gz
accel-ppp-a6aa7c279d2713c6723731029092199713d21257.zip
Merge pull request #66 from boomer41/feature/additions-2022-11-01
Use 64-bit interface statistics and some more env parameters for pppd-compat
Diffstat (limited to 'accel-pppd/cli')
-rw-r--r--accel-pppd/cli/show_sessions.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c
index fb3ff527..73adc54f 100644
--- a/accel-pppd/cli/show_sessions.c
+++ b/accel-pppd/cli/show_sessions.c
@@ -2,6 +2,7 @@
#include <time.h>
#include <string.h>
#include <unistd.h>
+#include <inttypes.h>
#include <signal.h>
#include <arpa/inet.h>
#include <linux/if_link.h>
@@ -52,7 +53,7 @@ struct cell_t
static LIST_HEAD(col_list);
static char *conf_def_columns = NULL;
-static __thread struct rtnl_link_stats stats;
+static __thread struct rtnl_link_stats64 stats;
static __thread int stats_set;
void __export cli_show_ses_register(const char *name, const char *desc, void (*print)(struct ap_session *ses, char *buf))
@@ -580,7 +581,7 @@ static void print_rx_bytes(struct ap_session *ses, char *buf)
get_stats(ses);
stats_set = 1;
}
- format_bytes(buf, 4294967296ll*ses->acct_input_gigawords + stats.rx_bytes);
+ format_bytes(buf, stats.rx_bytes);
}
static void print_tx_bytes(struct ap_session *ses, char *buf)
@@ -589,7 +590,7 @@ static void print_tx_bytes(struct ap_session *ses, char *buf)
get_stats(ses);
stats_set = 1;
}
- format_bytes(buf, 4294967296ll*ses->acct_output_gigawords + stats.tx_bytes);
+ format_bytes(buf, stats.tx_bytes);
}
static void print_rx_bytes_raw(struct ap_session *ses, char *buf)
@@ -598,7 +599,7 @@ static void print_rx_bytes_raw(struct ap_session *ses, char *buf)
get_stats(ses);
stats_set = 1;
}
- sprintf(buf, "%llu", 4294967296ll*ses->acct_input_gigawords + stats.rx_bytes);
+ sprintf(buf, PRIu64, stats.rx_bytes);
}
static void print_tx_bytes_raw(struct ap_session *ses, char *buf)
@@ -607,7 +608,7 @@ static void print_tx_bytes_raw(struct ap_session *ses, char *buf)
get_stats(ses);
stats_set = 1;
}
- sprintf(buf, "%llu", 4294967296ll*ses->acct_output_gigawords + stats.tx_bytes);
+ sprintf(buf, PRIu64, stats.tx_bytes);
}
static void print_rx_pkts(struct ap_session *ses, char *buf)
@@ -616,7 +617,7 @@ static void print_rx_pkts(struct ap_session *ses, char *buf)
get_stats(ses);
stats_set = 1;
}
- sprintf(buf, "%u", stats.rx_packets);
+ sprintf(buf, PRIu64, stats.rx_packets);
}
static void print_tx_pkts(struct ap_session *ses, char *buf)
@@ -625,7 +626,7 @@ static void print_tx_pkts(struct ap_session *ses, char *buf)
get_stats(ses);
stats_set = 1;
}
- sprintf(buf, "%u", stats.tx_packets);
+ sprintf(buf, PRIu64, stats.tx_packets);
}
static void load_config(void *data)