/************************************************************* /* /* Program mapnet /* /* This program contains an example of how to call the /* functions contained in the ksnmp library. /* It allows to retrieve and print the map of the local /* network. /* /* The enviroment variables MIBFILE and ARP_SERVER must be /* correctly set. /* /* E. Pasqualucci 15-4-1996 /* /* Modified for daqctl v2 /* E. Pasqualucci 23-5-1997 /* /************************************************************* /* standard include files */ #include <stdio.h> /* snmp include files */ #include "snmp.h" #include "asn1.h" #include "snmp_impl.h" #include "snmp_api.h" /* specific include files */ #include "netmap.h" #include "ksnmp.h" /* prototype files */ #include "ksnmplib_protos.h" main() { ksnmp_init(); init_mib(); if (ksnmp_map_network() != KSNMP_OK) exit (ErrorGetNumber()); ksnmp_map_print_network_map (stdout, ksnmp_map_retrieve_network_map()); if (ksnmp_map_network_remap() != KSNMP_OK) exit (ErrorGetNumber()); ksnmp_map_print_network_map (stdout, ksnmp_map_retrieve_network_map()); ksnmp_end(); }