-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: ipv6: Make Multicast Listener Discovery API public #79274
Open
rlubos
wants to merge
1
commit into
zephyrproject-rtos:main
Choose a base branch
from
rlubos:net/make-ipv6-mld-api-public
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+95
−42
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the API existed before as internal but it seems odd to state 1.8 here since strictly speaking it's being introduced only now as public API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API could have been called earlier too by the application even if it was internal, so I think it is ok to have the version set when the API was created.