MAC vendor lookup: Difference between revisions
Content added Content deleted
m (→{{header|APL}}) |
(→{{header|APL}}: move demo code into program instead of output section) |
||
Line 90: | Line 90: | ||
vendors ⍪← ⊆vendorLookup1 burger ⍝ then look up the next vendor and append |
vendors ⍪← ⊆vendorLookup1 burger ⍝ then look up the next vendor and append |
||
:EndFor |
:EndFor |
||
⍝ end function definition |
⍝ end function definition |
||
∇ |
|||
⍝ demo data |
|||
⚫ | |||
macList ← '88:53:2E:67:07:BE' 'D4:F4:6F:C9:EF:8D' 'FC:FB:FB:01:FA:21' |
|||
macList ⍪← '4c:72:b9:56:fe:bc' '00-14-22-01-23-45' |
|||
⍝ look up the vendors (takes a while with the 2-second delay between lookups) |
|||
vendorList ← vendorLookup macList |
|||
⚫ | |||
⚫ | |||
⍝ the result is an array (a 1-row by N-column matrix). to print out one vendor |
|||
⍝ per line, we reshape it to be N rows by 1 column instead. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
Apple, Inc. |
Apple, Inc. |
||
Cisco Systems, Inc |
Cisco Systems, Inc |