Data Structures | |
struct | ARPENTRY |
struct | ARPFRAME |
struct | ether_arp |
Ethernet ARP protocol structure. More... | |
struct | ether_header |
Ethernet protocol header. More... | |
struct | ip |
Structure of an internet header. More... | |
struct | nic_pkt_header |
struct | udphdr |
UDP protocol header structure. More... | |
Defines | |
#define | ARPHRD_ETHER 1 |
ethernet hardware format | |
#define | ARPOP_REQUEST 1 |
request to resolve address | |
#define | ARPOP_REPLY 2 |
response to previous request | |
#define | ETHERTYPE_IP 0x0008 |
IP protocol. | |
#define | ETHERTYPE_ARP 0x0608 |
Address resolution protocol. | |
#define | IPPROTO_IP 0 |
Dummy for IP. | |
#define | IPPROTO_ICMP 1 |
Control message protocol. | |
#define | IPPROTO_TCP 6 |
Transmission control protocol. | |
#define | IPPROTO_UDP 17 |
User datagram protocol. | |
#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. | |
Typedefs | |
typedef ether_arp | ETHERARP |
Ethernet ARP protocol type. | |
typedef ether_header | ETHERHDR |
Ethernet protocol header type. | |
typedef udphdr | UDPHDR |
UDP protocol header type. | |
Functions | |
int | ArpRequest (u_long dip, u_char *dmac) |
Request the MAC address of a specified IP address. | |
void | ArpRespond (void) |
Process incoming ARP packets. | |
void | NicInit (void) |
Initialize the NIC. | |
int | EtherOutput (u_char *dmac, u_short type, u_short len) |
Send an Ethernet frame. | |
int | EtherInput (u_short type, u_short tms) |
Receive an Ethernet frame. | |
u_short | IpChkSumPartial (u_short partial_csum, void *buf, u_short count) |
Calculates a partial IP checksum over a block of data. | |
u_short | IpChkSum (u_short partial_csum, void *buf, u_short count) |
Calculates an the final IP checksum over a block of data. | |
int | IpInput (u_char proto, u_short tms) |
Receive an IP packet with the specified protocol type. | |
int | IpOutput (u_long dip, u_char proto, u_short len) |
int | UdpInput (u_short port, u_short tms) |
Receive an UDP datagram on a specified port. | |
int | UdpOutput (u_long dip, u_short dport, u_short sport, u_short len) |
Send an UDP datagram. |
|
Request the MAC address of a specified IP address.
|
|
Process incoming ARP packets. We do not really respond to ARP requests. |
|
Receive an Ethernet frame.
|
|
Send an Ethernet frame.
|
|
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.
|
|
Receive an IP packet with the specified protocol type. This function calls EtherInput(). Any incoming Ethernet frame, which is not of the specified type will be discarded.
|
|
|
|
Initialize the NIC. For further description of the initialization please refer to the original Ethernut code. |
|
Receive an UDP datagram on a specified port. This function calls IpInput(). Any incoming Ethernet frame, which is not an UDP datagram to the specified port will be discarded.
|
|
Send an UDP datagram. This function fills the UDP header of the global send frame and calls IpOutput().
|