# ethernet_mac

Ethernet Header BETA

Author | Matthew Schinkel - borntechi.com, copyright © 2009, all rights reserved.
Adapted-by |
Compiler | >=2.4n

Description

    creates an ethernet header. contains destination/source
                 and next protocol type.

Sources

    http://www.iana.org/assignments/ethernet-numbers

Dependencies

No dependency found

## Summary

### Global variables/contants

- `var byte mac[6]`
- `const ETHERNET_REMOTE_MAC = 1`
- `const ETHERNET_PROTOCOL_ARP = 0x0806`
- `const ETHERNET_PROTOCOL = 12`
- `const MAC_IPV4 = 0x0800`
- `const MAC_ARP = 0x0806`
- `const ETHERNET_PROTOCOL_IP = 0x0800`
- `const ETHERNET_HEADER_SIZE = 14`
- `const ETHERNET_BROADCAST_MAC = 0`

### Procedures

- `ethernet_print_mac()`
- `ethernet_header_create(word in type, byte in option)`
- `ethernet_read_packet()`

### Functions

- `ethernet_verify_header() return bit`

## API details

### Global variables/contants

- `var byte mac[6]`

  No documentation found

- `const ETHERNET_REMOTE_MAC = 1`

  No documentation found

- `const ETHERNET_PROTOCOL_ARP = 0x0806`

  No documentation found

- `const ETHERNET_PROTOCOL = 12`

  No documentation found

- `const MAC_IPV4 = 0x0800`

  No documentation found

- `const MAC_ARP = 0x0806`

  No documentation found

- `const ETHERNET_PROTOCOL_IP = 0x0800`

  No documentation found

- `const ETHERNET_HEADER_SIZE = 14`

  No documentation found

- `const ETHERNET_BROADCAST_MAC = 0`

      create an ethernet header
      option = 0 - use broadcast mac
      option = 1 - use remote mac

### Procedures

- `ethernet_print_mac()`

      prints destination mac to serial port

- `ethernet_header_create(word in type, byte in option)`

  No documentation found

- `ethernet_read_packet()`

      read an ethernet header and pass to next protocol

### Functions

- `ethernet_verify_header() return bit`

      verify an ethernet header

## Related samples

Here are the list of samples which use this library:

18f4620 | 18f4620_network_udp_server.jal
18f4620 | 18f4620_network_webserver_enc28j60.jal
18f4620 | 18f4620_network_udp_client.jal
18f4620 | 18f4620_network_all_in_one.jal
18f4620 | 18f4620_network_tcp_client.jal
18f4620 | 18f4620_network_tcp_server.jal
18f4620 | 18f4620_network_ping.jal