summaryrefslogtreecommitdiffstats
path: root/LogReceiver/routemanager.cpp
diff options
context:
space:
mode:
authorNiklas2011-09-05 17:04:22 +0200
committerNiklas2011-09-05 17:04:22 +0200
commit5ea57d78c4c42551fcf57d423b13a0897f7db980 (patch)
tree134f4bbfacb52040a75529185f4a959b3d0d23c8 /LogReceiver/routemanager.cpp
parentadded a new container class which holds config informations about an interfac... (diff)
downloadfbgui-5ea57d78c4c42551fcf57d423b13a0897f7db980.tar.gz
fbgui-5ea57d78c4c42551fcf57d423b13a0897f7db980.tar.xz
fbgui-5ea57d78c4c42551fcf57d423b13a0897f7db980.zip
tried to manage cmake but failed. also tried to add the del_route() method of interface.c but failed too. made a static lib of the customdhcpcd files but couldn't change it to a shared lib. (tried to add SHARE to the add_library code but this resulted in an error multiple declarations of main...
Diffstat (limited to 'LogReceiver/routemanager.cpp')
-rw-r--r--LogReceiver/routemanager.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/LogReceiver/routemanager.cpp b/LogReceiver/routemanager.cpp
new file mode 100644
index 0000000..11b9a35
--- /dev/null
+++ b/LogReceiver/routemanager.cpp
@@ -0,0 +1,37 @@
+/*
+ * routemanager.cpp
+ *
+ * Created on: Sep 5, 2011
+ * Author: niklas
+ */
+
+#include <arpa/inet.h>
+
+//#include "interface.h"
+#include "routemanager.h"
+
+routemanager::routemanager() {
+ // TODO Auto-generated constructor stub
+
+}
+
+routemanager::~routemanager() {
+ // TODO Auto-generated destructor stub
+}
+
+void routemanager::addRoute(QString ifname, QString destination, QString netmask, QString gateway, int metric) {
+ //struct in_addr destination, netmask, gateway;
+ //add_route();
+}
+
+void routemanager::delRoute(QString ifname, QString destination, QString netmask, QString gateway, int metric) {
+ struct in_addr ds, nm, gw;
+ ba = ifname.toAscii();
+ const char *in = ba.constData();
+ inet_aton("0.0.0.0", &ds);
+ inet_aton("0.0.0.0", &nm);
+ ba = gateway.toAscii();
+ char * gwaddr = ba.data();
+ inet_aton(gwaddr,&gw);
+ del_route(in, ds, nm, gw, metric);
+}