1. 14 Mar, 2013 14 commits
    • 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: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      d924e8b0
    • Alessandro Rubini's avatar
      64946111
    • Alessandro Rubini's avatar
      tools/ptpdump: add "char *prefix" to all functions · 7ce8aecd
      Alessandro Rubini authored
      This is oh so boring, but I need to differentiate send from receive
      when dumping from withing ppsi itself.  This is a long patch that has
      no effect on tools/ptpdump, since it pases the empty string as prefix.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      7ce8aecd
    • Alessandro Rubini's avatar
      toos/ptpdump: code reorganizations · 23976c85
      Alessandro Rubini authored
      This moves some stuff between dump-main.c and dump-funcs.c, preparing
      for dump-funcs to be used within ppsi itself.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      23976c85
    • Alessandro Rubini's avatar
      diag-macrocs: introduce pp_diag_allow, used in fsm.c · 5589514b
      Alessandro Rubini authored
      pp_diag_allow(ppi, thing, level) can be used as a conditional
      to mask off diagnostic prints that cannot be individually
      written as pp_diag()  (this mainly applies to frame dumping, introduced
      in later commits).
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      5589514b
    • Alessandro Rubini's avatar
      tools/ptpdump: bring inter-frame output into main · 07fc9b14
      Alessandro Rubini authored
      Since dump-funcs.c is going to be used within ppsi itself, print the
      empty separating lines, as well as the time difference from the
      previous frame in main, not in dumping functions.
      
      This has no effect on ptpdump itself, it's only a preparation for reuse
      of the code.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      07fc9b14
    • Alessandro Rubini's avatar
      tools/dump-funcs: don't dump pdelay messages if freestanding · f00ec9b4
      Alessandro Rubini authored
      When building freestanding we need to save space. Avoid printing pdelay
      messages that are neither sent nor used if received.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      f00ec9b4
    • Alessandro Rubini's avatar
      msg_unpack_header(): receive packet length too · c5608fbc
      Alessandro Rubini authored
      I'm adding generic dump code to the receive and send code paths,
      so I need the length of the incoming frame when first "unpacking" it,
      to dump the whole frame using code from tools/dump-funcs.c
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      c5608fbc
    • Alessandro Rubini's avatar
      tools: prepare dump-funcs for freestanding compilation · 590c65ec
      Alessandro Rubini authored
      This commit allows dump-funcs.c to be build from a freestanding
      environment. It uses __STDC_HOSTED__ to select what to include,
      and relies on "network_types.h" to fill the gaps. Such header is not
      part of this commit.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      590c65ec
    • Alessandro Rubini's avatar
    • Alessandro Rubini's avatar
      tools: trivial: change -I directive · 194270e5
      Alessandro Rubini authored
      Include <ppsi/ieee1588_types.h> in tools/, like the rest of the code
      does.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      194270e5
    • Alessandro Rubini's avatar
      tools/dump-funcs: make dumpstruct less generic · 9062861f
      Alessandro Rubini authored
      This commit removes the "dest" argument to dumpstruct(), which now
      uses printf() and not fprintf(dest,).  I plan to use these functions
      withing PPSi itself if the "frames" diagnostic level is 2, and I'd
      better avoid to hack around fprintf.
      
      ptpdump is not changed, as it already used dumpstruct() with stdout
      as destination.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      9062861f
    • Alessandro Rubini's avatar
      Makefile: add -fno-common · b31bb242
      Alessandro Rubini authored
      I don't want to declare globals in header files by error (see previous
      commit).  So I'd better use this flag to request "multiple definition"
      errors at build time.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      b31bb242
    • Alessandro Rubini's avatar
      bugfix: ieee1588_types.h: remove unused data · c5c6b8b6
      Alessandro Rubini authored
      In commit 7c14152c I removed some typedef, in my quest for getting rid
      of them.  But I forgot to remove the type name, so we got "TLV" and
      similar global variables in the object files.  This fixes the buglet,
      then I add -fno-common to prevent this for happening againg.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      c5c6b8b6
  2. 12 Mar, 2013 3 commits
  3. 11 Mar, 2013 2 commits
  4. 08 Mar, 2013 11 commits
  5. 07 Mar, 2013 10 commits