Go to the documentation of this file.
38 #ifndef AUTO_IP_SUPPORT
39 #define AUTO_IP_SUPPORT DISABLED
40 #elif (AUTO_IP_SUPPORT != ENABLED && AUTO_IP_SUPPORT != DISABLED)
41 #error AUTO_IP_SUPPORT parameter is not valid
45 #ifndef AUTO_IP_BCT_SUPPORT
46 #define AUTO_IP_BCT_SUPPORT DISABLED
47 #elif (AUTO_IP_BCT_SUPPORT != ENABLED && AUTO_IP_BCT_SUPPORT != DISABLED)
48 #error AUTO_IP_BCT_SUPPORT parameter is not valid
52 #ifndef AUTO_IP_TICK_INTERVAL
53 #define AUTO_IP_TICK_INTERVAL 200
54 #elif (AUTO_IP_TICK_INTERVAL < 10)
55 #error AUTO_IP_TICK_INTERVAL parameter is not valid
59 #ifndef AUTO_IP_PROBE_WAIT
60 #define AUTO_IP_PROBE_WAIT 1000
61 #elif (AUTO_IP_PROBE_WAIT < 0)
62 #error AUTO_IP_PROBE_WAIT parameter is not valid
66 #ifndef AUTO_IP_PROBE_NUM
67 #define AUTO_IP_PROBE_NUM 3
68 #elif (AUTO_IP_PROBE_NUM < 1)
69 #error AUTO_IP_PROBE_NUM parameter is not valid
73 #ifndef AUTO_IP_PROBE_MIN
74 #define AUTO_IP_PROBE_MIN 1000
75 #elif (AUTO_IP_PROBE_MIN < 100)
76 #error AUTO_IP_PROBE_MIN parameter is not valid
80 #ifndef AUTO_IP_PROBE_MAX
81 #define AUTO_IP_PROBE_MAX 2000
82 #elif (AUTO_IP_PROBE_MAX < AUTO_IP_PROBE_MIN)
83 #error AUTO_IP_PROBE_MAX parameter is not valid
87 #ifndef AUTO_IP_ANNOUNCE_WAIT
88 #define AUTO_IP_ANNOUNCE_WAIT 2000
89 #elif (AUTO_IP_ANNOUNCE_WAIT < 100)
90 #error AUTO_IP_ANNOUNCE_WAIT parameter is not valid
94 #ifndef AUTO_IP_ANNOUNCE_NUM
95 #define AUTO_IP_ANNOUNCE_NUM 2
96 #elif (AUTO_IP_ANNOUNCE_NUM < 1)
97 #error AUTO_IP_ANNOUNCE_NUM parameter is not valid
101 #ifndef AUTO_IP_ANNOUNCE_INTERVAL
102 #define AUTO_IP_ANNOUNCE_INTERVAL 2000
103 #elif (AUTO_IP_ANNOUNCE_INTERVAL < 100)
104 #error AUTO_IP_ANNOUNCE_INTERVAL parameter is not valid
108 #ifndef AUTO_IP_MAX_CONFLICTS
109 #define AUTO_IP_MAX_CONFLICTS 10
110 #elif (AUTO_IP_MAX_CONFLICTS < 1)
111 #error AUTO_IP_MAX_CONFLICTS parameter is not valid
115 #ifndef AUTO_IP_RATE_LIMIT_INTERVAL
116 #define AUTO_IP_RATE_LIMIT_INTERVAL 60000
117 #elif (AUTO_IP_RATE_LIMIT_INTERVAL < 1000)
118 #error AUTO_IP_RATE_LIMIT_INTERVAL parameter is not valid
122 #ifndef AUTO_IP_DEFEND_INTERVAL
123 #define AUTO_IP_DEFEND_INTERVAL 10000
124 #elif (AUTO_IP_DEFEND_INTERVAL < 1000)
125 #error AUTO_IP_DEFEND_INTERVAL parameter is not valid
129 #define AUTO_IP_PREFIX IPV4_ADDR(169, 254, 0, 0)
131 #define AUTO_IP_MASK IPV4_ADDR(255, 255, 0, 0)
134 #define AUTO_IP_ADDR_MIN IPV4_ADDR(169, 254, 1, 0)
135 #define AUTO_IP_ADDR_MAX IPV4_ADDR(169, 254, 254, 255)
139 #define AutoIpContext struct _AutoIpContext
AutoIpStateChangeCallback stateChangeEvent
FSM state change event.
systime_t timeout
Timeout value.
@ AUTO_IP_STATE_DEFENDING
void(* AutoIpLinkChangeCallback)(AutoIpContext *context, NetInterface *interface, bool_t linkState)
Link state change callback.
uint32_t Ipv4Addr
IPv4 network address.
AutoIpLinkChangeCallback linkChangeEvent
Link state change event.
@ AUTO_IP_STATE_CONFIGURED
void autoIpGetDefaultSettings(AutoIpSettings *settings)
Initialize settings with default values.
bool_t running
Auto-IP is currently running.
systime_t timestamp
Timestamp to manage retransmissions.
AutoIpState autoIpGetState(AutoIpContext *context)
Retrieve current state.
AutoIpSettings settings
Auto-IP settings.
Ipv4Addr linkLocalAddr
Link-local address.
uint_t ipAddrIndex
Index of the IP address to be configured.
Ipv4Addr linkLocalAddr
Initial link-local address to be used.
uint32_t systime_t
System time.
error_t autoIpStop(AutoIpContext *context)
Stop Auto-IP process.
AutoIpState state
Current state of the FSM.
error_t autoIpStart(AutoIpContext *context)
Start Auto-IP process.
error_t autoIpInit(AutoIpContext *context, const AutoIpSettings *settings)
Auto-IP initialization.
void(* AutoIpStateChangeCallback)(AutoIpContext *context, NetInterface *interface, AutoIpState state)
FSM state change callback.
uint_t retransmitCount
Retransmission counter.
uint_t conflictCount
Number of conflicts.
NetInterface * interface
Network interface to configure.
AutoIpState
Auto-IP FSM states.
@ AUTO_IP_STATE_ANNOUNCING