Пример #1
0
    def __init__(self, interface, super_socket=None, timeout=5):

        abstract.FileDescriptor.__init__(self, reactor)
        if interface == 'auto':
            interface = getDefaultIface()
        if not super_socket and sys.platform == 'darwin':
            super_socket = conf.L3socket(iface=interface, promisc=True, filter='')
        elif not super_socket:
            super_socket = conf.L3socket(iface=interface)

        self.protocols = []
        fdesc._setCloseOnExec(super_socket.ins.fileno())
        self.super_socket = super_socket
Пример #2
0
    def setUp(self, *a, **kw):
        self.destinations = {}

        if self.localOptions:
            for key, value in self.localOptions.items():
                log.debug("setting self.%s = %s" % (key, value))
                setattr(self, key, value)

        self.timeout *= 1000  ## convert to milliseconds

        if not self.interface:
            try:
                iface = net.getDefaultIface()
            except Exception, e:
                log.msg("No network interface specified!")
                log.err(e)
            else:
                log.msg("Using system default interface: %s" % iface)
                self.interface = iface
Пример #3
0
    def setUp(self, *a, **kw):
        self.destinations = {}

        if self.localOptions:
            for key, value in self.localOptions.items():
                log.debug("setting self.%s = %s" % (key, value))
                setattr(self, key, value)

        self.timeout *= 1000  ## convert to milliseconds

        if not self.interface:
            try:
                iface = net.getDefaultIface()
            except Exception, e:
                log.msg("No network interface specified!")
                log.err(e)
            else:
                log.msg("Using system default interface: %s" % iface)
                self.interface = iface