- support nested VLANs + fix few clang warnings
This commit is contained in:
parent
aeedeb0626
commit
621afead4b
|
|
@ -24,12 +24,17 @@ NetworkFrame::PacketData NetworkFrame::GetUdpPayloadForEthernet(NetworkFrame::Pa
|
||||||
// See if there is Vlan header
|
// See if there is Vlan header
|
||||||
uint16_t proto = 0;
|
uint16_t proto = 0;
|
||||||
if (ethernet->mEtherType == 129)
|
if (ethernet->mEtherType == 129)
|
||||||
|
{
|
||||||
|
// Skip 1 or more VLAN headers
|
||||||
|
do
|
||||||
{
|
{
|
||||||
const VlanHeader* vlan = reinterpret_cast<const VlanHeader*>(packet.mData);
|
const VlanHeader* vlan = reinterpret_cast<const VlanHeader*>(packet.mData);
|
||||||
packet.mData += sizeof(VlanHeader);
|
packet.mData += sizeof(VlanHeader);
|
||||||
packet.mLength -= sizeof(VlanHeader);
|
packet.mLength -= sizeof(VlanHeader);
|
||||||
proto = ntohs(vlan->mData);
|
proto = ntohs(vlan->mData);
|
||||||
}
|
}
|
||||||
|
while (proto == 0x8100);
|
||||||
|
}
|
||||||
|
|
||||||
// Skip MPLS headers
|
// Skip MPLS headers
|
||||||
switch (proto)
|
switch (proto)
|
||||||
|
|
|
||||||
|
|
@ -245,6 +245,17 @@ std::string MediaStreamId::getFinishDescription() const
|
||||||
return oss.str();
|
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)
|
std::ostream& operator << (std::ostream& output, const MediaStreamId& id)
|
||||||
{
|
{
|
||||||
return (output << id.toString());
|
return (output << id.toString());
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ struct MediaStreamId
|
||||||
std::string toString() const;
|
std::string toString() const;
|
||||||
std::string getDetectDescription() const;
|
std::string getDetectDescription() const;
|
||||||
std::string getFinishDescription() const;
|
std::string getFinishDescription() const;
|
||||||
|
MediaStreamId& operator = (const MediaStreamId& src);
|
||||||
};
|
};
|
||||||
|
|
||||||
std::ostream& operator << (std::ostream& output, const MediaStreamId& id);
|
std::ostream& operator << (std::ostream& output, const MediaStreamId& id);
|
||||||
|
|
|
||||||
|
|
@ -783,3 +783,12 @@ bool NetworkAddress::isSame(const NetworkAddress& a1, const NetworkAddress& a2)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NetworkAddress& NetworkAddress::operator = (const NetworkAddress& src)
|
||||||
|
{
|
||||||
|
this->mInitialized = src.mInitialized;
|
||||||
|
this->mRelayed = src.mRelayed;
|
||||||
|
this->mAddr6 = src.mAddr6;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,8 @@ namespace ice
|
||||||
|
|
||||||
static bool isSame(const NetworkAddress& a1, const NetworkAddress& a2);
|
static bool isSame(const NetworkAddress& a1, const NetworkAddress& a2);
|
||||||
|
|
||||||
|
NetworkAddress& operator = (const NetworkAddress& src);
|
||||||
|
|
||||||
bool operator == (const NetworkAddress& rhs) const;
|
bool operator == (const NetworkAddress& rhs) const;
|
||||||
bool operator != (const NetworkAddress& rhs) const;
|
bool operator != (const NetworkAddress& rhs) const;
|
||||||
bool operator < (const NetworkAddress& rhs) const;
|
bool operator < (const NetworkAddress& rhs) const;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue