Changeset 2dac5a9 in mainline


Ignore:
Timestamp:
2024-12-13T08:32:55Z (10 months ago)
Author:
Nataliia Korop <n.corop08@…>
Children:
91042127
Parents:
a270026
git-author:
Nataliia Korop <n.corop08@…> (2024-02-24 19:54:31)
git-committer:
Nataliia Korop <n.corop08@…> (2024-12-13 08:32:55)
Message:

framework added to virtio-net

File:
1 edited

Legend:

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

    ra270026 r2dac5a9  
    4343
    4444#include <virtio-pci.h>
    45 
     45#include "pcapdump_iface.h"
     46#include "pcap_iface.h"
    4647#define NAME    "virtio-net"
    4748
     
    9798                if (frame) {
    9899                        memcpy(frame->data, &hdr[1], len - sizeof(*hdr));
     100                        pcapdump_packet(nic_get_pcap_iface(nic), frame->data, frame->size);
    99101                        nic_received_frame(nic, frame);
    100102                } else {
     
    357359        /* Copy packet data into the buffer just past the header */
    358360        memcpy(&hdr[1], data, size);
    359 
     361        pcapdump_packet(nic_get_pcap_iface(nic), data, size);
    360362        /*
    361363         * Set the descriptor, put it into the virtqueue and notify the device
     
    437439            ddf_dev_get_name(dev));
    438440
     441        errno_t pcap_rc  = pcapdump_init(nic_get_pcap_iface(nic));
     442
     443        if (pcap_rc != EOK) {
     444                printf("Failed creating pcapdump port\n");
     445        }
     446        rc = ddf_fun_add_to_category(fun, "pcap");
     447        if (rc != EOK)
     448                goto unbind;
     449
    439450        return EOK;
    440451
Note: See TracChangeset for help on using the changeset viewer.