pt1588-SH7216 1
IEEE1588v2 Implementation for Renesas SH7216 Demo

C:/Users/mzimmer/IEEE1588/pt1588/branches/pt1588-SH7216/pt1588/ptp-constants.h File Reference

Define the unconfigurable constants and enumerations that are required for the correct operation of PTP. More...

Go to the source code of this file.

Defines

#define VERSIONPTP   2
 Version of PTP (only support for version 2 is currently implemented).
#define UNICASTFLAG   FALSE
 Unicast or multicast flag (only support for multicast is currently implemented) (13.3.2.6).
#define ALTERNATEMASTERFLAG   FALSE
 Alternate master flag (support for alternative masters is currently not implemented) (13.3.2.6).
#define MESSAGELENGTH_ANNOUNCE   64
 Length of an Announce message in number of octets (13.5).
#define MESSAGELENGTH_SYNC   44
 Length of a Sync message in number of octets (13.6).
#define MESSAGELENGTH_FOLLOW_UP   44
 Length of a Follow_Up message in number of octets (13.7).
#define MESSAGELENGTH_DELAY_REQ   44
 Length of a Delay_Req message in number of octets (13.6).
#define MESSAGELENGTH_DELAY_RESP   54
 Length of a Delay_Resp message in number of octets (13.8).
#define MESSAGELENGTH_MANAGEMENT   54
 Length of a Management message in number of octets (ignoring the length of the data field of the TLV) (15.1)
#define FOREIGN_MASTER_TIME_WINDOW   4
 Number of announce intervals that define the duration of the FOREIGN_MASTER_TIME_WINDOW (9.3.2.4.4).
#define FOREIGN_MASTER_THRESHOLD   2
 Number of Announce messages that must be received within the duration of the FOREIGN_MASTER_TIME_WINDOW for the foreign master to be considered in the BMC algorithm (9.3.2.4.4).

Enumerations

enum  {
  INITIALIZING = 1, FAULTY, DISABLED, LISTENING,
  PRE_MASTER, MASTER, PASSIVE, UNCALIBRATED,
  SLAVE
}
 

Enumeration for all possible states of operation of PTP (8.2.5.3.1).

More...
enum  { E2E = 1, P2P = 2, DELAY_DISABLED = 0xFE }
 

Enumeration for the delay mechanisms for computing meanPathDelay (8.2.5.4.4).

More...
enum  {
  SYNC = 0x0, DELAY_REQ, PDELAY_REQ, PDELAY_RESP,
  FOLLOW_UP = 0x8, DELAY_RESP, PDELAY_RESP_FOLLOW_UP, ANNOUNCE,
  SIGNALING, MANAGEMENT
}
 

Enumeration for types of messages (13.3.2.2).

More...
enum  {
  CONTROLFIELD_SYNC = 0x0, CONTROLFIELD_DELAY_REQ, CONTROLFIELD_FOLLOW_UP, CONTROLFIELD_DELAY_RESP,
  CONTROLFIELD_MANAGEMENT, CONTROLFIELD_ALL_OTHERS
}
 

Enumeration for the control field of a message (13.3.2.10).

More...
enum  {
  EVENT_MSG_IN, EVENT_POWERUP, EVENT_INITIALIZE, EVENT_DESIGNATED_ENABLED,
  EVENT_DESIGNATED_DISABLED, EVENT_FAULT_CLEARED, EVENT_FAULT_DETECTED, EVENT_STATE_DECISION_EVENT,
  EVENT_QUALIFICATION_TIMEOUT_EXPIRES, EVENT_ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES, EVENT_SYNCHRONIZATION_FAULT, EVENT_MASTER_CLOCK_SELECTED,
  EVENT_PERIODIC_ANNOUNCE, EVENT_PERIODIC_SYNC, EVENT_DELAY_REQ, EVENT_FOLLOW_UP
}
 

Enumeration for possible states and events of PTP (9.2).

More...
enum  { BMC_MASTER, BMC_SLAVE, BMC_PASSIVE }
 

Enumeration for possible return values from state decision algorithm (9.3.3).

More...
enum  {
  DATA_SET_A, DATA_SET_B, DATA_SET_A_T, DATA_SET_B_T,
  DATA_SET_ERROR_1, DATA_SET_ERROR_2
}
 

Enumeration for possible return values from data set comparision (9.3.4).

More...
enum  {
  STATE_DECISION_CODE_M1, STATE_DECISION_CODE_M2, STATE_DECISION_CODE_M3, STATE_DECISION_CODE_S1,
  STATE_DECISION_CODE_P1, STATE_DECISION_CODE_P2
}
 

Enumeration for possible state decision codes (9.3.5).

More...
enum  { STEP, STEP_2, RATE }
 

Enumeration for types of adjustments made to the slave clock.

More...

Detailed Description

Define the unconfigurable constants and enumerations that are required for the correct operation of PTP.

Author:
Michael Zimmer (mzimmer@eecs.berkeley.edu)
Version:
$Id$

Definition in file ptp-constants.h.


Define Documentation

#define ALTERNATEMASTERFLAG   FALSE

Alternate master flag (support for alternative masters is currently not implemented) (13.3.2.6).

Definition at line 37 of file ptp-constants.h.

#define FOREIGN_MASTER_THRESHOLD   2

Number of Announce messages that must be received within the duration of the FOREIGN_MASTER_TIME_WINDOW for the foreign master to be considered in the BMC algorithm (9.3.2.4.4).

Definition at line 63 of file ptp-constants.h.

#define FOREIGN_MASTER_TIME_WINDOW   4

Number of announce intervals that define the duration of the FOREIGN_MASTER_TIME_WINDOW (9.3.2.4.4).

Definition at line 60 of file ptp-constants.h.

#define MESSAGELENGTH_ANNOUNCE   64

Length of an Announce message in number of octets (13.5).

Definition at line 41 of file ptp-constants.h.

#define MESSAGELENGTH_DELAY_REQ   44

Length of a Delay_Req message in number of octets (13.6).

Definition at line 50 of file ptp-constants.h.

#define MESSAGELENGTH_DELAY_RESP   54

Length of a Delay_Resp message in number of octets (13.8).

Definition at line 53 of file ptp-constants.h.

#define MESSAGELENGTH_FOLLOW_UP   44

Length of a Follow_Up message in number of octets (13.7).

Definition at line 47 of file ptp-constants.h.

#define MESSAGELENGTH_MANAGEMENT   54

Length of a Management message in number of octets (ignoring the length of the data field of the TLV) (15.1)

Definition at line 56 of file ptp-constants.h.

#define MESSAGELENGTH_SYNC   44

Length of a Sync message in number of octets (13.6).

Definition at line 44 of file ptp-constants.h.

#define UNICASTFLAG   FALSE

Unicast or multicast flag (only support for multicast is currently implemented) (13.3.2.6).

Definition at line 34 of file ptp-constants.h.

#define VERSIONPTP   2

Version of PTP (only support for version 2 is currently implemented).

Definition at line 31 of file ptp-constants.h.


Enumeration Type Documentation

anonymous enum

Enumeration for all possible states of operation of PTP (8.2.5.3.1).

Enumerator:
INITIALIZING 
FAULTY 
DISABLED 
LISTENING 
PRE_MASTER 
MASTER 
PASSIVE 
UNCALIBRATED 
SLAVE 

Definition at line 69 of file ptp-constants.h.

anonymous enum

Enumeration for the delay mechanisms for computing meanPathDelay (8.2.5.4.4).

Enumerator:
E2E 
P2P 
DELAY_DISABLED 

Definition at line 84 of file ptp-constants.h.

anonymous enum

Enumeration for types of messages (13.3.2.2).

Enumerator:
SYNC 
DELAY_REQ 
PDELAY_REQ 
PDELAY_RESP 
FOLLOW_UP 
DELAY_RESP 
PDELAY_RESP_FOLLOW_UP 
ANNOUNCE 
SIGNALING 
MANAGEMENT 

Definition at line 91 of file ptp-constants.h.

anonymous enum

Enumeration for the control field of a message (13.3.2.10).

Enumerator:
CONTROLFIELD_SYNC 
CONTROLFIELD_DELAY_REQ 
CONTROLFIELD_FOLLOW_UP 
CONTROLFIELD_DELAY_RESP 
CONTROLFIELD_MANAGEMENT 
CONTROLFIELD_ALL_OTHERS 

Definition at line 105 of file ptp-constants.h.

anonymous enum

Enumeration for possible states and events of PTP (9.2).

Enumerator:
EVENT_MSG_IN 
EVENT_POWERUP 
EVENT_INITIALIZE 
EVENT_DESIGNATED_ENABLED 
EVENT_DESIGNATED_DISABLED 
EVENT_FAULT_CLEARED 
EVENT_FAULT_DETECTED 
EVENT_STATE_DECISION_EVENT 
EVENT_QUALIFICATION_TIMEOUT_EXPIRES 
EVENT_ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES 
EVENT_SYNCHRONIZATION_FAULT 
EVENT_MASTER_CLOCK_SELECTED 
EVENT_PERIODIC_ANNOUNCE 
EVENT_PERIODIC_SYNC 
EVENT_DELAY_REQ 
EVENT_FOLLOW_UP 

Definition at line 115 of file ptp-constants.h.

anonymous enum

Enumeration for possible return values from state decision algorithm (9.3.3).

Enumerator:
BMC_MASTER 
BMC_SLAVE 
BMC_PASSIVE 

Definition at line 137 of file ptp-constants.h.

anonymous enum

Enumeration for possible return values from data set comparision (9.3.4).

Enumerator:
DATA_SET_A 
DATA_SET_B 
DATA_SET_A_T 
DATA_SET_B_T 
DATA_SET_ERROR_1 
DATA_SET_ERROR_2 

Definition at line 146 of file ptp-constants.h.

anonymous enum

Enumeration for possible state decision codes (9.3.5).

Enumerator:
STATE_DECISION_CODE_M1 
STATE_DECISION_CODE_M2 
STATE_DECISION_CODE_M3 
STATE_DECISION_CODE_S1 
STATE_DECISION_CODE_P1 
STATE_DECISION_CODE_P2 

Definition at line 156 of file ptp-constants.h.

anonymous enum

Enumeration for types of adjustments made to the slave clock.

Enumerator:
STEP 
STEP_2 
RATE 

Definition at line 166 of file ptp-constants.h.

 All Data Structures Files Functions Variables Typedefs Enumerator Defines