User`s guide

KwikNet Low Level Services
K
A
DAK
137
Network Parameter Structure
When a network interface is opened with a call to kn_ifopen(), KwikNet configures the
interface according to your definition of the operating characteristics required for that
network. The parameters are presented in a network parameter structure. A separate
structure is defined for each type of network interface in KwikNet header file KN_API.H.
Note
All of the parameters in the network parameter structure
can be overridden by your network hook function which
will be called by KwikNet as it prepares to open the network.
Network Parameter Structure (Ethernet)
struct knx_np_ether {
struct in_addr xp_ether_ipaddr; /* Network IP address */
struct in_addr xp_ether_snmask; /* Network subnet mask */
struct in_addr xp_ether_defgate; /* Network default gateway */
short xp_ether_ipattr; /* IP address attributes */
short xp_ether_rsv1; /* Reserved for alignment */
};
For Ethernet networks, the IP address, subnet mask and default gateway, if not 0, will be
used as the settings for the local network interface.
Field xp_ether_ipattr must be one of the following IP attributes flags:
0 Use the configured IP address, subnet mask and gateway
KN_IPATTR_DHCP Use DHCP for IP address acquisition
KN_IPATTR_REBOOT Use DHCP (reboot) for IP address acquisition
KN_IPATTR_BOOTP Use BOOTP for IP address acquisition
KN_IPATTR_AUTOIP Use Auto IP for IP address acquisition
If DHCP is used to dynamically acquire an IP address, the IP address is simply a
preference which, if present, will be requested from the DHCP server. If DHCP (reboot)
is used, the IP address must be provided for presentation in the request to the DHCP
server. If BOOTP or Auto IP is used, the configured IP address is ignored.
In all cases, if an IP address is dynamically acquired, the configured subnet mask is
ignored and the subnet mask derived by the DHCP, BOOTP or Auto IP process is used.
If DHCP, DHCP (reboot) or BOOTP is used, the default gateway, if any, provided by the
DHCP or BOOTP server is installed as the default gateway. If the DHCP or BOOTP
server does not provide a default gateway, the configured default gateway, if provided, is
installed as the default gateway. In any case, the default gateway is only installed if a
valid local IP address is available. Note that the first default gateway to be installed
becomes the system's default gateway. When a subsequent network interface is opened,
its default gateway will not override the previously installed gateway.