From 5ea57d78c4c42551fcf57d423b13a0897f7db980 Mon Sep 17 00:00:00 2001 From: Niklas Date: Mon, 5 Sep 2011 17:04:22 +0200 Subject: 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... --- LogReceiver/routemanager.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 LogReceiver/routemanager.cpp (limited to 'LogReceiver/routemanager.cpp') 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 + +//#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); +} -- cgit v1.2.3-55-g7522