tlv: Update macro definitions.

The 2019 version of 1588 known as v2.1 introduces new TLV type and
management IDs.  This patch adds the new definitions.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2020-04-04 13:03:33 -07:00
parent faea24aa32
commit b4d3b4126f
2 changed files with 44 additions and 3 deletions

28
tlv.c
View File

@ -728,7 +728,7 @@ int tlv_post_recv(struct tlv_extra *extra)
} }
break; break;
case TLV_ALTERNATE_TIME_OFFSET_INDICATOR: case TLV_ALTERNATE_TIME_OFFSET_INDICATOR:
case TLV_AUTHENTICATION: case TLV_AUTHENTICATION_2008:
case TLV_AUTHENTICATION_CHALLENGE: case TLV_AUTHENTICATION_CHALLENGE:
case TLV_SECURITY_ASSOCIATION_UPDATE: case TLV_SECURITY_ASSOCIATION_UPDATE:
case TLV_CUM_FREQ_SCALE_FACTOR_OFFSET: case TLV_CUM_FREQ_SCALE_FACTOR_OFFSET:
@ -737,6 +737,18 @@ int tlv_post_recv(struct tlv_extra *extra)
case TLV_PTPMON_RESP: case TLV_PTPMON_RESP:
result = nsm_resp_post_recv(extra); result = nsm_resp_post_recv(extra);
break; break;
case TLV_ORGANIZATION_EXTENSION_PROPAGATE:
case TLV_ENHANCED_ACCURACY_METRICS:
case TLV_ORGANIZATION_EXTENSION_DO_NOT_PROPAGATE:
case TLV_L1_SYNC:
case TLV_PORT_COMMUNICATION_AVAILABILITY:
case TLV_PROTOCOL_ADDRESS:
case TLV_SLAVE_RX_SYNC_TIMING_DATA:
case TLV_SLAVE_RX_SYNC_COMPUTED_DATA:
case TLV_SLAVE_TX_EVENT_TIMESTAMPS:
case TLV_CUMULATIVE_RATE_RATIO:
case TLV_PAD:
case TLV_AUTHENTICATION:
default: default:
break; break;
} }
@ -773,7 +785,7 @@ void tlv_pre_send(struct TLV *tlv, struct tlv_extra *extra)
break; break;
case TLV_PATH_TRACE: case TLV_PATH_TRACE:
case TLV_ALTERNATE_TIME_OFFSET_INDICATOR: case TLV_ALTERNATE_TIME_OFFSET_INDICATOR:
case TLV_AUTHENTICATION: case TLV_AUTHENTICATION_2008:
case TLV_AUTHENTICATION_CHALLENGE: case TLV_AUTHENTICATION_CHALLENGE:
case TLV_SECURITY_ASSOCIATION_UPDATE: case TLV_SECURITY_ASSOCIATION_UPDATE:
case TLV_CUM_FREQ_SCALE_FACTOR_OFFSET: case TLV_CUM_FREQ_SCALE_FACTOR_OFFSET:
@ -782,6 +794,18 @@ void tlv_pre_send(struct TLV *tlv, struct tlv_extra *extra)
case TLV_PTPMON_RESP: case TLV_PTPMON_RESP:
nsm_resp_pre_send(extra); nsm_resp_pre_send(extra);
break; break;
case TLV_ORGANIZATION_EXTENSION_PROPAGATE:
case TLV_ENHANCED_ACCURACY_METRICS:
case TLV_ORGANIZATION_EXTENSION_DO_NOT_PROPAGATE:
case TLV_L1_SYNC:
case TLV_PORT_COMMUNICATION_AVAILABILITY:
case TLV_PROTOCOL_ADDRESS:
case TLV_SLAVE_RX_SYNC_TIMING_DATA:
case TLV_SLAVE_RX_SYNC_COMPUTED_DATA:
case TLV_SLAVE_TX_EVENT_TIMESTAMPS:
case TLV_CUMULATIVE_RATE_RATIO:
case TLV_PAD:
case TLV_AUTHENTICATION:
default: default:
break; break;
} }

19
tlv.h
View File

@ -35,12 +35,24 @@
#define TLV_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION 0x0007 #define TLV_ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION 0x0007
#define TLV_PATH_TRACE 0x0008 #define TLV_PATH_TRACE 0x0008
#define TLV_ALTERNATE_TIME_OFFSET_INDICATOR 0x0009 #define TLV_ALTERNATE_TIME_OFFSET_INDICATOR 0x0009
#define TLV_AUTHENTICATION 0x2000 #define TLV_AUTHENTICATION_2008 0x2000
#define TLV_AUTHENTICATION_CHALLENGE 0x2001 #define TLV_AUTHENTICATION_CHALLENGE 0x2001
#define TLV_SECURITY_ASSOCIATION_UPDATE 0x2002 #define TLV_SECURITY_ASSOCIATION_UPDATE 0x2002
#define TLV_CUM_FREQ_SCALE_FACTOR_OFFSET 0x2003 #define TLV_CUM_FREQ_SCALE_FACTOR_OFFSET 0x2003
#define TLV_PTPMON_REQ 0x21FE #define TLV_PTPMON_REQ 0x21FE
#define TLV_PTPMON_RESP 0x21FF #define TLV_PTPMON_RESP 0x21FF
#define TLV_ORGANIZATION_EXTENSION_PROPAGATE 0x4000
#define TLV_ENHANCED_ACCURACY_METRICS 0x4001
#define TLV_ORGANIZATION_EXTENSION_DO_NOT_PROPAGATE 0x8000
#define TLV_L1_SYNC 0x8001
#define TLV_PORT_COMMUNICATION_AVAILABILITY 0x8002
#define TLV_PROTOCOL_ADDRESS 0x8003
#define TLV_SLAVE_RX_SYNC_TIMING_DATA 0x8004
#define TLV_SLAVE_RX_SYNC_COMPUTED_DATA 0x8005
#define TLV_SLAVE_TX_EVENT_TIMESTAMPS 0x8006
#define TLV_CUMULATIVE_RATE_RATIO 0x8007
#define TLV_PAD 0x8008
#define TLV_AUTHENTICATION 0x8009
enum management_action { enum management_action {
GET, GET,
@ -79,6 +91,8 @@ enum management_action {
#define TLV_ALTERNATE_TIME_OFFSET_NAME 0x201F #define TLV_ALTERNATE_TIME_OFFSET_NAME 0x201F
#define TLV_ALTERNATE_TIME_OFFSET_MAX_KEY 0x2020 #define TLV_ALTERNATE_TIME_OFFSET_MAX_KEY 0x2020
#define TLV_ALTERNATE_TIME_OFFSET_PROPERTIES 0x2021 #define TLV_ALTERNATE_TIME_OFFSET_PROPERTIES 0x2021
#define TLV_EXTERNAL_PORT_CONFIGURATION_ENABLED 0x3000
#define TLV_HOLDOVER_UPGRADE_ENABLE 0x3002
#define TLV_TRANSPARENT_CLOCK_DEFAULT_DATA_SET 0x4000 #define TLV_TRANSPARENT_CLOCK_DEFAULT_DATA_SET 0x4000
#define TLV_PRIMARY_DOMAIN 0x4002 #define TLV_PRIMARY_DOMAIN 0x4002
#define TLV_TIME_STATUS_NP 0xC000 #define TLV_TIME_STATUS_NP 0xC000
@ -101,6 +115,9 @@ enum management_action {
#define TLV_UNICAST_MASTER_MAX_TABLE_SIZE 0x2019 #define TLV_UNICAST_MASTER_MAX_TABLE_SIZE 0x2019
#define TLV_ACCEPTABLE_MASTER_TABLE_ENABLED 0x201B #define TLV_ACCEPTABLE_MASTER_TABLE_ENABLED 0x201B
#define TLV_ALTERNATE_MASTER 0x201D #define TLV_ALTERNATE_MASTER 0x201D
#define TLV_MASTER_ONLY 0x3001
#define TLV_EXT_PORT_CONFIG_PORT_DATA_SET 0x3003
#define TLV_SLAVE_EVENT_MONITORING 0x3004 // TODO - proposed value, missing in 1588 v2.1
#define TLV_TRANSPARENT_CLOCK_PORT_DATA_SET 0x4001 #define TLV_TRANSPARENT_CLOCK_PORT_DATA_SET 0x4001
#define TLV_DELAY_MECHANISM 0x6000 #define TLV_DELAY_MECHANISM 0x6000
#define TLV_LOG_MIN_PDELAY_REQ_INTERVAL 0x6001 #define TLV_LOG_MIN_PDELAY_REQ_INTERVAL 0x6001