Skip to main content

Library for generating Ethernet MAC addresses

Project description

Python-generate_mac

Python library for Generating Ethernet MAC addresses. Can use the wireshark manuf for specific vendors, and or a random, but assigned address. Will work with any file formated the same as said file.

Supported functions:

total_random() - Procedurely generated MAC address, using random function.

vid_file_random(file) - uses random line from wireshark's manuf file

vid_file_vendor(file, name) - specify a vendor name, uses wireshark's manuf file instead of being completely random

vid_provided(vid bytes) - specify the VID bytes when calling the function. Random device bytes will be generated.

list_vendors(file) - return a python list [] with valid vendors

Usage

Import and set up an object.

import generate_mac
g = generate_mac.generate_mac

Procedurely generated Vendor and Host bytes. Checks for broadcast bit

g.total_random()
'12:7E:C4:B5:F1:8E'

Read Vendor bytes from random line in a file. This has to be formated the same as wireshark's manuf file.

g.vid_file_random('/usr/share/wireshark/manuf')
'00:55:DA:10:FB:D8'

Read from a manuf file like above, but find Vendor bytes belonging to a specific vendor, by name.

g.vid_file_vendor('/usr/share/wireshark/manuf', 'Apple')
'94:0C:98:BC:74:1C'

Provide the vendor bytes in a string. Generate Host bytes only

g.vid_provided('AA:BB:CC')
'AA:BB:CC:B8:B3:01'

List valid vendor options as a list.

g.list_vendors('/usr/share/wireshark/manuf')
['Vendor1','Vendor2','etc']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-generate_mac-1.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_generate_mac-1.1.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file python-generate_mac-1.1.0.tar.gz.

File metadata

  • Download URL: python-generate_mac-1.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for python-generate_mac-1.1.0.tar.gz
Algorithm Hash digest
SHA256 6712dbb391ec41c9c7675938e12e8fa96b4802f27c12291adac773eae8ca6b43
MD5 36f3720e52b5c53d3e4d9c63a72cfc19
BLAKE2b-256 fe3b1f811d3275bca309ceaeed1571e511a89b9abe69bd86c20b1a4cc7c14dd2

See more details on using hashes here.

File details

Details for the file python_generate_mac-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: python_generate_mac-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for python_generate_mac-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6939be0e401a9e4c86f46a71a5763453b94107ae3dd5bfdedcc8b91c355a863e
MD5 90c06f3f584ddbd11aacaddd1b081b48
BLAKE2b-256 c7bd457e014d91f96d1706ddafc697f359d91d6d3765c2c147ca907e2430c592

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page