Commit d60fdeed authored by Alessandro Rubini's avatar Alessandro Rubini

general: kill pp_memcpy

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 1fc12250
...@@ -84,9 +84,6 @@ int posix_adj_freq(Integer32 adj) ...@@ -84,9 +84,6 @@ int posix_adj_freq(Integer32 adj)
void pp_puts(const char *s) void pp_puts(const char *s)
__attribute__((alias("posix_puts"))); __attribute__((alias("posix_puts")));
void *pp_memcpy(void *d, const void *s, int count)
__attribute__((alias("posix_memcpy")));
int pp_memcmp(const void *s1, const void *s2, int count) int pp_memcmp(const void *s1, const void *s2, int count)
__attribute__((alias("posix_memcmp"))); __attribute__((alias("posix_memcmp")));
......
...@@ -305,7 +305,7 @@ int posix_open_ch(struct pp_instance *ppi, char *ifname, int chtype) ...@@ -305,7 +305,7 @@ int posix_open_ch(struct pp_instance *ppi, char *ifname, int chtype)
} }
/* Init General multicast IP address */ /* Init General multicast IP address */
pp_memcpy(addr_str, PP_DEFAULT_DOMAIN_ADDRESS, INET_ADDRSTRLEN); memcpy(addr_str, PP_DEFAULT_DOMAIN_ADDRESS, INET_ADDRSTRLEN);
if (!inet_aton(addr_str, &net_addr)) { if (!inet_aton(addr_str, &net_addr)) {
pp_diag_error_str2(ppi, "inet_aton\n", strerror(errno)); pp_diag_error_str2(ppi, "inet_aton\n", strerror(errno));
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
/* What follow is the old way, being phased out */ /* What follow is the old way, being phased out */
extern void pp_puts(const char *s); extern void pp_puts(const char *s);
extern void *pp_memcpy(void *d, const void *s, int count);
extern int pp_memcmp(const void *s1, const void *s2, int count); extern int pp_memcmp(const void *s1, const void *s2, int count);
extern void *pp_memset(void *s, int c, int count); extern void *pp_memset(void *s, int c, int count);
......
...@@ -57,8 +57,6 @@ char *strcpy(char *dest, const char *src) ...@@ -57,8 +57,6 @@ char *strcpy(char *dest, const char *src)
} }
/* As a first step in removing pp_memset etc, provide aliases */ /* As a first step in removing pp_memset etc, provide aliases */
extern void *pp_memcpy(void *d, const void *s, int count)
__attribute__((alias("memcpy")));
extern int pp_memcmp(const void *s1, const void *s2, int count) extern int pp_memcmp(const void *s1, const void *s2, int count)
__attribute__((alias("memcmp"))); __attribute__((alias("memcmp")));
extern void *pp_memset(void *s, int c, int count) extern void *pp_memset(void *s, int c, int count)
......
...@@ -26,13 +26,13 @@ void m1(struct pp_instance *ppi) ...@@ -26,13 +26,13 @@ void m1(struct pp_instance *ppi)
DSCUR(ppi)->meanPathDelay.seconds = 0; DSCUR(ppi)->meanPathDelay.seconds = 0;
/* Parent data set */ /* Parent data set */
pp_memcpy(DSPAR(ppi)->parentPortIdentity.clockIdentity, memcpy(DSPAR(ppi)->parentPortIdentity.clockIdentity,
DSDEF(ppi)->clockIdentity, PP_CLOCK_IDENTITY_LENGTH); DSDEF(ppi)->clockIdentity, PP_CLOCK_IDENTITY_LENGTH);
DSPAR(ppi)->parentPortIdentity.portNumber = 0; DSPAR(ppi)->parentPortIdentity.portNumber = 0;
DSPAR(ppi)->parentStats = PP_DEFAULT_PARENTS_STATS; DSPAR(ppi)->parentStats = PP_DEFAULT_PARENTS_STATS;
DSPAR(ppi)->observedParentClockPhaseChangeRate = 0; DSPAR(ppi)->observedParentClockPhaseChangeRate = 0;
DSPAR(ppi)->observedParentOffsetScaledLogVariance = 0; DSPAR(ppi)->observedParentOffsetScaledLogVariance = 0;
pp_memcpy(DSPAR(ppi)->grandmasterIdentity, DSDEF(ppi)->clockIdentity, memcpy(DSPAR(ppi)->grandmasterIdentity, DSDEF(ppi)->clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
DSPAR(ppi)->grandmasterClockQuality.clockAccuracy = DSPAR(ppi)->grandmasterClockQuality.clockAccuracy =
DSDEF(ppi)->clockQuality.clockAccuracy; DSDEF(ppi)->clockQuality.clockAccuracy;
...@@ -55,13 +55,13 @@ void s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann) ...@@ -55,13 +55,13 @@ void s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
DSCUR(ppi)->stepsRemoved = ann->stepsRemoved + 1; DSCUR(ppi)->stepsRemoved = ann->stepsRemoved + 1;
/* Parent DS */ /* Parent DS */
pp_memcpy(DSPAR(ppi)->parentPortIdentity.clockIdentity, memcpy(DSPAR(ppi)->parentPortIdentity.clockIdentity,
hdr->sourcePortIdentity.clockIdentity, hdr->sourcePortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
DSPAR(ppi)->parentPortIdentity.portNumber = DSPAR(ppi)->parentPortIdentity.portNumber =
hdr->sourcePortIdentity.portNumber; hdr->sourcePortIdentity.portNumber;
pp_memcpy(DSPAR(ppi)->grandmasterIdentity, memcpy(DSPAR(ppi)->grandmasterIdentity,
ann->grandmasterIdentity, PP_CLOCK_IDENTITY_LENGTH); ann->grandmasterIdentity, PP_CLOCK_IDENTITY_LENGTH);
DSPAR(ppi)->grandmasterClockQuality.clockAccuracy = DSPAR(ppi)->grandmasterClockQuality.clockAccuracy =
...@@ -103,7 +103,7 @@ void s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann) ...@@ -103,7 +103,7 @@ void s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
void copy_d0( struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann) void copy_d0( struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
{ {
ann->grandmasterPriority1 = DSDEF(ppi)->priority1; ann->grandmasterPriority1 = DSDEF(ppi)->priority1;
pp_memcpy(ann->grandmasterIdentity, DSDEF(ppi)->clockIdentity, memcpy(ann->grandmasterIdentity, DSDEF(ppi)->clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
ann->grandmasterClockQuality.clockClass = ann->grandmasterClockQuality.clockClass =
DSDEF(ppi)->clockQuality.clockClass; DSDEF(ppi)->clockQuality.clockClass;
...@@ -113,7 +113,7 @@ void copy_d0( struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann) ...@@ -113,7 +113,7 @@ void copy_d0( struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
DSDEF(ppi)->clockQuality.offsetScaledLogVariance; DSDEF(ppi)->clockQuality.offsetScaledLogVariance;
ann->grandmasterPriority2 = DSDEF(ppi)->priority2; ann->grandmasterPriority2 = DSDEF(ppi)->priority2;
ann->stepsRemoved = 0; ann->stepsRemoved = 0;
pp_memcpy(hdr->sourcePortIdentity.clockIdentity, memcpy(hdr->sourcePortIdentity.clockIdentity,
DSDEF(ppi)->clockIdentity, PP_CLOCK_IDENTITY_LENGTH); DSDEF(ppi)->clockIdentity, PP_CLOCK_IDENTITY_LENGTH);
} }
......
...@@ -132,7 +132,7 @@ void st_com_add_foreign(struct pp_instance *ppi, unsigned char *buf) ...@@ -132,7 +132,7 @@ void st_com_add_foreign(struct pp_instance *ppi, unsigned char *buf)
j = ppi->foreign_record_i; j = ppi->foreign_record_i;
/* Copy new foreign master data set from announce message */ /* Copy new foreign master data set from announce message */
pp_memcpy(ppi->frgn_master[j].port_identity.clockIdentity, memcpy(ppi->frgn_master[j].port_identity.clockIdentity,
hdr->sourcePortIdentity.clockIdentity, hdr->sourcePortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
ppi->frgn_master[j].port_identity.portNumber = ppi->frgn_master[j].port_identity.portNumber =
......
...@@ -90,13 +90,13 @@ void msg_unpack_header(struct pp_instance *ppi, void *buf) ...@@ -90,13 +90,13 @@ void msg_unpack_header(struct pp_instance *ppi, void *buf)
hdr->messageLength = htons(*(UInteger16 *) (buf + 2)); hdr->messageLength = htons(*(UInteger16 *) (buf + 2));
hdr->domainNumber = (*(UInteger8 *) (buf + 4)); hdr->domainNumber = (*(UInteger8 *) (buf + 4));
pp_memcpy(hdr->flagField, (buf + 6), PP_FLAG_FIELD_LENGTH); memcpy(hdr->flagField, (buf + 6), PP_FLAG_FIELD_LENGTH);
pp_memcpy(&hdr->correctionfield.msb, (buf + 8), 4); memcpy(&hdr->correctionfield.msb, (buf + 8), 4);
pp_memcpy(&hdr->correctionfield.lsb, (buf + 12), 4); memcpy(&hdr->correctionfield.lsb, (buf + 12), 4);
hdr->correctionfield.msb = htonl(hdr->correctionfield.msb); hdr->correctionfield.msb = htonl(hdr->correctionfield.msb);
hdr->correctionfield.lsb = htonl(hdr->correctionfield.lsb); hdr->correctionfield.lsb = htonl(hdr->correctionfield.lsb);
pp_memcpy(hdr->sourcePortIdentity.clockIdentity, (buf + 20), memcpy(hdr->sourcePortIdentity.clockIdentity, (buf + 20),
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
hdr->sourcePortIdentity.portNumber = hdr->sourcePortIdentity.portNumber =
htons(*(UInteger16 *) (buf + 28)); htons(*(UInteger16 *) (buf + 28));
...@@ -142,7 +142,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf) ...@@ -142,7 +142,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf)
*(UInteger8 *) (buf + 6) = PP_TWO_STEP_FLAG; *(UInteger8 *) (buf + 6) = PP_TWO_STEP_FLAG;
pp_memset((buf + 8), 0, 8); pp_memset((buf + 8), 0, 8);
pp_memcpy((buf + 20), DSPOR(ppi)->portIdentity.clockIdentity, memcpy((buf + 20), DSPOR(ppi)->portIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 28) = *(UInteger16 *) (buf + 28) =
htons(DSPOR(ppi)->portIdentity.portNumber); htons(DSPOR(ppi)->portIdentity.portNumber);
...@@ -152,7 +152,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf) ...@@ -152,7 +152,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf)
void *msg_copy_header(MsgHeader *dest, MsgHeader *src) void *msg_copy_header(MsgHeader *dest, MsgHeader *src)
{ {
return pp_memcpy(dest, src, sizeof(MsgHeader)); return memcpy(dest, src, sizeof(MsgHeader));
} }
...@@ -224,7 +224,7 @@ int msg_pack_announce(struct pp_instance *ppi) ...@@ -224,7 +224,7 @@ int msg_pack_announce(struct pp_instance *ppi)
*(UInteger16 *) (buf + 50) = *(UInteger16 *) (buf + 50) =
htons(DSDEF(ppi)->clockQuality.offsetScaledLogVariance); htons(DSDEF(ppi)->clockQuality.offsetScaledLogVariance);
*(UInteger8 *) (buf + 52) = DSPAR(ppi)->grandmasterPriority2; *(UInteger8 *) (buf + 52) = DSPAR(ppi)->grandmasterPriority2;
pp_memcpy((buf + 53), DSPAR(ppi)->grandmasterIdentity, memcpy((buf + 53), DSPAR(ppi)->grandmasterIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 61) = htons(DSCUR(ppi)->stepsRemoved); *(UInteger16 *) (buf + 61) = htons(DSCUR(ppi)->stepsRemoved);
*(Enumeration8 *) (buf + 63) = DSPRO(ppi)->timeSource; *(Enumeration8 *) (buf + 63) = DSPRO(ppi)->timeSource;
...@@ -257,7 +257,7 @@ void msg_unpack_announce(void *buf, MsgAnnounce *ann) ...@@ -257,7 +257,7 @@ void msg_unpack_announce(void *buf, MsgAnnounce *ann)
ann->grandmasterClockQuality.offsetScaledLogVariance = ann->grandmasterClockQuality.offsetScaledLogVariance =
htons(*(UInteger16 *) (buf + 50)); htons(*(UInteger16 *) (buf + 50));
ann->grandmasterPriority2 = *(UInteger8 *) (buf + 52); ann->grandmasterPriority2 = *(UInteger8 *) (buf + 52);
pp_memcpy(ann->grandmasterIdentity, (buf + 53), memcpy(ann->grandmasterIdentity, (buf + 53),
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
ann->stepsRemoved = htons(*(UInteger16 *) (buf + 61)); ann->stepsRemoved = htons(*(UInteger16 *) (buf + 61));
ann->timeSource = *(Enumeration8 *) (buf + 63); ann->timeSource = *(Enumeration8 *) (buf + 63);
...@@ -416,7 +416,7 @@ void msg_pack_delay_resp(struct pp_instance *ppi, ...@@ -416,7 +416,7 @@ void msg_pack_delay_resp(struct pp_instance *ppi,
htons(rcv_tstamp->secondsField.msb); htons(rcv_tstamp->secondsField.msb);
*(UInteger32 *) (buf + 36) = htonl(rcv_tstamp->secondsField.lsb); *(UInteger32 *) (buf + 36) = htonl(rcv_tstamp->secondsField.lsb);
*(UInteger32 *) (buf + 40) = htonl(rcv_tstamp->nanosecondsField); *(UInteger32 *) (buf + 40) = htonl(rcv_tstamp->nanosecondsField);
pp_memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity, memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 52) = *(UInteger16 *) (buf + 52) =
htons(hdr->sourcePortIdentity.portNumber); htons(hdr->sourcePortIdentity.portNumber);
...@@ -450,7 +450,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi, MsgHeader *hdr, ...@@ -450,7 +450,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi, MsgHeader *hdr,
*(UInteger16 *) (buf + 34) = htons(req_rec_tstamp->secondsField.msb); *(UInteger16 *) (buf + 34) = htons(req_rec_tstamp->secondsField.msb);
*(UInteger32 *) (buf + 36) = htonl(req_rec_tstamp->secondsField.lsb); *(UInteger32 *) (buf + 36) = htonl(req_rec_tstamp->secondsField.lsb);
*(UInteger32 *) (buf + 40) = htonl(req_rec_tstamp->nanosecondsField); *(UInteger32 *) (buf + 40) = htonl(req_rec_tstamp->nanosecondsField);
pp_memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity, memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 52) = *(UInteger16 *) (buf + 52) =
htons(hdr->sourcePortIdentity.portNumber); htons(hdr->sourcePortIdentity.portNumber);
...@@ -498,7 +498,7 @@ void msg_unpack_delay_resp(void *buf, MsgDelayResp *resp) ...@@ -498,7 +498,7 @@ void msg_unpack_delay_resp(void *buf, MsgDelayResp *resp)
htonl(*(UInteger32 *) (buf + 36)); htonl(*(UInteger32 *) (buf + 36));
resp->receiveTimestamp.nanosecondsField = resp->receiveTimestamp.nanosecondsField =
htonl(*(UInteger32 *) (buf + 40)); htonl(*(UInteger32 *) (buf + 40));
pp_memcpy(resp->requestingPortIdentity.clockIdentity, memcpy(resp->requestingPortIdentity.clockIdentity,
(buf + 44), PP_CLOCK_IDENTITY_LENGTH); (buf + 44), PP_CLOCK_IDENTITY_LENGTH);
resp->requestingPortIdentity.portNumber = resp->requestingPortIdentity.portNumber =
htons(*(UInteger16 *) (buf + 52)); htons(*(UInteger16 *) (buf + 52));
...@@ -519,7 +519,7 @@ void msg_unpack_pdelay_resp(void *buf, MsgPDelayResp *presp) ...@@ -519,7 +519,7 @@ void msg_unpack_pdelay_resp(void *buf, MsgPDelayResp *presp)
htonl(*(UInteger32 *) (buf + 36)); htonl(*(UInteger32 *) (buf + 36));
presp->requestReceiptTimestamp.nanosecondsField = presp->requestReceiptTimestamp.nanosecondsField =
htonl(*(UInteger32 *) (buf + 40)); htonl(*(UInteger32 *) (buf + 40));
pp_memcpy(presp->requestingPortIdentity.clockIdentity, memcpy(presp->requestingPortIdentity.clockIdentity,
(buf + 44), PP_CLOCK_IDENTITY_LENGTH); (buf + 44), PP_CLOCK_IDENTITY_LENGTH);
presp->requestingPortIdentity.portNumber = presp->requestingPortIdentity.portNumber =
htons(*(UInteger16 *) (buf + 52)); htons(*(UInteger16 *) (buf + 52));
...@@ -566,7 +566,7 @@ void msg_pack_pdelay_resp_followup(struct pp_instance *ppi, ...@@ -566,7 +566,7 @@ void msg_pack_pdelay_resp_followup(struct pp_instance *ppi,
htonl(resp_orig_tstamp->secondsField.lsb); htonl(resp_orig_tstamp->secondsField.lsb);
*(UInteger32 *) (buf + 40) = *(UInteger32 *) (buf + 40) =
htonl(resp_orig_tstamp->nanosecondsField); htonl(resp_orig_tstamp->nanosecondsField);
pp_memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity, memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 52) = *(UInteger16 *) (buf + 52) =
htons(hdr->sourcePortIdentity.portNumber); htons(hdr->sourcePortIdentity.portNumber);
...@@ -582,7 +582,7 @@ void msg_unpack_pdelay_resp_followup(void *buf, ...@@ -582,7 +582,7 @@ void msg_unpack_pdelay_resp_followup(void *buf,
htonl(*(UInteger32 *) (buf + 36)); htonl(*(UInteger32 *) (buf + 36));
presp_follow->responseOriginTimestamp.nanosecondsField = presp_follow->responseOriginTimestamp.nanosecondsField =
htonl(*(UInteger32 *) (buf + 40)); htonl(*(UInteger32 *) (buf + 40));
pp_memcpy(presp_follow->requestingPortIdentity.clockIdentity, memcpy(presp_follow->requestingPortIdentity.clockIdentity,
(buf + 44), PP_CLOCK_IDENTITY_LENGTH); (buf + 44), PP_CLOCK_IDENTITY_LENGTH);
presp_follow->requestingPortIdentity.portNumber = presp_follow->requestingPortIdentity.portNumber =
htons(*(UInteger16 *) (buf + 52)); htons(*(UInteger16 *) (buf + 52));
......
...@@ -45,7 +45,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen) ...@@ -45,7 +45,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
id[7] = mac[5]; id[7] = mac[5];
DSDEF(ppi)->numberPorts = 1; DSDEF(ppi)->numberPorts = 1;
pp_memcpy(&DSDEF(ppi)->clockQuality, &OPTS(ppi)->clock_quality, memcpy(&DSDEF(ppi)->clockQuality, &OPTS(ppi)->clock_quality,
sizeof(ClockQuality)); sizeof(ClockQuality));
DSDEF(ppi)->priority1 = OPTS(ppi)->prio1; DSDEF(ppi)->priority1 = OPTS(ppi)->prio1;
DSDEF(ppi)->priority2 = OPTS(ppi)->prio2; DSDEF(ppi)->priority2 = OPTS(ppi)->prio2;
...@@ -55,7 +55,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen) ...@@ -55,7 +55,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
ppi->defaultDS->clockQuality.clockClass = 255; ppi->defaultDS->clockQuality.clockClass = 255;
/* Initialize port data set */ /* Initialize port data set */
pp_memcpy(ppi->portDS->portIdentity.clockIdentity, memcpy(ppi->portDS->portIdentity.clockIdentity,
ppi->defaultDS->clockIdentity, PP_CLOCK_IDENTITY_LENGTH); ppi->defaultDS->clockIdentity, PP_CLOCK_IDENTITY_LENGTH);
DSPOR(ppi)->portIdentity.portNumber = 1; DSPOR(ppi)->portIdentity.portNumber = 1;
DSPOR(ppi)->logMinDelayReqInterval = PP_DEFAULT_DELAYREQ_INTERVAL; DSPOR(ppi)->logMinDelayReqInterval = PP_DEFAULT_DELAYREQ_INTERVAL;
......
...@@ -127,7 +127,7 @@ int msg_pack_wrsig(struct pp_instance *ppi, Enumeration16 wr_msg_id) ...@@ -127,7 +127,7 @@ int msg_pack_wrsig(struct pp_instance *ppi, Enumeration16 wr_msg_id)
*(UInteger8*)(buf+32) = 0x05; //Table 23 -> all other *(UInteger8*)(buf+32) = 0x05; //Table 23 -> all other
/* target portIdentity */ /* target portIdentity */
pp_memcpy((buf+34),DSPAR(ppi)->parentPortIdentity.clockIdentity, memcpy((buf+34),DSPAR(ppi)->parentPortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
put_be16(buf + 42,DSPAR(ppi)->parentPortIdentity.portNumber); put_be16(buf + 42,DSPAR(ppi)->parentPortIdentity.portNumber);
...@@ -190,7 +190,7 @@ void msg_unpack_wrsig(struct pp_instance *ppi, void *buf, ...@@ -190,7 +190,7 @@ void msg_unpack_wrsig(struct pp_instance *ppi, void *buf,
UInteger16 tlv_versionNumber; UInteger16 tlv_versionNumber;
Enumeration16 wr_msg_id; Enumeration16 wr_msg_id;
pp_memcpy(wrsig_msg->targetPortIdentity.clockIdentity,(buf+34), memcpy(wrsig_msg->targetPortIdentity.clockIdentity,(buf+34),
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
wrsig_msg->targetPortIdentity.portNumber = (UInteger16)get_be16(buf+42); wrsig_msg->targetPortIdentity.portNumber = (UInteger16)get_be16(buf+42);
......
...@@ -25,13 +25,13 @@ void m1(struct pp_instance *ppi) ...@@ -25,13 +25,13 @@ void m1(struct pp_instance *ppi)
DSCUR(ppi)->meanPathDelay.seconds = 0; DSCUR(ppi)->meanPathDelay.seconds = 0;
/* Parent data set */ /* Parent data set */
pp_memcpy(DSPAR(ppi)->parentPortIdentity.clockIdentity, memcpy(DSPAR(ppi)->parentPortIdentity.clockIdentity,
DSDEF(ppi)->clockIdentity, PP_CLOCK_IDENTITY_LENGTH); DSDEF(ppi)->clockIdentity, PP_CLOCK_IDENTITY_LENGTH);
DSPAR(ppi)->parentPortIdentity.portNumber = 0; DSPAR(ppi)->parentPortIdentity.portNumber = 0;
DSPAR(ppi)->parentStats = PP_DEFAULT_PARENTS_STATS; DSPAR(ppi)->parentStats = PP_DEFAULT_PARENTS_STATS;
DSPAR(ppi)->observedParentClockPhaseChangeRate = 0; DSPAR(ppi)->observedParentClockPhaseChangeRate = 0;
DSPAR(ppi)->observedParentOffsetScaledLogVariance = 0; DSPAR(ppi)->observedParentOffsetScaledLogVariance = 0;
pp_memcpy(DSPAR(ppi)->grandmasterIdentity, DSDEF(ppi)->clockIdentity, memcpy(DSPAR(ppi)->grandmasterIdentity, DSDEF(ppi)->clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
DSPAR(ppi)->grandmasterClockQuality.clockAccuracy = DSPAR(ppi)->grandmasterClockQuality.clockAccuracy =
DSDEF(ppi)->clockQuality.clockAccuracy; DSDEF(ppi)->clockQuality.clockAccuracy;
...@@ -54,13 +54,13 @@ void s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann) ...@@ -54,13 +54,13 @@ void s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
DSCUR(ppi)->stepsRemoved = ann->stepsRemoved + 1; DSCUR(ppi)->stepsRemoved = ann->stepsRemoved + 1;
/* Parent DS */ /* Parent DS */
pp_memcpy(DSPAR(ppi)->parentPortIdentity.clockIdentity, memcpy(DSPAR(ppi)->parentPortIdentity.clockIdentity,
hdr->sourcePortIdentity.clockIdentity, hdr->sourcePortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
DSPAR(ppi)->parentPortIdentity.portNumber = DSPAR(ppi)->parentPortIdentity.portNumber =
hdr->sourcePortIdentity.portNumber; hdr->sourcePortIdentity.portNumber;
pp_memcpy(DSPAR(ppi)->grandmasterIdentity, memcpy(DSPAR(ppi)->grandmasterIdentity,
ann->grandmasterIdentity, PP_CLOCK_IDENTITY_LENGTH); ann->grandmasterIdentity, PP_CLOCK_IDENTITY_LENGTH);
DSPAR(ppi)->grandmasterClockQuality.clockAccuracy = DSPAR(ppi)->grandmasterClockQuality.clockAccuracy =
...@@ -91,7 +91,7 @@ void s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann) ...@@ -91,7 +91,7 @@ void s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
void copy_d0( struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann) void copy_d0( struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
{ {
ann->grandmasterPriority1 = DSDEF(ppi)->priority1; ann->grandmasterPriority1 = DSDEF(ppi)->priority1;
pp_memcpy(ann->grandmasterIdentity, DSDEF(ppi)->clockIdentity, memcpy(ann->grandmasterIdentity, DSDEF(ppi)->clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
ann->grandmasterClockQuality.clockClass = ann->grandmasterClockQuality.clockClass =
DSDEF(ppi)->clockQuality.clockClass; DSDEF(ppi)->clockQuality.clockClass;
...@@ -101,7 +101,7 @@ void copy_d0( struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann) ...@@ -101,7 +101,7 @@ void copy_d0( struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
DSDEF(ppi)->clockQuality.offsetScaledLogVariance; DSDEF(ppi)->clockQuality.offsetScaledLogVariance;
ann->grandmasterPriority2 = DSDEF(ppi)->priority2; ann->grandmasterPriority2 = DSDEF(ppi)->priority2;
ann->stepsRemoved = 0; ann->stepsRemoved = 0;
pp_memcpy(hdr->sourcePortIdentity.clockIdentity, memcpy(hdr->sourcePortIdentity.clockIdentity,
DSDEF(ppi)->clockIdentity, PP_CLOCK_IDENTITY_LENGTH); DSDEF(ppi)->clockIdentity, PP_CLOCK_IDENTITY_LENGTH);
} }
......
...@@ -123,7 +123,7 @@ void st_com_add_foreign(struct pp_instance *ppi, unsigned char *buf) ...@@ -123,7 +123,7 @@ void st_com_add_foreign(struct pp_instance *ppi, unsigned char *buf)
j = ppi->foreign_record_i; j = ppi->foreign_record_i;
/* Copy new foreign master data set from announce message */ /* Copy new foreign master data set from announce message */
pp_memcpy(ppi->frgn_master[j].port_identity.clockIdentity, memcpy(ppi->frgn_master[j].port_identity.clockIdentity,
hdr->sourcePortIdentity.clockIdentity, hdr->sourcePortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
ppi->frgn_master[j].port_identity.portNumber = ppi->frgn_master[j].port_identity.portNumber =
......
...@@ -87,13 +87,13 @@ void msg_unpack_header(struct pp_instance *ppi, void *buf) ...@@ -87,13 +87,13 @@ void msg_unpack_header(struct pp_instance *ppi, void *buf)
hdr->messageLength = htons(*(UInteger16 *) (buf + 2)); hdr->messageLength = htons(*(UInteger16 *) (buf + 2));
hdr->domainNumber = (*(UInteger8 *) (buf + 4)); hdr->domainNumber = (*(UInteger8 *) (buf + 4));
pp_memcpy(hdr->flagField, (buf + 6), PP_FLAG_FIELD_LENGTH); memcpy(hdr->flagField, (buf + 6), PP_FLAG_FIELD_LENGTH);
pp_memcpy(&hdr->correctionfield.msb, (buf + 8), 4); memcpy(&hdr->correctionfield.msb, (buf + 8), 4);
pp_memcpy(&hdr->correctionfield.lsb, (buf + 12), 4); memcpy(&hdr->correctionfield.lsb, (buf + 12), 4);
hdr->correctionfield.msb = htonl(hdr->correctionfield.msb); hdr->correctionfield.msb = htonl(hdr->correctionfield.msb);
hdr->correctionfield.lsb = htonl(hdr->correctionfield.lsb); hdr->correctionfield.lsb = htonl(hdr->correctionfield.lsb);
pp_memcpy(hdr->sourcePortIdentity.clockIdentity, (buf + 20), memcpy(hdr->sourcePortIdentity.clockIdentity, (buf + 20),
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
hdr->sourcePortIdentity.portNumber = hdr->sourcePortIdentity.portNumber =
htons(*(UInteger16 *) (buf + 28)); htons(*(UInteger16 *) (buf + 28));
...@@ -139,7 +139,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf) ...@@ -139,7 +139,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf)
*(UInteger8 *) (buf + 6) = PP_TWO_STEP_FLAG; *(UInteger8 *) (buf + 6) = PP_TWO_STEP_FLAG;
pp_memset((buf + 8), 0, 8); pp_memset((buf + 8), 0, 8);
pp_memcpy((buf + 20), DSPOR(ppi)->portIdentity.clockIdentity, memcpy((buf + 20), DSPOR(ppi)->portIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 28) = *(UInteger16 *) (buf + 28) =
htons(DSPOR(ppi)->portIdentity.portNumber); htons(DSPOR(ppi)->portIdentity.portNumber);
...@@ -149,7 +149,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf) ...@@ -149,7 +149,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf)
void *msg_copy_header(MsgHeader *dest, MsgHeader *src) void *msg_copy_header(MsgHeader *dest, MsgHeader *src)
{ {
return pp_memcpy(dest, src, sizeof(MsgHeader)); return memcpy(dest, src, sizeof(MsgHeader));
} }
...@@ -221,7 +221,7 @@ int msg_pack_announce(struct pp_instance *ppi) ...@@ -221,7 +221,7 @@ int msg_pack_announce(struct pp_instance *ppi)
*(UInteger16 *) (buf + 50) = *(UInteger16 *) (buf + 50) =
htons(DSDEF(ppi)->clockQuality.offsetScaledLogVariance); htons(DSDEF(ppi)->clockQuality.offsetScaledLogVariance);
*(UInteger8 *) (buf + 52) = DSPAR(ppi)->grandmasterPriority2; *(UInteger8 *) (buf + 52) = DSPAR(ppi)->grandmasterPriority2;
pp_memcpy((buf + 53), DSPAR(ppi)->grandmasterIdentity, memcpy((buf + 53), DSPAR(ppi)->grandmasterIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 61) = htons(DSCUR(ppi)->stepsRemoved); *(UInteger16 *) (buf + 61) = htons(DSCUR(ppi)->stepsRemoved);
*(Enumeration8 *) (buf + 63) = DSPRO(ppi)->timeSource; *(Enumeration8 *) (buf + 63) = DSPRO(ppi)->timeSource;
...@@ -247,7 +247,7 @@ void msg_unpack_announce(void *buf, MsgAnnounce *ann) ...@@ -247,7 +247,7 @@ void msg_unpack_announce(void *buf, MsgAnnounce *ann)
ann->grandmasterClockQuality.offsetScaledLogVariance = ann->grandmasterClockQuality.offsetScaledLogVariance =
htons(*(UInteger16 *) (buf + 50)); htons(*(UInteger16 *) (buf + 50));
ann->grandmasterPriority2 = *(UInteger8 *) (buf + 52); ann->grandmasterPriority2 = *(UInteger8 *) (buf + 52);
pp_memcpy(ann->grandmasterIdentity, (buf + 53), memcpy(ann->grandmasterIdentity, (buf + 53),
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
ann->stepsRemoved = htons(*(UInteger16 *) (buf + 61)); ann->stepsRemoved = htons(*(UInteger16 *) (buf + 61));
ann->timeSource = *(Enumeration8 *) (buf + 63); ann->timeSource = *(Enumeration8 *) (buf + 63);
...@@ -400,7 +400,7 @@ void msg_pack_delay_resp(struct pp_instance *ppi, ...@@ -400,7 +400,7 @@ void msg_pack_delay_resp(struct pp_instance *ppi,
htons(rcv_tstamp->secondsField.msb); htons(rcv_tstamp->secondsField.msb);
*(UInteger32 *) (buf + 36) = htonl(rcv_tstamp->secondsField.lsb); *(UInteger32 *) (buf + 36) = htonl(rcv_tstamp->secondsField.lsb);
*(UInteger32 *) (buf + 40) = htonl(rcv_tstamp->nanosecondsField); *(UInteger32 *) (buf + 40) = htonl(rcv_tstamp->nanosecondsField);
pp_memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity, memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 52) = *(UInteger16 *) (buf + 52) =
htons(hdr->sourcePortIdentity.portNumber); htons(hdr->sourcePortIdentity.portNumber);
...@@ -434,7 +434,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi, MsgHeader *hdr, ...@@ -434,7 +434,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi, MsgHeader *hdr,
*(UInteger16 *) (buf + 34) = htons(req_rec_tstamp->secondsField.msb); *(UInteger16 *) (buf + 34) = htons(req_rec_tstamp->secondsField.msb);
*(UInteger32 *) (buf + 36) = htonl(req_rec_tstamp->secondsField.lsb); *(UInteger32 *) (buf + 36) = htonl(req_rec_tstamp->secondsField.lsb);
*(UInteger32 *) (buf + 40) = htonl(req_rec_tstamp->nanosecondsField); *(UInteger32 *) (buf + 40) = htonl(req_rec_tstamp->nanosecondsField);
pp_memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity, memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 52) = *(UInteger16 *) (buf + 52) =
htons(hdr->sourcePortIdentity.portNumber); htons(hdr->sourcePortIdentity.portNumber);
...@@ -482,7 +482,7 @@ void msg_unpack_delay_resp(void *buf, MsgDelayResp *resp) ...@@ -482,7 +482,7 @@ void msg_unpack_delay_resp(void *buf, MsgDelayResp *resp)
htonl(*(UInteger32 *) (buf + 36)); htonl(*(UInteger32 *) (buf + 36));
resp->receiveTimestamp.nanosecondsField = resp->receiveTimestamp.nanosecondsField =
htonl(*(UInteger32 *) (buf + 40)); htonl(*(UInteger32 *) (buf + 40));
pp_memcpy(resp->requestingPortIdentity.clockIdentity, memcpy(resp->requestingPortIdentity.clockIdentity,
(buf + 44), PP_CLOCK_IDENTITY_LENGTH); (buf + 44), PP_CLOCK_IDENTITY_LENGTH);
resp->requestingPortIdentity.portNumber = resp->requestingPortIdentity.portNumber =
htons(*(UInteger16 *) (buf + 52)); htons(*(UInteger16 *) (buf + 52));
...@@ -503,7 +503,7 @@ void msg_unpack_pdelay_resp(void *buf, MsgPDelayResp *presp) ...@@ -503,7 +503,7 @@ void msg_unpack_pdelay_resp(void *buf, MsgPDelayResp *presp)
htonl(*(UInteger32 *) (buf + 36)); htonl(*(UInteger32 *) (buf + 36));
presp->requestReceiptTimestamp.nanosecondsField = presp->requestReceiptTimestamp.nanosecondsField =
htonl(*(UInteger32 *) (buf + 40)); htonl(*(UInteger32 *) (buf + 40));
pp_memcpy(presp->requestingPortIdentity.clockIdentity, memcpy(presp->requestingPortIdentity.clockIdentity,
(buf + 44), PP_CLOCK_IDENTITY_LENGTH); (buf + 44), PP_CLOCK_IDENTITY_LENGTH);
presp->requestingPortIdentity.portNumber = presp->requestingPortIdentity.portNumber =
htons(*(UInteger16 *) (buf + 52)); htons(*(UInteger16 *) (buf + 52));
...@@ -550,7 +550,7 @@ void msg_pack_pdelay_resp_followup(struct pp_instance *ppi, ...@@ -550,7 +550,7 @@ void msg_pack_pdelay_resp_followup(struct pp_instance *ppi,
htonl(resp_orig_tstamp->secondsField.lsb); htonl(resp_orig_tstamp->secondsField.lsb);
*(UInteger32 *) (buf + 40) = *(UInteger32 *) (buf + 40) =
htonl(resp_orig_tstamp->nanosecondsField); htonl(resp_orig_tstamp->nanosecondsField);
pp_memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity, memcpy((buf + 44), hdr->sourcePortIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 52) = *(UInteger16 *) (buf + 52) =
htons(hdr->sourcePortIdentity.portNumber); htons(hdr->sourcePortIdentity.portNumber);
...@@ -566,7 +566,7 @@ void msg_unpack_pdelay_resp_followup(void *buf, ...@@ -566,7 +566,7 @@ void msg_unpack_pdelay_resp_followup(void *buf,
htonl(*(UInteger32 *) (buf + 36)); htonl(*(UInteger32 *) (buf + 36));
presp_follow->responseOriginTimestamp.nanosecondsField = presp_follow->responseOriginTimestamp.nanosecondsField =
htonl(*(UInteger32 *) (buf + 40)); htonl(*(UInteger32 *) (buf + 40));
pp_memcpy(presp_follow->requestingPortIdentity.clockIdentity, memcpy(presp_follow->requestingPortIdentity.clockIdentity,
(buf + 44), PP_CLOCK_IDENTITY_LENGTH); (buf + 44), PP_CLOCK_IDENTITY_LENGTH);
presp_follow->requestingPortIdentity.portNumber = presp_follow->requestingPortIdentity.portNumber =
htons(*(UInteger16 *) (buf + 52)); htons(*(UInteger16 *) (buf + 52));
......
...@@ -40,7 +40,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen) ...@@ -40,7 +40,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
id[7] = mac[5]; id[7] = mac[5];
DSDEF(ppi)->numberPorts = 1; DSDEF(ppi)->numberPorts = 1;
pp_memcpy(&DSDEF(ppi)->clockQuality, &OPTS(ppi)->clock_quality, memcpy(&DSDEF(ppi)->clockQuality, &OPTS(ppi)->clock_quality,
sizeof(ClockQuality)); sizeof(ClockQuality));
DSDEF(ppi)->priority1 = OPTS(ppi)->prio1; DSDEF(ppi)->priority1 = OPTS(ppi)->prio1;
DSDEF(ppi)->priority2 = OPTS(ppi)->prio2; DSDEF(ppi)->priority2 = OPTS(ppi)->prio2;
...@@ -50,7 +50,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen) ...@@ -50,7 +50,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
ppi->defaultDS->clockQuality.clockClass = 255; ppi->defaultDS->clockQuality.clockClass = 255;
/* Initialize port data set */ /* Initialize port data set */
pp_memcpy(ppi->portDS->portIdentity.clockIdentity, memcpy(ppi->portDS->portIdentity.clockIdentity,
ppi->defaultDS->clockIdentity, PP_CLOCK_IDENTITY_LENGTH); ppi->defaultDS->clockIdentity, PP_CLOCK_IDENTITY_LENGTH);
DSPOR(ppi)->portIdentity.portNumber = 1; DSPOR(ppi)->portIdentity.portNumber = 1;
DSPOR(ppi)->logMinDelayReqInterval = PP_DEFAULT_DELAYREQ_INTERVAL; DSPOR(ppi)->logMinDelayReqInterval = PP_DEFAULT_DELAYREQ_INTERVAL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment