xref: /freebsd/sys/net/ieee_oui.h (revision 94c15665a554014572d5d837640bf9154474617c)
1fe267a55SPedro F. Giffuni /* -
2fe267a55SPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3fe267a55SPedro F. Giffuni  *
462f1e1b2SGeorge V. Neville-Neil  * Copyright (c) 2013 The FreeBSD Foundation
562f1e1b2SGeorge V. Neville-Neil  * All rights reserved.
662f1e1b2SGeorge V. Neville-Neil  *
762f1e1b2SGeorge V. Neville-Neil  * Redistribution and use in source and binary forms, with or without
862f1e1b2SGeorge V. Neville-Neil  * modification, are permitted provided that the following conditions
962f1e1b2SGeorge V. Neville-Neil  * are met:
1062f1e1b2SGeorge V. Neville-Neil  * 1. Redistributions of source code must retain the above copyright
1162f1e1b2SGeorge V. Neville-Neil  *    notice, this list of conditions and the following disclaimer.
1262f1e1b2SGeorge V. Neville-Neil  * 2. Redistributions in binary form must reproduce the above
1362f1e1b2SGeorge V. Neville-Neil  *    copyright notice, this list of conditions and the following
1462f1e1b2SGeorge V. Neville-Neil  *    disclaimer in the documentation and/or other materials provided
1562f1e1b2SGeorge V. Neville-Neil  *    with the distribution.
1662f1e1b2SGeorge V. Neville-Neil  *
1762f1e1b2SGeorge V. Neville-Neil  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
1862f1e1b2SGeorge V. Neville-Neil  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1962f1e1b2SGeorge V. Neville-Neil  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
2062f1e1b2SGeorge V. Neville-Neil  * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR
2162f1e1b2SGeorge V. Neville-Neil  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2262f1e1b2SGeorge V. Neville-Neil  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2362f1e1b2SGeorge V. Neville-Neil  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2462f1e1b2SGeorge V. Neville-Neil  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2562f1e1b2SGeorge V. Neville-Neil  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2662f1e1b2SGeorge V. Neville-Neil  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
2762f1e1b2SGeorge V. Neville-Neil  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2862f1e1b2SGeorge V. Neville-Neil  * SUCH DAMAGE.
2962f1e1b2SGeorge V. Neville-Neil  *
3062f1e1b2SGeorge V. Neville-Neil  * $FreeBSD$
3162f1e1b2SGeorge V. Neville-Neil  *
3262f1e1b2SGeorge V. Neville-Neil  * Author: George V. Neville-Neil
3362f1e1b2SGeorge V. Neville-Neil  *
3462f1e1b2SGeorge V. Neville-Neil  */
3562f1e1b2SGeorge V. Neville-Neil 
3662f1e1b2SGeorge V. Neville-Neil /* Organizationally Unique Identifier assigned by IEEE 14 Nov 2013 */
371350c361SGeorge V. Neville-Neil #define OUI_FREEBSD_BASE 0x589cfc000000
381350c361SGeorge V. Neville-Neil #define OUI_FREEBSD(nic) (OUI_FREEBSD_BASE | (nic))
3962f1e1b2SGeorge V. Neville-Neil 
4062f1e1b2SGeorge V. Neville-Neil /*
4162f1e1b2SGeorge V. Neville-Neil  * OUIs are most often used to uniquely identify network interfaces
4262f1e1b2SGeorge V. Neville-Neil  * and occupy the first 3 bytes of both destination and source MAC
4362f1e1b2SGeorge V. Neville-Neil  * addresses.  The following allocations exist so that various
4462f1e1b2SGeorge V. Neville-Neil  * software systems associated with FreeBSD can have unique IDs in the
4562f1e1b2SGeorge V. Neville-Neil  * absence of hardware.  The use of OUIs for this purpose is not fully
4662f1e1b2SGeorge V. Neville-Neil  * fleshed out but is now in common use in virtualization technology.
4762f1e1b2SGeorge V. Neville-Neil  *
4862f1e1b2SGeorge V. Neville-Neil  * Allocations from this range are expected to be made using COMMON
4962f1e1b2SGeorge V. Neville-Neil  * SENSE by developers.  Do NOT take a large range just because
5062f1e1b2SGeorge V. Neville-Neil  * they're currently wide open.  Take the smallest useful range for
5162f1e1b2SGeorge V. Neville-Neil  * your system.  We have (2^24 - 2) available addresses (see Reserved
5262f1e1b2SGeorge V. Neville-Neil  * Values below) but that is far from infinite.
5362f1e1b2SGeorge V. Neville-Neil  *
5462f1e1b2SGeorge V. Neville-Neil  * In the event of a conflict arbitration of allocation in this file
55d4aff8d1SGeorge V. Neville-Neil  * is subject to core@ approval.
5662f1e1b2SGeorge V. Neville-Neil  *
5762f1e1b2SGeorge V. Neville-Neil  * Applications are differentiated based on the high order bit(s) of
5862f1e1b2SGeorge V. Neville-Neil  * the remaining three bytes.  Our first allocation has all 0s, the
5962f1e1b2SGeorge V. Neville-Neil  * next allocation has the highest bit set.  Allocating in this way
6062f1e1b2SGeorge V. Neville-Neil  * gives us 254 allocations of 64K addresses.  Address blocks can be
6162f1e1b2SGeorge V. Neville-Neil  * concatenated if necessary.
6262f1e1b2SGeorge V. Neville-Neil  *
6362f1e1b2SGeorge V. Neville-Neil  * Reserved Values: 0x000000 and 0xffffff are reserved and MUST NOT BE
6462f1e1b2SGeorge V. Neville-Neil  * allocated for any reason.
6562f1e1b2SGeorge V. Neville-Neil  */
6662f1e1b2SGeorge V. Neville-Neil 
6769023644SPeter Grehan /* Allocate 20 bits to bhyve */
681350c361SGeorge V. Neville-Neil #define OUI_FREEBSD_BHYVE_LOW	OUI_FREEBSD(0x000001)
6969023644SPeter Grehan #define OUI_FREEBSD_BHYVE_HIGH	OUI_FREEBSD(0x0fffff)
703c3aa8c1SKyle Evans 
713c3aa8c1SKyle Evans /*
723c3aa8c1SKyle Evans  * Allocate 16 bits for a pool to give to various interfaces that need a
733c3aa8c1SKyle Evans  * generated address, but don't quite need to slice off a whole section of
743c3aa8c1SKyle Evans  * the OUI (e.g. cloned interfaces, one-off NICs of various vendors).
753c3aa8c1SKyle Evans  *
763c3aa8c1SKyle Evans  * ether_gen_addr should be used to generate an address from this pool.
773c3aa8c1SKyle Evans  */
783c3aa8c1SKyle Evans #define	OUI_FREEBSD_GENERATED_MASK	0x10ffff
793c3aa8c1SKyle Evans #define	OUI_FREEBSD_GENERATED_LOW	OUI_FREEBSD(0x100000)
80409a80e5SChuck Tuffli #define	OUI_FREEBSD_GENERATED_HIGH	OUI_FREEBSD(OUI_FREEBSD_GENERATED_MASK)
81409a80e5SChuck Tuffli 
82409a80e5SChuck Tuffli /* Allocate 16 bits for emulated NVMe devices */
83409a80e5SChuck Tuffli #define OUI_FREEBSD_NVME_MASK		0x20ffff
84409a80e5SChuck Tuffli #define OUI_FREEBSD_NVME_LOW		OUI_FREEBSD(0x200000)
85*94c15665SChuck Tuffli #define OUI_FREEBSD_NVME_HIGH		OUI_FREEBSD(OUI_FREEBSD_NVME_MASK)
86