-/* $OpenBSD: dhcpd.h,v 1.293 2021/02/22 02:19:03 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.294 2021/02/22 23:43:59 jsg Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
/* packet.c */
void assemble_eh_header(struct ether_addr, struct ether_header *);
-ssize_t decode_hw_header(unsigned char *, uint32_t,
- struct ether_addr *);
ssize_t decode_udp_ip_header(unsigned char *, uint32_t,
struct sockaddr_in *);
uint32_t checksum(unsigned char *, uint32_t, uint32_t);
-/* $OpenBSD: packet.c,v 1.44 2018/02/28 22:16:56 krw Exp $ */
+/* $OpenBSD: packet.c,v 1.45 2021/02/22 23:43:59 jsg Exp $ */
/* Packet assembly code, originally contributed by Archie Cobbs. */
eh->ether_type = htons(ETHERTYPE_IP);
}
-ssize_t
-decode_hw_header(unsigned char *buf, uint32_t buflen, struct ether_addr *from)
-{
- struct ether_header eh;
-
- if (buflen < sizeof(eh))
- return -1;
-
- memcpy(&eh, buf, sizeof(eh));
-
- memcpy(from->ether_addr_octet, eh.ether_shost, ETHER_ADDR_LEN);
-
- return sizeof(eh);
-}
-
ssize_t
decode_udp_ip_header(unsigned char *buf, uint32_t buflen,
struct sockaddr_in *from)