batman-adv: Send multicast packets to nodes with a WANT_ALL flag
[cascardo/linux.git] / net / batman-adv / packet.h
index 2dd8f24..c7f6eef 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2013 B.A.T.M.A.N. contributors:
+/* Copyright (C) 2007-2014 B.A.T.M.A.N. contributors:
  *
  * Marek Lindner, Simon Wunderlich
  *
@@ -12,9 +12,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef _NET_BATMAN_ADV_PACKET_H_
@@ -91,6 +89,19 @@ enum batadv_icmp_packettype {
        BATADV_PARAMETER_PROBLEM       = 12,
 };
 
+/**
+ * enum batadv_mcast_flags - flags for multicast capabilities and settings
+ * @BATADV_MCAST_WANT_ALL_UNSNOOPABLES: we want all packets destined for
+ *  224.0.0.0/24 or ff02::1
+ * @BATADV_MCAST_WANT_ALL_IPV4: we want all IPv4 multicast packets
+ * @BATADV_MCAST_WANT_ALL_IPV6: we want all IPv6 multicast packets
+ */
+enum batadv_mcast_flags {
+       BATADV_MCAST_WANT_ALL_UNSNOOPABLES      = BIT(0),
+       BATADV_MCAST_WANT_ALL_IPV4              = BIT(1),
+       BATADV_MCAST_WANT_ALL_IPV6              = BIT(2),
+};
+
 /* tt data subtypes */
 #define BATADV_TT_DATA_TYPE_MASK 0x0F
 
@@ -117,6 +128,7 @@ enum batadv_tt_client_flags {
        BATADV_TT_CLIENT_DEL     = BIT(0),
        BATADV_TT_CLIENT_ROAM    = BIT(1),
        BATADV_TT_CLIENT_WIFI    = BIT(4),
+       BATADV_TT_CLIENT_ISOLA   = BIT(5),
        BATADV_TT_CLIENT_NOPURGE = BIT(8),
        BATADV_TT_CLIENT_NEW     = BIT(9),
        BATADV_TT_CLIENT_PENDING = BIT(10),
@@ -146,6 +158,7 @@ enum batadv_bla_claimframe {
  * @BATADV_TVLV_NC: network coding tvlv
  * @BATADV_TVLV_TT: translation table tvlv
  * @BATADV_TVLV_ROAM: roaming advertisement tvlv
+ * @BATADV_TVLV_MCAST: multicast capability tvlv
  */
 enum batadv_tvlv_type {
        BATADV_TVLV_GW          = 0x01,
@@ -153,6 +166,7 @@ enum batadv_tvlv_type {
        BATADV_TVLV_NC          = 0x03,
        BATADV_TVLV_TT          = 0x04,
        BATADV_TVLV_ROAM        = 0x05,
+       BATADV_TVLV_MCAST       = 0x06,
 };
 
 #pragma pack(2)
@@ -505,4 +519,14 @@ struct batadv_tvlv_roam_adv {
        __be16 vid;
 };
 
+/**
+ * struct batadv_tvlv_mcast_data - payload of a multicast tvlv
+ * @flags: multicast flags announced by the orig node
+ * @reserved: reserved field
+ */
+struct batadv_tvlv_mcast_data {
+       uint8_t flags;
+       uint8_t reserved[3];
+};
+
 #endif /* _NET_BATMAN_ADV_PACKET_H_ */