arch-bare-* and lib-bare: network functions now dump if level is 2
Like what I did in two commits ago, now 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, but the time is
not showing the local time, as we miss localtime() and I don't want
to waste time recoding it.
This is an example of a bare-i386 slave requesting its master:
send: TIME: (1363278286 - 0x5141f9ce) 1363278286.52969000
send: ETH: 88f7 (00:25:11:86:1f:d2 -> 01:1b:19:00:00:00)
send: VERSION: 2 (type 1, len 44, domain 0)
send: FLAGS: 0x0002 (correction 0x00000000)
send: PORT: 00-25-11-ff-fe-86-1f-d2-00-01
send: REST: seq 2, ctrl 1, log-interval 127
send: MESSAGE: (E) DELAY_REQ
send: MSG-DELAY_REQ: 1363278286.052689000
send: DUMP: payload (size 44)
send: DUMP: 81 02 00 2c 00 00 02 00 00 00 00 00 00 00 00 00
send: DUMP: 00 00 00 00 00 25 11 ff fe 86 1f d2 00 01 00 02
send: DUMP: 01 7f 00 00 51 41 f9 ce 03 23 f8 68
diag-frames-1-eth0: SENT 44 bytes at 1363278286.052969000 (delay_req)
This is a bare-i386 master receiving the same frame:
recv: TIME: (1363278286 - 0x5141f9ce) 1363278286.92899000
recv: ETH: 88f7 (00:25:11:86:1f:d2 -> 01:1b:19:00:00:00)
recv: VERSION: 2 (type 1, len 44, domain 0)
recv: FLAGS: 0x0002 (correction 0x00000000)
recv: PORT: 00-25-11-ff-fe-86-1f-d2-00-01
recv: REST: seq 2, ctrl 1, log-interval 127
recv: MESSAGE: (E) DELAY_REQ
recv: MSG-DELAY_REQ: 1363278286.052689000
recv: TLV: too short (46 - 44 = 2)
recv: DUMP: payload (size 46)
recv: DUMP: 81 02 00 2c 00 00 02 00 00 00 00 00 00 00 00 00
recv: DUMP: 00 00 00 00 00 25 11 ff fe 86 1f d2 00 01 00 02
recv: DUMP: 01 7f 00 00 51 41 f9 ce 03 23 f8 68 00 00
diag-frames-1-eth0: RECV 46 bytes at 1363278286.092899000 (type 1)
And this is tools/ptprump running on the master, for the same frame:
TIME: (1363278286 - 0x5141f9ce) 17:24:46.092814
ETH: 88f7 (00:25:11:86:1f:d2 -> 01:1b:19:00:00:00)
VERSION: 2 (type 1, len 44, domain 0)
FLAGS: 0x0002 (correction 0x00000000)
PORT: 00-25-11-ff-fe-86-1f-d2-00-01
REST: seq 2, ctrl 1, log-interval 127
MESSAGE: (E) DELAY_REQ
MSG-DELAY_REQ: 1363278286.052689000
TLV: too short (46 - 44 = 2)
DUMP: payload (size 46)
DUMP: 81 02 00 2c 00 00 02 00 00 00 00 00 00 00 00 00
DUMP: 00 00 00 00 00 25 11 ff fe 86 1f d2 00 01 00 02
DUMP: 01 7f 00 00 51 41 f9 ce 03 23 f8 68 00 00
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Showing
Please
register
or
sign in
to comment