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