-static const struct tok ts_version_name[] = {
- { ARISTA_TIMESTAMP_64_TAI, "TAI(64-bit)" },
- { ARISTA_TIMESTAMP_64_UTC, "UTC(64-bit)" },
- { ARISTA_TIMESTAMP_48_TAI, "TAI(48-bit)" },
- { ARISTA_TIMESTAMP_48_UTC, "UTC(48-bit)" },
+The Arista timestamp header consists of the following fields:
+1. The Arista ethertype (0xd28b)
+2. A 2-byte subtype field; 0x01 indicates the timestamp header
+3. A 2-byte version field, described below.
+4. A 48-bit or 64-bit timestamp field, depending on the contents of the version field
+
+This header is then followed by the original ethertype and the remainder of the original packet.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| dst mac |
++ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| | |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
+| src mac |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| ethertype 0xd28b | subtype 0x1 |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| version | |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
+| timestamp... |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+The two-byte version value is split into 3 fields:
+1. The timescale in use. Currently assigned values include:
+ 0 = TAI
+ 1 = UTC
+2. The timestamp format and length. Currently assigned values include:
+ 1 = 64-bit timestamp
+ 2 = 48-bit timestamp
+3. The hardware info
+ 0 = R/R2 series
+ 1 = R3 series
+
+ 0 1
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| timescale | format|hw info|
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+See also: https://www.arista.com/assets/data/pdf/Whitepapers/Overview_Arista_Timestamps.pdf
+
+*/
+
+#define ARISTA_SUBTYPE_TIMESTAMP 0x0001
+static const struct tok subtype_str[] = {
+ { ARISTA_SUBTYPE_TIMESTAMP, "Timestamp" },
+ { 0, NULL }
+};
+
+static const struct tok ts_timescale_str[] = {
+ { 0, "TAI" },
+ { 1, "UTC" },
+ { 0, NULL }
+};
+
+#define FORMAT_64BIT 0x1
+#define FORMAT_48BIT 0x2
+static const struct tok ts_format_str[] = {
+ { FORMAT_64BIT, "64-bit" },
+ { FORMAT_48BIT, "48-bit" },
+ { 0, NULL }
+};
+
+static const struct tok hw_info_str[] = {
+ { 0, "R/R2" },
+ { 1, "R3" },