Microchip® Advanced Software Framework

mld6.h File Reference

Multicast listener discovery for IPv6.

Aims to be compliant with RFC 2710. No support for MLDv2.

#include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/netif.h"

Data Structures

struct  mld_group
 
struct  mld_header
 Multicast listener report/query/done message header. More...
 

Macros

#define MLD6_ADD_MAC_FILTER   1
 
#define MLD6_DEL_MAC_FILTER   0
 
#define mld6_init()   /* TODO should we init tables? */
 
#define MLD6_TMR_INTERVAL   100 /* Milliseconds */
 

Functions

void mld6_input (struct pbuf *p, struct netif *inp)
 Process an input MLD message. More...
 
err_t mld6_joingroup (ip6_addr_t *srcaddr, ip6_addr_t *groupaddr)
 Join a group on a network interface. More...
 
err_t mld6_leavegroup (ip6_addr_t *srcaddr, ip6_addr_t *groupaddr)
 Leave a group on a network interface. More...
 
struct mld_groupmld6_lookfor_group (struct netif *ifp, ip6_addr_t *addr)
 Search for a group that is joined on a netif. More...
 
void mld6_report_groups (struct netif *netif)
 Report MLD memberships for this interface. More...
 
err_t mld6_stop (struct netif *netif)
 Stop MLD processing on interface. More...
 
void mld6_tmr (void)
 Periodic timer for mld processing. More...
 

Variables

PACK_STRUCT_BEGIN struct mld_header PACK_STRUCT_STRUCT
 

#define MLD6_ADD_MAC_FILTER   1

Referenced by mld6_joingroup().

#define MLD6_DEL_MAC_FILTER   0

Referenced by mld6_leavegroup(), and mld6_stop().

#define mld6_init ( )    /* TODO should we init tables? */

Referenced by lwip_init().

#define MLD6_TMR_INTERVAL   100 /* Milliseconds */

void mld6_input ( struct pbuf p,
struct netif inp 
)
err_t mld6_joingroup ( ip6_addr_t srcaddr,
ip6_addr_t groupaddr 
)

Join a group on a network interface.

Parameters
srcaddripv6 address of the network interface which should join a new group. If IP6_ADDR_ANY, join on all netifs
groupaddrthe ipv6 address of the group to join
Returns
ERR_OK if group was joined on the netif(s), an err_t otherwise

References ERR_MEM, ERR_OK, ERR_VAL, ICMP6_TYPE_MLR, ip6_addr_cmp, ip6_addr_isany, MLD6_ADD_MAC_FILTER, mld6_delayed_report(), MLD6_JOIN_DELAYING_MEMBER_TMR_MS, mld6_lookfor_group(), mld6_new_group(), mld6_send(), MLD6_STATS_INC, netif::mld_mac_filter, netif_ip6_addr, netif_list, netif::next, NULL, and mld_group::use.

Referenced by lwip_netconn_do_join_leave_group(), and nd6_tmr().

err_t mld6_leavegroup ( ip6_addr_t srcaddr,
ip6_addr_t groupaddr 
)

Leave a group on a network interface.

Parameters
srcaddripv6 address of the network interface which should leave the group. If IP6_ISANY, leave on all netifs
groupaddrthe ipv6 address of the group to leave
Returns
ERR_OK if group was left on the netif(s), an err_t otherwise

References ERR_OK, ERR_VAL, ICMP6_TYPE_MLD, ip6_addr_cmp, ip6_addr_isany, mld_group::last_reporter_flag, MLD6_DEL_MAC_FILTER, mld6_free_group(), mld6_lookfor_group(), mld6_send(), MLD6_STATS_INC, netif::mld_mac_filter, netif_ip6_addr, netif_list, netif::next, NULL, and mld_group::use.

Referenced by lwip_netconn_do_join_leave_group(), and nd6_input().

struct mld_group* mld6_lookfor_group ( struct netif ifp,
ip6_addr_t addr 
)

Search for a group that is joined on a netif.

Parameters
ifpthe network interface for which to look
addrthe group ipv6 address to search for
Returns
a struct mld_group* if the group has been found, NULL if the group wasn't found.

References mld_group::group_address, ip6_addr_cmp, mld_group_list, mld_group::netif, mld_group::next, and NULL.

Referenced by ip6_input(), mld6_input(), mld6_joingroup(), and mld6_leavegroup().

void mld6_report_groups ( struct netif netif)

Report MLD memberships for this interface.

Parameters
netifnetwork interface on which report MLD memberships

References mld6_delayed_report(), MLD6_JOIN_DELAYING_MEMBER_TMR_MS, mld_group_list, mld_group::netif, mld_group::next, and NULL.

Referenced by netif_set_link_up(), and netif_set_up().

err_t mld6_stop ( struct netif netif)

Stop MLD processing on interface.

Parameters
netifnetwork interface on which stop MLD processing

References ERR_OK, mld_group::group_address, memp_free(), MLD6_DEL_MAC_FILTER, mld_group_list, netif::mld_mac_filter, mld_group::netif, mld_group::next, next, and NULL.

Referenced by netif_remove().

void mld6_tmr ( void  )

Periodic timer for mld processing.

Must be called every MLD6_TMR_INTERVAL milliseconds (100).

When a delaying member expires, a membership report is sent.

References mld_group::group_state, ICMP6_TYPE_MLR, MLD6_GROUP_DELAYING_MEMBER, MLD6_GROUP_IDLE_MEMBER, mld6_send(), MLD6_STATS_INC, mld_group_list, mld_group::next, NULL, and mld_group::timer.

Referenced by mld6_timer().

PACK_STRUCT_BEGIN struct mld_header PACK_STRUCT_STRUCT