X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=blobdiff_plain;f=docs%2Fnetwork-scripts.tex;h=7ace9755cec804957ecb1475a944454043856470;hp=79a88534178fe20f3bad789019f141d197d9d893;hb=9043a2474c6b7de3ff42473beca4ce566fcc2ca8;hpb=dfe52f0a791b7f715dabfc7c64c08a7d2d423e8b diff --git a/docs/network-scripts.tex b/docs/network-scripts.tex index 79a8853417..7ace9755ce 100644 --- a/docs/network-scripts.tex +++ b/docs/network-scripts.tex @@ -4,7 +4,7 @@ To be able to access the network functions, you need to include the necessary shell scripts by running: \begin{Verbatim} -. /etc/functions.sh # common functions +. /lib/functions.sh # common functions include /lib/network # include /lib/network/*.sh scan_interfaces # read and parse the network config \end{Verbatim} @@ -22,30 +22,31 @@ after \texttt{scan\_interfaces} might not return the same result as running it b After running \texttt{scan\_interfaces}, the following functions are available: \begin{itemize} - \item{\texttt{find\_config \textit{interface}}} \\ - looks for a network configuration that includes - the specified network interface. + \item{\texttt{find\_config \textit{interface}}} \\ + looks for a network configuration that includes + the specified network interface. - \item{\texttt{setup\_interface \textit{interface [config] [protocol]}}} \\ - will set up the specified interface, optionally overriding the network configuration - name or the protocol that it uses. + \item{\texttt{setup\_interface \textit{interface [config] [protocol]}}} \\ + will set up the specified interface, optionally overriding the network configuration + name or the protocol that it uses. \end{itemize} \subsubsection{Writing protocol handlers} -You can add custom protocol handlers by adding shell scripts to -\texttt{/lib/network}. They provide the following two shell functions: +You can add custom protocol handlers (e.g: PPPoE, PPPoA, ATM, PPTP ...) +by adding shell scripts to \texttt{/lib/network}. They provide the following +two shell functions: \begin{Verbatim} scan_() { - local config="$1" - # change the interface names if necessary + local config="$1" + # change the interface names if necessary } setup_interface_() { - local interface="\$1" - local config="\$2" - # set up the interface + local interface="$1" + local config="$2" + # set up the interface } \end{Verbatim}