fdsf

Dependents:   sisk_proj_stat MQTT Hello_FXOS8700Q WireFSHandControl ... more

Committer:
grzemich
Date:
Wed Dec 07 23:47:50 2016 +0000
Revision:
0:d7bd7384a37c
dgd

Who changed what in which revision?

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