Skip to content

Commit

Permalink
{FEC} Packet filter framework and API (#854)
Browse files Browse the repository at this point in the history
* Introduced a capability flag for packet filter. Added standard capability set definition. Recorded SRT HS flags in the fields.
  • Loading branch information
ethouris authored and rndi committed Sep 9, 2019
1 parent 9b01aac commit f94a4c1
Show file tree
Hide file tree
Showing 14 changed files with 1,391 additions and 211 deletions.
2 changes: 2 additions & 0 deletions srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ int CUDTUnited::startup()
throw CUDTException(MJ_SETUP, MN_NONE, WSAGetLastError());
#endif

PacketFilter::globalInit();

//init CTimer::EventLock

if (m_bGCStatus)
Expand Down
2 changes: 1 addition & 1 deletion srtcore/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ int CRcvBuffer::readMsg(char* data, int len, ref_t<SRT_MSGCTRL> r_msgctl)
<< FormatTime(srctime) << " in " << (timediff/1000.0)
<< "ms - TIME-PREVIOUS: PKT: " << (srctimediff/1000.0)
<< " LOCAL: " << (nowdiff/1000.0)
<< " !" << BufferStamp(pkt.m_pcData, pkt.getLength()));
<< " !" << BufferStamp(pkt.data(), pkt.size()));

prev_now = nowtime;
prev_srctime = srctime;
Expand Down
4 changes: 2 additions & 2 deletions srtcore/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ int CChannel::sendto(const sockaddr* addr, CPacket& packet) const
{
spec << " CONTROL size=" << packet.getLength()
<< " cmd=" << MessageTypeStr(packet.getType(), packet.getExtendedType())
<< " arg=" << packet.getHeader()[CPacket::PH_MSGNO];
<< " arg=" << packet.header(SRT_PH_MSGNO);
}
else
{
Expand Down Expand Up @@ -738,7 +738,7 @@ EReadStatus CChannel::recvfrom(sockaddr* addr, CPacket& packet) const
// packet.m_nHeader[i] = ntohl(packet.m_nHeader[i]);
{
uint32_t* p = packet.m_nHeader;
for (size_t i = 0; i < CPacket::PH_SIZE; ++ i)
for (size_t i = 0; i < SRT_PH__SIZE; ++ i)
{
*p = ntohl(*p);
++ p;
Expand Down
Loading

0 comments on commit f94a4c1

Please sign in to comment.