Skip to content
  • Alessandro Rubini's avatar
    arch-gnu-linux: network functions now dump if level is 2 · d924e8b0
    Alessandro Rubini authored
    
    
    If debug level for "frames" is 2 or more, net_ops->send and
    net_ops->recv now dump the data to stdout. The format is the same
    of tools/ptpdump, with "send:" and "recv:" in front. This is an example:
    
      send: TIME: (1363277414 - 0x5141f666) 17:10:14.748281
      send: VERSION: 2 (type 11, len 64, domain 0)
      send: FLAGS: 0x0002 (correction 0x00000000)
      send: PORT: 00-22-15-ff-fe-d7-c0-ef-00-01
      send: REST: seq 9, ctrl 5, log-interval 1
      send: MESSAGE: (G) ANNOUNCE
      send: MSG-ANNOUNCE: stamp 0.000000000
      send: MSG-ANNOUNCE: grandmaster-quality f8-fe-60f0
      send: MSG-ANNOUNCE: grandmaster-prio 248 248
      send: MSG-ANNOUNCE: grandmaster-id 00-22-15-ff-fe-d7-c0-ef
      send: DUMP: payload (size 64)
      send: DUMP: 8b 02 00 40  00 00 02 00  00 00 00 00  00 00 00 00
      send: DUMP: 00 00 00 00  00 22 15 ff  fe d7 c0 ef  00 01 00 09
      send: DUMP: 05 01 00 00  00 00 00 00  00 00 00 00  00 00 11 f8
      send: DUMP: f8 fe f0 60  f8 00 22 15  ff fe d7 c0  ef 00 00 a0
      diag-frames-1-eth0: SENT 64 bytes at 1363277414.748281517 (announce)
    
    And this is the same frame in the other host:
    
      recv: TIME: (1363277414 - 0x5141f666) 17:10:14.691032
      recv: VERSION: 2 (type 11, len 64, domain 0)
      recv: FLAGS: 0x0002 (correction 0x00000000)
      recv: PORT: 00-22-15-ff-fe-d7-c0-ef-00-01
      recv: REST: seq 9, ctrl 5, log-interval 1
      recv: MESSAGE: (G) ANNOUNCE
      recv: MSG-ANNOUNCE: stamp 0.000000000
      recv: MSG-ANNOUNCE: grandmaster-quality f8-fe-60f0
      recv: MSG-ANNOUNCE: grandmaster-prio 248 248
      recv: MSG-ANNOUNCE: grandmaster-id 00-22-15-ff-fe-d7-c0-ef
      recv: DUMP: payload (size 64)
      recv: DUMP: 8b 02 00 40  00 00 02 00  00 00 00 00  00 00 00 00
      recv: DUMP: 00 00 00 00  00 22 15 ff  fe d7 c0 ef  00 01 00 09
      recv: DUMP: 05 01 00 00  00 00 00 00  00 00 00 00  00 00 11 f8
      recv: DUMP: f8 fe f0 60  f8 00 22 15  ff fe d7 c0  ef 00 00 a0
      diag-frames-1-eth0: RECV 64 bytes at 1363277414.691032726 (type b)
    
    This is what I got for the same frame in a ptpdump running in the
    master.
    
      TIME: (1363277414 - 0x5141f666) 17:10:14.748376
      ETH: 0800 (00:22:15:d7:c0:ef -> 01:00:5e:00:01:81)
      IP: 17 (192.168.16.1 -> 224.0.1.129) len 92
      UDP: (320 -> 320) len 72
      VERSION: 2 (type 11, len 64, domain 0)
      FLAGS: 0x0002 (correction 0x00000000)
      PORT: 00-22-15-ff-fe-d7-c0-ef-00-01
      REST: seq 9, ctrl 5, log-interval 1
      MESSAGE: (G) ANNOUNCE
      MSG-ANNOUNCE: stamp 0.000000000
      MSG-ANNOUNCE: grandmaster-quality f8-fe-60f0
      MSG-ANNOUNCE: grandmaster-prio 248 248
      MSG-ANNOUNCE: grandmaster-id 00-22-15-ff-fe-d7-c0-ef
      DUMP: payload (size 64)
      DUMP: 8b 02 00 40  00 00 02 00  00 00 00 00  00 00 00 00
      DUMP: 00 00 00 00  00 22 15 ff  fe d7 c0 ef  00 01 00 09
      DUMP: 05 01 00 00  00 00 00 00  00 00 00 00  00 00 11 f8
      DUMP: f8 fe f0 60  f8 00 22 15  ff fe d7 c0  ef 00 00 a0
    
    Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
    d924e8b0