sourceforge tutorial sample code problem

"xiao ren" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi, there!

I compiled some sample code provided by sorceforge(http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/asyncapp/index.html), but it will run into error when call the 'initialize()' function:

void initialize (void)
{
  struct oid *op = oids;
  
  /* Win32: init winsock */
  SOCK_STARTUP;

  /* initialize library */
  init_snmp("asynchapp");

  /* parse the oids */
  while (op->Name) {
    op->OidLen = sizeof(op->Oid)/sizeof(op->Oid[0]);
    if (!read_objid(op->Name, op->Oid, &op->OidLen)) {  //########IT WILL RUN INTO ERROR HERE!!#########
      snmp_perror("read_objid");
      exit(1);
    }
    op++;
  }
}

The program will report 'read_objid: Unknown Object Identifier (Sub-id not found: (top) -> system)'. 

And I paste oid definition here:

struct oid {
  const char *Name;
  oid Oid[MAX_OID_LEN];
  int OidLen;
} oids[] = {
  { "system.sysDescr.0" },
  { "interfaces.ifNumber.1" },
  { "interfaces.ifNumber.0" },
  { NULL }
};

It seems that read_objid function don't understand what is 'system.sysDesc.0', could anybody tell me why this error happend? Thanks!
--------------
xiao ren
2008-06-23

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.