tests: posix: headers: net: Add IPv6 join/leave group

The IPV6_JOIN/LEAVE_GROUP corresponds to IPV6_ADD/DROP_MEMBERSHIP
definitions so define the former and add tests for them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
Jukka Rissanen 2024-11-08 15:59:22 +02:00 committed by Anas Nashif
parent 5216b52477
commit 96795f0b6c
2 changed files with 8 additions and 2 deletions

View File

@ -1225,6 +1225,12 @@ struct ip_mreqn {
/** Leave IPv6 multicast group. */
#define IPV6_DROP_MEMBERSHIP 21
/** Join IPv6 multicast group. */
#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
/** Leave IPv6 multicast group. */
#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
/**
* @brief Struct used when joining or leaving a IPv6 multicast group.
*/

View File

@ -63,8 +63,8 @@ ZTEST(posix_headers, test_netinet_in_h)
zassert_equal(INET_ADDRSTRLEN, 16);
zassert_equal(INET6_ADDRSTRLEN, 46);
/* zassert_not_equal(-1, IPV6_JOIN_GROUP); */ /* not implemented */
/* zassert_not_equal(-1, IPV6_LEAVE_GROUP); */ /* not implemented */
zassert_equal(IPV6_ADD_MEMBERSHIP, IPV6_JOIN_GROUP);
zassert_equal(IPV6_DROP_MEMBERSHIP, IPV6_LEAVE_GROUP);
/* zassert_not_equal(-1, IPV6_MULTICAST_HOPS); */ /* not implemented */
/* zassert_not_equal(-1, IPV6_MULTICAST_IF); */ /* not implemented */
/* zassert_not_equal(-1, IPV6_MULTICAST_LOOP); */ /* not implemented */