Changeset d5ed54b in mainline
- Timestamp:
- 2021-08-08T08:31:02Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b4edc96
- Parents:
- f05edcb
- Location:
- uspace
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/inet/include/inet/addr.h
rf05edcb rd5ed54b 86 86 extern const addr48_t addr48_broadcast; 87 87 88 extern void addr48(const addr48_t *, addr48_t *);89 88 extern void addr128(const addr128_t, addr128_t); 90 89 -
uspace/lib/inet/src/addr.c
rf05edcb rd5ed54b 71 71 .addr6 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } 72 72 }; 73 74 void addr48(const addr48_t *src, addr48_t *dst)75 {76 memcpy(dst, src, sizeof(addr48_t));77 }78 73 79 74 void addr128(const addr128_t src, addr128_t dst) -
uspace/srv/net/ethip/arp.c
rf05edcb rd5ed54b 85 85 86 86 reply.opcode = aop_reply; 87 addr48(&nic->mac_addr, &reply.sender_hw_addr);87 reply.sender_hw_addr = nic->mac_addr; 88 88 reply.sender_proto_addr = laddr_v4; 89 addr48(&packet.sender_hw_addr, &reply.target_hw_addr);89 reply.target_hw_addr = packet.sender_hw_addr; 90 90 reply.target_proto_addr = packet.sender_proto_addr; 91 91 … … 99 99 /* Broadcast address */ 100 100 if (ip_addr == addr32_broadcast_all_hosts) { 101 addr48(&addr48_broadcast, mac_addr);101 *mac_addr = addr48_broadcast; 102 102 return EOK; 103 103 } … … 110 110 111 111 packet.opcode = aop_request; 112 addr48(&nic->mac_addr, &packet.sender_hw_addr);112 packet.sender_hw_addr = nic->mac_addr; 113 113 packet.sender_proto_addr = src_addr; 114 addr48(&addr48_broadcast, &packet.target_hw_addr);114 packet.target_hw_addr = addr48_broadcast; 115 115 packet.target_proto_addr = ip_addr; 116 116 … … 138 138 return rc; 139 139 140 addr48(&packet->target_hw_addr, &frame.dest);141 addr48(&packet->sender_hw_addr, &frame.src);140 frame.dest = packet->target_hw_addr; 141 frame.src = packet->sender_hw_addr; 142 142 frame.etype_len = ETYPE_ARP; 143 143 frame.data = pdata; -
uspace/srv/net/ethip/atrans.c
rf05edcb rd5ed54b 69 69 70 70 atrans->ip_addr = ip_addr; 71 a ddr48(mac_addr, &atrans->mac_addr);71 atrans->mac_addr = *mac_addr; 72 72 73 73 fibril_mutex_lock(&atrans_list_lock); … … 109 109 return ENOENT; 110 110 111 addr48(&atrans->mac_addr, mac_addr);111 *mac_addr = atrans->mac_addr; 112 112 return EOK; 113 113 } -
uspace/srv/net/ethip/ethip.c
rf05edcb rd5ed54b 184 184 } 185 185 186 addr48(&nic->mac_addr, &frame.src);186 frame.src = nic->mac_addr; 187 187 frame.etype_len = ETYPE_IP; 188 188 frame.data = sdu->data; … … 208 208 eth_frame_t frame; 209 209 210 addr48(&sdu->dest, &frame.dest);211 addr48(&nic->mac_addr, &frame.src);210 frame.dest = sdu->dest; 211 frame.src = nic->mac_addr; 212 212 frame.etype_len = ETYPE_IPV6; 213 213 frame.data = sdu->data; … … 281 281 282 282 ethip_nic_t *nic = (ethip_nic_t *) srv->arg; 283 addr48(&nic->mac_addr, mac);283 *mac = nic->mac_addr; 284 284 285 285 return EOK; … … 291 291 292 292 ethip_nic_t *nic = (ethip_nic_t *) srv->arg; 293 addr48(mac, &nic->mac_addr);293 nic->mac_addr = *mac; 294 294 295 295 return EOK; -
uspace/srv/net/inetsrv/inet_link.c
rf05edcb rd5ed54b 401 401 402 402 iplink_sdu6_t sdu6; 403 addr48(ldest, &sdu6.dest);403 sdu6.dest = *ldest; 404 404 405 405 /* -
uspace/srv/net/inetsrv/inetcfg.c
rf05edcb rd5ed54b 177 177 linfo->def_mtu = ilink->def_mtu; 178 178 if (ilink->mac_valid) { 179 addr48(&ilink->mac, &linfo->mac_addr);179 linfo->mac_addr = ilink->mac; 180 180 } else { 181 181 memset(&linfo->mac_addr, 0, sizeof(linfo->mac_addr)); -
uspace/srv/net/inetsrv/ndp.c
rf05edcb rd5ed54b 115 115 116 116 reply.opcode = ICMPV6_NEIGHBOUR_ADVERTISEMENT; 117 addr48(&laddr->ilink->mac, &reply.sender_hw_addr);117 reply.sender_hw_addr = laddr->ilink->mac; 118 118 addr128(packet.target_proto_addr, reply.sender_proto_addr); 119 addr48(&packet.sender_hw_addr, &reply.target_hw_addr);119 reply.target_hw_addr = packet.sender_hw_addr; 120 120 addr128(packet.sender_proto_addr, reply.target_proto_addr); 121 121 … … 167 167 168 168 packet.opcode = ICMPV6_NEIGHBOUR_SOLICITATION; 169 addr48(&ilink->mac, &packet.sender_hw_addr);169 packet.sender_hw_addr = ilink->mac; 170 170 addr128(src_addr, packet.sender_proto_addr); 171 171 addr128(ip_addr, packet.solicited_ip); -
uspace/srv/net/inetsrv/ntrans.c
rf05edcb rd5ed54b 83 83 84 84 addr128(ip_addr, ntrans->ip_addr); 85 addr48(mac_addr, &ntrans->mac_addr);85 ntrans->mac_addr = *mac_addr; 86 86 87 87 fibril_mutex_lock(&ntrans_list_lock); … … 144 144 145 145 fibril_mutex_unlock(&ntrans_list_lock); 146 addr48(&ntrans->mac_addr, mac_addr);146 *mac_addr = ntrans->mac_addr; 147 147 return EOK; 148 148 }
Note:
See TracChangeset
for help on using the changeset viewer.