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 []
 first_creation_time = c[0][0]
 first_replied_timestamp = c[0][1]
 def _wrap_data(ts_tuple, wrap_seconds=2000):
  'Wrap the list of tuples.'
  (ct, rt) = ts_tuple
  X = (ct % wrap_seconds)
  Y = ((ct - first_creation_time) - ((rt - first_replied_timestamp) / 1000.0))
  return (X, Y)
 data = map(_wrap_data, c)
 if (kargs == {}):
  kargs = MATPLOTLIB_DEFAULT_PLOT_KARGS
 lines = plt.plot(data, **kargs)
 if (not MATPLOTLIB_INLINED):
  plt.show()
 return lines

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 [ ] first_creation_time = c [ 0 ] [ 0 ] first_replied_timestamp = c [ 0 ] [ 1 ] def _wrap_data ( ts_tuple , wrap_seconds = 2000 ) : ( ct , rt ) = ts_tuple X = ( ct % wrap_seconds ) Y = ( ( ct - first_creation_time ) - ( ( rt - first_replied_timestamp ) / 1000.0 ) ) return ( X , Y ) data = map ( _wrap_data , c ) if ( kargs == { } ) : kargs = MATPLOTLIB_DEFAULT_PLOT_KARGS lines = plt . plot ( data , ** kargs ) if ( not MATPLOTLIB_INLINED ) : plt . show ( ) return lines
tries to graph the timeskew between the timestamps and real time for a given ip .