Add helpers to check if an IP address is multicast.

Change-Id: Ib7141b5d6f40f4513eb67b59981ca5d3d235d9fa
diff --git a/tcpip/header/ipv4.go b/tcpip/header/ipv4.go
index ca6c1d3..9474522 100644
--- a/tcpip/header/ipv4.go
+++ b/tcpip/header/ipv4.go
@@ -249,3 +249,12 @@
 
 	return true
 }
+
+// IsV4MulticastAddress determines if the provided address is an IPv4
+// multicast address (range 224.0.0.0 to 239.255.255.255).
+func IsV4MulticastAddress(addr tcpip.Address) bool {
+	if len(addr) != IPv4AddressSize {
+		return false
+	}
+	return (addr[0] & 0xf0) == 0xe0
+}
diff --git a/tcpip/header/ipv6.go b/tcpip/header/ipv6.go
index b77bbae..b15b3bb 100644
--- a/tcpip/header/ipv6.go
+++ b/tcpip/header/ipv6.go
@@ -184,3 +184,12 @@
 
 	return true
 }
+
+// IsV6MulticastAddress determines if the provided address is an IPv6
+// multicast address (anything starting with FF).
+func IsV6MulticastAddress(addr tcpip.Address) bool {
+	if len(addr) != IPv6AddressSize {
+		return false
+	}
+	return addr[0] == 0xff
+}