STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
mld6.h
Go to the documentation of this file.
1 
8 /*
9  * Copyright (c) 2010 Inico Technologies Ltd.
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without modification,
13  * are permitted provided that the following conditions are met:
14  *
15  * 1. Redistributions of source code must retain the above copyright notice,
16  * this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright notice,
18  * this list of conditions and the following disclaimer in the documentation
19  * and/or other materials provided with the distribution.
20  * 3. The name of the author may not be used to endorse or promote products
21  * derived from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
24  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
26  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
28  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
31  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
32  * OF SUCH DAMAGE.
33  *
34  * This file is part of the lwIP TCP/IP stack.
35  *
36  * Author: Ivan Delamer <delamer@inicotech.com>
37  *
38  *
39  * Please coordinate changes and requests with Ivan Delamer
40  * <delamer@inicotech.com>
41  */
42 
43 #ifndef LWIP_HDR_MLD6_H
44 #define LWIP_HDR_MLD6_H
45 
46 #include "lwip/opt.h"
47 
48 #if LWIP_IPV6_MLD && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */
49 
50 #include "lwip/pbuf.h"
51 #include "lwip/netif.h"
52 
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 struct mld_group {
60  struct mld_group *next;
62  struct netif *netif;
64  ip6_addr_t group_address;
66  u8_t last_reporter_flag;
68  u8_t group_state;
70  u16_t timer;
72  u8_t use;
73 };
74 
76 #ifdef PACK_STRUCT_USE_INCLUDES
77 # include "arch/bpstruct.h"
78 #endif
80 struct mld_header {
81  PACK_STRUCT_FLD_8(u8_t type);
82  PACK_STRUCT_FLD_8(u8_t code);
83  PACK_STRUCT_FIELD(u16_t chksum);
84  PACK_STRUCT_FIELD(u16_t max_resp_delay);
85  PACK_STRUCT_FIELD(u16_t reserved);
86  PACK_STRUCT_FLD_S(ip6_addr_p_t multicast_address);
87  /* Options follow. */
90 #ifdef PACK_STRUCT_USE_INCLUDES
91 # include "arch/epstruct.h"
92 #endif
93 
94 #define MLD6_TMR_INTERVAL 100 /* Milliseconds */
95 
96 /* MAC Filter Actions, these are passed to a netif's
97  * mld_mac_filter callback function. */
98 #define MLD6_DEL_MAC_FILTER 0
99 #define MLD6_ADD_MAC_FILTER 1
100 
101 
102 err_t mld6_stop(struct netif *netif);
103 void mld6_report_groups(struct netif *netif);
104 void mld6_tmr(void);
105 struct mld_group *mld6_lookfor_group(struct netif *ifp, const ip6_addr_t *addr);
106 void mld6_input(struct pbuf *p, struct netif *inp);
107 err_t mld6_joingroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr);
108 err_t mld6_joingroup_netif(struct netif *netif, const ip6_addr_t *groupaddr);
109 err_t mld6_leavegroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr);
110 err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr);
111 
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #endif /* LWIP_IPV6_MLD && LWIP_IPV6 */
118 
119 #endif /* LWIP_HDR_MLD6_H */
120 
#define PACK_STRUCT_STRUCT
Definition: arch.h:68
#define PACK_STRUCT_FLD_8(x)
Definition: arch.h:78
#define PACK_STRUCT_FIELD(x)
Definition: arch.h:72
Definition: pbuf.h:108
s8_t err_t
Definition: err.h:47
Definition: netif.h:182
#define PACK_STRUCT_FLD_S(x)
Definition: arch.h:84
#define PACK_STRUCT_BEGIN
Definition: arch.h:60
unsigned char u8_t
Definition: cc.h:38
#define PACK_STRUCT_END
Definition: arch.h:64
unsigned short u16_t
Definition: cc.h:40