batman-adv: mcast: implement multicast packet generation
authorLinus Lüssing <linus.luessing@c0d3.blue>
Thu, 7 Sep 2023 01:09:09 +0000 (03:09 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Tue, 14 Nov 2023 07:16:34 +0000 (08:16 +0100)
commit90039133221e33964ccb4a536dad7eb0a372fff7
treef2128719fa18c5f03897e18faf0c40419a58cba1
parent07afe1ba288c04280622fa002ed385f1ac0b6fe6
batman-adv: mcast: implement multicast packet generation

Implement the preparation of a batman-adv multicast packet and use this
under certain conditions.

For one thing this implements the capability to push a complete
batman-adv multicast packet header, including a tracker TVLV with all
originator destinations that have signaled interest in it, onto a given
ethernet frame with an IP multicast packet inside.

For another checks are implemented to determine if encapsulating a
multicast packet in this new batman-adv multicast packet type and using
it is feasible. Those checks are:

1) Have all nodes signaled that they are capable of handling the new
   batman-adv multicast packet type?
2) Do all active hard interfaces of all nodes, including us, have an MTU
   of at least 1280 bytes?
3) Does a complete multicast packet header with all its destination
   addresses fit onto the given multicast packet / ethernet frame and
   does not exceed 1280 bytes?

If all checks passed then the new batman-adv multicast packet type will
be used for transmission and distribution. Otherwise we fall back to one or
more batman-adv unicast packet transmissions, if possible. Or if not
possible we will fall back to classic flooding through a batman-adv
broadcast packet.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/multicast.c
net/batman-adv/multicast.h
net/batman-adv/multicast_forw.c
net/batman-adv/soft-interface.c
net/batman-adv/types.h