Dependents:   TimeZoneDemo EthernetJackTestCode MMEx_Challenge ntp_mem ... more

Committer:
segundo
Date:
Tue Nov 09 20:54:15 2010 +0000
Revision:
0:ac1725ba162c

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
segundo 0:ac1725ba162c 1 /*
segundo 0:ac1725ba162c 2 * Copyright (c) 2002 CITEL Technologies Ltd.
segundo 0:ac1725ba162c 3 * All rights reserved.
segundo 0:ac1725ba162c 4 *
segundo 0:ac1725ba162c 5 * Redistribution and use in source and binary forms, with or without
segundo 0:ac1725ba162c 6 * modification, are permitted provided that the following conditions
segundo 0:ac1725ba162c 7 * are met:
segundo 0:ac1725ba162c 8 * 1. Redistributions of source code must retain the above copyright
segundo 0:ac1725ba162c 9 * notice, this list of conditions and the following disclaimer.
segundo 0:ac1725ba162c 10 * 2. Redistributions in binary form must reproduce the above copyright
segundo 0:ac1725ba162c 11 * notice, this list of conditions and the following disclaimer in the
segundo 0:ac1725ba162c 12 * documentation and/or other materials provided with the distribution.
segundo 0:ac1725ba162c 13 * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
segundo 0:ac1725ba162c 14 * may be used to endorse or promote products derived from this software
segundo 0:ac1725ba162c 15 * without specific prior written permission.
segundo 0:ac1725ba162c 16 *
segundo 0:ac1725ba162c 17 * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
segundo 0:ac1725ba162c 18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
segundo 0:ac1725ba162c 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
segundo 0:ac1725ba162c 20 * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
segundo 0:ac1725ba162c 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
segundo 0:ac1725ba162c 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
segundo 0:ac1725ba162c 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
segundo 0:ac1725ba162c 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
segundo 0:ac1725ba162c 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
segundo 0:ac1725ba162c 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
segundo 0:ac1725ba162c 27 * SUCH DAMAGE.
segundo 0:ac1725ba162c 28 *
segundo 0:ac1725ba162c 29 * This file is a contribution to the lwIP TCP/IP stack.
segundo 0:ac1725ba162c 30 * The Swedish Institute of Computer Science and Adam Dunkels
segundo 0:ac1725ba162c 31 * are specifically granted permission to redistribute this
segundo 0:ac1725ba162c 32 * source code.
segundo 0:ac1725ba162c 33 */
segundo 0:ac1725ba162c 34
segundo 0:ac1725ba162c 35 #ifndef __LWIP_IGMP_H__
segundo 0:ac1725ba162c 36 #define __LWIP_IGMP_H__
segundo 0:ac1725ba162c 37
segundo 0:ac1725ba162c 38 #include "lwip/opt.h"
segundo 0:ac1725ba162c 39 #include "lwip/ip_addr.h"
segundo 0:ac1725ba162c 40 #include "lwip/netif.h"
segundo 0:ac1725ba162c 41 #include "lwip/pbuf.h"
segundo 0:ac1725ba162c 42
segundo 0:ac1725ba162c 43 #if LWIP_IGMP /* don't build if not configured for use in lwipopts.h */
segundo 0:ac1725ba162c 44
segundo 0:ac1725ba162c 45 #ifdef __cplusplus
segundo 0:ac1725ba162c 46 extern "C" {
segundo 0:ac1725ba162c 47 #endif
segundo 0:ac1725ba162c 48
segundo 0:ac1725ba162c 49
segundo 0:ac1725ba162c 50 /* IGMP timer */
segundo 0:ac1725ba162c 51 #define IGMP_TMR_INTERVAL 100 /* Milliseconds */
segundo 0:ac1725ba162c 52 #define IGMP_V1_DELAYING_MEMBER_TMR (1000/IGMP_TMR_INTERVAL)
segundo 0:ac1725ba162c 53 #define IGMP_JOIN_DELAYING_MEMBER_TMR (500 /IGMP_TMR_INTERVAL)
segundo 0:ac1725ba162c 54
segundo 0:ac1725ba162c 55 /* MAC Filter Actions, these are passed to a netif's
segundo 0:ac1725ba162c 56 * igmp_mac_filter callback function. */
segundo 0:ac1725ba162c 57 #define IGMP_DEL_MAC_FILTER 0
segundo 0:ac1725ba162c 58 #define IGMP_ADD_MAC_FILTER 1
segundo 0:ac1725ba162c 59
segundo 0:ac1725ba162c 60
segundo 0:ac1725ba162c 61 /**
segundo 0:ac1725ba162c 62 * igmp group structure - there is
segundo 0:ac1725ba162c 63 * a list of groups for each interface
segundo 0:ac1725ba162c 64 * these should really be linked from the interface, but
segundo 0:ac1725ba162c 65 * if we keep them separate we will not affect the lwip original code
segundo 0:ac1725ba162c 66 * too much
segundo 0:ac1725ba162c 67 *
segundo 0:ac1725ba162c 68 * There will be a group for the all systems group address but this
segundo 0:ac1725ba162c 69 * will not run the state machine as it is used to kick off reports
segundo 0:ac1725ba162c 70 * from all the other groups
segundo 0:ac1725ba162c 71 */
segundo 0:ac1725ba162c 72 struct igmp_group {
segundo 0:ac1725ba162c 73 /** next link */
segundo 0:ac1725ba162c 74 struct igmp_group *next;
segundo 0:ac1725ba162c 75 /** interface on which the group is active */
segundo 0:ac1725ba162c 76 struct netif *netif;
segundo 0:ac1725ba162c 77 /** multicast address */
segundo 0:ac1725ba162c 78 ip_addr_t group_address;
segundo 0:ac1725ba162c 79 /** signifies we were the last person to report */
segundo 0:ac1725ba162c 80 u8_t last_reporter_flag;
segundo 0:ac1725ba162c 81 /** current state of the group */
segundo 0:ac1725ba162c 82 u8_t group_state;
segundo 0:ac1725ba162c 83 /** timer for reporting, negative is OFF */
segundo 0:ac1725ba162c 84 u16_t timer;
segundo 0:ac1725ba162c 85 /** counter of simultaneous uses */
segundo 0:ac1725ba162c 86 u8_t use;
segundo 0:ac1725ba162c 87 };
segundo 0:ac1725ba162c 88
segundo 0:ac1725ba162c 89 /* Prototypes */
segundo 0:ac1725ba162c 90 void igmp_init(void);
segundo 0:ac1725ba162c 91 err_t igmp_start(struct netif *netif);
segundo 0:ac1725ba162c 92 err_t igmp_stop(struct netif *netif);
segundo 0:ac1725ba162c 93 void igmp_report_groups(struct netif *netif);
segundo 0:ac1725ba162c 94 struct igmp_group *igmp_lookfor_group(struct netif *ifp, ip_addr_t *addr);
segundo 0:ac1725ba162c 95 void igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest);
segundo 0:ac1725ba162c 96 err_t igmp_joingroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr);
segundo 0:ac1725ba162c 97 err_t igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr);
segundo 0:ac1725ba162c 98 void igmp_tmr(void);
segundo 0:ac1725ba162c 99
segundo 0:ac1725ba162c 100 #ifdef __cplusplus
segundo 0:ac1725ba162c 101 }
segundo 0:ac1725ba162c 102 #endif
segundo 0:ac1725ba162c 103
segundo 0:ac1725ba162c 104 #endif /* LWIP_IGMP */
segundo 0:ac1725ba162c 105
segundo 0:ac1725ba162c 106 #endif /* __LWIP_IGMP_H__ */