sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
acd.h
Go to the documentation of this file.
1
6
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_PROT_ACD_H
40#define LWIP_HDR_PROT_ACD_H
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46/* RFC 5227 and RFC 3927 Constants */
47#define PROBE_WAIT 1 /* second (initial random delay) */
48#define PROBE_MIN 1 /* second (minimum delay till repeated probe) */
49#define PROBE_MAX 2 /* seconds (maximum delay till repeated probe) */
50#define PROBE_NUM 3 /* (number of probe packets) */
51#define ANNOUNCE_NUM 2 /* (number of announcement packets) */
52#define ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */
53#define ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */
54#define MAX_CONFLICTS 10 /* (max conflicts before rate limiting) */
55#define RATE_LIMIT_INTERVAL 60 /* seconds (delay between successive attempts) */
56#define DEFEND_INTERVAL 10 /* seconds (minimum interval between defensive ARPs) */
57
58/* ACD states */
59typedef enum {
60 /* ACD is module is off */
61 ACD_STATE_OFF,
62 /* Waiting before probing can be started */
63 ACD_STATE_PROBE_WAIT,
64 /* Probing the ipaddr */
65 ACD_STATE_PROBING,
66 /* Waiting before announcing the probed ipaddr */
67 ACD_STATE_ANNOUNCE_WAIT,
68 /* Announcing the new ipaddr */
69 ACD_STATE_ANNOUNCING,
70 /* Performing ongoing conflict detection with one defend within defend inferval */
71 ACD_STATE_ONGOING,
72 /* Performing ongoing conflict detection but immediately back off and Release
73 * the address when a conflict occurs. This state is used for LL addresses
74 * that stay active even if the netif has a routable address selected.
75 * In such a case, we cannot defend our address */
76 ACD_STATE_PASSIVE_ONGOING,
77 /* To many conflicts occurred, we need to wait before restarting the selection
78 * process */
79 ACD_STATE_RATE_LIMIT
80} acd_state_enum_t;
81
82typedef enum {
83 ACD_IP_OK, /* IP address is good, no conflicts found in checking state */
84 ACD_RESTART_CLIENT, /* Conflict found -> the client should try again */
85 ACD_DECLINE /* Decline the received IP address (rate limiting)*/
86} acd_callback_enum_t;
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* LWIP_HDR_PROT_ACD_H */