aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/uuid.h
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2013-07-24 04:24:21 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2013-07-24 04:24:21 +0000
commitef1f916971dc57bc4cc60ec447721644568ff250 (patch)
tree5a9b936ca0a1586a327a35bf012dd92454f71b1c /sys/sys/uuid.h
parentd2034d1b22b1c9a551fa3cd7d5143bb1d2dd4602 (diff)
downloadsrc-ef1f916971dc57bc4cc60ec447721644568ff250.tar.gz
src-ef1f916971dc57bc4cc60ec447721644568ff250.zip
Decouple the UUID generator from network interfaces by having MAC
addresses added to the UUID generator using uuid_ether_add(). The UUID generator keeps an arbitrary number of MAC addresses, under the assumption that they are rarely removed (= uuid_ether_del()). This achieves the following: 1. It brings up closer to having the network stack as a loadable module. 2. It allows the UUID generator to filter MAC addresses for best results (= highest chance of uniqeness). 3. MAC addresses can come from anywhere, irrespactive of whether it's used for an interface or not. A side-effect of the change is that when no MAC addresses have been added, a random multicast MAC address is created once and re-used if needed. Previusly, when a random MAC address was needed, it was created for every call. Thus, a change in behaviour is introduced for when no MAC addresses exist. Obtained from: Juniper Networks, Inc.
Notes
Notes: svn path=/head/; revision=253590
Diffstat (limited to 'sys/sys/uuid.h')
-rw-r--r--sys/sys/uuid.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/sys/uuid.h b/sys/sys/uuid.h
index 0f40bb20e31b..0748f6114853 100644
--- a/sys/sys/uuid.h
+++ b/sys/sys/uuid.h
@@ -58,6 +58,9 @@ struct sbuf;
struct uuid *kern_uuidgen(struct uuid *, size_t);
+int uuid_ether_add(const uint8_t *);
+int uuid_ether_del(const uint8_t *);
+
int snprintf_uuid(char *, size_t, struct uuid *);
int printf_uuid(struct uuid *);
int sbuf_printf_uuid(struct sbuf *, struct uuid *);