(self, ip, **kargs)
return g
Tries to graph the timeskew between the timestamps and real time for a given ip
Tries to graph the timeskew between the timestamps and real time for a given ip
Tries to graph the timeskew between the timestamps and real time for a given ip
def _packetlist_timeskew_graph(self, ip, **kargs):
    """Tries to graph the timeskew between the timestamps and real time for a given ip"""
    res = map(lambda x: self._elt2pkt(x), self.res)
    b = filter(lambda x:x.haslayer(IP) and x.getlayer(IP).src == ip and x.haslayer(TCP), res)
    c = []
    for p in b:
        opts = p.getlayer(TCP).options
        for o in opts:
            if o[0] == "Timestamp":
                c.append((p.time,o[1][0]))
    if not c:
        warning("No timestamps found in packet list")
        return
    d = map(lambda (x,y): (x%2000,((x-c[0][0])-((y-c[0][1])/1000.0))),c)
    g = Gnuplot.Gnuplot()
    g.plot(Gnuplot.Data(d,**kargs))
    return g
def _packetlist_timeskew_graph ( self , ip , * * kargs ) : res = map ( lambda x : self . _elt2pkt ( x ) , self . res ) b = filter ( lambda x : x . haslayer ( IP ) and x . getlayer ( IP ) . src == ip and x . haslayer ( TCP ) , res ) c = [ ] for p in b : opts = p . getlayer ( TCP ) . options for o in opts : if o [ 0 ] == "Timestamp" : c . append ( ( p . time , o [ 1 ] [ 0 ] ) ) if not c : warning ( "No timestamps found in packet list" ) return d = map ( lambda ( x , y ) : ( x % 2000 , ( ( x - c [ 0 ] [ 0 ] ) - ( ( y - c [ 0 ] [ 1 ] ) / 1000.0 ) ) ) , c ) g = Gnuplot . Gnuplot ( ) g . plot ( Gnuplot . Data ( d , * * kargs ) ) return g