aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/net/ethernet.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h
index 01485cf26e06..3c296852e3d6 100644
--- a/sys/net/ethernet.h
+++ b/sys/net/ethernet.h
@@ -447,6 +447,7 @@ void ether_bpf_mtap_if(struct ifnet *ifp, struct mbuf *m);
#ifdef _KERNEL
#include <sys/_eventhandler.h>
+#include <sys/systm.h>
struct ifnet;
struct mbuf;
@@ -479,10 +480,18 @@ void ether_gen_addr_byname(const char *nameunit, struct ether_addr *hwaddr);
static __inline struct mbuf *ether_vlanencap(struct mbuf *m, uint16_t tag)
{
-
return ether_vlanencap_proto(m, tag, ETHERTYPE_VLAN);
}
+/* Create an ether_addr from an array of u_char (or uint8_t). */
+__nodiscard static __inline __unused struct ether_addr
+make_ether_addr(const u_char *__octets)
+{
+ struct ether_addr __ret;
+ memcpy(&__ret.octet[0], __octets, ETHER_ADDR_LEN);
+ return (__ret);
+}
+
/* new ethernet interface attached event */
typedef void (*ether_ifattach_event_handler_t)(void *, struct ifnet *);
EVENTHANDLER_DECLARE(ether_ifattach_event, ether_ifattach_event_handler_t);