pt1588-SH7216 1
IEEE1588v2 Implementation for Renesas SH7216 Demo

C:/Users/mzimmer/IEEE1588/pt1588/branches/pt1588-SH7216/pt1588/platform/ptp-msg.c

Go to the documentation of this file.
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 
00030 #include "../ptp-protocol.h"
00031 #include "DP83640.h"
00032 #include "uip.h"
00033  
00034 extern struct uip_udp_conn * ptp_event_conn; 
00036 extern struct uip_udp_conn * ptp_general_conn; 
00039 // These macro's are implementation specific (depending on endianness of 
00040 // processor)
00041 // PTP packets are big-endian.
00042 #define set08(x,y) (*(x) = (y)) 
00045 #define set16(x,y) (*(x) = ((y) >> 8), *((x) + 1) = (y)) 
00048 #define set32(x,y) (*(x) = ((y) >> 24), *((x) + 1) = ((y) >> 16), \
00049     *((x) + 2) = ((y) >> 8), *((x) + 3) = (y)) 
00052 #define set64(x,y) (memcpy((x), &(y), 8)) 
00055 #define get4h(x,y) ((x) = (*(y) >> 4) & 0x0F) 
00058 #define get4l(x,y) ((x) = (*(y)) & 0x0F) 
00061 #define get08(x,y) ((x) = *(y)) 
00064 #define get16(x,y) (memcpy(&(x), (y), 2))  
00067 #define get32(x,y) (memcpy(&(x), (y), 4))  
00070 #define get64(x,y) (memcpy(&(x), (y), 8)) 
00080 void sendAnnounceMsg(PTPState *ptp)
00081 {
00082     
00083     UInteger8 *buf;
00084     Timestamp timestamp;
00085 
00086     buf = (UInteger8 *)uip_appdata;
00087     getClock(&timestamp);
00088     
00089     // Increment sequence Id.
00090     ptp->sequenceIdAnnounce++;
00091     
00092     // Message header (13.3.1).
00093     set08(buf + 0, (TRANSPORTSPECIFIC << 4) | ANNOUNCE);
00094     set08(buf + 1, VERSIONPTP);
00095     set16(buf + 2, MESSAGELENGTH_ANNOUNCE);
00096     set08(buf + 4, ptp->defaultDS.domainNumber);
00097     set08(buf + 6, (UNICASTFLAG << 2) | ALTERNATEMASTERFLAG);
00098     set08(buf + 7, ptp->timePropertiesDS.leap61 |
00099                   (ptp->timePropertiesDS.leap59 << 1) |
00100                   (ptp->timePropertiesDS.currentUtcOffsetValid << 2) |
00101                   (ptp->timePropertiesDS.ptpTimescale << 3) |
00102                   (ptp->timePropertiesDS.timeTraceable << 4) |
00103                   (ptp->timePropertiesDS.frequencyTraceable << 5));
00104     memset(buf + 8, 0, 8);
00105     memcpy(buf + 20, ptp->portDS.portIdentity.clockIdentity, 8);
00106     
00107     set16(buf + 28, ptp->portDS.portIdentity.portNumber);
00108     set16(buf + 30, ptp->sequenceIdAnnounce);
00109     set08(buf + 32, CONTROLFIELD_ALL_OTHERS);
00110     set08(buf + 33, ptp->portDS.logAnnounceInterval);
00111 
00112     // Announce message fields (13.5).
00113     set16(buf + 34, timestamp.secondsField.msb);
00114     set32(buf + 36, timestamp.secondsField.lsb);
00115     set32(buf + 40, timestamp.nanosecondsField);
00116     set16(buf + 44, ptp->timePropertiesDS.currentUtcOffset);
00117     set08(buf + 47, ptp->parentDS.priority1);
00118     set08(buf + 48, ptp->parentDS.grandmasterClockQuality.clockClass);
00119     set08(buf + 49, ptp->parentDS.grandmasterClockQuality.clockAccuracy);
00120     set16(buf + 50, 
00121           ptp->parentDS.grandmasterClockQuality.offsetScaledLogVariance);
00122     set08(buf + 52, ptp->parentDS.priority2);
00123     memcpy(buf + 53, ptp->parentDS.grandmasterIdentity, 8);
00124     set16(buf + 61, ptp->currentDS.stepsRemoved);
00125     set08(buf + 63, ptp->timePropertiesDS.timeSource);
00126 
00127     // Send Announce message.
00128     uip_udp_conn = ptp_general_conn;
00129     uip_udp_send(MESSAGELENGTH_ANNOUNCE);
00130     
00131 }
00132 
00139 void sendSyncMsg(PTPState *ptp)
00140 {
00141     
00142     UInteger8 *buf;
00143     Timestamp timestamp;
00144 
00145     buf = (UInteger8 *)uip_appdata;
00146 
00147     // Increment sequence Id.
00148     ptp->sequenceIdSync++;
00149 
00150     // Message header (13.3.1).
00151     set08(buf + 0, (TRANSPORTSPECIFIC << 4) | SYNC);
00152     set08(buf + 1, VERSIONPTP);
00153     set16(buf + 2, MESSAGELENGTH_SYNC);
00154     set08(buf + 4, ptp->defaultDS.domainNumber);
00155     set08(buf + 6, (UNICASTFLAG << 2) | (TWOSTEPFLAG << 1) | 
00156                    ALTERNATEMASTERFLAG);
00157     memset(buf + 8, 0, 8); 
00158     memcpy(buf + 20, ptp->portDS.portIdentity.clockIdentity, 8);
00159     set16(buf + 28, ptp->portDS.portIdentity.portNumber);
00160     set16(buf + 30, ptp->sequenceIdSync);
00161     set08(buf + 32, CONTROLFIELD_SYNC);
00162     set08(buf + 33, ptp->portDS.logSyncInterval);
00163 
00164     // Sync message fields. (13.6)
00165     if(ptp->defaultDS.twoStepFlag == TRUE) {
00166         getClock(&timestamp);    
00167         set16(buf + 34, timestamp.secondsField.msb);
00168         set32(buf + 36, timestamp.secondsField.lsb);
00169         set32(buf + 40, timestamp.nanosecondsField);  
00170     }  
00171     else {
00172         memset((buf + 34), 0, 10); // DP83640 will fill this packet.   
00173     }
00174 
00175     // Send Sync message.
00176     uip_udp_conn = ptp_event_conn;
00177     uip_udp_send(MESSAGELENGTH_SYNC);
00178 
00179 }
00180 
00187 void sendFollowUpMsg(PTPState *ptp)
00188 {
00189 
00190     UInteger8 *buf;
00191     buf = (UInteger8 *)uip_appdata;
00192 
00193     // Message header (13.3.1).
00194     set08(buf + 0, (TRANSPORTSPECIFIC << 4) | FOLLOW_UP);
00195     set08(buf + 1, VERSIONPTP);
00196     set16(buf + 2, MESSAGELENGTH_FOLLOW_UP);
00197     set08(buf + 4, ptp->defaultDS.domainNumber);
00198     set08(buf + 6, (UNICASTFLAG << 2) | ALTERNATEMASTERFLAG);
00199     memset(buf + 8, 0, 8); 
00200     memcpy(buf + 20, ptp->portDS.portIdentity.clockIdentity, 8);
00201     set16(buf + 28, ptp->portDS.portIdentity.portNumber);
00202     set16(buf + 30, ptp->sequenceIdSync);
00203     set08(buf + 32, CONTROLFIELD_FOLLOW_UP);
00204     set08(buf + 33, 0);
00205 
00206     // Follow_Up message fields. (13.7)
00207     set16(buf + 34, ptp->syncEventEgressTimestamp.secondsField.msb);
00208     set32(buf + 36, ptp->syncEventEgressTimestamp.secondsField.lsb);
00209     set32(buf + 40, ptp->syncEventEgressTimestamp.nanosecondsField);    
00210 
00211     // Send Follow_Up message.
00212     uip_udp_conn = ptp_general_conn;
00213     uip_udp_send(MESSAGELENGTH_FOLLOW_UP);
00214     
00215 }
00216 
00223 void sendDelayReqMsg(PTPState *ptp)
00224 {
00225 
00226     UInteger8 *buf;
00227     Integer64 c = -DELAY_ASYMMETRY;
00228 
00229     buf = (UInteger8 *)uip_appdata;
00230 
00231     // Increment sequence Id.
00232     ptp->sequenceIdDelayReq++;
00233 
00234     // Message header (13.3.1).
00235     set08(buf + 0, (TRANSPORTSPECIFIC << 4) | DELAY_REQ);
00236     set08(buf + 1, VERSIONPTP);
00237     set16(buf + 2, MESSAGELENGTH_DELAY_REQ);
00238     set08(buf + 4, ptp->defaultDS.domainNumber);
00239     set08(buf + 6, (UNICASTFLAG << 2));
00240     set64(buf + 8, c);
00241     memcpy(buf + 20, ptp->portDS.portIdentity.clockIdentity, 8);
00242     set16(buf + 28, ptp->portDS.portIdentity.portNumber);
00243     set16(buf + 30, ptp->sequenceIdDelayReq);
00244     set08(buf + 32, CONTROLFIELD_DELAY_REQ);
00245     set08(buf + 33, 0x7F);
00246     
00247     // Delay_Req message fields. (13.6)
00248     memset((buf + 34), 0, 10); 
00249     
00250     // Send Delay_Req message.
00251     uip_udp_conn = ptp_event_conn;
00252     uip_udp_send(MESSAGELENGTH_DELAY_REQ);
00253 
00254 }
00255 
00263 void sendDelayRespMsg(PTPState *ptp, DelayReqMsg *msg)
00264 {
00265 
00266     UInteger8 *buf;
00267 
00268     buf = (UInteger8 *)uip_appdata;
00269 
00270     // Message header (13.3.1).
00271     set08(buf + 0, (TRANSPORTSPECIFIC << 4) | DELAY_RESP);
00272     set08(buf + 1, VERSIONPTP);
00273     set16(buf + 2, MESSAGELENGTH_DELAY_RESP);
00274     set08(buf + 4, ptp->defaultDS.domainNumber);
00275     set08(buf + 6, (UNICASTFLAG << 2) | ALTERNATEMASTERFLAG);
00276     set64(buf + 8, msg->header.correctionField);
00277     memcpy(buf + 20, ptp->portDS.portIdentity.clockIdentity, 8);
00278     set16(buf + 28, ptp->portDS.portIdentity.portNumber);
00279     set16(buf + 30, msg->header.sequenceId);
00280     set08(buf + 32, CONTROLFIELD_DELAY_RESP);
00281     set08(buf + 33, ptp->portDS.logMinDelayReqInterval);
00282 
00283     // Delay_Req message fields. (13.8)
00284     set16(buf + 34, ptp->delayEventIngressTimestamp.secondsField.msb);
00285     set32(buf + 36, ptp->delayEventIngressTimestamp.secondsField.lsb);
00286     set32(buf + 40, ptp->delayEventIngressTimestamp.nanosecondsField);
00287     memcpy(buf + 44, msg->header.sourcePortIdentity.clockIdentity, 8);    
00288     set16(buf + 52, msg->header.sourcePortIdentity.portNumber);
00289 
00290     // Send Delay_Resp message.
00291     uip_udp_conn = ptp_general_conn;
00292     uip_udp_send(MESSAGELENGTH_DELAY_RESP);
00293     
00294 }
00295 
00303 void sendManagementMsg(PTPState *ptp, ManagementMsg *msg)
00304 {
00305     
00306     UInteger8 *buf;
00307 
00308     buf = (UInteger8 *)uip_appdata;
00309 
00310     // Message header (13.3.1).
00311     set08(buf + 0, (TRANSPORTSPECIFIC << 4) | MANAGEMENT);
00312     set08(buf + 1, VERSIONPTP);
00313     set16(buf + 2, (MESSAGELENGTH_MANAGEMENT + 
00314                    msg->managementTLV.dataFieldLength));
00315     set08(buf + 4, msg->header.domainNumber);
00316     set08(buf + 6, (UNICASTFLAG << 2));
00317     set64(buf + 8, msg->header.correctionField);
00318     memcpy(buf + 20, ptp->portDS.portIdentity.clockIdentity, 8);
00319     set16(buf + 28, ptp->portDS.portIdentity.portNumber);
00320     set16(buf + 30, msg->header.sequenceId);
00321     set08(buf + 32, CONTROLFIELD_MANAGEMENT);
00322     set08(buf + 33, 0x7F);    
00323     
00324     // Management message fields (15.4.1).
00325     memcpy(buf + 34, msg->targetPortIdentity.clockIdentity, 8);
00326     set16(buf + 42, msg->targetPortIdentity.portNumber);
00327     set08(buf + 44, msg->startingBoundaryHops);
00328     set08(buf + 45, msg->boundaryHops);
00329     set08(buf + 46, msg->actionField);
00330     
00331     // Management TLV fields (15.5.2).
00332     set16(buf + 48, msg->managementTLV.tlvType);
00333     set16(buf + 50, msg->managementTLV.lengthField);
00334     set16(buf + 52, msg->managementTLV.managementId);
00335     memcpy(buf + 54, msg->managementTLV.dataField, 
00336                      msg->managementTLV.dataFieldLength);
00337     
00338     // Send Management message.
00339     uip_udp_conn = ptp_general_conn;
00340     uip_udp_send(MESSAGELENGTH_MANAGEMENT + msg->managementTLV.dataFieldLength);
00341     
00342 }
00343 
00344 
00346 void getSyncEventEgressTimestamp(PTPState *ptp)
00347 {
00348     
00349     UInteger8 i;
00350     UInteger16 reg;
00351     
00352     // Use latest timestamp in hardware buffer.
00353     _phy_write(PAGE_SEL_REG, PTP_STS_PAGE);
00354     
00355     // Buffer can contain at 4 timestamps.
00356     for(i = 0; i < 4; i++) {
00357     
00358         // Check for timestamp in buffer.
00359         if((_phy_read(PTP_STS_REG) & 0x0800) != 0) {
00360         
00361             // Read timestamp (DP83640, 14.5.9).
00362             reg = _phy_read(PTP_TXTS_REG);
00363             ptp->syncEventEgressTimestamp.nanosecondsField = 
00364                     (reg & 0xFFFF) | (_phy_read(PTP_TXTS_REG) << 16);
00365             reg = _phy_read(PTP_TXTS_REG);
00366             ptp->syncEventEgressTimestamp.secondsField.lsb = 
00367                     (reg & 0xFFFF) | (_phy_read(PTP_TXTS_REG) << 16);
00368             ptp->syncEventEgressTimestamp.secondsField.msb = 0;
00369         
00370         }
00371      
00372     }    
00373 
00374 }
00375 
00376 
00377 
00379 Boolean getSyncEventIngressTimestamp(PTPState *ptp, UInteger16 seqId)
00380 {
00381 
00382     UInteger16 reg;
00383     UInteger8 i;
00384     Timestamp timestamp;
00385 
00386     // Use latest timestamp in buffer.
00387     _phy_write(PAGE_SEL_REG, PTP_STS_PAGE);
00388 
00389     // Buffer could contain at most 4 timestamps.
00390     for(i = 0; i < 4; i++) {
00391 
00392         // Check for timestamp in buffer.
00393         if((_phy_read(PTP_STS_REG) & 0x0400) != 0) {
00394 
00395             // Read timestamp (DP83640, 14.5.10).
00396             reg = _phy_read(PTP_RXTS_REG);
00397             timestamp.nanosecondsField = 
00398                 (0xFFFF & reg) | (_phy_read(PTP_RXTS_REG) << 16);
00399             reg = _phy_read(PTP_RXTS_REG);
00400             timestamp.secondsField.lsb = 
00401                 (0xFFFF & reg) | (_phy_read(PTP_RXTS_REG) << 16);
00402             timestamp.secondsField.msb = 0;
00403             reg = _phy_read(PTP_RXTS_REG);
00404             if(reg == seqId && 
00405                 (_phy_read(PTP_RXTS_REG) >> 12) == SYNC) {
00406                 ptp->syncEventIngressTimestamp = timestamp;
00407                 return TRUE;
00408             }
00409 
00410         }
00411         else {
00412             break;
00413         }
00414     }
00415     return FALSE;
00416     
00417 }
00418 
00420 void getDelayEventEgressTimestamp(PTPState *ptp)
00421 {
00422     
00423     UInteger8 i;
00424     UInteger16 reg;
00425     
00426     // Use latest timestamp in hardware buffer.
00427     _phy_write(PAGE_SEL_REG, PTP_STS_PAGE);
00428     
00429     // Buffer can contain at 4 timestamps.
00430     for(i = 0; i < 4; i++) {
00431     
00432         // Check for timestamp in buffer.
00433         if((_phy_read(PTP_STS_REG) & 0x0800) != 0) {
00434         
00435             // Read timestamp (DP83640, 14.5.9).
00436             reg = _phy_read(PTP_TXTS_REG);
00437             ptp->delayEventEgressTimestamp.nanosecondsField = 
00438                     (reg & 0xFFFF) | (_phy_read(PTP_TXTS_REG) << 16);
00439             reg = _phy_read(PTP_TXTS_REG);
00440             ptp->delayEventEgressTimestamp.secondsField.lsb = 
00441                     (reg & 0xFFFF) | (_phy_read(PTP_TXTS_REG) << 16);
00442             ptp->delayEventEgressTimestamp.secondsField.msb = 0;
00443         
00444         }
00445      
00446     }
00447     
00448 }
00449 
00451 Boolean getDelayEventIngressTimestamp(PTPState *ptp, UInteger16 seqId)
00452 {
00453   
00454     UInteger8 i;
00455     UInteger16 reg;
00456     Timestamp timestamp;
00457     
00458     // Use latest timestamp in buffer.
00459     _phy_write(PAGE_SEL_REG, PTP_STS_PAGE);
00460 
00461     // Buffer could contain at most 4 timestamps.
00462     for(i = 0; i < 4; i++) { 
00463 
00464         // Check for timestamp in buffer.
00465         if((_phy_read(PTP_STS_REG) & 0x0400) != 0) {
00466 
00467             // Read timestamp (DP83640, 14.5.10).
00468             reg = _phy_read(PTP_RXTS_REG);
00469             timestamp.nanosecondsField =
00470                 (0xFFFF & reg) | (_phy_read(PTP_RXTS_REG) << 16);
00471             reg = _phy_read(PTP_RXTS_REG);
00472             timestamp.secondsField.lsb = 
00473                 (0xFFFF & reg) | (_phy_read(PTP_RXTS_REG) << 16);
00474             timestamp.secondsField.msb = 0;
00475             reg = _phy_read(PTP_RXTS_REG);
00476             if(reg == seqId && 
00477                 (_phy_read(PTP_RXTS_REG) >> 12) == DELAY_REQ) {
00478                 ptp->delayEventIngressTimestamp = timestamp;
00479                 return TRUE;
00480             }
00481         }
00482         else {
00483             break;
00484         }
00485     }
00486     return FALSE;
00487 
00488 
00489 }
00490 
00494 void readHeader(Header *header) {
00495 
00496     UInteger8 *buf;
00497 
00498     buf = (UInteger8 *)uip_appdata;
00499     
00500     get4h(header->transportSpecific, buf + 0);
00501     get4l(header->messageType, buf + 0);
00502     get4l(header->versionPTP, buf + 1);
00503     get16(header->messageLength, buf + 2);
00504     get08(header->domainNumber, buf + 4);
00505     get08(header->flagField[0], buf + 6);
00506     get08(header->flagField[1], buf + 7);
00507     get64(header->correctionField, buf + 8);
00508     memcpy(header->sourcePortIdentity.clockIdentity, buf + 20, 8);
00509     get16(header->sourcePortIdentity.portNumber, buf + 28);
00510     get16(header->sequenceId, buf + 30);
00511     get08(header->controlField, buf + 32);
00512     get08(header->logMessageInterval, buf + 33);
00513     
00514 }
00515 
00519 void readAnnounceMsg(AnnounceMsg *msg) {
00520  
00521     UInteger8 *buf;
00522 
00523     buf = (UInteger8 *)uip_appdata;
00524 
00525     readHeader(&msg->header);
00526     get16(msg->originTimestamp.secondsField.msb, buf + 34);
00527     get32(msg->originTimestamp.secondsField.lsb, buf + 36);
00528     get32(msg->originTimestamp.nanosecondsField, buf + 40);
00529     get16(msg->currentUtcOffset, buf + 44);
00530     get08(msg->grandmasterPriority1, buf + 47);
00531     get08(msg->grandmasterClockQuality.clockClass, buf + 48);
00532     get08(msg->grandmasterClockQuality.clockAccuracy, buf + 49);
00533     get16(msg->grandmasterClockQuality.offsetScaledLogVariance, buf + 50);
00534     get08(msg->grandmasterPriority2, buf + 52);
00535     memcpy(msg->grandmasterIdentity, buf + 53, 8);
00536     get16(msg->stepsRemoved, buf + 61);
00537     get08(msg->timeSource, buf + 63);
00538     
00539 }
00540 
00544 void readSyncMsg(SyncMsg *msg){
00545    
00546     UInteger8 *buf;
00547 
00548     buf = (UInteger8 *)uip_appdata;
00549 
00550     readHeader(&msg->header);
00551     get16(msg->originTimestamp.secondsField.msb, buf + 34);
00552     get32(msg->originTimestamp.secondsField.lsb, buf + 36);
00553     get32(msg->originTimestamp.nanosecondsField, buf + 40);
00554     
00555 }
00556 
00560 void readFollowUpMsg(FollowUpMsg *msg) {
00561 
00562     UInteger8 *buf;
00563 
00564     buf = (UInteger8 *)uip_appdata;
00565 
00566     readHeader(&msg->header);
00567     get16(msg->preciseOriginTimestamp.secondsField.msb, buf + 34);
00568     get32(msg->preciseOriginTimestamp.secondsField.lsb, buf + 36);
00569     get32(msg->preciseOriginTimestamp.nanosecondsField, buf + 40);
00570     
00571 }
00572 
00576 void readDelayReqMsg(DelayReqMsg *msg) {
00577 
00578     UInteger8 *buf;
00579 
00580     buf = (UInteger8 *)uip_appdata;
00581 
00582     readHeader(&msg->header);
00583     get16(msg->originTimestamp.secondsField.msb, buf + 34);
00584     get32(msg->originTimestamp.secondsField.lsb, buf + 36);
00585     get32(msg->originTimestamp.nanosecondsField, buf + 40);
00586     
00587 }
00588 
00592 void readDelayRespMsg(DelayRespMsg *msg) {
00593 
00594     UInteger8 *buf;
00595 
00596     buf = (UInteger8 *)uip_appdata;
00597 
00598     readHeader(&msg->header);
00599     get16(msg->receiveTimestamp.secondsField.msb, buf + 34);
00600     get32(msg->receiveTimestamp.secondsField.lsb, buf + 36);
00601     get32(msg->receiveTimestamp.nanosecondsField, buf + 40);
00602     memcpy(msg->requestingPortIdentity.clockIdentity, buf + 44, 8);
00603     get16(msg->requestingPortIdentity.portNumber, buf + 52);
00604     
00605 }
00606 
00610 void readManagementMsg(ManagementMsg *msg) {
00611     
00612     UInteger8 *buf;
00613 
00614     buf = (UInteger8 *)uip_appdata;
00615 
00616     readHeader(&msg->header);
00617     memcpy(msg->targetPortIdentity.clockIdentity, buf + 34, 8);
00618     get16(msg->targetPortIdentity.portNumber, buf + 42);
00619     get08(msg->startingBoundaryHops, buf + 44);
00620     get08(msg->boundaryHops, buf + 45);
00621     get4l(msg->actionField, buf + 46);
00622     get16(msg->managementTLV.tlvType, buf + 48);
00623     get16(msg->managementTLV.lengthField, buf + 50);
00624     get16(msg->managementTLV.managementId, buf + 52);
00625     msg->managementTLV.dataFieldLength = msg->header.messageLength - 
00626                                          MESSAGELENGTH_MANAGEMENT;
00627     memcpy(msg->managementTLV.dataField, buf + 54, 
00628            msg->managementTLV.dataFieldLength);
00629     
00630 }
00631 
00638 void clearIngressTimestamp() {
00639     
00640 }
00641 
00642 
 All Data Structures Files Functions Variables Typedefs Enumerator Defines