Dependencies:   mbed

Dependents:   TCP

Committer:
slowness
Date:
Tue Sep 06 18:05:46 2011 +0000
Revision:
0:58c3d014a4e7

        

Who changed what in which revision?

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