Committer:
mbed714
Date:
Sat Sep 18 23:05:49 2010 +0000
Revision:
0:d616ece2d859

        

Who changed what in which revision?

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