def __repr__(self):
     rt = "Network         Netmask         Gateway         Iface           Output IP\n"
     for net,msk,gw,iface,addr in self.routes:
         rt += "%-15s %-15s %-15s %-15s %-15s\n" % (ltoa(net),
                                           ltoa(msk),
                                           gw,
                                           iface,
                                           addr)
     return rt
 def get_if_bcast(self, iff):
     for net, msk, gw, iface, addr in self.routes:
         if (iff == iface and net != 0L):
             bcast = atol(addr) | (~msk & 0xffffffffL)
             # FIXME: check error in atol()
             return ltoa(bcast)
     warning("No broadcast address found for iface %s\n" % iff)
Beispiel #3
0
 def get_if_bcast(self, iff):
     for net, msk, gw, iface, addr in self.routes:
         if (iff == iface and net != 0L):
             bcast = atol(addr) | (~msk & 0xffffffffL)
             # FIXME: check error in atol()
             return ltoa(bcast)
     warning("No broadcast address found for iface %s\n" % iff)