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