projects
/
anytun.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 0.3.3 - merge fix
[anytun.git]
/
src
/
anytun-config.cpp
diff --git
a/src/anytun-config.cpp
b/src/anytun-config.cpp
index
72e4902
..
d09f1e8
100644
(file)
--- a/
src/anytun-config.cpp
+++ b/
src/anytun-config.cpp
@@
-11,14
+11,15
@@
* tunneling and relaying of packets of any protocol.
*
*
* tunneling and relaying of packets of any protocol.
*
*
- * Copyright (C) 2007-200
8
Othmar Gsenger, Erwin Nindl,
+ * Copyright (C) 2007-200
9
Othmar Gsenger, Erwin Nindl,
* Christian Pointner <satp@wirdorange.org>
*
* This file is part of Anytun.
*
* Anytun is free software: you can redistribute it and/or modify
* Christian Pointner <satp@wirdorange.org>
*
* This file is part of Anytun.
*
* Anytun is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * any later version.
*
* Anytun is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* Anytun is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-87,6
+88,11
@@
void createConnection(const PacketSourceEndpoint & remote_end, ConnectionList &
sem.up();
}
sem.up();
}
+void createConnectionResolver(PacketSourceResolverIt& it, ConnectionList & cl, u_int16_t seqSize, SyncQueue & queue, mux_t mux, Semaphore& sem)
+{
+ createConnection(*it, cl, seqSize, queue, mux, sem);
+}
+
void createConnectionError(const std::exception& e, Semaphore& sem, int& ret)
{
cLog.msg(Log::PRIO_ERROR) << "uncaught runtime error: " << e.what();
void createConnectionError(const std::exception& e, Semaphore& sem, int& ret)
{
cLog.msg(Log::PRIO_ERROR) << "uncaught runtime error: " << e.what();
@@
-98,20
+104,12
@@
int main(int argc, char* argv[])
{
try
{
{
try
{
- bool result = gOpt.parse(argc, argv);
- if(!result) {
- gOpt.printUsage();
+ if(!gOpt.parse(argc, argv))
exit(0);
exit(0);
- }
+
StringList targets = gOpt.getLogTargets();
StringList targets = gOpt.getLogTargets();
- if(targets.empty()) {
- cLog.addTarget("stderr:2");
- }
- else {
- StringList::const_iterator it;
- for(it = targets.begin();it != targets.end(); ++it)
- cLog.addTarget(*it);
- }
+ for(StringList::const_iterator it = targets.begin();it != targets.end(); ++it)
+ cLog.addTarget(*it);
}
catch(syntax_error& e)
{
}
catch(syntax_error& e)
{
@@
-132,7
+130,7
@@
int main(int argc, char* argv[])
UDPPacketSource::proto::endpoint endpoint;
// allow emtpy endpoint!!!
gResolver.resolveUdp(gOpt.getRemoteAddr(), gOpt.getRemotePort(),
UDPPacketSource::proto::endpoint endpoint;
// allow emtpy endpoint!!!
gResolver.resolveUdp(gOpt.getRemoteAddr(), gOpt.getRemotePort(),
- boost::bind(createConnection, _1, boost::ref(cl), gOpt.getSeqWindowSize(), boost::ref(queue), gOpt.getMux(), boost::ref(sem)),
+ boost::bind(createConnection
Resolver
, _1, boost::ref(cl), gOpt.getSeqWindowSize(), boost::ref(queue), gOpt.getMux(), boost::ref(sem)),
boost::bind(createConnectionError, _1, boost::ref(sem), boost::ref(ret)),
gOpt.getResolvAddrType());
sem.down();
boost::bind(createConnectionError, _1, boost::ref(sem), boost::ref(ret)),
gOpt.getResolvAddrType());
sem.down();