summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 52d020c)
raw | patch | inline | side by side (parent: 52d020c)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 25 Sep 2009 09:58:50 +0000 (11:58 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 1 Dec 2009 10:35:43 +0000 (11:35 +0100) |
Whitespace-only commit.
src/openvpn.c | patch | blob | history |
diff --git a/src/openvpn.c b/src/openvpn.c
index 647c9e134d1fb456a19bef375fb3faeec6f78dc0..33c94ed62f90defc67c558c10696c6a378e2b04a 100644 (file)
--- a/src/openvpn.c
+++ b/src/openvpn.c
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;
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;
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;
overhead_rx = 0;
overhead_tx = 0;
-
while (fgets (buffer, sizeof (buffer), fh) != NULL)
{
fields_num = openvpn_strsplit (buffer, fields, max_fields);
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;
}
{
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;
}
}
{
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;
}
}
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 */