[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1 of 6 V1] Add counter files and structs


 include/libssh/counters.h |  63 +++++++++++++++++++++++++++++++++++++++++++++++
 src/counters.c            |  24 +++++++++++++++++
 2 files changed, 87 insertions(+), 0 deletions(-)


# HG changeset patch
# User Audrius Butkevicius <audrius.butkevicius@xxxxxxxxxxxxxxxx>
# Date 1389803754 0
#      Wed Jan 15 16:35:54 2014 +0000
# Node ID 176b813f886518aab651c08375d8877a34ae14fb
# Parent  1b19b15ea250610c4fde53c43dfe248ab36d1cbb
Add counter files and structs

diff --git a/include/libssh/counters.h b/include/libssh/counters.h
new file mode 100644
--- /dev/null
+++ b/include/libssh/counters.h
@@ -0,0 +1,63 @@
+/*
+ * This file is part of the SSH Library
+ *
+ * Copyright (c) 2009 by Aris Adamantiadis
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/* counters.h
+ * This file includes the public declarations for the libssh counter mechanisms
+ */
+
+#ifndef _SSH_COUNTERS_H_
+#define _SSH_COUNTERS_H_
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup libssh_counters The libssh counters
+ * @ingroup libssh
+ *
+ * Counters which can be used in libssh.
+ *
+ * @{
+ */
+
+struct ssh_bytes_counter_struct {
+    uint64_t in_bytes;
+    uint64_t out_bytes;
+};
+
+typedef struct ssh_bytes_counter_struct *ssh_bytes_counter;
+
+struct ssh_packet_counter_struct {
+    uint64_t in_packets;
+    uint64_t out_packets;
+};
+
+typedef struct ssh_packet_counter_struct *ssh_packet_counter;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SSH_COUNTERS_H_ */
diff --git a/src/counters.c b/src/counters.c
new file mode 100644
--- /dev/null
+++ b/src/counters.c
@@ -0,0 +1,24 @@
+/*
+ * counters.c - counter functions
+ *
+ * This file is part of the SSH Library
+ *
+ * Copyright (c) 2009-2013  by Andreas Schneider <asn@xxxxxxxxxxxxxx>
+ *
+ * The SSH Library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * The SSH Library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the SSH Library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+#include "libssh/counters.h"

References:
[PATCH 0 of 6 V1] CountersAudrius Butkevicius <audrius.butkevicius@xxxxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org