Marco Zecchini
/
Example_RTOS
Rtos API example
Embed:
(wiki syntax)
Show/hide line numbers
mld6.h
Go to the documentation of this file.
00001 /** 00002 * @file 00003 * 00004 * Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710. 00005 * No support for MLDv2. 00006 */ 00007 00008 /* 00009 * Copyright (c) 2010 Inico Technologies Ltd. 00010 * All rights reserved. 00011 * 00012 * Redistribution and use in source and binary forms, with or without modification, 00013 * are permitted provided that the following conditions are met: 00014 * 00015 * 1. Redistributions of source code must retain the above copyright notice, 00016 * this list of conditions and the following disclaimer. 00017 * 2. Redistributions in binary form must reproduce the above copyright notice, 00018 * this list of conditions and the following disclaimer in the documentation 00019 * and/or other materials provided with the distribution. 00020 * 3. The name of the author may not be used to endorse or promote products 00021 * derived from this software without specific prior written permission. 00022 * 00023 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 00024 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00025 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 00026 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00027 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00028 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00029 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00030 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 00031 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 00032 * OF SUCH DAMAGE. 00033 * 00034 * This file is part of the lwIP TCP/IP stack. 00035 * 00036 * Author: Ivan Delamer <delamer@inicotech.com> 00037 * 00038 * 00039 * Please coordinate changes and requests with Ivan Delamer 00040 * <delamer@inicotech.com> 00041 */ 00042 00043 #ifndef LWIP_HDR_MLD6_H 00044 #define LWIP_HDR_MLD6_H 00045 00046 #include "lwip/opt.h" 00047 00048 #if LWIP_IPV6_MLD && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ 00049 00050 #include "lwip/pbuf.h" 00051 #include "lwip/netif.h" 00052 00053 #ifdef __cplusplus 00054 extern "C" { 00055 #endif 00056 00057 /** MLD group */ 00058 struct mld_group { 00059 /** next link */ 00060 struct mld_group *next; 00061 /** multicast address */ 00062 ip6_addr_t group_address; 00063 /** signifies we were the last person to report */ 00064 u8_t last_reporter_flag; 00065 /** current state of the group */ 00066 u8_t group_state; 00067 /** timer for reporting */ 00068 u16_t timer; 00069 /** counter of simultaneous uses */ 00070 u8_t use; 00071 }; 00072 00073 #define MLD6_TMR_INTERVAL 100 /* Milliseconds */ 00074 00075 err_t mld6_stop(struct netif *netif); 00076 void mld6_report_groups(struct netif *netif); 00077 void mld6_tmr(void); 00078 struct mld_group *mld6_lookfor_group(struct netif *ifp, const ip6_addr_t *addr); 00079 void mld6_input(struct pbuf *p, struct netif *inp); 00080 err_t mld6_joingroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr); 00081 err_t mld6_joingroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); 00082 err_t mld6_leavegroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr); 00083 err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); 00084 00085 /** @ingroup mld6 00086 * Get list head of MLD6 groups for netif. 00087 * Note: The allnodes group IP is NOT in the list, since it must always 00088 * be received for correct IPv6 operation. 00089 * @see @ref netif_set_mld_mac_filter() 00090 */ 00091 #define netif_mld6_data(netif) ((struct mld_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6)) 00092 00093 #ifdef __cplusplus 00094 } 00095 #endif 00096 00097 #endif /* LWIP_IPV6_MLD && LWIP_IPV6 */ 00098 00099 #endif /* LWIP_HDR_MLD6_H */
Generated on Sun Jul 17 2022 08:25:28 by 1.7.2