mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
Clean up IGMP naming
This commit is contained in:
@@ -124,7 +124,7 @@
|
|||||||
* (0x11); in other messages it is set to 0 and ignored by the receiver.
|
* (0x11); in other messages it is set to 0 and ignored by the receiver.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct uip_igmphdr_s
|
struct igmp_iphdr_s
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
|
|
||||||
@@ -224,7 +224,8 @@ struct igmp_group_s
|
|||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
#define EXTERN extern "C"
|
#define EXTERN extern "C"
|
||||||
extern "C" {
|
extern "C"
|
||||||
|
{
|
||||||
#else
|
#else
|
||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
@@ -237,7 +238,7 @@ EXTERN uip_ipaddr_t g_allrouters;
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmpdevinit
|
* Name: igmp_devinit
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called when a new network device is registered to configure that device
|
* Called when a new network device is registered to configure that device
|
||||||
@@ -245,9 +246,11 @@ EXTERN uip_ipaddr_t g_allrouters;
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
EXTERN void uip_igmpdevinit(struct uip_driver_s *dev);
|
void igmp_devinit(FAR struct uip_driver_s *dev);
|
||||||
EXTERN int igmp_joingroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr);
|
int igmp_joingroup(FAR struct uip_driver_s *dev,
|
||||||
EXTERN int igmp_leavegroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr);
|
FAR const struct in_addr *grpaddr);
|
||||||
|
int igmp_leavegroup(FAR struct uip_driver_s *dev,
|
||||||
|
FAR const struct in_addr *grpaddr);
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ NET_CSRCS += arp_inout.c arp_table.c arp_timer.c
|
|||||||
|
|
||||||
DEPPATH += --dep-path arp
|
DEPPATH += --dep-path arp
|
||||||
VPATH += :arp
|
VPATH += :arp
|
||||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)net$(DELIM)arp}
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -54,6 +54,5 @@ endif
|
|||||||
|
|
||||||
DEPPATH += --dep-path icmp
|
DEPPATH += --dep-path icmp
|
||||||
VPATH += :icmp
|
VPATH += :icmp
|
||||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)net$(DELIM)icmp}
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -0,0 +1,95 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* net/icmp/icmp.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 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_ICMP_ICMP_H
|
||||||
|
#define __NET_ICMP_ICMP_H
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_NET_ICMP
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Type Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
# define EXTERN extern "C"
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#else
|
||||||
|
# define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Function Prototypes
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* Defined in icmp_input.c **************************************************/
|
||||||
|
|
||||||
|
void icmp_input(FAR struct uip_driver_s *dev);
|
||||||
|
|
||||||
|
/* Defined in icmp_poll.c ***************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_NET_ICMP_PING
|
||||||
|
void icmp_poll(FAR struct uip_driver_s *dev);
|
||||||
|
#endif /* CONFIG_NET_ICMP_PING */
|
||||||
|
|
||||||
|
/* Defined in icmp_send.c ***************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_NET_ICMP_PING
|
||||||
|
void icmp_send(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *destaddr);
|
||||||
|
#endif /* CONFIG_NET_ICMP_PING */
|
||||||
|
|
||||||
|
#undef EXTERN
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* CONFIG_NET_ICMP */
|
||||||
|
#endif /* __NET_ICMP_ICMP_H */
|
||||||
+1
-2
@@ -39,14 +39,13 @@ ifeq ($(CONFIG_NET),y)
|
|||||||
|
|
||||||
ifeq ($(CONFIG_NET_IGMP),y)
|
ifeq ($(CONFIG_NET_IGMP),y)
|
||||||
|
|
||||||
NET_CSRCS += igmp_group.c igmp_init.c igmp_input.c igmp_join.c igmp_leave.c
|
NET_CSRCS += igmp_group.c igmp_initialize.c igmp_input.c igmp_join.c igmp_leave.c
|
||||||
NET_CSRCS += igmp_mcastmac.c igmp_msg.c igmp_poll.c igmp_send.c igmp_timer.c
|
NET_CSRCS += igmp_mcastmac.c igmp_msg.c igmp_poll.c igmp_send.c igmp_timer.c
|
||||||
|
|
||||||
# Include igmp build support
|
# Include igmp build support
|
||||||
|
|
||||||
DEPPATH += --dep-path igmp
|
DEPPATH += --dep-path igmp
|
||||||
VPATH += :igmp
|
VPATH += :igmp
|
||||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)net$(DELIM)uip}
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
+125
@@ -0,0 +1,125 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* net/igmp/igmp.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 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_IGMP_IGMP_H
|
||||||
|
#define _NET_IGMP_IGMP_H
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Type Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
# define EXTERN extern "C"
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#else
|
||||||
|
# define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Function Prototypes
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* Defined in igmp_init.c ***************************************************/
|
||||||
|
|
||||||
|
void igmp_initialize(void);
|
||||||
|
|
||||||
|
/* Defined in igmp_input.c **************************************************/
|
||||||
|
|
||||||
|
void igmp_input(struct uip_driver_s *dev);
|
||||||
|
|
||||||
|
/* Defined in igmp_group.c **************************************************/
|
||||||
|
|
||||||
|
void igmp_grpinit(void);
|
||||||
|
FAR struct igmp_group_s *igmp_grpalloc(FAR struct uip_driver_s *dev,
|
||||||
|
FAR const uip_ipaddr_t *addr);
|
||||||
|
FAR struct igmp_group_s *igmp_grpfind(FAR struct uip_driver_s *dev,
|
||||||
|
FAR const uip_ipaddr_t *addr);
|
||||||
|
FAR struct igmp_group_s *igmp_grpallocfind(FAR struct uip_driver_s *dev,
|
||||||
|
FAR const uip_ipaddr_t *addr);
|
||||||
|
void igmp_grpfree(FAR struct uip_driver_s *dev,
|
||||||
|
FAR struct igmp_group_s *group);
|
||||||
|
|
||||||
|
/* Defined in igmp_msg.c ****************************************************/
|
||||||
|
|
||||||
|
void igmp_schedmsg(FAR struct igmp_group_s *group, uint8_t msgid);
|
||||||
|
void igmp_waitmsg(FAR struct igmp_group_s *group, uint8_t msgid);
|
||||||
|
|
||||||
|
/* Defined in igmp_poll.c ***************************************************/
|
||||||
|
|
||||||
|
void igmp_poll(FAR struct uip_driver_s *dev);
|
||||||
|
|
||||||
|
/* Defined in igmp_send.c ***************************************************/
|
||||||
|
|
||||||
|
void igmp_send(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group,
|
||||||
|
FAR uip_ipaddr_t *dest);
|
||||||
|
|
||||||
|
/* Defined in igmp_timer.c **************************************************/
|
||||||
|
|
||||||
|
int igmp_decisec2tick(int decisecs);
|
||||||
|
void igmp_startticks(FAR struct igmp_group_s *group, int ticks);
|
||||||
|
void igmp_starttimer(FAR struct igmp_group_s *group, uint8_t decisecs);
|
||||||
|
bool igmp_cmptimer(FAR struct igmp_group_s *group, int maxticks);
|
||||||
|
|
||||||
|
/* Defined in igmp_mcastmac *************************************************/
|
||||||
|
|
||||||
|
void igmp_addmcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip);
|
||||||
|
void igmp_removemcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip);
|
||||||
|
|
||||||
|
#undef EXTERN
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* CONFIG_NET_IGMP */
|
||||||
|
#endif /* _NET_IGMP_IGMP_H */
|
||||||
+22
-21
@@ -59,6 +59,7 @@
|
|||||||
#include <nuttx/net/igmp.h>
|
#include <nuttx/net/igmp.h>
|
||||||
|
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
@@ -133,7 +134,7 @@ static FAR sq_queue_t g_freelist;
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_grpheapalloc
|
* Name: igmp_grpheapalloc
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Allocate a new group from heap memory.
|
* Allocate a new group from heap memory.
|
||||||
@@ -143,13 +144,13 @@ static FAR sq_queue_t g_freelist;
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static inline FAR struct igmp_group_s *uip_grpheapalloc(void)
|
static inline FAR struct igmp_group_s *igmp_grpheapalloc(void)
|
||||||
{
|
{
|
||||||
return (FAR struct igmp_group_s *)kzalloc(sizeof(struct igmp_group_s));
|
return (FAR struct igmp_group_s *)kzalloc(sizeof(struct igmp_group_s));
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_grpprealloc
|
* Name: igmp_grpprealloc
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Allocate a new group from the pre-allocated groups.
|
* Allocate a new group from the pre-allocated groups.
|
||||||
@@ -161,7 +162,7 @@ static inline FAR struct igmp_group_s *uip_grpheapalloc(void)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if CONFIG_PREALLOC_IGMPGROUPS > 0
|
#if CONFIG_PREALLOC_IGMPGROUPS > 0
|
||||||
static inline FAR struct igmp_group_s *uip_grpprealloc(void)
|
static inline FAR struct igmp_group_s *igmp_grpprealloc(void)
|
||||||
{
|
{
|
||||||
FAR struct igmp_group_s *group =
|
FAR struct igmp_group_s *group =
|
||||||
(FAR struct igmp_group_s *)sq_remfirst(&g_freelist);
|
(FAR struct igmp_group_s *)sq_remfirst(&g_freelist);
|
||||||
@@ -181,7 +182,7 @@ static inline FAR struct igmp_group_s *uip_grpprealloc(void)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_grpinit
|
* Name: igmp_grpinit
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* One-time initialization of group data.
|
* One-time initialization of group data.
|
||||||
@@ -191,7 +192,7 @@ static inline FAR struct igmp_group_s *uip_grpprealloc(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_grpinit(void)
|
void igmp_grpinit(void)
|
||||||
{
|
{
|
||||||
FAR struct igmp_group_s *group;
|
FAR struct igmp_group_s *group;
|
||||||
int i;
|
int i;
|
||||||
@@ -208,7 +209,7 @@ void uip_grpinit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_grpalloc
|
* Name: igmp_grpalloc
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Allocate a new group from heap memory.
|
* Allocate a new group from heap memory.
|
||||||
@@ -218,8 +219,8 @@ void uip_grpinit(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR struct igmp_group_s *uip_grpalloc(FAR struct uip_driver_s *dev,
|
FAR struct igmp_group_s *igmp_grpalloc(FAR struct uip_driver_s *dev,
|
||||||
FAR const uip_ipaddr_t *addr)
|
FAR const uip_ipaddr_t *addr)
|
||||||
{
|
{
|
||||||
FAR struct igmp_group_s *group;
|
FAR struct igmp_group_s *group;
|
||||||
uip_lock_t flags;
|
uip_lock_t flags;
|
||||||
@@ -229,7 +230,7 @@ FAR struct igmp_group_s *uip_grpalloc(FAR struct uip_driver_s *dev,
|
|||||||
{
|
{
|
||||||
#if CONFIG_PREALLOC_IGMPGROUPS > 0
|
#if CONFIG_PREALLOC_IGMPGROUPS > 0
|
||||||
grplldbg("Use a pre-allocated group entry\n");
|
grplldbg("Use a pre-allocated group entry\n");
|
||||||
group = uip_grpprealloc();
|
group = igmp_grpprealloc();
|
||||||
#else
|
#else
|
||||||
grplldbg("Cannot allocate from interrupt handler\n");
|
grplldbg("Cannot allocate from interrupt handler\n");
|
||||||
group = NULL;
|
group = NULL;
|
||||||
@@ -238,7 +239,7 @@ FAR struct igmp_group_s *uip_grpalloc(FAR struct uip_driver_s *dev,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
grplldbg("Allocate from the heap\n");
|
grplldbg("Allocate from the heap\n");
|
||||||
group = uip_grpheapalloc();
|
group = igmp_grpheapalloc();
|
||||||
}
|
}
|
||||||
|
|
||||||
grplldbg("group: %p\n", group);
|
grplldbg("group: %p\n", group);
|
||||||
@@ -271,7 +272,7 @@ FAR struct igmp_group_s *uip_grpalloc(FAR struct uip_driver_s *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_grpfind
|
* Name: igmp_grpfind
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Find an existing group.
|
* Find an existing group.
|
||||||
@@ -281,8 +282,8 @@ FAR struct igmp_group_s *uip_grpalloc(FAR struct uip_driver_s *dev,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR struct igmp_group_s *uip_grpfind(FAR struct uip_driver_s *dev,
|
FAR struct igmp_group_s *igmp_grpfind(FAR struct uip_driver_s *dev,
|
||||||
FAR const uip_ipaddr_t *addr)
|
FAR const uip_ipaddr_t *addr)
|
||||||
{
|
{
|
||||||
FAR struct igmp_group_s *group;
|
FAR struct igmp_group_s *group;
|
||||||
uip_lock_t flags;
|
uip_lock_t flags;
|
||||||
@@ -311,7 +312,7 @@ FAR struct igmp_group_s *uip_grpfind(FAR struct uip_driver_s *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_grpallocfind
|
* Name: igmp_grpallocfind
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Find an existing group. If not found, create a new group for the
|
* Find an existing group. If not found, create a new group for the
|
||||||
@@ -322,15 +323,15 @@ FAR struct igmp_group_s *uip_grpfind(FAR struct uip_driver_s *dev,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR struct igmp_group_s *uip_grpallocfind(FAR struct uip_driver_s *dev,
|
FAR struct igmp_group_s *igmp_grpallocfind(FAR struct uip_driver_s *dev,
|
||||||
FAR const uip_ipaddr_t *addr)
|
FAR const uip_ipaddr_t *addr)
|
||||||
{
|
{
|
||||||
FAR struct igmp_group_s *group = uip_grpfind(dev, addr);
|
FAR struct igmp_group_s *group = igmp_grpfind(dev, addr);
|
||||||
|
|
||||||
grplldbg("group: %p addr: %08x\n", group, (int)*addr);
|
grplldbg("group: %p addr: %08x\n", group, (int)*addr);
|
||||||
if (!group)
|
if (!group)
|
||||||
{
|
{
|
||||||
group = uip_grpalloc(dev, addr);
|
group = igmp_grpalloc(dev, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
grplldbg("group: %p\n", group);
|
grplldbg("group: %p\n", group);
|
||||||
@@ -338,7 +339,7 @@ FAR struct igmp_group_s *uip_grpallocfind(FAR struct uip_driver_s *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_grpfree
|
* Name: igmp_grpfree
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Release a previously allocated group.
|
* Release a previously allocated group.
|
||||||
@@ -348,7 +349,7 @@ FAR struct igmp_group_s *uip_grpallocfind(FAR struct uip_driver_s *dev,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_grpfree(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group)
|
void igmp_grpfree(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group)
|
||||||
{
|
{
|
||||||
uip_lock_t flags;
|
uip_lock_t flags;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* net/igmp/igmp_init.c
|
* net/igmp/igmp_init.c
|
||||||
* IGMP initialization logic
|
* IGMP initialization logic
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2010, 2014 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* The NuttX implementation of IGMP was inspired by the IGMP add-on for the
|
* The NuttX implementation of IGMP was inspired by the IGMP add-on for the
|
||||||
@@ -51,6 +51,7 @@
|
|||||||
#include <nuttx/net/igmp.h>
|
#include <nuttx/net/igmp.h>
|
||||||
|
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
@@ -74,14 +75,14 @@ uip_ipaddr_t g_allrouters;
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmpinit
|
* Name: igmp_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Perform one-time IGMP initialization.
|
* Perform one-time IGMP initialization.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_igmpinit(void)
|
void igmp_initialize(void)
|
||||||
{
|
{
|
||||||
nvdbg("IGMP initializing\n");
|
nvdbg("IGMP initializing\n");
|
||||||
|
|
||||||
@@ -90,11 +91,11 @@ void uip_igmpinit(void)
|
|||||||
|
|
||||||
/* Initialize the group allocation logic */
|
/* Initialize the group allocation logic */
|
||||||
|
|
||||||
uip_grpinit();
|
igmp_grpinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmpdevinit
|
* Name: igmp_devinit
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called when a new network device is registered to configure that device
|
* Called when a new network device is registered to configure that device
|
||||||
@@ -102,19 +103,19 @@ void uip_igmpinit(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_igmpdevinit(struct uip_driver_s *dev)
|
void igmp_devinit(struct uip_driver_s *dev)
|
||||||
{
|
{
|
||||||
nvdbg("IGMP initializing dev %p\n", dev);
|
nvdbg("IGMP initializing dev %p\n", dev);
|
||||||
DEBUGASSERT(dev->grplist.head == NULL);
|
DEBUGASSERT(dev->grplist.head == NULL);
|
||||||
|
|
||||||
/* Add the all systems address to the group */
|
/* Add the all systems address to the group */
|
||||||
|
|
||||||
(void)uip_grpalloc(dev, &g_allsystems);
|
(void)igmp_grpalloc(dev, &g_allsystems);
|
||||||
|
|
||||||
/* Allow the IGMP messages at the MAC level */
|
/* Allow the IGMP messages at the MAC level */
|
||||||
|
|
||||||
uip_addmcastmac(dev, &g_allrouters);
|
igmp_addmcastmac(dev, &g_allrouters);
|
||||||
uip_addmcastmac(dev, &g_allsystems);
|
igmp_addmcastmac(dev, &g_allsystems);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_NET_IGMP */
|
#endif /* CONFIG_NET_IGMP */
|
||||||
+15
-14
@@ -52,6 +52,7 @@
|
|||||||
#include <nuttx/net/igmp.h>
|
#include <nuttx/net/igmp.h>
|
||||||
|
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
@@ -59,7 +60,7 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define IGMPBUF ((struct uip_igmphdr_s *)&dev->d_buf[UIP_LLH_LEN])
|
#define IGMPBUF ((struct igmp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN])
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
@@ -70,7 +71,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmpinput
|
* Name: igmp_input
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* An IGMP packet has been received.
|
* An IGMP packet has been received.
|
||||||
@@ -111,7 +112,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_igmpinput(struct uip_driver_s *dev)
|
void igmp_input(struct uip_driver_s *dev)
|
||||||
{
|
{
|
||||||
FAR struct igmp_group_s *group;
|
FAR struct igmp_group_s *group;
|
||||||
uip_ipaddr_t destipaddr;
|
uip_ipaddr_t destipaddr;
|
||||||
@@ -141,7 +142,7 @@ void uip_igmpinput(struct uip_driver_s *dev)
|
|||||||
/* Find the group (or create a new one) using the incoming IP address*/
|
/* Find the group (or create a new one) using the incoming IP address*/
|
||||||
|
|
||||||
destipaddr = uip_ip4addr_conv(IGMPBUF->destipaddr);
|
destipaddr = uip_ip4addr_conv(IGMPBUF->destipaddr);
|
||||||
group = uip_grpallocfind(dev, &destipaddr);
|
group = igmp_grpallocfind(dev, &destipaddr);
|
||||||
if (!group)
|
if (!group)
|
||||||
{
|
{
|
||||||
nlldbg("Failed to allocate/find group: %08x\n", destipaddr);
|
nlldbg("Failed to allocate/find group: %08x\n", destipaddr);
|
||||||
@@ -205,11 +206,11 @@ void uip_igmpinput(struct uip_driver_s *dev)
|
|||||||
|
|
||||||
if (!uip_ipaddr_cmp(member->grpaddr, g_allsystems))
|
if (!uip_ipaddr_cmp(member->grpaddr, g_allsystems))
|
||||||
{
|
{
|
||||||
ticks = uip_decisec2tick((int)IGMPBUF->maxresp);
|
ticks = igmp_decisec2tick((int)IGMPBUF->maxresp);
|
||||||
if (IS_IDLEMEMBER(member->flags) ||
|
if (IS_IDLEMEMBER(member->flags) ||
|
||||||
uip_igmpcmptimer(member, ticks))
|
igmp_cmptimer(member, ticks))
|
||||||
{
|
{
|
||||||
uip_igmpstartticks(member, ticks);
|
igmp_startticks(member, ticks);
|
||||||
CLR_IDLEMEMBER(member->flags);
|
CLR_IDLEMEMBER(member->flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -225,11 +226,11 @@ void uip_igmpinput(struct uip_driver_s *dev)
|
|||||||
|
|
||||||
IGMP_STATINCR(uip_stat.igmp.ucast_query);
|
IGMP_STATINCR(uip_stat.igmp.ucast_query);
|
||||||
grpaddr = uip_ip4addr_conv(IGMPBUF->grpaddr);
|
grpaddr = uip_ip4addr_conv(IGMPBUF->grpaddr);
|
||||||
group = uip_grpallocfind(dev, &grpaddr);
|
group = igmp_grpallocfind(dev, &grpaddr);
|
||||||
ticks = uip_decisec2tick((int)IGMPBUF->maxresp);
|
ticks = igmp_decisec2tick((int)IGMPBUF->maxresp);
|
||||||
if (IS_IDLEMEMBER(group->flags) || uip_igmpcmptimer(group, ticks))
|
if (IS_IDLEMEMBER(group->flags) || igmp_cmptimer(group, ticks))
|
||||||
{
|
{
|
||||||
uip_igmpstartticks(group, ticks);
|
igmp_startticks(group, ticks);
|
||||||
CLR_IDLEMEMBER(group->flags);
|
CLR_IDLEMEMBER(group->flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -244,10 +245,10 @@ void uip_igmpinput(struct uip_driver_s *dev)
|
|||||||
|
|
||||||
nlldbg("Query to a specific group with the group address as destination\n");
|
nlldbg("Query to a specific group with the group address as destination\n");
|
||||||
|
|
||||||
ticks = uip_decisec2tick((int)IGMPBUF->maxresp);
|
ticks = igmp_decisec2tick((int)IGMPBUF->maxresp);
|
||||||
if (IS_IDLEMEMBER(group->flags) || uip_igmpcmptimer(group, ticks))
|
if (IS_IDLEMEMBER(group->flags) || igmp_cmptimer(group, ticks))
|
||||||
{
|
{
|
||||||
uip_igmpstartticks(group, ticks);
|
igmp_startticks(group, ticks);
|
||||||
CLR_IDLEMEMBER(group->flags);
|
CLR_IDLEMEMBER(group->flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
#include <nuttx/net/igmp.h>
|
#include <nuttx/net/igmp.h>
|
||||||
|
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
@@ -128,27 +129,27 @@ int igmp_joingroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr)
|
|||||||
|
|
||||||
/* Check if a this address is already in the group */
|
/* Check if a this address is already in the group */
|
||||||
|
|
||||||
group = uip_grpfind(dev, &grpaddr->s_addr);
|
group = igmp_grpfind(dev, &grpaddr->s_addr);
|
||||||
if (!group)
|
if (!group)
|
||||||
{
|
{
|
||||||
/* No... allocate a new entry */
|
/* No... allocate a new entry */
|
||||||
|
|
||||||
nvdbg("Join to new group: %08x\n", grpaddr->s_addr);
|
nvdbg("Join to new group: %08x\n", grpaddr->s_addr);
|
||||||
group = uip_grpalloc(dev, &grpaddr->s_addr);
|
group = igmp_grpalloc(dev, &grpaddr->s_addr);
|
||||||
IGMP_STATINCR(uip_stat.igmp.joins);
|
IGMP_STATINCR(uip_stat.igmp.joins);
|
||||||
|
|
||||||
/* Send the Membership Report */
|
/* Send the Membership Report */
|
||||||
|
|
||||||
IGMP_STATINCR(uip_stat.igmp.report_sched);
|
IGMP_STATINCR(uip_stat.igmp.report_sched);
|
||||||
uip_igmpwaitmsg(group, IGMPv2_MEMBERSHIP_REPORT);
|
igmp_waitmsg(group, IGMPv2_MEMBERSHIP_REPORT);
|
||||||
|
|
||||||
/* And start the timer at 10*100 msec */
|
/* And start the timer at 10*100 msec */
|
||||||
|
|
||||||
uip_igmpstarttimer(group, 10);
|
igmp_starttimer(group, 10);
|
||||||
|
|
||||||
/* Add the group (MAC) address to the ether drivers MAC filter list */
|
/* Add the group (MAC) address to the ether drivers MAC filter list */
|
||||||
|
|
||||||
uip_addmcastmac(dev, (FAR uip_ipaddr_t *)&grpaddr->s_addr);
|
igmp_addmcastmac(dev, (FAR uip_ipaddr_t *)&grpaddr->s_addr);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
#include <nuttx/net/igmp.h>
|
#include <nuttx/net/igmp.h>
|
||||||
|
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
@@ -136,7 +137,7 @@ int igmp_leavegroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr)
|
|||||||
|
|
||||||
/* Find the entry corresponding to the address leaving the group */
|
/* Find the entry corresponding to the address leaving the group */
|
||||||
|
|
||||||
group = uip_grpfind(dev, &grpaddr->s_addr);
|
group = igmp_grpfind(dev, &grpaddr->s_addr);
|
||||||
ndbg("Leaving group: %p\n", group);
|
ndbg("Leaving group: %p\n", group);
|
||||||
if (group)
|
if (group)
|
||||||
{
|
{
|
||||||
@@ -160,16 +161,16 @@ int igmp_leavegroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr)
|
|||||||
{
|
{
|
||||||
ndbg("Schedule Leave Group message\n");
|
ndbg("Schedule Leave Group message\n");
|
||||||
IGMP_STATINCR(uip_stat.igmp.leave_sched);
|
IGMP_STATINCR(uip_stat.igmp.leave_sched);
|
||||||
uip_igmpwaitmsg(group, IGMP_LEAVE_GROUP);
|
igmp_waitmsg(group, IGMP_LEAVE_GROUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the group structure (state is now Non-Member */
|
/* Free the group structure (state is now Non-Member */
|
||||||
|
|
||||||
uip_grpfree(dev, group);
|
igmp_grpfree(dev, group);
|
||||||
|
|
||||||
/* And remove the group address from the ethernet drivers MAC filter set */
|
/* And remove the group address from the ethernet drivers MAC filter set */
|
||||||
|
|
||||||
uip_removemcastmac(dev, (FAR uip_ipaddr_t *)&grpaddr->s_addr);
|
igmp_removemcastmac(dev, (FAR uip_ipaddr_t *)&grpaddr->s_addr);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
#include <nuttx/net/uip.h>
|
#include <nuttx/net/uip.h>
|
||||||
|
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
@@ -90,14 +91,14 @@ static void uip_mcastmac(uip_ipaddr_t *ip, FAR uint8_t *mac)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_addmcastmac
|
* Name: igmp_addmcastmac
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Add an IGMP MAC address to the device's MAC filter table.
|
* Add an IGMP MAC address to the device's MAC filter table.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_addmcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip)
|
void igmp_addmcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip)
|
||||||
{
|
{
|
||||||
uint8_t mcastmac[6];
|
uint8_t mcastmac[6];
|
||||||
|
|
||||||
@@ -110,14 +111,14 @@ void uip_addmcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_removemcastmac
|
* Name: igmp_removemcastmac
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Remove an IGMP MAC address from the device's MAC filter table.
|
* Remove an IGMP MAC address from the device's MAC filter table.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_removemcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip)
|
void igmp_removemcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip)
|
||||||
{
|
{
|
||||||
uint8_t mcastmac[6];
|
uint8_t mcastmac[6];
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -51,6 +51,7 @@
|
|||||||
#include <nuttx/net/igmp.h>
|
#include <nuttx/net/igmp.h>
|
||||||
|
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
@@ -67,7 +68,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmpschedmsg
|
* Name: igmp_schedmsg
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Schedule a message to be send at the next driver polling interval.
|
* Schedule a message to be send at the next driver polling interval.
|
||||||
@@ -77,7 +78,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_igmpschedmsg(FAR struct igmp_group_s *group, uint8_t msgid)
|
void igmp_schedmsg(FAR struct igmp_group_s *group, uint8_t msgid)
|
||||||
{
|
{
|
||||||
uip_lock_t flags;
|
uip_lock_t flags;
|
||||||
|
|
||||||
@@ -91,7 +92,7 @@ void uip_igmpschedmsg(FAR struct igmp_group_s *group, uint8_t msgid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmpwaitmsg
|
* Name: igmp_waitmsg
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Schedule a message to be send at the next driver polling interval and
|
* Schedule a message to be send at the next driver polling interval and
|
||||||
@@ -103,7 +104,7 @@ void uip_igmpschedmsg(FAR struct igmp_group_s *group, uint8_t msgid)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_igmpwaitmsg(FAR struct igmp_group_s *group, uint8_t msgid)
|
void igmp_waitmsg(FAR struct igmp_group_s *group, uint8_t msgid)
|
||||||
{
|
{
|
||||||
uip_lock_t flags;
|
uip_lock_t flags;
|
||||||
|
|
||||||
@@ -112,7 +113,7 @@ void uip_igmpwaitmsg(FAR struct igmp_group_s *group, uint8_t msgid)
|
|||||||
flags = uip_lock();
|
flags = uip_lock();
|
||||||
DEBUGASSERT(!IS_WAITMSG(group->flags));
|
DEBUGASSERT(!IS_WAITMSG(group->flags));
|
||||||
SET_WAITMSG(group->flags);
|
SET_WAITMSG(group->flags);
|
||||||
uip_igmpschedmsg(group, msgid);
|
igmp_schedmsg(group, msgid);
|
||||||
|
|
||||||
/* Then wait for the message to be sent */
|
/* Then wait for the message to be sent */
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
#include <nuttx/net/netdev.h>
|
#include <nuttx/net/netdev.h>
|
||||||
|
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
@@ -104,7 +105,7 @@ static inline void uip_schedsend(FAR struct uip_driver_s *dev, FAR struct igmp_g
|
|||||||
|
|
||||||
/* Send the message */
|
/* Send the message */
|
||||||
|
|
||||||
uip_igmpsend(dev, group, dest);
|
igmp_send(dev, group, dest);
|
||||||
|
|
||||||
/* Indicate that the message has been sent */
|
/* Indicate that the message has been sent */
|
||||||
|
|
||||||
@@ -125,7 +126,7 @@ static inline void uip_schedsend(FAR struct uip_driver_s *dev, FAR struct igmp_g
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmppoll
|
* Name: igmp_poll
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Poll the groups associated with the device to see if any IGMP messages
|
* Poll the groups associated with the device to see if any IGMP messages
|
||||||
@@ -140,7 +141,7 @@ static inline void uip_schedsend(FAR struct uip_driver_s *dev, FAR struct igmp_g
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_igmppoll(FAR struct uip_driver_s *dev)
|
void igmp_poll(FAR struct uip_driver_s *dev)
|
||||||
{
|
{
|
||||||
FAR struct igmp_group_s *group;
|
FAR struct igmp_group_s *group;
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
#include <nuttx/net/igmp.h>
|
#include <nuttx/net/igmp.h>
|
||||||
|
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
@@ -73,7 +74,7 @@
|
|||||||
/* Buffer layout */
|
/* Buffer layout */
|
||||||
|
|
||||||
#define RASIZE (4)
|
#define RASIZE (4)
|
||||||
#define IGMPBUF ((struct uip_igmphdr_s *)&dev->d_buf[UIP_LLH_LEN])
|
#define IGMPBUF ((struct igmp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN])
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Variables
|
* Public Variables
|
||||||
@@ -87,7 +88,7 @@
|
|||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static uint16_t uip_igmpchksum(FAR uint8_t *buffer, int buflen)
|
static uint16_t igmp_chksum(FAR uint8_t *buffer, int buflen)
|
||||||
{
|
{
|
||||||
uint16_t sum = uip_chksum((FAR uint16_t*)buffer, buflen);
|
uint16_t sum = uip_chksum((FAR uint16_t*)buffer, buflen);
|
||||||
return sum ? sum : 0xffff;
|
return sum ? sum : 0xffff;
|
||||||
@@ -98,7 +99,7 @@ static uint16_t uip_igmpchksum(FAR uint8_t *buffer, int buflen)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmpsend
|
* Name: igmp_send
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Sends an IGMP IP packet on a network interface. This function constructs
|
* Sends an IGMP IP packet on a network interface. This function constructs
|
||||||
@@ -118,8 +119,8 @@ static uint16_t uip_igmpchksum(FAR uint8_t *buffer, int buflen)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_igmpsend(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group,
|
void igmp_send(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group,
|
||||||
FAR uip_ipaddr_t *destipaddr)
|
FAR uip_ipaddr_t *destipaddr)
|
||||||
{
|
{
|
||||||
nllvdbg("msgid: %02x destipaddr: %08x\n", group->msgid, (int)*destipaddr);
|
nllvdbg("msgid: %02x destipaddr: %08x\n", group->msgid, (int)*destipaddr);
|
||||||
|
|
||||||
@@ -158,7 +159,7 @@ void uip_igmpsend(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group,
|
|||||||
/* Calculate IP checksum. */
|
/* Calculate IP checksum. */
|
||||||
|
|
||||||
IGMPBUF->ipchksum = 0;
|
IGMPBUF->ipchksum = 0;
|
||||||
IGMPBUF->ipchksum = ~uip_igmpchksum((FAR uint8_t *)IGMPBUF, UIP_IPH_LEN + RASIZE);
|
IGMPBUF->ipchksum = ~igmp_chksum((FAR uint8_t *)IGMPBUF, UIP_IPH_LEN + RASIZE);
|
||||||
|
|
||||||
/* Set up the IGMP message */
|
/* Set up the IGMP message */
|
||||||
|
|
||||||
@@ -169,7 +170,7 @@ void uip_igmpsend(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group,
|
|||||||
/* Calculate the IGMP checksum. */
|
/* Calculate the IGMP checksum. */
|
||||||
|
|
||||||
IGMPBUF->chksum = 0;
|
IGMPBUF->chksum = 0;
|
||||||
IGMPBUF->chksum = ~uip_igmpchksum(&IGMPBUF->type, UIP_IPIGMPH_LEN);
|
IGMPBUF->chksum = ~igmp_chksum(&IGMPBUF->type, UIP_IPIGMPH_LEN);
|
||||||
|
|
||||||
IGMP_STATINCR(uip_stat.igmp.poll_send);
|
IGMP_STATINCR(uip_stat.igmp.poll_send);
|
||||||
IGMP_STATINCR(uip_stat.ip.sent);
|
IGMP_STATINCR(uip_stat.ip.sent);
|
||||||
|
|||||||
+14
-13
@@ -53,6 +53,7 @@
|
|||||||
#include <nuttx/net/igmp.h>
|
#include <nuttx/net/igmp.h>
|
||||||
|
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
|
||||||
@@ -99,7 +100,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmptimeout
|
* Name: igmp_timeout
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Timeout watchdog handler.
|
* Timeout watchdog handler.
|
||||||
@@ -110,7 +111,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void uip_igmptimeout(int argc, uint32_t arg, ...)
|
static void igmp_timeout(int argc, uint32_t arg, ...)
|
||||||
{
|
{
|
||||||
FAR struct igmp_group_s *group;
|
FAR struct igmp_group_s *group;
|
||||||
|
|
||||||
@@ -134,7 +135,7 @@ static void uip_igmptimeout(int argc, uint32_t arg, ...)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
IGMP_STATINCR(uip_stat.igmp.report_sched);
|
IGMP_STATINCR(uip_stat.igmp.report_sched);
|
||||||
uip_igmpschedmsg(group, IGMPv2_MEMBERSHIP_REPORT);
|
igmp_schedmsg(group, IGMPv2_MEMBERSHIP_REPORT);
|
||||||
|
|
||||||
/* Also note: The Membership Report is sent at most two times becasue
|
/* Also note: The Membership Report is sent at most two times becasue
|
||||||
* the timer is not reset here. Hmm.. does this mean that the group
|
* the timer is not reset here. Hmm.. does this mean that the group
|
||||||
@@ -151,7 +152,7 @@ static void uip_igmptimeout(int argc, uint32_t arg, ...)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmpstarttimer
|
* Name: igmp_starttimer
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Start the IGMP timer.
|
* Start the IGMP timer.
|
||||||
@@ -161,7 +162,7 @@ static void uip_igmptimeout(int argc, uint32_t arg, ...)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int uip_decisec2tick(int decisecs)
|
int igmp_decisec2tick(int decisecs)
|
||||||
{
|
{
|
||||||
/* Convert the deci-second comparison value to clock ticks. The CLK_TCK
|
/* Convert the deci-second comparison value to clock ticks. The CLK_TCK
|
||||||
* value is the number of clock ticks per second; decisecs argument is the
|
* value is the number of clock ticks per second; decisecs argument is the
|
||||||
@@ -173,7 +174,7 @@ int uip_decisec2tick(int decisecs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmpstartticks and uip_igmpstarttimer
|
* Name: igmp_startticks and igmp_starttimer
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Start the IGMP timer with differing time units (ticks or deciseconds).
|
* Start the IGMP timer with differing time units (ticks or deciseconds).
|
||||||
@@ -183,7 +184,7 @@ int uip_decisec2tick(int decisecs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uip_igmpstartticks(FAR struct igmp_group_s *group, int ticks)
|
void igmp_startticks(FAR struct igmp_group_s *group, int ticks)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -191,24 +192,24 @@ void uip_igmpstartticks(FAR struct igmp_group_s *group, int ticks)
|
|||||||
|
|
||||||
gtmrlldbg("ticks: %d\n", ticks);
|
gtmrlldbg("ticks: %d\n", ticks);
|
||||||
|
|
||||||
ret = wd_start(group->wdog, ticks, uip_igmptimeout, 1, (uint32_t)group);
|
ret = wd_start(group->wdog, ticks, igmp_timeout, 1, (uint32_t)group);
|
||||||
|
|
||||||
DEBUGASSERT(ret == OK);
|
DEBUGASSERT(ret == OK);
|
||||||
UNUSED(ret);
|
UNUSED(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uip_igmpstarttimer(FAR struct igmp_group_s *group, uint8_t decisecs)
|
void igmp_starttimer(FAR struct igmp_group_s *group, uint8_t decisecs)
|
||||||
{
|
{
|
||||||
/* Convert the decisec value to system clock ticks and start the timer.
|
/* Convert the decisec value to system clock ticks and start the timer.
|
||||||
* Important!! this should be a random timer from 0 to decisecs
|
* Important!! this should be a random timer from 0 to decisecs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
gtmrdbg("decisecs: %d\n", decisecs);
|
gtmrdbg("decisecs: %d\n", decisecs);
|
||||||
uip_igmpstartticks(group, uip_decisec2tick(decisecs));
|
igmp_startticks(group, igmp_decisec2tick(decisecs));
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: uip_igmpcmptimer
|
* Name: igmp_cmptimer
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Compare the timer remaining on the watching timer to the deci-second
|
* Compare the timer remaining on the watching timer to the deci-second
|
||||||
@@ -217,11 +218,11 @@ void uip_igmpstarttimer(FAR struct igmp_group_s *group, uint8_t decisecs)
|
|||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function may be called from most any context. If true is returned
|
* This function may be called from most any context. If true is returned
|
||||||
* then the caller must call uip_igmpstartticks() to restart the timer
|
* then the caller must call igmp_startticks() to restart the timer
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
bool uip_igmpcmptimer(FAR struct igmp_group_s *group, int maxticks)
|
bool igmp_cmptimer(FAR struct igmp_group_s *group, int maxticks)
|
||||||
{
|
{
|
||||||
uip_lock_t flags;
|
uip_lock_t flags;
|
||||||
int remaining;
|
int remaining;
|
||||||
|
|||||||
@@ -51,6 +51,5 @@ endif
|
|||||||
|
|
||||||
DEPPATH += --dep-path iob
|
DEPPATH += --dep-path iob
|
||||||
VPATH += :iob
|
VPATH += :iob
|
||||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)net$(DELIM)iob}
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ int netdev_register(FAR struct uip_driver_s *dev)
|
|||||||
/* Configure the device for IGMP support */
|
/* Configure the device for IGMP support */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
uip_igmpdevinit(dev);
|
igmp_devinit(dev);
|
||||||
#endif
|
#endif
|
||||||
netdev_semgive();
|
netdev_semgive();
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ NET_CSRCS += pkt_poll.c
|
|||||||
|
|
||||||
DEPPATH += --dep-path pkt
|
DEPPATH += --dep-path pkt
|
||||||
VPATH += :pkt
|
VPATH += :pkt
|
||||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)net$(DELIM)pkt}
|
|
||||||
|
|
||||||
endif # CONFIG_NET_PKT
|
endif # CONFIG_NET_PKT
|
||||||
endif # CONFIG_NET
|
endif # CONFIG_NET
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ endif
|
|||||||
|
|
||||||
DEPPATH += --dep-path tcp
|
DEPPATH += --dep-path tcp
|
||||||
VPATH += :tcp
|
VPATH += :tcp
|
||||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)net$(DELIM)tcp}
|
|
||||||
|
|
||||||
endif # CONFIG_NET_TCP
|
endif # CONFIG_NET_TCP
|
||||||
endif # CONFIG_NET
|
endif # CONFIG_NET
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ NET_CSRCS += udp_conn.c udp_poll.c udp_send.c udp_input.c udp_callback.c
|
|||||||
|
|
||||||
DEPPATH += --dep-path udp
|
DEPPATH += --dep-path udp
|
||||||
VPATH += :udp
|
VPATH += :udp
|
||||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)net$(DELIM)udp}
|
|
||||||
|
|
||||||
endif # CONFIG_NET_UDP
|
endif # CONFIG_NET_UDP
|
||||||
endif # CONFIG_NET
|
endif # CONFIG_NET
|
||||||
|
|||||||
@@ -68,6 +68,5 @@ endif
|
|||||||
|
|
||||||
DEPPATH += --dep-path uip
|
DEPPATH += --dep-path uip
|
||||||
VPATH += :uip
|
VPATH += :uip
|
||||||
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)net$(DELIM)uip}
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
+2
-50
@@ -90,7 +90,8 @@ extern struct uip_callback_s *g_echocallback;
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define EXTERN extern "C"
|
#define EXTERN extern "C"
|
||||||
extern "C" {
|
extern "C"
|
||||||
|
{
|
||||||
#else
|
#else
|
||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
@@ -125,55 +126,6 @@ void uip_pktpoll(struct uip_driver_s *dev, struct uip_pkt_conn *conn);
|
|||||||
|
|
||||||
#endif /* CONFIG_NET_PKT */
|
#endif /* CONFIG_NET_PKT */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
|
||||||
/* Defined in igmp_init.c ***************************************************/
|
|
||||||
|
|
||||||
void uip_igmpinit(void);
|
|
||||||
|
|
||||||
/* Defined in igmp_input.c **************************************************/
|
|
||||||
|
|
||||||
void uip_igmpinput(struct uip_driver_s *dev);
|
|
||||||
|
|
||||||
/* Defined in igmp_group.c **************************************************/
|
|
||||||
|
|
||||||
void uip_grpinit(void);
|
|
||||||
FAR struct igmp_group_s *uip_grpalloc(FAR struct uip_driver_s *dev,
|
|
||||||
FAR const uip_ipaddr_t *addr);
|
|
||||||
FAR struct igmp_group_s *uip_grpfind(FAR struct uip_driver_s *dev,
|
|
||||||
FAR const uip_ipaddr_t *addr);
|
|
||||||
FAR struct igmp_group_s *uip_grpallocfind(FAR struct uip_driver_s *dev,
|
|
||||||
FAR const uip_ipaddr_t *addr);
|
|
||||||
void uip_grpfree(FAR struct uip_driver_s *dev,
|
|
||||||
FAR struct igmp_group_s *group);
|
|
||||||
|
|
||||||
/* Defined in igmp_msg.c ****************************************************/
|
|
||||||
|
|
||||||
void uip_igmpschedmsg(FAR struct igmp_group_s *group, uint8_t msgid);
|
|
||||||
void uip_igmpwaitmsg(FAR struct igmp_group_s *group, uint8_t msgid);
|
|
||||||
|
|
||||||
/* Defined in igmp_poll.c ***************************************************/
|
|
||||||
|
|
||||||
void uip_igmppoll(FAR struct uip_driver_s *dev);
|
|
||||||
|
|
||||||
/* Defined in igmp_send.c ***************************************************/
|
|
||||||
|
|
||||||
void uip_igmpsend(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group,
|
|
||||||
FAR uip_ipaddr_t *dest);
|
|
||||||
|
|
||||||
/* Defined in igmp_timer.c **************************************************/
|
|
||||||
|
|
||||||
int uip_decisec2tick(int decisecs);
|
|
||||||
void uip_igmpstartticks(FAR struct igmp_group_s *group, int ticks);
|
|
||||||
void uip_igmpstarttimer(FAR struct igmp_group_s *group, uint8_t decisecs);
|
|
||||||
bool uip_igmpcmptimer(FAR struct igmp_group_s *group, int maxticks);
|
|
||||||
|
|
||||||
/* Defined in igmp_mcastmac *****************************************************/
|
|
||||||
|
|
||||||
void uip_addmcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip);
|
|
||||||
void uip_removemcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip);
|
|
||||||
|
|
||||||
#endif /* CONFIG_NET_IGMP */
|
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
#include <nuttx/net/uip.h>
|
#include <nuttx/net/uip.h>
|
||||||
#include <nuttx/net/netdev.h>
|
#include <nuttx/net/netdev.h>
|
||||||
|
|
||||||
#include "uip.h"
|
#include "uip/uip.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
#include <nuttx/net/uip.h>
|
#include <nuttx/net/uip.h>
|
||||||
#include <nuttx/net/netdev.h>
|
#include <nuttx/net/netdev.h>
|
||||||
|
|
||||||
#include "uip.h"
|
#include "uip/uip.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
#include "tcp/tcp.h"
|
#include "tcp/tcp.h"
|
||||||
#include "udp/udp.h"
|
#include "udp/udp.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -156,7 +157,7 @@ void uip_initialize(void)
|
|||||||
/* Initialize IGMP support */
|
/* Initialize IGMP support */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
uip_igmpinit();
|
igmp_initialize();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_NET */
|
#endif /* CONFIG_NET */
|
||||||
|
|||||||
+3
-2
@@ -97,6 +97,7 @@
|
|||||||
#include "tcp/tcp.h"
|
#include "tcp/tcp.h"
|
||||||
#include "udp/udp.h"
|
#include "udp/udp.h"
|
||||||
#include "icmp/icmp.h"
|
#include "icmp/icmp.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -458,7 +459,7 @@ int uip_input(struct uip_driver_s *dev)
|
|||||||
{
|
{
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
uip_ipaddr_t destip = uip_ip4addr_conv(pbuf->destipaddr);
|
uip_ipaddr_t destip = uip_ip4addr_conv(pbuf->destipaddr);
|
||||||
if (uip_grpfind(dev, &destip) == NULL)
|
if (igmp_grpfind(dev, &destip) == NULL)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_NET_STATISTICS
|
#ifdef CONFIG_NET_STATISTICS
|
||||||
@@ -536,7 +537,7 @@ int uip_input(struct uip_driver_s *dev)
|
|||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
#ifndef CONFIG_NET_IPv6
|
#ifndef CONFIG_NET_IPv6
|
||||||
case UIP_PROTO_IGMP: /* IGMP input */
|
case UIP_PROTO_IGMP: /* IGMP input */
|
||||||
uip_igmpinput(dev);
|
igmp_input(dev);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+4
-3
@@ -50,6 +50,7 @@
|
|||||||
#include "tcp/tcp.h"
|
#include "tcp/tcp.h"
|
||||||
#include "udp/udp.h"
|
#include "udp/udp.h"
|
||||||
#include "icmp/icmp.h"
|
#include "icmp/icmp.h"
|
||||||
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
@@ -125,7 +126,7 @@ static inline int uip_pollicmp(FAR struct uip_driver_s *dev,
|
|||||||
* Function: uip_polligmp
|
* Function: uip_polligmp
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Poll all UDP connections for available packets to send.
|
* Poll all IGMP connections for available packets to send.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function is called from the MAC device driver and may be called from
|
* This function is called from the MAC device driver and may be called from
|
||||||
@@ -137,9 +138,9 @@ static inline int uip_pollicmp(FAR struct uip_driver_s *dev,
|
|||||||
static inline int uip_polligmp(FAR struct uip_driver_s *dev,
|
static inline int uip_polligmp(FAR struct uip_driver_s *dev,
|
||||||
uip_poll_callback_t callback)
|
uip_poll_callback_t callback)
|
||||||
{
|
{
|
||||||
/* Perform the UDP TX poll */
|
/* Perform the IGMP TX poll */
|
||||||
|
|
||||||
uip_igmppoll(dev);
|
igmp_poll(dev);
|
||||||
|
|
||||||
/* Call back into the driver */
|
/* Call back into the driver */
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
#include <nuttx/net/uip.h>
|
#include <nuttx/net/uip.h>
|
||||||
|
|
||||||
#include "uip.h"
|
#include "uip/uip.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
|
|||||||
Reference in New Issue
Block a user