Multicast listener discovery for IPv6.
Aims to be compliant with RFC 2710. No support for MLDv2.
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_group * | mld6_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 */ |
Referenced by mld6_delayed_report(), mld6_timer(), and sys_timeouts_init().
Process an input MLD message.
Called by icmp6_input.
p | the mld packet, p->payload pointing to the icmpv6 header |
inp | the netif on which this packet was received |
References mld_group::group_address, mld_group::group_state, ICMP6_TYPE_MLD, ICMP6_TYPE_MLQ, ICMP6_TYPE_MLR, ip6_addr_isallnodes_linklocal, ip6_addr_isany, ip6_addr_ismulticast_iflocal, ip6_current_dest_addr, mld_group::last_reporter_flag, pbuf::len, mld6_delayed_report(), MLD6_GROUP_DELAYING_MEMBER, MLD6_GROUP_IDLE_MEMBER, mld6_lookfor_group(), MLD6_STATS_INC, mld_group_list, mld_group::netif, mld_group::next, NULL, pbuf::payload, pbuf_free(), and mld_group::timer.
Referenced by icmp6_input().
err_t mld6_joingroup | ( | ip6_addr_t * | srcaddr, |
ip6_addr_t * | groupaddr | ||
) |
Join a group on a network interface.
srcaddr | ipv6 address of the network interface which should join a new group. If IP6_ADDR_ANY, join on all netifs |
groupaddr | the ipv6 address of the group to join |
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.
srcaddr | ipv6 address of the network interface which should leave the group. If IP6_ISANY, leave on all netifs |
groupaddr | the ipv6 address of the group to leave |
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.
ifp | the network interface for which to look |
addr | the group ipv6 address to search for |
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().
Report MLD memberships for this interface.
netif | network 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().
Stop MLD processing on interface.
netif | network 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().
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 |