def BunchRemoveRoute(self, removeRouteMessage, context):
     prefixes = removeRouteMessage.prefix.split(';')
     devices = removeRouteMessage.device.split(';')
     n = len(prefixes)
     ip = IPRoute()
     for i in range(0, n - 1):
         idx = ip.link_lookup(ifname=devices[i])[0]
         ip.route('delete', dst=prefixes[i] + '/128', oif=idx)
     ip.close()
     return parameters_pb2.RmRouteReply(message=str(0))
 def BunchRemoveRoute(self, removeRouteMessage, context):
     prefixes = removeRouteMessage.prefix.split(';')
     devices = removeRouteMessage.device.split(';')
     n = len(prefixes)
     commandToShell = ""
     for i in range(0, n - 1):
         os.popen("ip -6 route del " + prefixes[i] + " dev " + devices[i])
         #call("ip -6 route del "+prefixes[i]+" dev "+devices[i], shell=True)
         #commandToShell += "ip -6 route del "+prefixes[i]+" dev "+devices[i]+";"
     #os.system(commandToShell)
     return parameters_pb2.RmRouteReply(message=str(0))
 def RemoveRoute(self, removeRouteMessage, context):
     ip = IPRoute()
     idx = ip.link_lookup(ifname=removeRouteMessage.device)[0]
     ip.route('delete', dst=removeRouteMessage.prefix + '/128', oif=idx)
     ip.close()
     return parameters_pb2.RmRouteReply(message=str(0))
 def BunchRemoveRoute(self, removeRouteMessage, context):
     return parameters_pb2.RmRouteReply(message=str(0))
 def RemoveRoute(self, removeRouteMessage, context):
     os.popen("ip -6 route del " + removeRouteMessage.prefix + " dev " +
              removeRouteMessage.device)
     #os.system("ip -6 route del "+removeRouteMessage.prefix+" dev "+removeRouteMessage.device)
     return parameters_pb2.RmRouteReply(message=str(0))