just to make a commit i removed some newlines... ;) testing the github mail service. it should send mail to linspector-commits@lists.linspector.org on every commit now.
This commit is contained in:
parent
7273c74028
commit
a1ca7da5ad
1 changed files with 1 additions and 4 deletions
|
|
@ -8,7 +8,6 @@ import struct
|
||||||
|
|
||||||
|
|
||||||
class Packet(object):
|
class Packet(object):
|
||||||
|
|
||||||
"""Creates ICMPv4 and v6 packets.
|
"""Creates ICMPv4 and v6 packets.
|
||||||
|
|
||||||
header
|
header
|
||||||
|
|
@ -101,7 +100,6 @@ class Packet(object):
|
||||||
self.type = None
|
self.type = None
|
||||||
self.code = None
|
self.code = None
|
||||||
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<ICMPv%s packet: type = %s, code = %s, data length = %s>" % \
|
return "<ICMPv%s packet: type = %s, code = %s, data length = %s>" % \
|
||||||
(self.version, self.type, self.code, len(self.data))
|
(self.version, self.type, self.code, len(self.data))
|
||||||
|
|
@ -182,6 +180,7 @@ class PingResponse(object):
|
||||||
return "%d bytes from %s: id=%s, seq=%u, rtt=%.3f ms" % \
|
return "%d bytes from %s: id=%s, seq=%u, rtt=%.3f ms" % \
|
||||||
(self.bufferLength, self.address, self.ident, self.seq, self.rtt)
|
(self.bufferLength, self.address, self.ident, self.seq, self.rtt)
|
||||||
|
|
||||||
|
|
||||||
class PingService(Service):
|
class PingService(Service):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(PingService, self).__init__(**kwargs)
|
super(PingService, self).__init__(**kwargs)
|
||||||
|
|
@ -205,7 +204,6 @@ class PingService(Service):
|
||||||
|
|
||||||
base_packet = Packet((8, 0))
|
base_packet = Packet((8, 0))
|
||||||
|
|
||||||
|
|
||||||
seqNum = 0
|
seqNum = 0
|
||||||
## create ping packet
|
## create ping packet
|
||||||
pdata = struct.pack("!HHd", processId, seqNum, time.time())
|
pdata = struct.pack("!HHd", processId, seqNum, time.time())
|
||||||
|
|
@ -246,6 +244,5 @@ class PingService(Service):
|
||||||
task._execute()
|
task._execute()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def create(kwargs):
|
def create(kwargs):
|
||||||
return PingService(**kwargs)
|
return PingService(**kwargs)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue