Hi everyone,
I am a new user of IBR-DTN (v 0.10.2) and I would like to know if it is possible to add and delete static routes while the daemon is running (e.g. through API calls) in the same way we can add and delete connections through this api command : "connection <eid> [tcp|udp|file] [add|del] <ip> <port> <global|local>".
Regards, J.
Hello Jawad,
at the moment there is no way to add/remove static routes via the API. But if you like to add this functionality, you should take a look at the file ManagementConnection.cpp [1] and the BundleCore::addRoute() method [2].
Kind regards, Johannes Morgenroth
[1] https://github.com/ibrdtn/ibrdtn/blob/master/ibrdtn/daemon/src/api/Managemen... [2] https://github.com/ibrdtn/ibrdtn/blob/master/ibrdtn/daemon/src/core/BundleCo...
Am 09.01.2014 16:43, schrieb Jawad Seddar:
Hi everyone,
I am a new user of IBR-DTN (v 0.10.2) and I would like to know if it is possible to add and delete static routes while the daemon is running (e.g. through API calls) in the same way we can add and delete connections through this api command : "connection <eid> [tcp|udp|file] [add|del] <ip> <port> <global|local>".
Regards, J.
Hello Johannes,
I simply added the following to ManagementConnection.cpp :
if( cmd[0] == "route"){ if(cmd.size() == 4){ if(cmd[1] == "add"){ dtn::core::BundleCore::getInstance().addRoute(cmd[2], cmd[3], 3600); _stream << ClientHandler::API_STATUS_OK << " ROUTE ADDED FOR " << cmd[2] << " THROUGH " << cmd[3] << std::endl; } if(cmd[1] == "del"){ dtn::core::BundleCore::getInstance().removeRoute(cmd[2], cmd[3]); _stream << ClientHandler::API_STATUS_OK << " ROUTE REMOVED FOR " << cmd[2] << " THROUGH " << cmd[3] << std::endl; } } else{ _stream << ClientHandler::API_STATUS_OK << " WRONG NUMBER OF ARGUMENTS" << std::endl; } }
And it seems to be working like a charm simply using "route add dtn://n1.dtn dtn://n2.dtn" or "route del dtn://n1.dtn dtn://n2.dtn"
Thank you for the pointers.
Regards, J.
2014/1/10 Johannes Morgenroth morgenroth@ibr.cs.tu-bs.de
Hello Jawad,
at the moment there is no way to add/remove static routes via the API. But if you like to add this functionality, you should take a look at the file ManagementConnection.cpp [1] and the BundleCore::addRoute() method [2].
Kind regards, Johannes Morgenroth
[1]
https://github.com/ibrdtn/ibrdtn/blob/master/ibrdtn/daemon/src/api/Managemen... [2]
https://github.com/ibrdtn/ibrdtn/blob/master/ibrdtn/daemon/src/core/BundleCo...
Am 09.01.2014 16:43, schrieb Jawad Seddar:
Hi everyone,
I am a new user of IBR-DTN (v 0.10.2) and I would like to know if it is possible to add and delete static routes while the daemon is running (e.g. through API calls) in the same way we can add and delete connections through this api command : "connection <eid> [tcp|udp|file] [add|del] <ip> <port> <global|local>".
Regards, J.
-- !! This message is brought to you via the `ibr-dtn' mailing list. !! Please do not reply to this message to unsubscribe. To unsubscribe or adjust !! your settings, send a mail message to ibr-dtn-request@ibr.cs.tu-bs.de !! or look at https://www.ibr.cs.tu-bs.de/mailman/listinfo/ibr-dtn.
participants (2)
-
Jawad Seddar
-
Johannes Morgenroth