User`s guide
130
K
A
DAK
KwikNet Low Level Services
4.2.2 Auto IP Operation
There is an optional KwikNet component which provides the Auto IP service which an
Ethernet network interface can use to assign its own IP address dynamically when the
network is first started. This feature is enabled by a configuration parameter in the
KwikNet Network Parameter File used in the construction of the KwikNet Library as
described in Chapter 2.3. When you define your
KwikNet configuration, simply check the
box labeled "Auto IP address discovery" on the IPv4 property page.
Once you have enabled Auto IP support, KwikNet allows each Ethernet network interface
to be individually Auto IP enabled. To do so, edit your Network Parameter File, go to the
Networks property page and add or edit your Ethernet network interface description.
Click on the Edit: IP Address radio button and select Auto IP from the pull down list labeled
"Runtime configuration:" (see Chapter 2.4).
Whenever a network interface which is configured to use Auto IP is opened, the network
driver begins an Ethernet ARPing process to claim ownership of an IP address in the
range 169.254.1.0 to 169.254.254.255. It makes a random guess at an IP address in this
range and uses ARP requests with collision detection enabled to determine if the address
is already in use. The process continues indefinitely until an unused IP address can be
detected and assigned to the network interface. At that time the network interface is
declared operational.
Note
KwikNet does not provide Auto IP support for SLIP or PPP
networks.
4.2.3 IP Address Notification
A network which uses DHCP, BOOTP or Auto IP to acquire an IP address is not usable
until such time as the IP address becomes available. At that time the network interface is
declared up and available for service. Your application can periodically call KwikNet
procedure kn_ifstate() to determine when the network interface is first available.
Alternatively, you can provide a network event notification function
kn_netevent()
which will be called whenever any network state transition or other significant network
event occurs. To enable this feature, edit your
KwikNet Network Parameter File and check
the option box labeled "Enable network event notification" on the General property page.
Function kn_netevent() will be called whenever the DHCP client fails to acquire an IP
address, successfully negotiates an IP address or loses its lease for a previously granted
IP address.
Function
kn_netevent() will also be called whenever the Auto IP service fails or
succeeds to acquire an IP address for a network interface.