Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/ethip/pdu.c

    rf0a2720 ra2e3ee6  
    6969            frame->size);
    7070
    71         log_msg(LVL_DEBUG, "Encoding Ethernet frame "
     71        log_msg(LOG_DEFAULT, LVL_DEBUG, "Encoding Ethernet frame "
    7272            "src=%" PRIx64 " dest=%" PRIx64 " etype=%x",
    7373            frame->src.addr, frame->dest.addr, frame->etype_len);
    74         log_msg(LVL_DEBUG, "Encoded Ethernet frame (%zu bytes)", size);
     74        log_msg(LOG_DEFAULT, LVL_DEBUG, "Encoded Ethernet frame (%zu bytes)", size);
    7575
    7676        *rdata = data;
     
    8484        eth_header_t *hdr;
    8585
    86         log_msg(LVL_DEBUG, "eth_pdu_decode()");
     86        log_msg(LOG_DEFAULT, LVL_DEBUG, "eth_pdu_decode()");
    8787
    8888        if (size < sizeof(eth_header_t)) {
    89                 log_msg(LVL_DEBUG, "PDU too short (%zu)", size);
     89                log_msg(LOG_DEFAULT, LVL_DEBUG, "PDU too short (%zu)", size);
    9090                return EINVAL;
    9191        }
     
    105105            frame->size);
    106106
    107         log_msg(LVL_DEBUG, "Decoding Ethernet frame "
     107        log_msg(LOG_DEFAULT, LVL_DEBUG, "Decoding Ethernet frame "
    108108            "src=%" PRIx64 " dest=%" PRIx64 " etype=%x",
    109109            frame->src.addr, frame->dest.addr, frame->etype_len);
    110         log_msg(LVL_DEBUG, "Decoded Ethernet frame payload (%zu bytes)", frame->size);
     110        log_msg(LOG_DEFAULT, LVL_DEBUG, "Decoded Ethernet frame payload (%zu bytes)", frame->size);
    111111
    112112        return EOK;
     
    145145        uint16_t fopcode;
    146146
    147         log_msg(LVL_DEBUG, "arp_pdu_encode()");
     147        log_msg(LOG_DEFAULT, LVL_DEBUG, "arp_pdu_encode()");
    148148
    149149        size = sizeof(arp_eth_packet_fmt_t);
     
    170170        mac48_encode(&packet->sender_hw_addr, pfmt->sender_hw_addr);
    171171        pfmt->sender_proto_addr =
    172             host2uint32_t_be(packet->sender_proto_addr.ipv4);
     172            host2uint32_t_be(packet->sender_proto_addr);
    173173        mac48_encode(&packet->target_hw_addr, pfmt->target_hw_addr);
    174174        pfmt->target_proto_addr =
    175             host2uint32_t_be(packet->target_proto_addr.ipv4);
     175            host2uint32_t_be(packet->target_proto_addr);
    176176
    177177        *rdata = data;
     
    185185        arp_eth_packet_fmt_t *pfmt;
    186186
    187         log_msg(LVL_DEBUG, "arp_pdu_decode()");
     187        log_msg(LOG_DEFAULT, LVL_DEBUG, "arp_pdu_decode()");
    188188
    189189        if (size < sizeof(arp_eth_packet_fmt_t)) {
    190                 log_msg(LVL_DEBUG, "ARP PDU too short (%zu)", size);
     190                log_msg(LOG_DEFAULT, LVL_DEBUG, "ARP PDU too short (%zu)", size);
    191191                return EINVAL;
    192192        }
     
    195195
    196196        if (uint16_t_be2host(pfmt->hw_addr_space) != AHRD_ETHERNET) {
    197                 log_msg(LVL_DEBUG, "HW address space != %u (%" PRIu16 ")",
     197                log_msg(LOG_DEFAULT, LVL_DEBUG, "HW address space != %u (%" PRIu16 ")",
    198198                    AHRD_ETHERNET, uint16_t_be2host(pfmt->hw_addr_space));
    199199                return EINVAL;
     
    201201
    202202        if (uint16_t_be2host(pfmt->proto_addr_space) != 0x0800) {
    203                 log_msg(LVL_DEBUG, "Proto address space != %u (%" PRIu16 ")",
     203                log_msg(LOG_DEFAULT, LVL_DEBUG, "Proto address space != %u (%" PRIu16 ")",
    204204                    ETYPE_IP, uint16_t_be2host(pfmt->proto_addr_space));
    205205                return EINVAL;
     
    207207
    208208        if (pfmt->hw_addr_size != ETH_ADDR_SIZE) {
    209                 log_msg(LVL_DEBUG, "HW address size != %zu (%zu)",
     209                log_msg(LOG_DEFAULT, LVL_DEBUG, "HW address size != %zu (%zu)",
    210210                    (size_t)ETH_ADDR_SIZE, (size_t)pfmt->hw_addr_size);
    211211                return EINVAL;
     
    213213
    214214        if (pfmt->proto_addr_size != IPV4_ADDR_SIZE) {
    215                 log_msg(LVL_DEBUG, "Proto address size != %zu (%zu)",
     215                log_msg(LOG_DEFAULT, LVL_DEBUG, "Proto address size != %zu (%zu)",
    216216                    (size_t)IPV4_ADDR_SIZE, (size_t)pfmt->proto_addr_size);
    217217                return EINVAL;
     
    222222        case AOP_REPLY: packet->opcode = aop_reply; break;
    223223        default:
    224                 log_msg(LVL_DEBUG, "Invalid ARP opcode (%" PRIu16 ")",
     224                log_msg(LOG_DEFAULT, LVL_DEBUG, "Invalid ARP opcode (%" PRIu16 ")",
    225225                    uint16_t_be2host(pfmt->opcode));
    226226                return EINVAL;
     
    228228
    229229        mac48_decode(pfmt->sender_hw_addr, &packet->sender_hw_addr);
    230         packet->sender_proto_addr.ipv4 =
     230        packet->sender_proto_addr =
    231231            uint32_t_be2host(pfmt->sender_proto_addr);
    232232        mac48_decode(pfmt->target_hw_addr, &packet->target_hw_addr);
    233         packet->target_proto_addr.ipv4 =
     233        packet->target_proto_addr =
    234234            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}
    240239
    241240/** @}
Note: See TracChangeset for help on using the changeset viewer.