mbed Phone Platform

Dependencies:   ulaw mbed ConfigFile

Committer:
okini3939
Date:
Sun Dec 26 15:49:07 2010 +0000
Revision:
1:0f82c574096f

        

Who changed what in which revision?

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