Created
April 25, 2009 23:50
-
-
Save tcolgate/101808 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (define l3list '(localhost)) | |
| (define (find-host ) | |
| (for-each | |
| (lambda(router) | |
| (session router | |
| (let* ((arp (get (+ ipNetToMediaPhysAddressq | |
| (% 2 (iid (walk vtpVlanState))) | |
| (ip-as-oid hostip)))) | |
| (vlan (% 1 (iid arp))) | |
| (mac (arp))) | |
| (sesion l3-host (+ community vlan) | |
| (let* ((interface (get (+ dot1dBasePortIfIndex | |
| (get (+ dot1dTpFdbPor | |
| (mac-as-oid mac)))))) | |
| (neighbour (walk (+ '(cdpCacheAddress cdpCacheAddressType) | |
| (iid (walk pagpGroupIfIndex (pagpGroupIfIndex interface)))) ;uses a filter | |
| (cdpCacheAddressType ipaddress))) | |
| (port (session neighbour (+ community vlan) (get (+ ifDescr | |
| (get (+ dot1dBasePortIfIndex | |
| (get (+ dot1dTpFdbPort (mac-as-oid mac)))))))))) | |
| (format #t "Found ~a on ~a port ~a" hostip neighbour port))))) | |
| l3list))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment