2
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
4
* Tomahawk is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
9
* Tomahawk is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
18
#include "portfwd/portfwd.h"
20
int main(int argc, char** argv)
24
printf("Usage: %s <port>\n", argv[0]);
27
int port = atoi(argv[1]);
31
printf("Portfwd.init() failed.\n");
34
printf("External IP: %s\n", pf.external_ip().c_str());
35
printf("LAN IP: %s\n", pf.lan_ip().c_str());
36
printf("Max upstream: %d bps, max downstream: %d bps\n",
37
pf.max_upstream_bps(), pf.max_downstream_bps() );
39
printf("%s\n", ((pf.add( port ))?"Added":"Failed to add") );
41
printf("Any key to exit...\n");
45
printf("%s\n", ((pf.remove( port ))?"Removed.":"Failed to remove") );