Giter Club home page Giter Club logo

macco's Introduction

NAME

MACCo - MAC COnverter

SYNOPSIS:

[STDIN] | macco.sh [OPTIONS]... [MAC-ADDRESSES]...

DESCRIPTION

MACCo is a script for translating MAC addresses between various vendors' formats.

The motivation for this script is similar to my earlier project'ciscom' ([CISCO M]ac converter), but is a different project due to the change in scope (ie, it supports more vendors than just Cisco).

This script is largely useful for converting MAC addresses so that they can be used in regexps - eg, Cisco's 'show mac-address-table | i maca.ddre.sses'.

OPTIONS:

-a,-A   'Automatic' mode (depends on defaults defined in the script)
-b,-B   Binary style
-c      Cisco style ('maca.ddre.sses') - for newer Cisco IOS
-C      Cisco style ('maca.ddre.sses') - for older Cisco IOS
-h      Help - display brief help text and quit.
-H      Help - display full help text and quit.
-i,-I   Interface Lookup
-l      Linux style - lowercase ('ma:ca:dd:re:ss:es')
-L      Linux style - UPPERCASE ('MA:CA:DD:RE:SS:ES')
-n      Naked style - lowercase ('macaddresses')
-N      Naked style - UPPERCASE ('MACADDRESSES')
-O,-o   Only print MAC addresses; similar to the -o flag in grep(1)
-p      H(P) style - lowercase ('macadd-resses')
-P      H(P) style - UPPERCASE ('MACADD-RESSES')
-r,-R   ARP Lookup
-s      Solaris style - lowercase ('50:1A:12:14:a:b')
-S      Solaris style - UPPERCASE ('50:1A:12:15:A:B')
-w      Windows style - lowercase ('ma-ca-dd-re-ss-es')
-W      Windows style - UPPERCASE ('MA-CA-DD-RE-SS-ES')
-x,-X   'Exclude' mode (filters out things like global broadcast)

NOTES

  • Automatic Mode converts to the 'default' format (as defined by FUNCT). If the supplied MAC is already in that format, it is converted to the 'automatic' format (defined by AUTO_FUNCT)
  • MAC address(es) can be supplied by STDIN, and/or script arguments. If both STDIN and arguments are supplied, STDIN is processed first.
  • Input from STDIN will be parsed for MAC addresses (that is, the script will make an effort to only convert tokens which look like MAC addresses whilst passing through all other input).
  • If no MAC addresses are supplied, all system MAC addresses (excluding loopback) are displayed.
  • Interface Lookup (INT_LOOKUP) and ARP Lookup (ARP_LOOKUP) embeds the converted addresses in various lookup commands (per the style used). NB: Both Lookup modes imply ONLY_MATCHING (-o).
  • The New/Old divide in Cisco/IOS affects whether 'show mac-address-table' (old) or 'show mac address-table' (new) is used. It only matters if INT_LOOKUP (-m|-M) is used.
  • Exclude mode current filters 00:00:00:00:00:00 and FF:FF:FF:FF:FF:FF.

AUTHOR

Written by Robert W.J. Stewart

TODO

  • Add interface/ARP support for more vendors (Juniper NetScreen/JunOS, HP, etc)
  • Add support for custom MAC filters with -x

macco's People

Contributors

bkeifer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.