pt1588-SH7216 1
IEEE1588v2 Implementation for Renesas SH7216 Demo
|
00001 /* 00002 Copyright (c) 2010-2011 The Regents of the University of California. All rights 00003 reserved. 00004 00005 Permission is hereby granted, without written agreement and without license or 00006 royalty fees, to use, copy, modify, and distribute this software and its 00007 documentation for any purpose, provided that the above copyright notice and the 00008 following two paragraphs appear in all copies of this software. 00009 00010 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR 00011 DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF 00012 THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF 00013 CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00014 00015 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 00016 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00017 A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, 00018 AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, 00019 SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 00020 */ 00021 00033 // Send messages to the network. 00034 00039 void sendAnnounceMsg(PTPState *ptp); 00040 00045 void sendSyncMsg(PTPState *ptp); 00046 00051 void sendFollowUpMsg(PTPState *ptp); 00052 00057 void sendDelayReqMsg(PTPState *ptp); 00058 00064 void sendDelayRespMsg(PTPState *ptp, DelayReqMsg *msg); 00065 00071 void sendManagementMsg(PTPState *ptp, ManagementMsg *msg); 00072 00073 00074 // Get timestamps. 00075 00080 void getSyncEventEgressTimestamp(PTPState *ptp); 00081 00082 00088 Boolean getSyncEventIngressTimestamp(PTPState *ptp, UInteger16 seqId); 00089 00094 void getDelayEventEgressTimestamp(PTPState *ptp); 00095 00101 Boolean getDelayEventIngressTimestamp(PTPState *ptp, UInteger16 seqId); 00102 00103 // Parse received message. 00104 00109 void readHeader(Header *header); 00110 00115 void readAnnounceMsg(AnnounceMsg *msg); 00116 00121 void readSyncMsg(SyncMsg *msg); 00122 00127 void readFollowUpMsg(FollowUpMsg *msg); 00128 00133 void readDelayReqMsg(DelayReqMsg *msg); 00134 00139 void readDelayRespMsg(DelayRespMsg *msg); 00140 00145 void readManagementMsg(ManagementMsg *msg); 00146 00148 void clearIngressTimestamp(); 00149 00150