File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ This file is a best-effort approach to solving this issue; we will do our best b
1616
1717### New API
1818
19+ * (network) Added a function to detect IPv4 APIPA addresses (169.254.0.0/16).
20+
1921### Changes to existing API
2022
2123* (internet-apps) Added a parameter to the RADVD helper to announce a prefix without the autoconfiguration flag.
Original file line number Diff line number Diff line change @@ -281,6 +281,14 @@ Ipv4Address::IsLocalMulticast() const
281281 return (m_address & 0xffffff00 ) == 0xe0000000 ;
282282}
283283
284+ bool
285+ Ipv4Address::IsLinkLocal () const
286+ {
287+ NS_LOG_FUNCTION (this );
288+ // Link-Local address is 169.254.0.0/16
289+ return (m_address & 0xffff0000 ) == 0xa9fe0000 ;
290+ }
291+
284292void
285293Ipv4Address::Serialize (uint8_t buf[4 ]) const
286294{
Original file line number Diff line number Diff line change @@ -112,6 +112,14 @@ class Ipv4Address
112112 * @return true only if address is in local multicast address scope, 224.0.0.0/24
113113 */
114114 bool IsLocalMulticast () const ;
115+ /* *
116+ * @brief If the IPv4 address is an APIPA address (169.254/16).
117+ *
118+ * The Automatic Private IP Address is described in \RFC{3927}
119+ *
120+ * @return true if the address is link-local, false otherwise
121+ */
122+ bool IsLinkLocal () const ;
115123 /* *
116124 * @brief Combine this address with a network mask
117125 *
You can’t perform that action at this time.
0 commit comments