From 3d72cbbc967f46546379ec10cba326c2d1307cec Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 25 Sep 2009 11:58:50 +0200 Subject: [PATCH] openvpn plugin: Use tabs for indentation only. Whitespace-only commit. --- src/openvpn.c | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/src/openvpn.c b/src/openvpn.c index 647c9e13..33c94ed6 100644 --- a/src/openvpn.c +++ b/src/openvpn.c @@ -35,15 +35,15 @@ struct vpn_status_s { - char *file; + char *file; enum { - MULTI1 = 1, /* status-version 1 */ - MULTI2, /* status-version 2 */ - MULTI3, /* status-version 3 */ - SINGLE = 10 /* currently no versions for single mode, maybe in the future */ + MULTI1 = 1, /* status-version 1 */ + MULTI2, /* status-version 2 */ + MULTI3, /* status-version 3 */ + SINGLE = 10 /* currently no versions for single mode, maybe in the future */ } version; - char *name; + char *name; }; typedef struct vpn_status_s vpn_status_t; @@ -60,8 +60,8 @@ static const char *config_keys[] = static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); -/* Helper function */ -/* copy-n-pasted from common.c - changed delim to "," */ +/* Helper function + * copy-n-pasted from common.c - changed delim to "," */ static int openvpn_strsplit (char *string, char **fields, size_t size) { size_t i; @@ -94,8 +94,8 @@ static void iostats_submit (char *name, char *type, counter_t rx, counter_t tx) values[1].counter = tx; /* NOTE: using plugin_instance to identify each vpn config (and - * status) file; using type_instance to identify the endpoint - * host when in multimode, traffic or overhead when in single. + * status) file; using type_instance to identify the endpoint + * host when in multimode, traffic or overhead when in single. */ vl.values = values; @@ -153,7 +153,6 @@ static int single_read (char *name, FILE *fh) overhead_rx = 0; overhead_tx = 0; - while (fgets (buffer, sizeof (buffer), fh) != NULL) { fields_num = openvpn_strsplit (buffer, fields, max_fields); @@ -255,10 +254,10 @@ static int multi1_read (char *name, FILE *fh) if (fields_num < 4) continue; - iostats_submit (name, /* vpn instance */ - fields[0], /* "Common Name" */ - atoll (fields[2]), /* "Bytes Received" */ - atoll (fields[3])); /* "Bytes Sent" */ + iostats_submit (name, /* vpn instance */ + fields[0], /* "Common Name" */ + atoll (fields[2]), /* "Bytes Received" */ + atoll (fields[3])); /* "Bytes Sent" */ read = 1; } @@ -291,10 +290,10 @@ static int multi2_read (char *name, FILE *fh) { if (strcmp (fields[0], "CLIENT_LIST") == 0) { - iostats_submit (name, /* vpn instance */ - fields[1], /* "Common Name" */ - atoll (fields[4]), /* "Bytes Received" */ - atoll (fields[5])); /* "Bytes Sent" */ + iostats_submit (name, /* vpn instance */ + fields[1], /* "Common Name" */ + atoll (fields[4]), /* "Bytes Received" */ + atoll (fields[5])); /* "Bytes Sent" */ read = 1; } } @@ -329,10 +328,10 @@ static int multi3_read (char *name, FILE *fh) { if (strcmp (fields[0], "CLIENT_LIST") == 0) { - iostats_submit (name, /* vpn instance */ - fields[1], /* "Common Name" */ - atoll (fields[4]), /* "Bytes Received" */ - atoll (fields[5])); /* "Bytes Sent" */ + iostats_submit (name, /* vpn instance */ + fields[1], /* "Common Name" */ + atoll (fields[4]), /* "Bytes Received" */ + atoll (fields[5])); /* "Bytes Sent" */ read = 1; } } @@ -569,7 +568,7 @@ static int openvpn_shutdown (void) void module_register (void) { plugin_register_config ("openvpn", openvpn_config, - config_keys, config_keys_num); + config_keys, config_keys_num); plugin_register_read ("openvpn", openvpn_read); plugin_register_shutdown ("openvpn", openvpn_shutdown); } /* void module_register */ -- 2.11.0