Data Structures | |
struct | _ARPENTRY |
ARP entry structure. More... | |
struct | _ARPENTRY |
ARP entry structure. More... | |
struct | ifnet |
Network interface structure. More... | |
struct | ifnet |
Network interface structure. More... | |
struct | ip |
Structure of an internet header. More... | |
struct | ip |
Structure of an internet header. More... | |
struct | pseudo_hdr |
Defines | |
#define | ATF_COM 0x02 |
Completed entry. | |
#define | ATF_PERM 0x04 |
Permanent entry. | |
#define | IPVERSION 4 |
IP protocol version. | |
#define | IP_DF 0x4000 |
Don't fragment flag. | |
#define | IP_MF 0x2000 |
More fragments flag. | |
#define | IP_OFFMASK 0x1fff |
Mask for fragmenting bits. | |
#define | IPOPT_EOL 0 |
End of option list. | |
#define | IPOPT_NOP 1 |
No operation. | |
#define | IPOPT_RR 7 |
Record packet route. | |
#define | IPOPT_TS 68 |
Timestamp. | |
#define | IPOPT_SECURITY 130 |
Provide s,c,h,tcc. | |
#define | IPOPT_LSRR 131 |
Loose source route. | |
#define | IPOPT_SATID 136 |
Satnet id. | |
#define | IPOPT_SSRR 137 |
Strict source route. | |
#define | IPOPT_OPTVAL 0 |
Option identifier offset. | |
#define | IPOPT_OLEN 1 |
Option length offset. | |
#define | IPOPT_OFFSET 2 |
Offset within option. | |
#define | IPOPT_MINOFF 4 |
Minimum offset within option. | |
#define | MAXTTL 255 |
Maximum time to live (seconds). | |
#define | IPDEFTTL 64 |
Default time to live. | |
#define | IPFRAGTTL 60 |
Time to live for fragments. | |
#define | IPTTLDEC 1 |
Subtracted from time to live when forwarding. | |
Typedefs | |
typedef _ARPENTRY | ARPENTRY |
ARP entry type. | |
typedef ifnet | IFNET |
Network interface type. | |
typedef ip | IPHDR |
Internet header type. | |
Functions | |
int | NutNetIfConfig (CONST char *name, void *mac_dev, u_long ip_addr, u_long ip_mask) |
Configure a network interface. | |
int | NutNetIfSetup (NUTDEVICE *dev, u_long ip_addr, u_long ip_mask, u_long gateway) |
int | NutNetLoadConfig (CONST char *name) |
Load network configuration from EEPROM. | |
int | NutNetSaveConfig (void) |
int | NutNetAutoConfig (CONST char *name) |
Configure a network interface using EEPROM values. | |
int | NutIpOutput (u_char proto, u_long dest, NETBUF *nb) |
Send IP datagram. | |
void | NutIpInput (NUTDEVICE *dev, NETBUF *nb) |
Process incoming IP datagrams. | |
u_long | inet_addr (CONST u_char *str) |
Convert decimal dotted ASCII representation into numeric IP address. | |
u_char * | inet_ntoa (u_long addr) |
Convert numeric IP address into decimal dotted ASCII representation. | |
u_short | NutIpChkSumPartial (u_short partial_csum, void *buf, u_short count) |
Calculates a partial IP checksum over a block of data. | |
u_short | NutIpChkSum (u_short partial_csum, void *buf, u_short count) |
Calculates an the final IP checksum over a block of data. | |
u_short | NutIpPseudoChkSumPartial (u_long src_addr, u_long dest_addr, u_char protocol, u_short len) |
Calculates the partial IP pseudo checksum. | |
u_short | NutIpPseudoChkSum (u_long src_addr, u_long dest_addr, u_char protocol, u_short len) |
Calculates the IP pseudo checksum. | |
int | NutIpRouteAdd (u_long ip, u_long mask, u_long gate, NUTDEVICE *dev) |
Add a new entry to the IP routing table. | |
NUTDEVICE * | NutIpRouteQuery (u_long ip, u_long *gate) |
Find a device associated with a particular IP route. | |
Variables | |
RTENTRY * | rteList = 0 |
Linked list of routing entries. |
|
Convert decimal dotted ASCII representation into numeric IP address.
|
|
Convert numeric IP address into decimal dotted ASCII representation.
|
|
Calculates an the final IP checksum over a block of data. Unlike the partial checksum in NutIpChkSumPartial(), this function takes the one's complement of the final result, thus making it the full checksum. |
|
Calculates a partial IP checksum over a block of data. Note that this returns the checksum in network byte order, and thus does not need to be converted via hton16(), etc. Of course this means that we mustn't use this value for normal arithmetic! This is a partial checksum because it doesn't take the 1's complement of the overall sum.
|
|
Process incoming IP datagrams. Datagrams addressed to other destinations and datagrams whose version number is not 4 are silently discarded.
|
|
Send IP datagram. Route an IP datagram to the proper interface. The function will not return until the data has been stored in the network device hardware for transmission. If the device is not ready for transmitting a new packet, the calling thread will be suspended until the device becomes ready again. If the hardware address of the target host needs to be resolved the function will be suspended too.
|
|
Add a new entry to the IP routing table. Note, that there is currently no support for removing entries or detecting duplicates. Anyway, newer entries will be found first, because they are inserted in front of older entries. However, this works only for equal masks, i.e. new network routes will never overwrite old host routes.
|
|
Find a device associated with a particular IP route. Gateway routes will be automatically resolved up to four levels of redirection.
|
|
Configure a network interface using EEPROM values. Loads IP address, netmask and MAC address from EEPROM and calls NutNetIfConfig().
|
|
Configure a network interface. Open the device and associate the given MAC address, IP address and netmask with the network interface.
|
|
Network interface setup.
|
|
Load network configuration from EEPROM.
|
|
Save network configuration in EEPROM. |