Clipping a control packet does merely the same, just the packet has different contents, so it must be differetly interpreted.
| 545 | // Clipping a control packet does merely the same, just the packet has |
| 546 | // different contents, so it must be differetly interpreted. |
| 547 | void FECFilterBuiltin::ClipControlPacket(Group& g, const CPacket& pkt) |
| 548 | { |
| 549 | // Both length and timestamp must be taken as NETWORK ORDER |
| 550 | // before applying the clip. |
| 551 | |
| 552 | const char* fec_header = pkt.data(); |
| 553 | const char* payload = fec_header + 4; |
| 554 | size_t payload_clip_len = pkt.size() - 4; |
| 555 | |
| 556 | const uint8_t* flag_clip = (const uint8_t*)(fec_header + 1); |
| 557 | const uint16_t* length_clip = (const uint16_t*)(fec_header + 2); |
| 558 | |
| 559 | uint32_t timestamp_hw = pkt.getMsgTimeStamp(); |
| 560 | |
| 561 | ClipData(g, *length_clip, *flag_clip, timestamp_hw, payload, payload_clip_len); |
| 562 | |
| 563 | HLOGC(pflog.Debug, log << "FEC/CTL CLIP: " << hex |
| 564 | << "FLAGS=" << unsigned(*flag_clip) << " LENGTH[ne]=" << (*length_clip) |
| 565 | << " TS[he]=" << timestamp_hw |
| 566 | << " CLIP STATE: FLAGS=" << unsigned(g.flag_clip) |
| 567 | << " LENGTH[ne]=" << g.length_clip |
| 568 | << " TS[he]=" << g.timestamp_clip |
| 569 | << " PL4=" << (*(uint32_t*)&g.payload_clip[0])); |
| 570 | } |
| 571 | |
| 572 | void FECFilterBuiltin::ClipRebuiltPacket(Group& g, Receive::PrivPacket& pkt) |
| 573 | { |
nothing calls this directly
no test coverage detected