Changes in uspace/srv/net/ethip/pdu.c [f0a2720:a2e3ee6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/ethip/pdu.c
rf0a2720 ra2e3ee6 69 69 frame->size); 70 70 71 log_msg(L VL_DEBUG, "Encoding Ethernet frame "71 log_msg(LOG_DEFAULT, LVL_DEBUG, "Encoding Ethernet frame " 72 72 "src=%" PRIx64 " dest=%" PRIx64 " etype=%x", 73 73 frame->src.addr, frame->dest.addr, frame->etype_len); 74 log_msg(L VL_DEBUG, "Encoded Ethernet frame (%zu bytes)", size);74 log_msg(LOG_DEFAULT, LVL_DEBUG, "Encoded Ethernet frame (%zu bytes)", size); 75 75 76 76 *rdata = data; … … 84 84 eth_header_t *hdr; 85 85 86 log_msg(L VL_DEBUG, "eth_pdu_decode()");86 log_msg(LOG_DEFAULT, LVL_DEBUG, "eth_pdu_decode()"); 87 87 88 88 if (size < sizeof(eth_header_t)) { 89 log_msg(L VL_DEBUG, "PDU too short (%zu)", size);89 log_msg(LOG_DEFAULT, LVL_DEBUG, "PDU too short (%zu)", size); 90 90 return EINVAL; 91 91 } … … 105 105 frame->size); 106 106 107 log_msg(L VL_DEBUG, "Decoding Ethernet frame "107 log_msg(LOG_DEFAULT, LVL_DEBUG, "Decoding Ethernet frame " 108 108 "src=%" PRIx64 " dest=%" PRIx64 " etype=%x", 109 109 frame->src.addr, frame->dest.addr, frame->etype_len); 110 log_msg(L VL_DEBUG, "Decoded Ethernet frame payload (%zu bytes)", frame->size);110 log_msg(LOG_DEFAULT, LVL_DEBUG, "Decoded Ethernet frame payload (%zu bytes)", frame->size); 111 111 112 112 return EOK; … … 145 145 uint16_t fopcode; 146 146 147 log_msg(L VL_DEBUG, "arp_pdu_encode()");147 log_msg(LOG_DEFAULT, LVL_DEBUG, "arp_pdu_encode()"); 148 148 149 149 size = sizeof(arp_eth_packet_fmt_t); … … 170 170 mac48_encode(&packet->sender_hw_addr, pfmt->sender_hw_addr); 171 171 pfmt->sender_proto_addr = 172 host2uint32_t_be(packet->sender_proto_addr .ipv4);172 host2uint32_t_be(packet->sender_proto_addr); 173 173 mac48_encode(&packet->target_hw_addr, pfmt->target_hw_addr); 174 174 pfmt->target_proto_addr = 175 host2uint32_t_be(packet->target_proto_addr .ipv4);175 host2uint32_t_be(packet->target_proto_addr); 176 176 177 177 *rdata = data; … … 185 185 arp_eth_packet_fmt_t *pfmt; 186 186 187 log_msg(L VL_DEBUG, "arp_pdu_decode()");187 log_msg(LOG_DEFAULT, LVL_DEBUG, "arp_pdu_decode()"); 188 188 189 189 if (size < sizeof(arp_eth_packet_fmt_t)) { 190 log_msg(L VL_DEBUG, "ARP PDU too short (%zu)", size);190 log_msg(LOG_DEFAULT, LVL_DEBUG, "ARP PDU too short (%zu)", size); 191 191 return EINVAL; 192 192 } … … 195 195 196 196 if (uint16_t_be2host(pfmt->hw_addr_space) != AHRD_ETHERNET) { 197 log_msg(L VL_DEBUG, "HW address space != %u (%" PRIu16 ")",197 log_msg(LOG_DEFAULT, LVL_DEBUG, "HW address space != %u (%" PRIu16 ")", 198 198 AHRD_ETHERNET, uint16_t_be2host(pfmt->hw_addr_space)); 199 199 return EINVAL; … … 201 201 202 202 if (uint16_t_be2host(pfmt->proto_addr_space) != 0x0800) { 203 log_msg(L VL_DEBUG, "Proto address space != %u (%" PRIu16 ")",203 log_msg(LOG_DEFAULT, LVL_DEBUG, "Proto address space != %u (%" PRIu16 ")", 204 204 ETYPE_IP, uint16_t_be2host(pfmt->proto_addr_space)); 205 205 return EINVAL; … … 207 207 208 208 if (pfmt->hw_addr_size != ETH_ADDR_SIZE) { 209 log_msg(L VL_DEBUG, "HW address size != %zu (%zu)",209 log_msg(LOG_DEFAULT, LVL_DEBUG, "HW address size != %zu (%zu)", 210 210 (size_t)ETH_ADDR_SIZE, (size_t)pfmt->hw_addr_size); 211 211 return EINVAL; … … 213 213 214 214 if (pfmt->proto_addr_size != IPV4_ADDR_SIZE) { 215 log_msg(L VL_DEBUG, "Proto address size != %zu (%zu)",215 log_msg(LOG_DEFAULT, LVL_DEBUG, "Proto address size != %zu (%zu)", 216 216 (size_t)IPV4_ADDR_SIZE, (size_t)pfmt->proto_addr_size); 217 217 return EINVAL; … … 222 222 case AOP_REPLY: packet->opcode = aop_reply; break; 223 223 default: 224 log_msg(L VL_DEBUG, "Invalid ARP opcode (%" PRIu16 ")",224 log_msg(LOG_DEFAULT, LVL_DEBUG, "Invalid ARP opcode (%" PRIu16 ")", 225 225 uint16_t_be2host(pfmt->opcode)); 226 226 return EINVAL; … … 228 228 229 229 mac48_decode(pfmt->sender_hw_addr, &packet->sender_hw_addr); 230 packet->sender_proto_addr .ipv4=230 packet->sender_proto_addr = 231 231 uint32_t_be2host(pfmt->sender_proto_addr); 232 232 mac48_decode(pfmt->target_hw_addr, &packet->target_hw_addr); 233 packet->target_proto_addr .ipv4=233 packet->target_proto_addr = 234 234 uint32_t_be2host(pfmt->target_proto_addr); 235 log_msg(LVL_DEBUG, "packet->tpa = %x\n", pfmt->target_proto_addr); 236 237 return EOK; 238 } 239 235 log_msg(LOG_DEFAULT, LVL_DEBUG, "packet->tpa = %x\n", pfmt->target_proto_addr); 236 237 return EOK; 238 } 240 239 241 240 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.