User`s guide
KwikNet Low Level Services
K
A
DAK
163
kn_ifopen kn_ifopen
Purpose Open a Network Interface
Used by
n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure
Setup Prototype is in file KN_API.H.
#include "KN_LIB.H"
int kn_ifopen(KN_NETDP netdp, void *paramp);
Description Netdp is a network descriptor pointer, the KwikNet handle used to identify
the network interface of interest.
Parameter paramp is a pointer to a network parameter structure which
specifies the configuration parameters for the network interface. These
structures are described in Chapter 4.5. Use the network parameter
structure which corresponds to the type of network interface that you
are opening. These structures are defined in file KN_API.H.
knx_np_ether Ethernet network interface
knx_np_slip SLIP network interface
knx_np_ppp PPP Client network interface
knx_np_ppp PPP Server network interface
If parameter paramp is NULL, the network interface will be opened using
the same parameters that were used the previous time the network was
opened. If the network has never been opened, setting paramp to NULL
is equivalent to opening the network with all network configuration
parameters set to 0.
Returns If the network interface is successfully opened and is up with a valid IP
address, a value of 0 is returned. If the interface is not yet up but is in
transit going up, a warning status of
KN_WRPROGRESS is returned.
On failure, one of the following error status codes is returned:
KN_ERPARAM Parameter netdp does not refer to a valid network.
KN_ERREJECT The request has been rejected. A network interface
must be in the down state before it can be opened.
KN_ERNETWORK An unexpected network or device error occurred.
The network interface cannot be opened.
Note You can close a prebuilt network interface and then open it with an
alternate set of network configuration parameters. Of course, you can also
reopen the network interface with the configuration unaltered.
Note Your network hook, device hook and modem hook functions will be
called, if they exist, as the network, device driver and optional modem are
made ready for use. Your network event function (see kn_netevent())
will also be called allowing you to monitor each network state transition.
See Also kn_ifadd(), kn_ifclose()