• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/lwip/src/core/ipv4/

Lines Matching refs:group

52 A query for a specific group address (as opposed to ALLHOSTS)
124 struct igmp_group *group = igmp_group_list;
126 while (group != NULL) {
129 (u32_t) (group->group_state)));
130 ip_addr_debug_print(IGMP_DEBUG, &group->group_address);
131 LWIP_DEBUGF(IGMP_DEBUG, (" on if %p\n", group->interface));
132 group = group->next;
147 struct igmp_group *group;
152 group = igmp_lookup_group(netif, &allsystems);
154 if (group != NULL) {
155 group->group_state = IGMP_GROUP_IDLE_MEMBER;
156 group->use++;
179 struct igmp_group *group = igmp_group_list;
184 while (group != NULL) {
185 next = group->next;
186 /* is it a group joined on this interface? */
187 if (group->interface == netif) {
188 /* is it the first group of the list? */
189 if (group == igmp_group_list) {
192 /* is there a "previous" group defined? */
196 /* disable the group at the MAC level */
199 ip_addr_debug_print(IGMP_DEBUG, &group->group_address);
201 netif->igmp_mac_filter(netif, &(group->group_address),
204 /* free group */
205 memp_free(MEMP_IGMP_GROUP, group);
208 prev = group;
211 group = next;
223 struct igmp_group *group = igmp_group_list;
228 while (group != NULL) {
229 if (group->interface == netif) {
230 igmp_delaying_member(group, IGMP_JOIN_DELAYING_MEMBER_TMR);
232 group = group->next;
237 * Search for a group in the global igmp_group_list
240 * @param addr the group ip address to search for
241 * @return a struct igmp_group* if the group has been found,
242 * NULL if the group wasn't found.
246 struct igmp_group *group = igmp_group_list;
248 while (group != NULL) {
249 if ((group->interface == ifp)
250 && (ip_addr_cmp(&(group->group_address), addr))) {
251 return group;
253 group = group->next;
257 * 'group' (which is also NULL at this point).
263 * Search for a specific igmp group and create a new one if not found-
266 * @param addr the group ip address to search
272 struct igmp_group *group = igmp_group_list;
274 /* Search if the group already exists */
275 group = igmp_lookfor_group(ifp, addr);
276 if (group != NULL) {
278 return group;
282 group = memp_malloc(MEMP_IGMP_GROUP);
283 if (group != NULL) {
284 group->interface = ifp;
285 ip_addr_set(&(group->group_address), addr);
286 group->timer = 0; /* Not running */
287 group->group_state = IGMP_GROUP_NON_MEMBER;
288 group->last_reporter_flag = 0;
289 group->use = 0;
290 group->next = igmp_group_list;
292 igmp_group_list = group;
296 ("igmp_lookup_group: %sallocated a new group with address ",
297 (group ? "" : "impossible to ")));
301 return group;
305 * Remove a group in the global igmp_group_list
307 * @param group the group to remove from the global igmp_group_list
308 * @return ERR_OK if group was removed from the list, an err_t otherwise
310 err_t igmp_remove_group(struct igmp_group * group)
314 /* Is it the first group? */
315 if (igmp_group_list == group) {
316 igmp_group_list = group->next;
318 /* look for group further down the list */
323 if (tmpGroup->next == group) {
324 tmpGroup->next = group->next;
332 /* free group */
333 memp_free(MEMP_IGMP_GROUP, group);
349 struct igmp_group *group;
376 /* Packet is ok so find an existing group */
377 group = igmp_lookfor_group(inp, dest); /* use the incoming IP address! */
379 /* If group can be found or create... */
380 if (!group) {
407 /* Do not send messages on the all systems group address! */
417 /* IGMP_MEMB_QUERY to a specific group ? */
418 if (group->group_address.addr != 0) {
420 ("igmp_input: IGMP_MEMB_QUERY to a specific group "));
421 ip_addr_debug_print(IGMP_DEBUG, &group->group_address);
426 /* we first need to re-lookfor the group since we used dest last time */
427 group =
432 (" with the group address as destination [igmp_maxresp=%i]\n",
436 if (group != NULL) {
438 igmp_delaying_member(group, igmp->igmp_maxresp);
448 if (group->group_state == IGMP_GROUP_DELAYING_MEMBER) {
449 /* This is on a specific group we have already looked up */
450 group->timer = 0; /* stopped */
451 group->group_state = IGMP_GROUP_IDLE_MEMBER;
452 group->last_reporter_flag = 0;
458 ("igmp_input: unexpected msg %d in state %d on group %p on if %p\n",
459 igmp->igmp_msgtype, group->group_state, &group,
460 group->interface));
470 * Join a group on one network interface.
472 * @param ifaddr ip address of the network interface which should join a new group
473 * @param groupaddr the ip address of the group which to join
474 * @return ERR_OK if group was joined on the netif(s), an err_t otherwise
479 struct igmp_group *group;
498 /* find group or create a new one if not found */
499 group = igmp_lookup_group(netif, groupaddr);
501 if (group != NULL) {
502 /* This should create a new group, check the state to make sure */
503 if (group->group_state != IGMP_GROUP_NON_MEMBER) {
505 ("igmp_joingroup: join to group not in state IGMP_GROUP_NON_MEMBER\n"));
507 /* OK - it was new group */
509 ("igmp_joingroup: join to new group: "));
513 /* If first use of the group, allow the group at the MAC level */
514 if ((group->use == 0) && (netif->igmp_mac_filter != NULL)) {
524 igmp_send(group, IGMP_V2_MEMB_REPORT);
526 igmp_start_timer(group, IGMP_JOIN_DELAYING_MEMBER_TMR);
529 group->group_state = IGMP_GROUP_DELAYING_MEMBER;
531 /* Increment group use */
532 group->use++;
539 ("igmp_joingroup: Not enought memory to join to group\n"));
551 * Leave a group on one network interface.
553 * @param ifaddr ip address of the network interface which should leave a group
554 * @param groupaddr the ip address of the group which to leave
555 * @return ERR_OK if group was left on the netif(s), an err_t otherwise
560 struct igmp_group *group;
579 /* find group */
580 group = igmp_lookfor_group(netif, groupaddr);
582 if (group != NULL) {
584 LWIP_DEBUGF(IGMP_DEBUG, ("igmp_leavegroup: Leaving group: "));
588 /* If there is no other use of the group */
589 if (group->use <= 1) {
590 /* If we are the last reporter for this group */
591 if (group->last_reporter_flag) {
593 ("igmp_leavegroup: sending leaving group\n"));
595 igmp_send(group, IGMP_LEAVE_GROUP);
598 /* Disable the group at the MAC level */
609 ("igmp_leavegroup: remove group: "));
613 /* Free the group */
614 igmp_remove_group(group);
616 /* Decrement group use */
617 group->use--;
624 ("igmp_leavegroup: not member of group\n"));
640 struct igmp_group *group = igmp_group_list;
642 while (group != NULL) {
643 if (group->timer != 0) {
644 group->timer -= 1;
645 if (group->timer == 0) {
646 igmp_timeout(group);
649 group = group->next;
654 * Called if a timeout for one group is reached.
655 * Sends a report for this group.
657 * @param group an igmp_group for which a timeout is reached
659 void igmp_timeout(struct igmp_group *group)
661 /* If the state is IGMP_GROUP_DELAYING_MEMBER then we send a report for this group */
662 if (group->group_state == IGMP_GROUP_DELAYING_MEMBER) {
664 ("igmp_timeout: report membership for group with address "));
665 ip_addr_debug_print(IGMP_DEBUG, &(group->group_address));
666 LWIP_DEBUGF(IGMP_DEBUG, (" on if %p\n", group->interface));
668 igmp_send(group, IGMP_V2_MEMB_REPORT);
673 * Start a timer for an igmp group
675 * @param group the igmp_group for which to start a timer
679 void igmp_start_timer(struct igmp_group *group, u8_t max_time)
684 group->timer = max_time;
690 * @param group the igmp_group for which to stop the timer
692 void igmp_stop_timer(struct igmp_group *group)
694 group->timer = 0;
698 * Delaying membership report for a group if necessary
700 * @param group the igmp_group for which "delaying" membership report
703 void igmp_delaying_member(struct igmp_group *group, u8_t maxresp)
705 if ((group->group_state == IGMP_GROUP_IDLE_MEMBER) ||
706 ((group->group_state == IGMP_GROUP_DELAYING_MEMBER)
707 && (maxresp > group->timer))) {
708 igmp_start_timer(group, (maxresp) / 2);
709 group->group_state = IGMP_GROUP_DELAYING_MEMBER;
746 * Send an igmp packet to a specific group.
748 * @param group the group to which to send the packet
751 void igmp_send(struct igmp_group *group, u8_t type)
765 ip_addr_set(&src, &((group->interface)->ip_addr));
768 dest = &(group->group_address);
770 ip_addr_set(&(igmp->igmp_group_address), &(group->group_address));
771 group->last_reporter_flag = 1; /* Remember we were the last to report */
776 &(group->group_address));
787 group->interface);