Commit Graph

17 Commits (6fa42d3491ba64ffc8f9e5626aa505534a0d911b)

Author SHA1 Message Date
Jiri Benc e804e6f9a0 Common type holding an address
This modifies all transports to use a new common address type, struct
address. This address is stored in a ptp_message for all received messages.

For sending, the "default" address is used with the default sending
functions, transport_send and transport_peer. The default address depends on
the transport; it's supposed to be the multicast address assigned by the
transport specification.

Later, a new transport_sendto function will be implemented that sends to the
address contained in the passed ptp_message.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
2014-04-25 14:28:14 +02:00
Jiri Benc 3d22154299 raw: separate src and dst addresses
In order to be able to convert to a generic address struct, separate source
and destination address into separate fields.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
2014-04-17 06:49:37 +02:00
Jiri Benc 8c02ae53f2 raw: replace hard coded constants by MAC_LEN
Signed-off-by: Jiri Benc <jbenc@redhat.com>
2014-04-17 06:49:37 +02:00
Jiri Benc 8bbebdd381 raw: fix reading of uninitialized memory on recv
When less bytes than the header size is read, do not indicate to the caller
that the read was successful, as the caller would read uninitialized memory.
To achieve that, subtract the header size unconditionally (unless an error
was returned by sk_receive).

In addition, do not check for Ethernet type when full Ethernet header was
not read. This again may lead to reading of uninitialized memory.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
2014-04-10 12:29:26 +02:00
Stephan Gatzka 110849d422 Make functions and structs dealing with string literals const correct.
This allows the compiler to check if someone writes into string
literals.

Signed-off-by: Stephan Gatzka <stephan.gatzka@gmail.com>
2014-02-07 19:41:47 +01:00
Richard Cochran 7b7e046e91 Add an optional extra check on sync and follow up message ordering.
Because of packet reordering that can occur in the network, in the
hardware, or in the networking stack, a follow up message can appear
to arrive in the application before the matching sync message. As this
is a normal occurrence, and the sequenceID message field ensures
proper matching, the ptp4l program accepts out of order packets.

This patch adds an additional check using the software time stamps
from the networking stack to verify that the sync message did arrive
first. This check is only useful if the sequence IDs generated by
the master might possibly be incorrect.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2013-08-29 11:22:25 +02:00
Geoff Salmon d6779889cc raw: implement getting physical and protocol addrs 2013-01-14 19:12:18 +01:00
Richard Cochran 24385005b8 Enumerate the event codes for the transport layer transmission methods.
We add a new event code that indicates a one step event message.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-30 11:34:29 +01:00
Richard Cochran 8dde0d31b6 Pass transport type to time stamping initialization function.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Jiri Benc <jbenc@redhat.com>
2012-10-29 20:06:00 +01:00
Richard Cochran 08bee20be2 raw: accept VLAN tagged packets.
The power profile requires using VLAN priority tagged packets. The tags
may or may not reach the application. This commit adds code to handle the
tags in the case that they do appear.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-21 16:22:18 +02:00
Richard Cochran 1d1a6acdc1 raw: return the length of the PTP message on receive.
The upper layer code will be confused by the extra fourteen byte length
of the Ethernet header.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-10 07:40:21 +02:00
Richard Cochran 7460d2756a Add a configuration option to specify the L2 MAC addresses.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-07-27 22:41:00 +02:00
Richard Cochran 3983406818 raw: Implement the peer transmission option.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-04-05 17:48:59 +02:00
Richard Cochran beb3d5d821 Expand the transport layer interface with a peer transmission method.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-04-05 17:48:59 +02:00
Eliot Blennerhassett 433b6f635e raw: fix filter reject for non 1588 frames
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
2012-03-31 20:30:59 +02:00
Richard Cochran 0ca8143da5 Remove a useless variable from the file descriptor array data type.
It was a cute idea to have the raw Ethernet layer use just one socket,
but it ended up not working on some specific PTP time stamping hardware.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-21 13:55:56 +01:00
Richard Cochran 32d461d4ed Add a transport over raw Ethernet packets.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-18 09:31:21 +01:00