projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1842 from rubenk/declare-loop-variable-in-for-loop-controlling...
[collectd.git]
/
src
/
tcpconns.c
diff --git
a/src/tcpconns.c
b/src/tcpconns.c
index
da91695
..
e74e4bc
100644
(file)
--- a/
src/tcpconns.c
+++ b/
src/tcpconns.c
@@
-58,6
+58,7
@@
*/
#include "collectd.h"
*/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "common.h"
#include "plugin.h"
@@
-304,7
+305,6
@@
static void conn_submit_port_entry (port_entry_t *pe)
{
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
{
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
- int i;
conn_prepare_vl (&vl, values);
conn_prepare_vl (&vl, values);
@@
-314,7
+314,7
@@
static void conn_submit_port_entry (port_entry_t *pe)
ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%"PRIu16"-local", pe->port);
ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%"PRIu16"-local", pe->port);
- for (i = 1; i <= TCP_STATE_MAX; i++)
+ for (i
nt i
= 1; i <= TCP_STATE_MAX; i++)
{
vl.values[0].gauge = pe->count_local[i];
{
vl.values[0].gauge = pe->count_local[i];
@@
-329,7
+329,7
@@
static void conn_submit_port_entry (port_entry_t *pe)
ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%"PRIu16"-remote", pe->port);
ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%"PRIu16"-remote", pe->port);
- for (i = 1; i <= TCP_STATE_MAX; i++)
+ for (i
nt i
= 1; i <= TCP_STATE_MAX; i++)
{
vl.values[0].gauge = pe->count_remote[i];
{
vl.values[0].gauge = pe->count_remote[i];
@@
-344,13
+344,12
@@
static void conn_submit_port_total (void)
{
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
{
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
- int i;
conn_prepare_vl (&vl, values);
sstrncpy (vl.plugin_instance, "all", sizeof (vl.plugin_instance));
conn_prepare_vl (&vl, values);
sstrncpy (vl.plugin_instance, "all", sizeof (vl.plugin_instance));
- for (i = 1; i <= TCP_STATE_MAX; i++)
+ for (i
nt i
= 1; i <= TCP_STATE_MAX; i++)
{
vl.values[0].gauge = count_total[i];
{
vl.values[0].gauge = count_total[i];
@@
-362,12
+361,10
@@
static void conn_submit_port_total (void)
static void conn_submit_all (void)
{
static void conn_submit_all (void)
{
- port_entry_t *pe;
-
if (port_collect_total)
conn_submit_port_total ();
if (port_collect_total)
conn_submit_port_total ();
- for (pe = port_list_head; pe != NULL; pe = pe->next)
+ for (p
ort_entry_t *p
e = port_list_head; pe != NULL; pe = pe->next)
conn_submit_port_entry (pe);
} /* void conn_submit_all */
conn_submit_port_entry (pe);
} /* void conn_submit_all */
@@
-1016,7
+1013,6
@@
static int conn_read (void)
static int conn_read (void)
{
int size;
static int conn_read (void)
{
int size;
- int i;
int nconn;
void *data;
struct netinfo_header *header;
int nconn;
void *data;
struct netinfo_header *header;
@@
-1058,7
+1054,7
@@
static int conn_read (void)
nconn = header->size;
conn = (struct netinfo_conn *)(data + sizeof(struct netinfo_header));
nconn = header->size;
conn = (struct netinfo_conn *)(data + sizeof(struct netinfo_header));
- for (i
=
0; i < nconn; conn++, i++)
+ for (i
nt i =
0; i < nconn; conn++, i++)
{
conn_handle_ports (conn->srcport, conn->dstport, conn->tcp_state);
}
{
conn_handle_ports (conn->srcport, conn->dstport, conn->tcp_state);
}