3 * Copyright (C) 2010 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 #include "heartbeat.h"
33 int init (char *dev
, unsigned short port
)
35 if (heartbeat_init () == -1)
41 if (packet_init () == -1)
44 if (tunnel_init (port
) == -1)
47 if (sniff_init (dev
) == -1)
50 if (poll_init () == -1)
53 if (signal_init () == -1)
64 if (db_reload () == -1)
67 if (poll_loop () == -1)
70 if (heartbeat_loop () == -1)
77 int main (int argc
, char **argv
)
79 printf ("TUNNEL6 server v%s by ZeXx86\n", DEFAULT_VERSION
);
82 char *dev
= DEFAULT_ETHDEV
;
84 unsigned short port
= DEFAULT_PORT
;
89 port
= (unsigned short) atoi (argv
[2]);
91 printf ("Device: %s\n"
92 "Port: %u\n", dev
, port
);
94 if (init (dev
, port
) == -1)
99 printf ("> tunnel closed\n");
101 db_disconnect_all ();