#define ARP_LEN \
(sizeof(struct arphdr) + (2 * sizeof(uint32_t)) + (2 * HWADDR_LEN))
+/* Assert the correct structure size for on wire */
+__CTASSERT(sizeof(struct arphdr) == 8);
+
ssize_t
arp_request(const struct interface *ifp, in_addr_t sip, in_addr_t tip)
{
#define IPDEFTTL 64 /* RFC1340 */
#endif
-/* Assert the bootp structure is correct size. */
-__CTASSERT(sizeof(struct bootp) == 300);
+/* Assert the correct structure size for on wire */
+__CTASSERT(sizeof(struct ip) == 20);
+__CTASSERT(sizeof(struct udphdr) == 8);
+__CTASSERT(sizeof(struct bootp) == 300);
struct dhcp_op {
uint8_t value;
#ifdef DHCP6
+/* Assert the correct structure size for on wire */
struct dhcp6_message {
uint8_t type;
uint8_t xid[3];
};
__CTASSERT(sizeof(struct dhcp6_ia_addr) == 16 + 8);
+/* XXX FIXME: This is the only packed structure and it does not align.
+ * Maybe manually decode it? */
struct dhcp6_pd_addr {
uint32_t pltime;
uint32_t vltime;