summaryrefslogblamecommitdiffstats
path: root/LogReceiver/routemanager.cpp
blob: d3d51392e460e51d650c5b56194d58ce35740840 (plain) (tree)
1
2
3
4
5
6
7
8






                           
 













                                                                                                                
 












                                                                                                                
/*
 * routemanager.cpp
 *
 *  Created on: Sep 5, 2011
 *      Author: niklas
 */


#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);
}