-
Notifications
You must be signed in to change notification settings - Fork 17
/
chap_api_slaacv4.tex
44 lines (29 loc) · 1.55 KB
/
chap_api_slaacv4.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
\section{SLAACV4 Module}
% Short description/overview of module functions
\subsection{pico\_slaacv4\_claimip}
\subsubsection*{Description}
This function starts the ip claiming process for a device. It will generate first the local link ip using
as seed the mac address of the device. Then it will start the claim procedure described in RFC3927.
In case of success the IP is registered to the IP layer and returned using the callback function.
In case of error, code SLAACV4\_ERROR is returned. Errors occur when the maximum number of conflicts is reached.
Use the IP returned only if the return code is SLAACV4\_SUCCESS.
\subsubsection*{Function prototype}
\texttt{pico\_slaacv4\_claimip(struct pico\_device *dev, void (*cb)(struct pico\_ip4 *ip, uint8\_t code));}
\subsubsection*{Parameters}
\begin{itemize}[noitemsep]
\item \texttt{dev} - a pointer to a struct \texttt{pico\_device}
\item \texttt{*cb} - a callback function returning the ip claimed and a return code (SLAACV4\_ERROR | SLAACV4\_SUCCESS)
\end{itemize}
\subsubsection*{Return value}
0 returned if the claiming has started successfully
\subsubsection*{Example}
\begin{verbatim}
dev = pico_get_device(sdev);
ret = pico_slaacv4_claimip(dev, slaacv4_cb);
\end{verbatim}
\subsection{pico\_slaacv4\_unregisterip}
\subsubsection*{Description}
This function allows to unregister the local link ip in usage. The function will remove from the route table
the local link ip and will reset the internal state of the SLAACV4 module
\subsubsection*{Function prototype}
\texttt{void pico\_slaacv4\_unregisterip(void);}