-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ip #355
base: main
Are you sure you want to change the base?
Ip #355
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your work!
#define ETH_ARP_DST_MAC_P 0x20 | ||
#define ETH_ARP_DST_IP_P 0x26 | ||
// Ethernet II header | ||
struct EthHeader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This struct should also be __attribute__((__packed__))
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is EtherCard support something else than 8 bits controllers? If yes then we need this attribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, but even if that's not the case, there's no harm in adding it for future proof :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am aiming to add support for a wider range of devices, including the 32-bit ones, such as the Arduino M0.
The biggest blocker is the SPI interface - I have a half-complete branch using the Arduino SPI library - see #335.
* keep MAC/IP relations into an ARP 'store'. * fix issue when IP packet is received from local network: answer is no more broadcasted * define ETHERCARD_ARP_STORE_SIZE to set cache size
* less error prone * decrease code size to flash * introduce ethernet_header(), ethernet_payload(), ip_header(), ip_payload().... basic functions to retrieve headers and payloads * use ntoh and hton instead of manual multibytes adaptations. getBigEndianLong has been replaced by standard function ntohl.
[IP] use IP header instead of array offsets
Description
less error prone
decrease code size to flash (save some bytes, see below)
introduce ethernet_header(), ethernet_payload(), ip_header(),
ip_payload().... basic functions to retrieve headers and payloads
use ntoh and hton instead of manual multibytes adaptations.
getBigEndianLong has been replaced by standard function ntohl.
Code size evolution depending on examples
Negative value: save size
Positive value: increase size