#!/usr/bin/perl
#    Big Sister network monitor
#    Copyright (C) 1998  Thomas Aeby
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

%oid = ( 
	 "org-dod-internet", "1.3.6.1",
	 "internet", "1.3.6.1",
	 "directory", "1.3.6.1.1",
	 "mgmt", "1.3.6.1.2",
	 "experimental", "1.3.6.1.3",
	 "private", "1.3.6.1.4",
	 "enterprises", "1.3.6.1.4.1",
	 "mib-2", "1.3.6.1.2.1",
	 "microsoft", "1.3.6.1.4.1.311",
	 "software", "1.3.6.1.4.1.311.1",
	 "internetServer", "1.3.6.1.4.1.311.1.7"
       );

while( <> ) {
    s/[\r\n]*//;
    next if( /^--/ || /^$/ );
    ($name,$oid) = split( /\s+/ );
    if( $oid =~ /^([^\.]+)\.(.*)/ ) {
	$parent = $oid{$1};
	unless( $parent ) {
	    print STDERR "$1 unknown - ignoring $name\n";
	    next;
	}
	$oid = $parent.".".$2;
	$oid{$name} = $oid;
	print "$name\t$oid\n";
    }
}

