Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. Re: [PATCH v2] build: Add --disable-stats option (Chris Novakovic)
   2. [PATCH v3] build: Add --disable-stats option (Chris Novakovic)


----------------------------------------------------------------------

Message: 1
Date: Sun, 4 Mar 2018 17:57:33 +0000
From: Chris Novakovic <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH v2] build: Add --disable-stats option
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

On 28/02/18 08:07, Daniel Wagner wrote:
> Though these in-file ifdefs are not okay. Create a new file, e.g.
> nostats.c, which contains the empty implementation of the functions. And
> then include according the configuration either the stats.c or nostats.c
> into the build.
> 
> See how this has been done for WISPR.
> 
> if WISPR
> gweb_sources += gweb/giognutls.h gweb/giognutls.c
> else
> gweb_sources += gweb/giognutls.h gweb/gionotls.c
> endif

Okay, updated patch coming up.



------------------------------

Message: 2
Date: Sun,  4 Mar 2018 17:59:53 +0000
From: Chris Novakovic <[email protected]>
To: [email protected]
Subject: [PATCH v3] build: Add --disable-stats option
Message-ID: <[email protected]>

Generation of interface statistics files can now be controlled at
compile-time using the --{enable,disable}-stats configure options.
Statistics files remain enabled by default.

Based on an idea by Feng Wang <[email protected]>.
---
 Makefile.am   | 17 +++++++++++------
 configure.ac  |  5 +++++
 src/nostats.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 73 insertions(+), 6 deletions(-)
 create mode 100644 src/nostats.c

diff --git a/Makefile.am b/Makefile.am
index 97f1c87d..c94164f7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,6 +43,12 @@ else
 gweb_sources += gweb/giognutls.h gweb/gionotls.c
 endif
 
+if STATS
+stats_sources = src/stats.c
+else
+stats_sources = src/nostats.c
+endif
+
 if BACKTRACE
 backtrace_sources = src/backtrace.c
 endif
@@ -106,9 +112,9 @@ MANUAL_PAGES =
 
 sbin_PROGRAMS = src/connmand src/connmand-wait-online
 
-src_connmand_SOURCES = $(gdhcp_sources) $(gweb_sources) $(backtrace_sources) \
-                       $(builtin_sources) $(shared_sources) src/connman.ver \
-                       src/main.c src/connman.h src/log.c \
+src_connmand_SOURCES = $(gdhcp_sources) $(gweb_sources) $(stats_sources) \
+                       $(backtrace_sources) $(builtin_sources) 
$(shared_sources) \
+                       src/connman.ver src/main.c src/connman.h src/log.c \
                        src/error.c src/plugin.c src/task.c \
                        src/device.c src/network.c src/connection.c \
                        src/manager.c src/service.c \
@@ -120,9 +126,8 @@ src_connmand_SOURCES = $(gdhcp_sources) $(gweb_sources) 
$(backtrace_sources) \
                        src/storage.c src/dbus.c src/config.c \
                        src/technology.c src/counter.c src/ntp.c \
                        src/session.c src/tethering.c src/wpad.c src/wispr.c \
-                       src/stats.c src/6to4.c \
-                       src/ippool.c src/bridge.c src/nat.c src/ipaddress.c \
-                       src/inotify.c src/ipv6pd.c src/peer.c \
+                       src/6to4.c src/ippool.c src/bridge.c src/nat.c \
+                       src/ipaddress.c src/inotify.c src/ipv6pd.c src/peer.c \
                        src/peer_service.c src/machine.c src/util.c
 
 if INTERNAL_DNS_BACKEND
diff --git a/configure.ac b/configure.ac
index 3cdf4b29..c1f037dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -380,6 +380,11 @@ AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
                                        [enable_tools=${enableval}])
 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
 
+AC_ARG_ENABLE(stats, AC_HELP_STRING([--disable-stats],
+                               [disable statistics round robin file 
generation]),
+                                       [enable_stats=${enableval}])
+AM_CONDITIONAL(STATS, test "${enable_stats}" != "no")
+
 if (test "${enable_tools}" != "no"); then
        AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
                                                $PATH:/sbin:/usr/sbin)
diff --git a/src/nostats.c b/src/nostats.c
new file mode 100644
index 00000000..3d0dc793
--- /dev/null
+++ b/src/nostats.c
@@ -0,0 +1,57 @@
+/*
+ *
+ *  Connection Manager
+ *
+ *  Copyright (C) 2018  Chris Novakovic
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+
+#include "connman.h"
+
+int __connman_stats_service_register(struct connman_service *service)
+{
+       return -ENOTSUP;
+}
+
+void __connman_stats_service_unregister(struct connman_service *service)
+{
+}
+
+int  __connman_stats_update(struct connman_service *service,
+                               bool roaming,
+                               struct connman_stats_data *data)
+{
+       return 0;
+}
+
+int __connman_stats_get(struct connman_service *service,
+                               bool roaming,
+                               struct connman_stats_data *data)
+{
+       return 0;
+}
+
+int __connman_stats_init(void)
+{
+       return 0;
+}
+
+void __connman_stats_cleanup(void)
+{
+}
-- 
2.14.1



------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 29, Issue 5
**************************************

Reply via email to