- support nested VLANs + fix few clang warnings
This commit is contained in:
@@ -25,10 +25,15 @@ NetworkFrame::PacketData NetworkFrame::GetUdpPayloadForEthernet(NetworkFrame::Pa
|
||||
uint16_t proto = 0;
|
||||
if (ethernet->mEtherType == 129)
|
||||
{
|
||||
const VlanHeader* vlan = reinterpret_cast<const VlanHeader*>(packet.mData);
|
||||
packet.mData += sizeof(VlanHeader);
|
||||
packet.mLength -= sizeof(VlanHeader);
|
||||
proto = ntohs(vlan->mData);
|
||||
// Skip 1 or more VLAN headers
|
||||
do
|
||||
{
|
||||
const VlanHeader* vlan = reinterpret_cast<const VlanHeader*>(packet.mData);
|
||||
packet.mData += sizeof(VlanHeader);
|
||||
packet.mLength -= sizeof(VlanHeader);
|
||||
proto = ntohs(vlan->mData);
|
||||
}
|
||||
while (proto == 0x8100);
|
||||
}
|
||||
|
||||
// Skip MPLS headers
|
||||
|
||||
@@ -245,6 +245,17 @@ std::string MediaStreamId::getFinishDescription() const
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
MediaStreamId& MediaStreamId::operator = (const MediaStreamId& src)
|
||||
{
|
||||
this->mDestination = src.mDestination;
|
||||
this->mSource = src.mSource;
|
||||
this->mLinkId = src.mLinkId;
|
||||
this->mSSRC = src.mSSRC;
|
||||
this->mSsrcIsId = src.mSsrcIsId;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::ostream& operator << (std::ostream& output, const MediaStreamId& id)
|
||||
{
|
||||
return (output << id.toString());
|
||||
|
||||
@@ -85,6 +85,7 @@ struct MediaStreamId
|
||||
std::string toString() const;
|
||||
std::string getDetectDescription() const;
|
||||
std::string getFinishDescription() const;
|
||||
MediaStreamId& operator = (const MediaStreamId& src);
|
||||
};
|
||||
|
||||
std::ostream& operator << (std::ostream& output, const MediaStreamId& id);
|
||||
|
||||
Reference in New Issue
Block a user