Changeset 192019f in mainline


Ignore:
Timestamp:
2024-02-24T19:54:31Z (2 months ago)
Author:
Nataliia Korop <n.corop08@…>
Children:
325ea9c, 6eab537d
Parents:
f2cb80a
Message:

framework added to virtio-net

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/virtio-net/virtio-net.c

    rf2cb80a r192019f  
    4343
    4444#include <virtio-pci.h>
    45 
     45#include "pcapdump_iface.h"
     46#include "pcap_iface.h"
    4647#define NAME    "virtio-net"
    4748
     
    9293                if (frame) {
    9394                        memcpy(frame->data, &hdr[1], len - sizeof(*hdr));
     95                        pcapdump_packet(nic_get_pcap_iface(nic), frame->data, frame->size);
    9496                        nic_received_frame(nic, frame);
    9597                } else {
     
    351353        /* Copy packet data into the buffer just past the header */
    352354        memcpy(&hdr[1], data, size);
    353 
     355        pcapdump_packet(nic_get_pcap_iface(nic), data, size);
    354356        /*
    355357         * Set the descriptor, put it into the virtqueue and notify the device
     
    431433            ddf_dev_get_name(dev));
    432434
     435        errno_t pcap_rc  = pcapdump_init(nic_get_pcap_iface(nic));
     436
     437        if (pcap_rc != EOK) {
     438                printf("Failed creating pcapdump port\n");
     439        }
     440        rc = ddf_fun_add_to_category(fun, "pcap");
     441        if (rc != EOK)
     442                goto unbind;
     443
    433444        return EOK;
    434445
Note: See TracChangeset for help on using the changeset viewer.