Initial commit on project bpdyndnsd.
[bpdyndnsd] / src / main.cpp
CommitLineData
4545a371
BS
1
2#ifdef HAVE_CONFIG_H
3#include <config.h>
4#endif
5
6#define VERSION 0
7#define REVISION 1
8#define RELEASE 0
9
10#include <iostream>
11#include <list>
12#include <string>
13
14#include <boost/foreach.hpp>
15
16#include "updater.cpp"
17#include "config.cpp"
18
19#include "service.cpp"
20
21#include "dhs.cpp"
22#include "ods.cpp"
23
24using namespace std;
25
26/**
27 * @brief the main part.
28 * @param argc number of arguments
29 * @param argv command line arguments
30 * @return exit code for the process.
31 */
32int main(int argc, char *argv[])
33{
34 // initialize Config class
35 Config * config = new Config;
36 int ret_val = config->parse_cmd_line(argc,argv);
37 if(ret_val == 1)
38 {
39 config->print_usage();
40 return 0;
41 }
42 else if(ret_val == 2)
43 {
44 ostringstream version_string;
45 version_string << VERSION << "." << REVISION << "." << RELEASE;
46 config->print_version(version_string.str());
47 return 0;
48 }
49
50 // initialize Updater
51
52 Updater * updater = new Updater(config);
53
54 updater->update_services();
55
56 cout << "Hello World" << endl;
57
58 return 0;
59}