File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / snmp / gawk-2.11 / s-netstat / mib.arp
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

function at_type(f) {
    if (f in types)
	return types[f];

    return (f ? f : "unknown");
}

BEGIN {
	types[1] = "Other";
	types[2] = "Invalid";
	types[3] = "Dynamic";
	types[4] = "Static";

	printf "ARP table:\n";
	didone = 0;
	for (i in ipNetToMediaIfIndex) {
	    didone = 1;

	    printf "%-15s at %s flags %s on interface #%d (%s)\n",
		   ipNetToMediaNetAddress, ipNetToMediaPhysAddress,
		   at_type(ipNetToMediaType), ipNetToMediaIfIndex,
		   ifDescr[ipNetToMediaIfIndex];
	}
	if (!didone && DIAGNOSTIC)
	    printf "ipNetToMediaTable: %s\n", DIAGNOSTIC;
	if (!didone) {
	    for (i in atIfIndex) {
		didone = 1;

		printf "%-15s at %s on interface #%d (%s)\n",
		       atNetAddress, atPhysAddress, atIfIndex,
		       ifDescr[atIfIndex];
	    }
	    if (!didone && DIAGNOSTIC)
		printf "atTable: %s\n", DIAGNOSTIC;
	}
	if (!didone && !DIAGNOSTIC)
	    printf "\tempty.\n";	    

	if (!oflag)
	    exit(0);

	printf "\nNet to media:\n";
	didone = 0;
	for (i in clnpNetToMediaIfIndex) {
	    didone = 1;

	    printf "NS+%s at %s type %s age %d hold %d on interface #%d (%s)\n",
		    clnpNetToMediaNetAddress, clnpNetToMediaPhysAddress,
		    clnp_type(clnpNetToMediaType), clnpNetToMediaAge,
		    clnpNetToMediaHoldTime,
		    clnpNetToMediaIfIndex, ifDescr[clnpNetToMediaIfIndex];
	}
	if (!didone)
	    if (DIAGNOSTIC)
		printf "clnpNetToMediaTable: %s\n", DIAGNOSTIC;
	    else
		printf "\tempty.\n";
      }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.