Skip to content

Commit

Permalink
use constants
Browse files Browse the repository at this point in the history
  • Loading branch information
marenz2569 committed Jun 16, 2024
1 parent ddbd97a commit d4daa4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/l2/logical_link_control.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class LogicalLinkControl {
friend auto operator<<(std::ostream& stream, const LogicalLinkControl& llc) -> std::ostream&;

private:
static const auto kSupplementaryLlcPdu = 13;
static const auto kLayer2SignallingPdu = 14;

std::array<std::string, 16> llc_pdu_description_;
std::array<std::string, 4> supplementary_llc_pdu_description_;
std::array<std::string, 16> layer_2_signalling_pdu_description_;
Expand Down
2 changes: 1 addition & 1 deletion src/l2/logical_link_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void LogicalLinkControl::process(const Address address, BitVector& vec) {
const auto& pdu_name = llc_pdu_description_.at(pdu_type);

// Skip incrementing the metrics for Supplementary LLC PDU and Layer 2 signalling PDU
if (metrics_ && (pdu_type != 13) && (pdu_type != 14)) {
if (metrics_ && (pdu_type != kSupplementaryLlcPdu) && (pdu_type != kLayer2SignallingPdu)) {
metrics_->increment(pdu_name);
}

Expand Down

0 comments on commit d4daa4e

Please sign in to comment.