Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

netif Struct Reference


Detailed Description

This structure holds information about the network interface. This means that all of the network-related information are stored in this kind of structure.
Examples:

main_demo.c.

Definition at line 100 of file system.h.

Data Fields

LWORD localip
 IP address of a device.

BYTE localHW [6]
 Ethernet address given to a device.

LWORD defgw
 Default network gateway.

LWORD netmask
 Network submask.


Field Documentation

LWORD netif::localip
 

IP address of a happy device using OpenTCP :-). This must hold proper-value IP address in order for the networking stuff to work.

Possible scenarios for filling this field are:

  • By assigning static IP address to a device always after reset
  • By allowing user to choose IP address by some tool (e.g. through serial communication, storing that information to some external flash,...)
  • By using BOOTP or DHCP clients for obtaining dynamically assigned address
  • By obtaining the IP address from the first ICMP packet the device receives
First three approaches can also be used for obtaining gateway and subnet-mask information.
Examples:
main_demo.c.

Definition at line 119 of file system.h.

Referenced by is_subnet().

BYTE netif::localHW[6]
 

This array holds an Ethernet address assigned to a device. Note that these must be unique so if you're shipping your product to outside world you must purchase sufficient address range.

Examples:
main_demo.c.

Definition at line 128 of file system.h.

LWORD netif::defgw
 

IP address of a default network gateway. This is needed if the device is to communicate with the outside network (Internet) and not only intranet.

Examples:
main_demo.c.

Definition at line 136 of file system.h.

LWORD netif::netmask
 

Network submask. Also needed if the the device is to communicate with the outside network. Used when determining whether the host we're sending some data to is on the local network (send data directly) or not (send through gateway).

Examples:
main_demo.c.

Definition at line 145 of file system.h.

Referenced by is_subnet().


The documentation for this struct was generated from the following file:
Generated on Sun Aug 3 20:33:01 2003 for OpenTCP by doxygen1.2.18