forked from apache/nuttx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/mld: Add basic build structure for Multicast Listener Discovery (…
…MLD). No real MLD logic yet. Only a few hooks to capture and dispatch MLD ICMPv6 packets.
- Loading branch information
1 parent
a3c67df
commit dde1e89
Showing
11 changed files
with
304 additions
and
4 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# For a description of the syntax of this configuration file, | ||
# see the file kconfig-language.txt in the NuttX tools repository. | ||
# | ||
|
||
if NET_ICMPv6 | ||
|
||
menuconfig NET_MLD | ||
bool "Multicast Listener Discovery (MLD)" | ||
default n | ||
depends on EXPERIMENTAL | ||
---help--- | ||
Enable Multicast Listener Discovery (MLD) support. | ||
|
||
if NET_MLD | ||
|
||
endif # NET_MLD | ||
endif # NET_ICMPv6 |
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,47 @@ | ||
############################################################################ | ||
# net/mld/Make.defs | ||
# | ||
# Copyright (C) 2018 Gregory Nutt. All rights reserved. | ||
# Author: Gregory Nutt <gnutt@nuttx.org> | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# | ||
# 1. Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# 2. Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in | ||
# the documentation and/or other materials provided with the | ||
# distribution. | ||
# 3. Neither the name NuttX nor the names of its contributors may be | ||
# used to endorse or promote products derived from this software | ||
# without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | ||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
# POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
############################################################################ | ||
|
||
# Logic specific to Multicast Listener Discovery (MLD) | ||
|
||
ifeq ($(CONFIG_NET_MLD),y) | ||
|
||
SOCK_CSRCS += | ||
NET_CSRCS += | ||
|
||
# Include MLD build support | ||
|
||
DEPPATH += --dep-path mld | ||
VPATH += :mld | ||
endif |
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,149 @@ | ||
/**************************************************************************** | ||
* net/mld/mld.h | ||
* Multicast Listener Discovery (MLD) Definitions | ||
* | ||
* Copyright (C) 2018 Gregory Nutt. All rights reserved. | ||
* Author: Gregory Nutt <gnutt@nuttx.org> | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* 3. Neither the name NuttX nor the names of its contributors may be | ||
* used to endorse or promote products derived from this software | ||
* without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | ||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
****************************************************************************/ | ||
|
||
#ifndef __NET_NETLINK_MLD_H | ||
#define __NET_NETLINK_MLD_H | ||
|
||
/**************************************************************************** | ||
* Included Files | ||
****************************************************************************/ | ||
|
||
#include <nuttx/config.h> | ||
|
||
#include <sys/types.h> | ||
#include <queue.h> | ||
#include <semaphore.h> | ||
|
||
#include "devif/devif.h" | ||
#include "socket/socket.h" | ||
|
||
#ifdef CONFIG_NET_MLD | ||
|
||
/**************************************************************************** | ||
* Pre-processor Definitions | ||
****************************************************************************/ | ||
|
||
/**************************************************************************** | ||
* Public Type Definitions | ||
****************************************************************************/ | ||
|
||
/**************************************************************************** | ||
* Public Data | ||
****************************************************************************/ | ||
|
||
#ifdef __cplusplus | ||
# define EXTERN extern "C" | ||
extern "C" | ||
{ | ||
#else | ||
# define EXTERN extern | ||
#endif | ||
|
||
/**************************************************************************** | ||
* Public Function Prototypes | ||
****************************************************************************/ | ||
|
||
struct net_driver_s; /* Forward reference */ | ||
struct mld_mcast_listen_query_s; /* Forward reference */ | ||
struct mld_mcast_listen_report_v1_s; /* Forward reference */ | ||
struct mld_mcast_listen_report_v2_s; /* Forward reference */ | ||
struct mld_mcast_listen_done_v1_s; /* Forward reference */ | ||
|
||
/**************************************************************************** | ||
* Name: mld_initialize() | ||
* | ||
* Description: | ||
* Initialize the MLD structures. Called once and only from the | ||
* networking layer. | ||
* | ||
****************************************************************************/ | ||
|
||
void mld_initialize(void); | ||
|
||
/**************************************************************************** | ||
* Name: mld_query | ||
* | ||
* Description: | ||
* Called from icmpv6_input() when a Multicast Listener Query is received. | ||
* | ||
****************************************************************************/ | ||
|
||
int mld_query_input(FAR struct net_driver_s *dev, | ||
FAR const struct mld_mcast_listen_query_s *query); | ||
|
||
/**************************************************************************** | ||
* Name: mld_report_v1 | ||
* | ||
* Description: | ||
* Called from icmpv6_input() when a Version 1 Multicast Listener Report is | ||
* received. | ||
* | ||
****************************************************************************/ | ||
|
||
int mld_report_v1(FAR struct net_driver_s *dev, | ||
FAR const struct mld_mcast_listen_report_v1_s *report); | ||
|
||
/**************************************************************************** | ||
* Name: mld_report_v2 | ||
* | ||
* Description: | ||
* Called from icmpv6_input() when a Version 2 Multicast Listener Report is | ||
* received. | ||
* | ||
****************************************************************************/ | ||
|
||
int mld_report_v2(FAR struct net_driver_s *dev, | ||
FAR const struct mld_mcast_listen_report_v2_s *report); | ||
|
||
/**************************************************************************** | ||
* Name: mld_done_v1 | ||
* | ||
* Description: | ||
* Called from icmpv6_input() when a Version 1 Multicast Listener Done is | ||
* received. | ||
* | ||
****************************************************************************/ | ||
|
||
int mld_done_v1(FAR struct net_driver_s *dev, | ||
FAR const struct mld_mcast_listen_done_v1_s *done); | ||
|
||
#undef EXTERN | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* CONFIG_NET_MLD */ | ||
#endif /* __NET_NETLINK_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