Change the inappropriately chosen name to the more descriptive name.
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/detstats.c | 12 ++++++------
src/hostmon.c | 4 ++--
src/ifstats.c | 4 ++--
src/rate.c | 2 +-
src/rate.h | 2 +-
src/serv.c | 6 +++---
6 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/detstats.c b/src/detstats.c
index 8a8eb8c..90f64d6 100644
--- a/src/detstats.c
+++ b/src/detstats.c
@@ -376,13 +376,13 @@ void detstats(char *iface, const struct OPTIONS *options, time_t
facilitytime,
doupdate();
memset(&span, 0, sizeof(span));
- rate_init(&rate, 5);
- rate_init(&rate_in, 5);
- rate_init(&rate_out, 5);
+ rate_alloc(&rate, 5);
+ rate_alloc(&rate_in, 5);
+ rate_alloc(&rate_out, 5);
- rate_init(&pps_rate, 5);
- rate_init(&pps_rate_in, 5);
- rate_init(&pps_rate_out, 5);
+ rate_alloc(&pps_rate, 5);
+ rate_alloc(&pps_rate_in, 5);
+ rate_alloc(&pps_rate_out, 5);
gettimeofday(&tv, NULL);
start_tv = tv;
diff --git a/src/hostmon.c b/src/hostmon.c
index b37aaa2..33dacf0 100644
--- a/src/hostmon.c
+++ b/src/hostmon.c
@@ -284,8 +284,8 @@ static struct ethtabent *addethentry(struct ethtab *table,
ptemp->un.figs.inspanbr = ptemp->un.figs.outspanbr = 0;
ptemp->un.figs.inippcount = ptemp->un.figs.outippcount = 0;
ptemp->un.figs.inbcount = ptemp->un.figs.outbcount = 0;
- rate_init(&ptemp->un.figs.inrate, 5);
- rate_init(&ptemp->un.figs.outrate, 5);
+ rate_alloc(&ptemp->un.figs.inrate, 5);
+ rate_alloc(&ptemp->un.figs.outrate, 5);
table->entcount++;
diff --git a/src/ifstats.c b/src/ifstats.c
index 01148ef..fbe7dc4 100644
--- a/src/ifstats.c
+++ b/src/ifstats.c
@@ -177,7 +177,7 @@ static void initiflist(struct iflist **list)
struct iflist *itmp = xmallocz(sizeof(struct iflist));
strcpy(itmp->ifname, ifname);
itmp->ifindex = ifindex;
- rate_init(&itmp->rate, 5);
+ rate_alloc(&itmp->rate, 5);
/* make the linked list sorted by ifindex */
struct iflist *cur = *list, *last = NULL;
@@ -688,7 +688,7 @@ void selectiface(char *ifname, int withall, int *aborted)
ptmp = xmalloc(sizeof(struct iflist));
strncpy(ptmp->ifname, "All interfaces", sizeof(ptmp->ifname));
ptmp->ifindex = 0;
- rate_init(&ptmp->rate, 5); /* FIXME: need iflist_entry_init() */
+ rate_alloc(&ptmp->rate, 5); /* FIXME: need iflist_entry_init() */
ptmp->prev_entry = NULL;
list->prev_entry = ptmp;
diff --git a/src/rate.c b/src/rate.c
index f996478..c60c70a 100644
--- a/src/rate.c
+++ b/src/rate.c
@@ -4,7 +4,7 @@
#include "iptraf-ng-compat.h"
#include "rate.h"
-void rate_init(struct rate *rate, unsigned int n)
+void rate_alloc(struct rate *rate, unsigned int n)
{
if (!rate)
return;
diff --git a/src/rate.h b/src/rate.h
index 3cd3d8b..87f476d 100644
--- a/src/rate.h
+++ b/src/rate.h
@@ -23,7 +23,7 @@ struct rate {
unsigned long sma; /* simple moving average */
};
-void rate_init(struct rate *rate, unsigned int n);
+void rate_alloc(struct rate *rate, unsigned int n);
void rate_destroy(struct rate *rate);
void rate_add_rate(struct rate *rate, unsigned long bytes,
unsigned long msecs);
diff --git a/src/serv.c b/src/serv.c
index 73dc3b7..04f964e 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -211,9 +211,9 @@ static struct portlistent *addtoportlist(struct portlist *list,
ptemp->protocol = protocol;
ptemp->port = port; /* This is used in checks later. */
- rate_init(&ptemp->rate, 5);
- rate_init(&ptemp->rate_in, 5);
- rate_init(&ptemp->rate_out, 5);
+ rate_alloc(&ptemp->rate, 5);
+ rate_alloc(&ptemp->rate_in, 5);
+ rate_alloc(&ptemp->rate_out, 5);
/*
* Obtain appropriate service name
--
1.7.8.4