Lines Matching +full:multicast +full:- +full:hash
8 * SPDX-License-Identifier: Apache-2.0
66 return -ENOBUFS; in igmp_v2_create()
69 igmp->type = type; in igmp_v2_create()
70 igmp->max_rsp = 0U; in igmp_v2_create()
71 net_ipaddr_copy(&igmp->address, addr); in igmp_v2_create()
72 igmp->chksum = 0; in igmp_v2_create()
75 return -ENOBUFS; in igmp_v2_create()
78 igmp->chksum = net_calc_chksum_igmp(pkt); in igmp_v2_create()
84 if (net_pkt_write(pkt, &igmp->chksum, sizeof(igmp->chksum))) { in igmp_v2_create()
85 return -ENOBUFS; in igmp_v2_create()
104 return -ENOBUFS; in igmp_v3_create()
109 * all systems multicast address of 224.0.0.1 so skip over it. in igmp_v3_create()
110 * Since the IGMP all systems multicast address is marked as in igmp_v3_create()
123 igmp->type = type; in igmp_v3_create()
124 igmp->reserved_1 = 0U; in igmp_v3_create()
125 igmp->reserved_2 = 0U; in igmp_v3_create()
126 igmp->groups_len = htons(group_count); in igmp_v3_create()
130 igmp->chksum = 0; in igmp_v3_create()
133 return -ENOBUFS; in igmp_v3_create()
138 * all systems multicast address of 224.0.0.1 so skip over it. in igmp_v3_create()
139 * Since the IGMP all systems multicast address is marked as in igmp_v3_create()
152 return -ENOBUFS; in igmp_v3_create()
155 group_record->type = mcast[i].record_type; in igmp_v3_create()
156 group_record->aux_len = 0U; in igmp_v3_create()
157 net_ipaddr_copy(&group_record->address, &mcast[i].address.in_addr); in igmp_v3_create()
158 group_record->sources_len = htons(mcast[i].sources_len); in igmp_v3_create()
161 return -ENOBUFS; in igmp_v3_create()
167 return -ENOBUFS; in igmp_v3_create()
172 igmp->chksum = net_calc_chksum_igmp(pkt); in igmp_v3_create()
178 if (net_pkt_write(pkt, &igmp->chksum, sizeof(igmp->chksum))) { in igmp_v3_create()
179 return -ENOBUFS; in igmp_v3_create()
205 return -ENOBUFS; in igmp_v2_create_packet()
210 return -ENOBUFS; in igmp_v2_create_packet()
231 return -ENOBUFS; in igmp_v3_create_packet()
236 return -ENOBUFS; in igmp_v3_create_packet()
266 struct net_if_ipv4 *ipv4 = iface->config.ip.ipv4; in send_igmp_report()
272 return -ENOENT; in send_igmp_report()
277 * all systems multicast address of 224.0.0.1 so skip over it. in send_igmp_report()
278 * Since the IGMP all systems multicast address is marked as in send_igmp_report()
282 if (!ipv4->mcast[i].is_used || !ipv4->mcast[i].is_joined || in send_igmp_report()
283 net_ipv4_addr_cmp_raw((uint8_t *)&ipv4->mcast[i].address.in_addr, in send_igmp_report()
292 return -ESRCH; in send_igmp_report()
297 * all systems multicast address of 224.0.0.1 so skip over it. in send_igmp_report()
298 * Since the IGMP all systems multicast address is marked as in send_igmp_report()
302 if (!ipv4->mcast[i].is_used || !ipv4->mcast[i].is_joined || in send_igmp_report()
303 net_ipv4_addr_cmp_raw((uint8_t *)&ipv4->mcast[i].address.in_addr, in send_igmp_report()
314 return -ENOMEM; in send_igmp_report()
317 /* Send the IGMP V2 membership report to the group multicast in send_igmp_report()
320 ret = igmp_v2_create_packet(pkt, &ipv4->mcast[i].address.in_addr, in send_igmp_report()
321 &ipv4->mcast[i].address.in_addr, in send_igmp_report()
347 struct net_if_ipv4 *ipv4 = iface->config.ip.ipv4; in send_igmp_v3_report()
353 return -ENOENT; in send_igmp_v3_report()
358 * all systems multicast address of 224.0.0.1 so skip over it. in send_igmp_v3_report()
359 * Since the IGMP all systems multicast address is marked as in send_igmp_v3_report()
363 if (!ipv4->mcast[i].is_used || !ipv4->mcast[i].is_joined || in send_igmp_v3_report()
364 net_ipv4_addr_cmp_raw((uint8_t *)&ipv4->mcast[i].address.in_addr, in send_igmp_v3_report()
370 source_count += ipv4->mcast[i].sources_len; in send_igmp_v3_report()
374 return -ESRCH; in send_igmp_v3_report()
384 return -ENOMEM; in send_igmp_v3_report()
387 /* Send the IGMP V3 membership report to the igmp multicast in send_igmp_v3_report()
391 ret = igmp_v3_create_packet(pkt, &igmp_multicast_addr, ipv4->mcast, NET_IF_MAX_IPV4_MADDR, in send_igmp_v3_report()
421 pkt->buffer->len - (net_pkt_ip_hdr_len(pkt) + net_pkt_ipv4_opts_len(pkt));
443 if (!net_ipv4_addr_cmp_raw(ip_hdr->dst, (uint8_t *)&all_systems)) {
482 dbg_addr_recv("Internet Group Management Protocol", &ip_hdr->src, &ip_hdr->dst);
520 return -ENOMEM;
523 /* Send the IGMP V2 membership report to the group multicast
525 * should be sent to the ALL ROUTERS multicast address (224.0.0.2)
558 sizeof(struct in_addr) * mcast->sources_len,
561 return -ENOMEM;
591 if (param->sources_len > CONFIG_NET_IF_MCAST_IPV4_SOURCE_COUNT) {
592 return -ENOMEM;
599 return -EALREADY;
605 return -ENOMEM;
611 maddr->record_type = param->include ? IGMPV3_CHANGE_TO_INCLUDE_MODE
613 maddr->sources_len = param->sources_len;
614 for (int i = 0; i < param->sources_len; i++) {
615 net_ipaddr_copy(&maddr->sources[i].in_addr.s_addr,
616 ¶m->source_list[i].s_addr);
619 maddr->record_type = IGMPV3_CHANGE_TO_EXCLUDE_MODE;
638 maddr->record_type =
639 param->include ? IGMPV3_MODE_IS_INCLUDE : IGMPV3_MODE_IS_EXCLUDE;
643 net_if_mcast_monitor(iface, &maddr->address, true);
645 net_mgmt_event_notify_with_info(NET_EVENT_IPV4_MCAST_JOIN, iface, &maddr->address.in_addr,
658 return -ENOENT;
662 maddr->record_type = IGMPV3_CHANGE_TO_INCLUDE_MODE;
663 maddr->sources_len = 0;
674 return -EINVAL;
679 net_if_mcast_monitor(iface, &maddr->address, false);
681 net_mgmt_event_notify_with_info(NET_EVENT_IPV4_MCAST_LEAVE, iface, &maddr->address.in_addr,
690 /* Ensure multicast addresses are available */
695 /* This code adds the IGMP all systems 224.0.0.1 multicast address
696 * to the list of multicast addresses of the given interface.
699 * address in the list of multicast addresses of the interface
700 * and marking it as joined is helpful for multicast hash filter
701 * implementations that need a list of multicast addresses it needs
702 * to add to the multicast hash filter after a multicast address
719 net_if_mcast_monitor(iface, &maddr->address, true);