Skip to content

Commit

Permalink
Add ECN to CCFB metric block string output
Browse files Browse the repository at this point in the history
  • Loading branch information
mengelbart committed Jan 28, 2025
1 parent b5ab305 commit 580a9e1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion rfc8888.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ const (
ECNCE // 11
)

func (e ECN) String() string {
switch e {
case ECNNonECT:
return "Non-ECT (00)"

Check failure on line 71 in rfc8888.go

View workflow job for this annotation

GitHub Actions / lint / Go

`ECT` is a misspelling of `ETC` (misspell)
case ECNECT0:
return "ECT(0) (01)"

Check failure on line 73 in rfc8888.go

View workflow job for this annotation

GitHub Actions / lint / Go

`ECT` is a misspelling of `ETC` (misspell)
case ECNECT1:
return "ECT(1) (10)"

Check failure on line 75 in rfc8888.go

View workflow job for this annotation

GitHub Actions / lint / Go

`ECT` is a misspelling of `ETC` (misspell)
case ECNCE:
return "CE (11)"

Check warning on line 77 in rfc8888.go

View check run for this annotation

Codecov / codecov/patch

rfc8888.go#L68-L77

Added lines #L68 - L77 were not covered by tests
}
return "invalid ECN value"

Check warning on line 79 in rfc8888.go

View check run for this annotation

Codecov / codecov/patch

rfc8888.go#L79

Added line #L79 was not covered by tests
}

const (
reportTimestampLength = 4
reportBlockOffset = 8
Expand Down Expand Up @@ -217,7 +231,7 @@ func (b CCFeedbackReportBlock) String() string {
out += fmt.Sprintf("\tReport Begin Sequence Nr %d\n", b.BeginSequence)
out += fmt.Sprintf("\tReport length %d\n\t", len(b.MetricBlocks))
for i, block := range b.MetricBlocks {
out += fmt.Sprintf("{nr: %d, rx: %v, ts: %v} ", b.BeginSequence+uint16(i), block.Received, block.ArrivalTimeOffset)
out += fmt.Sprintf("{nr: %d, rx: %v, ts: %v, ecn: %v} ", b.BeginSequence+uint16(i), block.Received, block.ArrivalTimeOffset, block.ECN)

Check warning on line 234 in rfc8888.go

View check run for this annotation

Codecov / codecov/patch

rfc8888.go#L234

Added line #L234 was not covered by tests
}
out += "\n"
return out
Expand Down

0 comments on commit 580a9e1

Please sign in to comment.