|
|
The reference peer program calls the readobjects routine to read the compiled module, look-up the module which it will register with the SNMP agent, and call the getsmuxEntrybyname routine to find its entry in the snmpd.peers database.
OT ot; char objectsfile[BUFSIZ];If either of these routines fails, do not register the MIB module.if ((se = getsmuxEntrybyname(myname)) == NULL) { LIB_PERROR("no SMUX entry for - NEWD"); exit(-1); } (void) sprintf(objectsfile, "%s.defs", myname); if (readobjects(objectsfile) == NOTOK) { LIB_PERROR("readobjects: "); exit(-1); } for (tc = triples; tc->t_tree; tc++) if (ot = text2obj(tc->t_tree)) { tc->t_name = ot->ot_name; (void) (*tc->t_init) (); } else LIB_ERROR1("text2obj (\"%s\") fails", tc->t_tree);