User`s guide

136
K
A
DAK
KwikNet Low Level Services
Network Descriptor
When a network interface is added with a call to kn_ifadd(), KwikNet allocates a
network descriptor structure which it uses to define the network. A pointer to the
structure is returned to the caller as a handle for subsequent references to the interface.
The handle is called a network descriptor pointer and is declared to be of type KN_NETDP.
/* KwikNet Network Descriptor Structure */
struct knx_netd {
char xnd_tag[KN_TAGSIZE]; /* Network tag string */
unsigned short xnd_ifnum; /* Interface number */
unsigned short xnd_iftype; /* Interface type */
ttUserInterface xnd_interface; /* Interface handle */
unsigned long xnd_userinfo; /* User defined parameter */
struct knx_dvcprep *xnd_prepp; /* Device preparation pointer */
};
If netdp is a network descriptor pointer, then netdp can be used to access the members
of the network descriptor structure, as in netdp->xnd_iftype.
Field xnd_tag is the network tag assigned by you to identify your network interface.
Field xnd_ifnum is the interface number, a decimal number from 0 to n-1 where n is the
maximum number of network interfaces which your KwikNet configuration supports.
Field xnd_iftype is the interface type:
KNIF_ETHER for Ethernet (Ethernet-II framing only),
KNIF_ET8023 for Ethernet (802.3 and possibly Ethernet-II framing),
KNIF_SLIP for SLIP,
KNIF_PPPC for a PPP client and
KNIF_PPPS for a PPP server.
Field xnd_interface is the Treck interface handle assigned by Treck to identify the
network interface. This interface handle must be used to identify the network if you call
Treck functions to manipulate the network in some special way.
Field
xnd_userinfo is reserved for the private use of your application. Once you have
added a network interface, you can install an application specific parameter into this
field. Since the network descriptor pointer is passed to your network callback procedure,
you can use this parameter to provide access to application dependent information
specific to a particular network interface.
Field
xnd_prepp is the device preparation structure used for intercommunication between
the KwikNet network driver and the associated device driver. You will require this
parameter if your application must make an ioctl call directly to the device driver.
Rarely will you have any such need.
Warning
You may modify field xnd_userinfo in the network
descriptor structure. Do not modify any other fields.