semi-real multicast hardware addresses

This commit is contained in:
Craig Dowell
2007-08-24 17:38:49 -07:00
parent 217edad33c
commit 4e486b1f59
6 changed files with 64 additions and 15 deletions

View File

@@ -113,6 +113,7 @@ NetDevice::IsBroadcast (void) const
{
return m_isBroadcast;
}
Address const &
NetDevice::GetBroadcast (void) const
{
@@ -139,10 +140,18 @@ NetDevice::IsMulticast (void) const
return m_isMulticast;
}
Address const &
NetDevice::GetMulticast (void) const
{
NS_ASSERT (m_isMulticast);
return m_multicast;
}
void
NetDevice::EnableMulticast (void)
NetDevice::EnableMulticast (Address multicast)
{
m_isMulticast = true;
m_multicast = multicast;
}
void

View File

@@ -138,10 +138,21 @@ public:
* not true.
*/
Address const &GetBroadcast (void) const;
/**
* \return value of m_isMulticast flag
*/
bool IsMulticast (void) const;
/**
* \return the multicast address supported by
* this netdevice.
*
* Calling this method is invalid if IsMulticast returns
* not true.
*/
Address const &GetMulticast (void) const;
/**
* \return value of m_isPointToPoint flag
*/
@@ -212,9 +223,10 @@ public:
*/
void DisableBroadcast (void);
/**
* Set m_isMulticast flag to true
* Enable multicast support. This method should be
* called by subclasses from their constructor
*/
void EnableMulticast (void);
void EnableMulticast (Address multicast);
/**
* Set m_isMulticast flag to false
*/
@@ -303,6 +315,7 @@ public:
uint16_t m_ifIndex;
Address m_address;
Address m_broadcast;
Address m_multicast;
uint16_t m_mtu;
bool m_isUp;
bool m_isBroadcast;