ReactOS 0.4.16-dev-297-gc569aee
acd.h
Go to the documentation of this file.
1
7/*
8 *
9 * Copyright (c) 2007 Dominik Spies <kontakt@dspies.de>
10 * Copyright (c) 2018 Jasper Verschueren <jasper.verschueren@apart-audio.com>
11 * All rights reserved.
12 *
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 *
16 * 1. Redistributions of source code must retain the above copyright notice,
17 * this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright notice,
19 * this list of conditions and the following disclaimer in the documentation
20 * and/or other materials provided with the distribution.
21 * 3. The name of the author may not be used to endorse or promote products
22 * derived from this software without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
25 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
27 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
29 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
33 * OF SUCH DAMAGE.
34 *
35 * Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
36 * Author: Dominik Spies <kontakt@dspies.de>
37 */
38
39#ifndef LWIP_HDR_ACD_H
40#define LWIP_HDR_ACD_H
41
42#include "lwip/opt.h"
43
44/* don't build if not configured for use in lwipopts.h */
45#if LWIP_IPV4 && LWIP_ACD
46
47#include "lwip/netif.h"
48#include "lwip/etharp.h"
49#include "lwip/prot/acd.h"
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
60#define ACD_TMR_INTERVAL 100
61
68typedef void (*acd_conflict_callback_t)(struct netif *netif, acd_callback_enum_t state);
69
71struct acd
72{
74 struct acd *next;
76 ip4_addr_t ipaddr;
80 u8_t sent_num;
82 u16_t ttw;
84 u8_t lastconflict;
86 u8_t num_conflicts;
89 acd_conflict_callback_t acd_conflict_callback;
90};
91
92err_t acd_add(struct netif *netif, struct acd *acd,
93 acd_conflict_callback_t acd_conflict_callback);
94void acd_remove(struct netif *netif, struct acd *acd);
95err_t acd_start(struct netif *netif, struct acd *acd, ip4_addr_t ipaddr);
96err_t acd_stop(struct acd *acd);
97void acd_arp_reply(struct netif *netif, struct etharp_hdr *hdr);
98void acd_tmr(void);
99void acd_network_changed_link_down(struct netif *netif);
100void acd_netif_ip_addr_changed(struct netif *netif, const ip_addr_t *old_addr,
101 const ip_addr_t *new_addr);
102
103#ifdef __cplusplus
104}
105#endif
106
107#endif /* LWIP_IPV4 && LWIP_ACD */
108
109#endif /* LWIP_HDR_ACD_H */
static int state
Definition: maze.c:121
uint8_t u8_t
Definition: arch.h:125
uint16_t u16_t
Definition: arch.h:127
s8_t err_t
Definition: err.h:96
ip6_addr_t ip_addr_t
Definition: ip_addr.h:344
char hdr[14]
Definition: iptest.cpp:33
acd_callback_enum_t
Definition: acd.h:81
acd_state_enum_t
Definition: acd.h:58
static unsigned __int64 next
Definition: rand_nt.c:6
Definition: netif.h:269