EtherSia
A minimal IPv6 Ethernet library for Arduino.
|
Run EtherSia on Linux using a raw socket to Send and receive Ethernet frames Not intended for use with running EtherSia on Arduino. More...
#include <LinuxSocket.h>
Public Member Functions | |
EtherSia_LinuxSocket (const char *iface=NULL) | |
Constructor. More... | |
virtual boolean | begin (const MACAddress &address) |
Initialise the Ethernet controller Must be called before sending or receiving Ethernet frames. More... | |
virtual uint16_t | sendFrame (const uint8_t *data, uint16_t datalen) |
Send an Ethernet frame. More... | |
virtual uint16_t | readFrame (uint8_t *buffer, uint16_t bufsize) |
Read an Ethernet frame. More... | |
virtual void | end () |
Close the raw ethernet socket. | |
boolean | begin () |
Configure the Ethernet interface and get things ready. More... | |
Public Member Functions inherited from EtherSia | |
EtherSia () | |
Default Constructor. | |
boolean | begin () |
Configure the Ethernet interface and get things ready. More... | |
void | disableAutoconfiguration () |
Disable stateless auto-configuration (SLAAC) More... | |
void | enableAutoconfiguration () |
Enable stateless auto-configuration (SLAAC) More... | |
void | setGlobalAddress (IPv6Address &address) |
Manually set the global IPv6 address for the Ethernet Interface from an IPv6Address object. More... | |
void | setGlobalAddress (const char *address) |
Manually set the global IPv6 address for the Ethernet Interface from human readable string. More... | |
IPv6Address & | globalAddress () |
Get the global IPv6 address of the Ethernet Interface. More... | |
IPv6Address & | linkLocalAddress () |
Get the link-local address of the Ethernet Interface This is generated automatically from the MAC address. More... | |
MACAddress & | localMac () |
Get the local MAC address of this network interface. More... | |
MACAddress & | routerMac () |
Get the MAC address of the router on the local subnet. More... | |
void | setRouter (MACAddress &routerMac) |
Manually set the MAC address of the router on the local subnet. More... | |
boolean | setRouter (const char *address) |
Manually set the IPv6 address of the router on the local subnet. More... | |
boolean | setRouter (IPv6Address &address) |
Manually set the IPv6 address of the router on the local subnet. More... | |
uint8_t | isOurAddress (const IPv6Address &address) |
Check to see if an IPv6 address belongs to this Ethernet interface. More... | |
uint8_t | inOurSubnet (const IPv6Address &address) |
Check if an address is in the same subnet as us. More... | |
void | setDnsServerAddress (IPv6Address &address) |
Set the IPv6 address DNS server to use for hostname lookups. More... | |
IPv6Address & | dnsServerAddress () |
Get the IPv6 address of the DNS server. More... | |
uint16_t | receivePacket () |
Check if there is an IPv6 packet waiting for us and copy it into the buffer. More... | |
void | rejectPacket () |
Check the received packet, and reply with a rejection packet. More... | |
boolean | bufferContainsReceived () |
Check if the packet buffer contains a valid received packet. More... | |
IPv6Packet & | packet () |
Get a reference to the packet buffer (the last packet sent or received). More... | |
void | send () |
Send the packet currently in the packet buffer. | |
void | prepareSend () |
Get the packet buffer ready to send a packet. More... | |
void | prepareReply () |
Convert the packet current in the packet buffer into a reply. More... | |
IPv6Address * | lookupHostname (const char *hostname) |
Lookup a hostname using DNS and get an IPv6 address for it. More... | |
MACAddress * | discoverNeighbour (const char *address) |
Perform Neighbour Discovery for an IPv6 address on the local subnet. More... | |
MACAddress * | discoverNeighbour (IPv6Address &address, uint8_t attempts=NEIGHBOUR_SOLICITATION_ATTEMPTS) |
Perform Neighbour Discovery for an IPv6 address on the local subnet. More... | |
void | tcpSendRSTReply () |
Send a reply with a TCP RST packet. | |
Run EtherSia on Linux using a raw socket to Send and receive Ethernet frames Not intended for use with running EtherSia on Arduino.
EtherSia_LinuxSocket::EtherSia_LinuxSocket | ( | const char * | iface = NULL | ) |
Constructor.
iface | the name of the Ethernet interface to send/receive on |
boolean EtherSia::begin |
Configure the Ethernet interface and get things ready.
If auto-configuration has not been disabled, then stateless auto-configuration will start - attempting to get an IP address and Router address using IGMPv6.
|
virtual |
Initialise the Ethernet controller Must be called before sending or receiving Ethernet frames.
address | the local MAC address for the Ethernet interface |
|
virtual |
Read an Ethernet frame.
buffer | a pointer to a buffer to write the packet to |
bufsize | the available space in the buffer |
Implements EtherSia.
|
virtual |
Send an Ethernet frame.
data | a pointer to the data to send |
datalen | the length of the data in the packet |
Implements EtherSia.