1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
14 ******************************************************************************/
15 #ifndef USAGE_STATS_H_
16 #define USAGE_STATS_H_
18 /*****************************************************
20 // include usage_stats.hh before dbgnew.hh!!
21 // XYSender sender; // XYSender is a subclass of Sender
22 // int timeout = 200; // timeout in msec for the data sender thread
23 // UsageData::getInstance().sendDataThreaded("info", timeout, &sender);
26 // for Solaris -lnsl -lsocket -lresolv
27 // for Linux -lpthread -lrt
29 // iodine: use iodine as a library from /etc/dns/iodine/lib/libiodine.a
30 // or via pipe as an outside process
31 // uncomment this and the DNSSender::send function
32 //#include "../etc/dns/iodine/src/iodine.h"
33 *****************************************************/
37 #include "version_internal.h"
43 virtual void send(const char*) = 0;
46 class DNSSender: public Sender {
50 void send(const char*);
53 const char* nameserver;
57 class HttpSender: public Sender {
61 void send(const char*);
67 static UsageData& getInstance()
69 static UsageData instance; // Guaranteed to be destroyed.
70 return instance; // Instantiated on first use.
72 static void sendDataThreaded(std::string msg, Sender* sender);
78 UsageData(UsageData const&); // Don't Implement
79 void operator=(UsageData const&); // Don't implement
81 static void* sendData(void*);
83 static std::string id;
84 static std::string host;
85 static std::string platform;
88 #endif /* USAGE_STATS_H_ */