Downloads the public IEEE registries of MAC address blocks and combines them in one data frame. The result is cached on disk, so later calls do not need an internet connection.
Usage
get_oui_registry(
registry = c("MA-L", "MA-M", "MA-S"),
refresh = FALSE,
cache_dir = NULL
)Arguments
- registry
Which registries to download.
- refresh
Logical. Download again even if a cached copy exists?
- cache_dir
Directory where the CSV files are cached. By default, the user cache directory given by
tools::R_user_dir("MAC.address", "cache").To remove the cached files, delete the cache directory, e.g.
unlink(tools::R_user_dir("MAC.address", "cache"), recursive = TRUE).
Value
A data frame with columns registry, assignment (hexadecimal
prefix), organization and address. If a registry cannot be downloaded
(e.g. no internet connection), an error with an informative message is
given.
Details
Registries:
MA-L: MAC Address Block Large (24-bit prefix, the classic OUI).MA-M: MAC Address Block Medium (28-bit prefix).MA-S: MAC Address Block Small (36-bit prefix).
Examples
# \donttest{
# Needs an internet connection; the MA-L registry is about 4 MB
oui <- try(get_oui_registry("MA-L", cache_dir = tempdir()))
if (is.data.frame(oui)) head(oui)
#> registry assignment organization
#> 1 MA-L 286FB9 Nokia Shanghai Bell Co., Ltd.
#> 2 MA-L 38E2CA Katun Corporation
#> 3 MA-L E80AB9 Cisco Systems, Inc
#> 4 MA-L 78465F Fiberhome Telecommunication Technologies Co.,LTD
#> 5 MA-L 9075DE Zebra Technologies Inc.
#> 6 MA-L 80BA16 Micas Networks Inc.
#> address
#> 1 No.388 Ning Qiao Road,Jin Qiao Pudong Shanghai Shanghai CN 201206
#> 2 7760 France Ave S Suite 340 Bloomington MN US 55438
#> 3 80 West Tasman Drive San Jose CA US 94568
#> 4 No.5 DongXin Road Wuhan Hubei CN 430074
#> 5 ONE ZEBRA PLAZA HOLTSVILLE NY US 11742
#> 6 250 Tasman Drive, Ste 170, San Jose, CA 95134 San Jose CA US 95134
# }