monitor.hh 1.58 KB
Newer Older
1
/*
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
	Flexisip, a flexible SIP proxy server with media capabilities.
	Copyright (C) 2014  Belledonne Communications SARL.

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU Affero General Public License as
	published by the Free Software Foundation, either version 3 of the
	License, or (at your option) any later version.

	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 Affero General Public License for more details.

	You should have received a copy of the GNU Affero General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 18
*/

19
#pragma once
20 21

#include <string>
22 23 24
#include <flexisip/agent.hh>

namespace flexisip {
25 26

class Monitor {
27
  public:
28
	static void exec(int socket);
29
	static void createAccounts();
30

31
  private:
32
	class Init {
33
	  public:
34 35
		Init();
	};
36 37

	static std::string findLocalAddress(const std::list<std::string> &nodes);
38 39 40 41 42
	static bool isLocalhost(const std::string &host);
	static bool notLocalhost(const std::string &host);
	static std::string md5sum(const std::string &s);
	static std::string generateUsername(const std::string &prefix, const std::string &host);
	static std::string generatePassword(const std::string &host, const std::string &salt);
43
	static std::string findDomain();
44

45 46
	static Init sInit;
	static const std::string SCRIPT_PATH;
47 48
	static const std::string CALLER_PREFIX;
	static const std::string CALLEE_PREFIX;
49
	static const int PASSWORD_CACHE_EXPIRE;
50 51
};

52
}