-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: ipv6: Make Multicast Listener Discovery API public
IPv6 MLD API was so far defined in an internal header. This does not seem correct though, as application code should be able to join/leave multicast groups, hence the API should be exposed in a public header, just as it is done for its IPv4 countepart - IGMP. Signed-off-by: Robert Lubos <[email protected]>
- Loading branch information
Showing
12 changed files
with
95 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright (c) 2016 Intel Corporation | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/** @file | ||
* @brief Multicast Listener Discovery API | ||
*/ | ||
|
||
#ifndef ZEPHYR_INCLUDE_NET_MLD_H_ | ||
#define ZEPHYR_INCLUDE_NET_MLD_H_ | ||
|
||
/** | ||
* @brief MLD (Multicast Listener Discovery) | ||
* @defgroup mld Multicast Listener Discovery API | ||
* @since 1.8 | ||
* @version 0.8.0 | ||
* @ingroup networking | ||
* @{ | ||
*/ | ||
|
||
#include <errno.h> | ||
|
||
#include <zephyr/net/net_if.h> | ||
#include <zephyr/net/net_ip.h> | ||
#include <zephyr/toolchain.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief Join a given multicast group. | ||
* | ||
* @param iface Network interface where join message is sent | ||
* @param addr Multicast group to join | ||
* | ||
* @return 0 if joining was done, <0 otherwise. | ||
*/ | ||
#if defined(CONFIG_NET_IPV6_MLD) | ||
int net_ipv6_mld_join(struct net_if *iface, const struct in6_addr *addr); | ||
#else | ||
static inline int | ||
net_ipv6_mld_join(struct net_if *iface, const struct in6_addr *addr) | ||
{ | ||
Check notice on line 47 in include/zephyr/net/mld.h GitHub Actions / Run compliance checks on patch series (PR)You may want to run clang-format on this change
|
||
ARG_UNUSED(addr); | ||
ARG_UNUSED(iface); | ||
|
||
return -ENOTSUP; | ||
} | ||
#endif /* CONFIG_NET_IPV6_MLD */ | ||
|
||
/** | ||
* @brief Leave a given multicast group. | ||
* | ||
* @param iface Network interface where leave message is sent | ||
* @param addr Multicast group to leave | ||
* | ||
* @return 0 if leaving is done, <0 otherwise. | ||
*/ | ||
#if defined(CONFIG_NET_IPV6_MLD) | ||
int net_ipv6_mld_leave(struct net_if *iface, const struct in6_addr *addr); | ||
#else | ||
static inline int | ||
net_ipv6_mld_leave(struct net_if *iface, const struct in6_addr *addr) | ||
{ | ||
Check notice on line 68 in include/zephyr/net/mld.h GitHub Actions / Run compliance checks on patch series (PR)You may want to run clang-format on this change
|
||
ARG_UNUSED(iface); | ||
ARG_UNUSED(addr); | ||
|
||
return -ENOTSUP; | ||
} | ||
#endif /* CONFIG_NET_IPV6_MLD */ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
#endif /* ZEPHYR_INCLUDE_NET_MLD_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters