Browse Source

Adding lightweight option parser

pull/16/head
Meeh 11 years ago
parent
commit
fb16e50c4d
  1. 2
      Makefile
  2. 1
      RouterContext.cpp
  3. 9
      i2p.cpp

2
Makefile

@ -3,7 +3,7 @@ CC = g++
CFLAGS = -g -Wall -std=c++0x CFLAGS = -g -Wall -std=c++0x
OBJECTS = i2p.o base64.o NTCPSession.o RouterInfo.o Transports.o RouterContext.o \ OBJECTS = i2p.o base64.o NTCPSession.o RouterInfo.o Transports.o RouterContext.o \
NetDb.o LeaseSet.o Tunnel.o TunnelEndpoint.o TunnelGateway.o TransitTunnel.o \ NetDb.o LeaseSet.o Tunnel.o TunnelEndpoint.o TunnelGateway.o TransitTunnel.o \
I2NPProtocol.o Log.o Garlic.o HTTPServer.o Streaming.o Identity.o SSU.o I2NPProtocol.o Log.o Garlic.o HTTPServer.o Streaming.o Identity.o SSU.o util.o
INCFLAGS = INCFLAGS =
LDFLAGS = -Wl,-rpath,/usr/local/lib -lcryptopp -lboost_system -lboost_filesystem -lpthread LDFLAGS = -Wl,-rpath,/usr/local/lib -lcryptopp -lboost_system -lboost_filesystem -lpthread
LIBS = LIBS =

1
RouterContext.cpp

@ -3,6 +3,7 @@
#include <cryptopp/dsa.h> #include <cryptopp/dsa.h>
#include "CryptoConst.h" #include "CryptoConst.h"
#include "RouterContext.h" #include "RouterContext.h"
#include "util.h"
namespace i2p namespace i2p
{ {

9
i2p.cpp

@ -10,10 +10,11 @@
#include "Tunnel.h" #include "Tunnel.h"
#include "NetDb.h" #include "NetDb.h"
#include "HTTPServer.h" #include "HTTPServer.h"
#include "util.h"
int main( int, char** ) int main( int argc, char* argv[] )
{ {
i2p::util::ParseArguments(argc,argv);
#ifdef _WIN32 #ifdef _WIN32
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
SetConsoleCP(1251); SetConsoleCP(1251);
@ -21,7 +22,9 @@ int main( int, char** )
setlocale(LC_ALL, "Russian"); setlocale(LC_ALL, "Russian");
#endif #endif
i2p::util::HTTPServer httpServer (7070); int httpport = i2p::util::GetIntArg("--httpport", 7070);
i2p::util::HTTPServer httpServer (httpport);
httpServer.Start (); httpServer.Start ();
i2p::data::netdb.Start (); i2p::data::netdb.Start ();

Loading…
Cancel
Save