use memset and memcpy instead of bzero and bcopy throughout lwIP core code.Archs need to update.Bug #1899

This commit is contained in:
jani
2002-12-18 10:40:01 +00:00
parent 219266b7de
commit 4c1069c38b
12 changed files with 24 additions and 24 deletions

View File

@@ -156,7 +156,7 @@ icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t)
ICMPH_TYPE_SET(idur, ICMP_DUR);
ICMPH_CODE_SET(idur, t);
bcopy(p->payload, (char *)q->payload + 8, IP_HLEN + 8);
memcpy((char *)q->payload + 8, p->payload, IP_HLEN + 8);
/* calculate checksum */
idur->chksum = 0;
@@ -200,7 +200,7 @@ icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t)
ICMPH_CODE_SET(tehdr, t);
/* copy fields from original packet */
bcopy((char *)p->payload, (char *)q->payload + 8, IP_HLEN + 8);
memcpy((char *)q->payload + 8, (char *)p->payload, IP_HLEN + 8);
/* calculate checksum */
tehdr->chksum = 0;

View File

@@ -62,7 +62,7 @@ copy_from_pbuf(struct pbuf *p, u16_t * offset,
p->len -= *offset;
while (len) {
l = len < p->len ? len : p->len;
bcopy(p->payload, buffer, l);
memcpy(buffer, p->payload, l);
buffer += l;
len -= l;
if (len)
@@ -112,12 +112,12 @@ ip_reass(struct pbuf *p)
buffer. The timer is updated with the maximum age. */
if (ip_reasstmr == 0) {
DEBUGF(IP_REASS_DEBUG, ("ip_reass: new packet\n"));
bcopy(fraghdr, iphdr, IP_HLEN);
memcpy(iphdr, fraghdr, IP_HLEN);
ip_reasstmr = IP_REASS_MAXAGE;
sys_timeout(IP_REASS_TMO, (sys_timeout_handler) ip_reass_timer, NULL);
ip_reassflags = 0;
/* Clear the bitmap. */
bzero(ip_reassbitmap, sizeof(ip_reassbitmap));
memset(ip_reassbitmap, 0, sizeof(ip_reassbitmap));
}
/* Check if the incoming fragment matches the one currently present
@@ -235,10 +235,10 @@ ip_reass(struct pbuf *p)
avaliable data in the pbuf is given by the q->len
variable. */
DEBUGF(IP_REASS_DEBUG,
("ip_reass: bcopy from %p (%d) to %p, %d bytes\n",
("ip_reass: memcpy from %p (%d) to %p, %d bytes\n",
&ip_reassbuf[i], i, q->payload,
q->len > ip_reasslen - i ? ip_reasslen - i : q->len));
bcopy(&ip_reassbuf[i], q->payload,
memcpy(q->payload, &ip_reassbuf[i],
q->len > ip_reasslen - i ? ip_reasslen - i : q->len);
i += q->len;
}
@@ -284,7 +284,7 @@ ip_frag(struct pbuf *p, struct netif *netif, struct ip_addr *dest)
/* Copy the IP header in it */
iphdr = rambuf->payload;
bcopy(p->payload, iphdr, IP_HLEN);
memcpy(iphdr, p->payload, IP_HLEN);
/* Save original offset */
tmp = ntohs(IPH_OFFSET(iphdr));