pt1588-SH7216 1
IEEE1588v2 Implementation for Renesas SH7216 Demo

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

Define all platform-dependent functions that are required to send and receive PTP messages and record their timestamps. More...

Go to the source code of this file.

Functions

void sendAnnounceMsg (PTPState *ptp)
 Send an Announce message over the network, with content of message as specified in 13.5.
void sendSyncMsg (PTPState *ptp)
 Send a Sync message over the network, with content of message as specified in 13.6.
void sendFollowUpMsg (PTPState *ptp)
 Send a Follow_Up message over the network, with content of message as specified in 13.7.
void sendDelayReqMsg (PTPState *ptp)
 Send a Delay_Req message over the network, with content of message as specified in 13.6.
void sendDelayRespMsg (PTPState *ptp, DelayReqMsg *msg)
 Send a Delay_Resp message over the network, with content of message as specified in 13.8.
void sendManagementMsg (PTPState *ptp, ManagementMsg *msg)
 Send a Management message over the network, with content of message as specified in 15.4.
void getSyncEventEgressTimestamp (PTPState *ptp)
 Set PTPState.syncEventEgressTimestamp to the timestamp at which the latest Sync message was sent.
Boolean getSyncEventIngressTimestamp (PTPState *ptp, UInteger16 seqId)
 Set PTPState.syncEventIngressTimestamp to the timestamp at which the latest Sync message was received.
void getDelayEventEgressTimestamp (PTPState *ptp)
 Set PTPState.delayEventEgressTimestamp to the timestamp at which the latest Delay_Req message was sent.
Boolean getDelayEventIngressTimestamp (PTPState *ptp, UInteger16 seqId)
 Set PTPState.delayEventIngressTimestamp to the timestamp at which the latest Delay_Req message was received.
void readHeader (Header *header)
 Parse received message into provided Header data structure, but do not update PTP state (13.1).
void readAnnounceMsg (AnnounceMsg *msg)
 Parse received Announce message into provided AnnounceMsg data structure, but do not update PTP state (13.5).
void readSyncMsg (SyncMsg *msg)
 Parse received Sync message into provided SyncMsg data structure, but do not update PTP state (13.6).
void readFollowUpMsg (FollowUpMsg *msg)
 Parse received Follow_Up message into provided FollowUpMsg data structure, but do not update PTP state (13.7).
void readDelayReqMsg (DelayReqMsg *msg)
 Parse received Delay_Req message into provided DelayReqMsg data structure, but do not update PTP state (13.6).
void readDelayRespMsg (DelayRespMsg *msg)
 Parse received Delay_Resp message into provided DelayRespMsg data structure, but do not update PTP state (13.8).
void readManagementMsg (ManagementMsg *msg)
 Parse received Management message into provided ManagementMsg data structure, but do not update PTP state (15.1).
void clearIngressTimestamp ()
 Clear receive timestamp.

Detailed Description

Define all platform-dependent functions that are required to send and receive PTP messages and record their timestamps.

The implementation of these functions will depend on how PTP interacts with the communication network and how messages are timestamped.

Author:
Michael Zimmer (mzimmer@eecs.berkeley.edu)
Version:
Id:
ptp-msg.h 51 2011-04-12 01:19:19Z mzimmer

Definition in file ptp-msg.h.


Function Documentation

void clearIngressTimestamp ( )

Clear receive timestamp.

Clear receive timestamp.

Nothing is done because it is assumed that messages are received in the same order in software that they are timestamped in hardware, so ingressTimestamp is overwritten when the next message is processed.

Definition at line 639 of file ptp-msg.c.

void getDelayEventEgressTimestamp ( PTPState ptp)

Set PTPState.delayEventEgressTimestamp to the timestamp at which the latest Delay_Req message was sent.

Parameters:
[in,out]ptpThe current state of PTP.

Definition at line 421 of file ptp-msg.c.

Boolean getDelayEventIngressTimestamp ( PTPState ptp,
UInteger16  seqId 
)

Set PTPState.delayEventIngressTimestamp to the timestamp at which the latest Delay_Req message was received.

Parameters:
[in,out]ptpThe current state of PTP.
[in]seqIdThe sequence Id of the Sync message received.

Definition at line 452 of file ptp-msg.c.

void getSyncEventEgressTimestamp ( PTPState ptp)

Set PTPState.syncEventEgressTimestamp to the timestamp at which the latest Sync message was sent.

Parameters:
[in,out]ptpThe current state of PTP.

Definition at line 347 of file ptp-msg.c.

Boolean getSyncEventIngressTimestamp ( PTPState ptp,
UInteger16  seqId 
)

Set PTPState.syncEventIngressTimestamp to the timestamp at which the latest Sync message was received.

Parameters:
[in,out]ptpThe current state of PTP.
[in]seqIdThe sequence Id of the Sync message received.

Definition at line 380 of file ptp-msg.c.

void readAnnounceMsg ( AnnounceMsg msg)

Parse received Announce message into provided AnnounceMsg data structure, but do not update PTP state (13.5).

Parameters:
[out]msgThe destination for content from Announce message.

Definition at line 520 of file ptp-msg.c.

void readDelayReqMsg ( DelayReqMsg msg)

Parse received Delay_Req message into provided DelayReqMsg data structure, but do not update PTP state (13.6).

Parameters:
[out]msgThe destination for content from Delay_Req message.

Definition at line 577 of file ptp-msg.c.

void readDelayRespMsg ( DelayRespMsg msg)

Parse received Delay_Resp message into provided DelayRespMsg data structure, but do not update PTP state (13.8).

Parameters:
[out]msgThe destination for content from Delay_Resp message.

Definition at line 593 of file ptp-msg.c.

void readFollowUpMsg ( FollowUpMsg msg)

Parse received Follow_Up message into provided FollowUpMsg data structure, but do not update PTP state (13.7).

Parameters:
[out]msgThe destination for content from Follow_Up message.

Definition at line 561 of file ptp-msg.c.

void readHeader ( Header header)

Parse received message into provided Header data structure, but do not update PTP state (13.1).

Parameters:
[out]headerThe destination for header content from message.

Definition at line 495 of file ptp-msg.c.

void readManagementMsg ( ManagementMsg msg)

Parse received Management message into provided ManagementMsg data structure, but do not update PTP state (15.1).

Parameters:
[out]msgThe destination for content from Management message.

Definition at line 611 of file ptp-msg.c.

void readSyncMsg ( SyncMsg msg)

Parse received Sync message into provided SyncMsg data structure, but do not update PTP state (13.6).

Parameters:
[out]msgThe destination for content from Sync message.

Definition at line 545 of file ptp-msg.c.

void sendAnnounceMsg ( PTPState ptp)

Send an Announce message over the network, with content of message as specified in 13.5.

Parameters:
[in,out]ptpThe current state of PTP.

Send an Announce message over the network, with content of message as specified in 13.5.

This implementation uses current data from the PTPState ptp and the current time to fill the buffer location uip_appdata with the Announce message. Once the message is correctly in the buffer, the uIP protocol stack is called to send the message.

Definition at line 81 of file ptp-msg.c.

void sendDelayReqMsg ( PTPState ptp)

Send a Delay_Req message over the network, with content of message as specified in 13.6.

Parameters:
[in,out]ptpThe current state of PTP.

Send a Delay_Req message over the network, with content of message as specified in 13.6.

This implementation uses current data from the PTPState ptp to fill the buffer location uip_appdata with the Delay_Req message. Once the message is correctly in the buffer, the uIP protocol stack is called to send the message.

Definition at line 224 of file ptp-msg.c.

void sendDelayRespMsg ( PTPState ptp,
DelayReqMsg msg 
)

Send a Delay_Resp message over the network, with content of message as specified in 13.8.

Parameters:
[in,out]ptpThe current state of PTP.
[in]msgThe Delay_Req message that is being responded to.

Send a Delay_Resp message over the network, with content of message as specified in 13.8.

This implementation uses current data from the PTPState ptp and the DelayReqMsg msg for which this message is a response to fill the buffer location uip_appdata with the Delay_Resp message. Once the message is correctly in the buffer, the uIP protocol stack is called to send the message.

Definition at line 264 of file ptp-msg.c.

void sendFollowUpMsg ( PTPState ptp)

Send a Follow_Up message over the network, with content of message as specified in 13.7.

Parameters:
[in,out]ptpThe current state of PTP.

Send a Follow_Up message over the network, with content of message as specified in 13.7.

This implementation uses current data from the PTPState ptp to fill the buffer location uip_appdata with the Follow_Up message. Once the message is correctly in the buffer, the uIP protocol stack is called to send the message.

Definition at line 188 of file ptp-msg.c.

void sendManagementMsg ( PTPState ptp,
ManagementMsg msg 
)

Send a Management message over the network, with content of message as specified in 15.4.

Parameters:
[in,out]ptpThe current state of PTP.
[in]msgThe Management message being sent.

Send a Management message over the network, with content of message as specified in 15.4.

This implementation uses current data from the PTPState ptp and the ManagementMsg msg which is being sent to fill the buffer location uip_appdata with the Management message. Once the message is correctly in the buffer, the uIP protocol stack is called to send the message.

Definition at line 304 of file ptp-msg.c.

void sendSyncMsg ( PTPState ptp)

Send a Sync message over the network, with content of message as specified in 13.6.

Parameters:
[in,out]ptpThe current state of PTP.

Send a Sync message over the network, with content of message as specified in 13.6.

This implementation uses current data from the PTPState ptp and the current time to fill the buffer location uip_appdata with the Sync message. Once the message is correctly in the buffer, the uIP protocol stack is called to send the message.

Definition at line 140 of file ptp-msg.c.

 All Data Structures Files Functions Variables Typedefs Enumerator Defines