Skip to content

Commit

Permalink
Fix SonarQube issue
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Sep 7, 2023
1 parent 04c7dab commit 70972f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cpp/devices/ctapdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ bool CTapDriver::Disable() const
return result;
}

void CTapDriver::Flush()
void CTapDriver::Flush() const
{
LOGTRACE("%s", __PRETTY_FUNCTION__)
while (PendingPackets()) {
Expand Down Expand Up @@ -421,7 +421,7 @@ uint32_t CTapDriver::Crc32(span<const uint8_t> data) {
return ~crc;
}

int CTapDriver::Receive(uint8_t *buf)
int CTapDriver::Receive(uint8_t *buf) const
{
assert(m_hTAP != -1);

Expand Down Expand Up @@ -459,7 +459,7 @@ int CTapDriver::Receive(uint8_t *buf)
return dwReceived;
}

int CTapDriver::Send(const uint8_t *buf, int len)
int CTapDriver::Send(const uint8_t *buf, int len) const
{
assert(m_hTAP != -1);

Expand Down
10 changes: 4 additions & 6 deletions cpp/devices/ctapdriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#pragma once

#include <net/ethernet.h>
#include <unordered_map>
#include <vector>
#include <string>
Expand All @@ -32,14 +31,13 @@ class CTapDriver
CTapDriver& operator=(const CTapDriver&) = default;

bool Init(const unordered_map<string, string>&);
void OpenDump(const string& path); // Capture packets
void GetMacAddr(uint8_t *mac) const;
int Receive(uint8_t *buf);
int Send(const uint8_t *buf, int len);
void GetMacAddr(uint8_t *) const;
int Receive(uint8_t *) const;
int Send(const uint8_t *, int) const;
bool PendingPackets() const; // Check if there are IP packets available
bool Enable() const; // Enable the piscsi0 interface
bool Disable() const; // Disable the piscsi0 interface
void Flush(); // Purge all of the packets that are waiting to be processed
void Flush() const; // Purge all of the packets that are waiting to be processed

static uint32_t Crc32(span<const uint8_t>);

Expand Down

0 comments on commit 70972f2

Please sign in to comment.