Ejemplo n.º 1
0
 def setDefault(self, gw, dst = "0.0.0.0", mask = "0.0.0.0"):
     # We must delete previous default gateway and route entry set for gateway
     # or we will end up with multiple entries
     self.deleteDefault()
     self.delete(gw)
     try:
         csapi.changeroute(SIOCADDRT, gw, dst, mask)
     except:
         pass
Ejemplo n.º 2
0
    def setDefaultRoute(self, gw, dst="0.0.0.0", mask="0.0.0.0"):
        """ Set the default gateway. To do this we must delete the previous default gateway
            and the route entry set for gw, if any, or we will end up with multiple entries """

        self.delDefaultRoute()
        self.delRoute(gw)
        try:
            csapi.changeroute(self.SIOCADDRT, gw, dst, mask)
        except:
            pass
Ejemplo n.º 3
0
    def setDefaultRoute(self, gw, dst = "0.0.0.0", mask = "0.0.0.0"):
        """ Set the default gateway. To do this we must delete the previous default gateway
            and the route entry set for gw, if any, or we will end up with multiple entries """

        self.delDefaultRoute()
        self.delRoute(gw)
        try:
            csapi.changeroute(self.SIOCADDRT, gw, dst, mask)
        except:
            pass
Ejemplo n.º 4
0
 def delete(self, gw, dst = "0.0.0.0", mask = "0.0.0.0"):
     try:
         csapi.changeroute(SIOCDELRT, gw, dst, mask)
     except:
         pass
Ejemplo n.º 5
0
 def delRoute(self, gw, dst="0.0.0.0", mask="0.0.0.0"):
     """ Delete a route entry from kernel routing table """
     try:
         csapi.changeroute(self.SIOCDELRT, gw, dst, mask)
     except:
         pass
Ejemplo n.º 6
0
 def delRoute(self, gw, dst = "0.0.0.0", mask = "0.0.0.0"):
     """ Delete a route entry from kernel routing table """
     try:
         csapi.changeroute(self.SIOCDELRT, gw, dst, mask)
     except:
         pass