File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / snmp / gawk-2.11 / s-netstat / mib.egp
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 neigh_state(f) {
    if (f in states)
	return states[f];

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

function neigh_mode(f) {
    if (f in modes)
	return modes[f];

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

function neigh_trigger(f) {
   if (f in triggers)
	return triggers[f];

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

BEGIN {
	states[1] = "Idle";
	states[2] = "Acquisition";
	states[3] = "Down";
	states[4] = "Up";
	states[5] = "Cease";

	modes[1] = "Active";
	modes[2] = "Passive";

	triggers[1] = "Start";
	triggers[2] = "Stop";

	mibii = 0;
	didone = 0;
	for (i in egpInMsgs) {
		didone = 1;
		if (egpAs) {
			mibii = 1;
		}

		printf "\n";

		if (mibii)
			printf "\tAutonomous system %d\n\n", egpAs;

		printf "%10s %10s %10s\n",
			"",
				"In",
					"Out";
		printf "%10s %10d %10d\n",
			"Messages",
				egpInMsgs,
					egpOutMsgs;
		printf "%10s %10d %10d\n",
			"Errors",
				egpInErrors,
					egpOutErrors;
	}
	if (!didone && DIAGNOSTIC)
	    printf "egp group: %s\n", DIAGNOSTIC;

	printf "\n"

	printf "%15s %11s",
		"Neighbor",
			"State";

	if (mibii)
		printf " %5s %7s %6s %6s %6s\n",
			    "AS",
			    "Mode",
			    "Trigger",
			    "Hello",
			    "Poll";
				    
				    	
	else
		printf "\n";

	didone = 0;
	for (i in egpNeighAddr) {
		didone = 1;

		printf "%15s %11s",
		    egpNeighAddr,
			neigh_state(egpNeighState);
		if (mibii)
			printf " %5d %7s %6s %6d %6d\n",
			    egpNeighAs,
				neigh_mode(egpNeighMode),
				neigh_trigger(egpNeighEventTrigger),
				egpNeighIntervalHello,
				egpNeighIntervalPoll;
		else
			printf "\n";
	}
	if (!didone && DIAGNOSTIC)
	    printf "egpNeigh group: %s\n", DIAGNOSTIC;

}

unix.superglobalmegacorp.com

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