예제 #1
0
파일: network.py 프로젝트: Tayyib/uludag
 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
예제 #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
예제 #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
예제 #4
0
파일: network.py 프로젝트: Tayyib/uludag
 def delete(self, gw, dst = "0.0.0.0", mask = "0.0.0.0"):
     try:
         csapi.changeroute(SIOCDELRT, gw, dst, mask)
     except:
         pass
예제 #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
예제 #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