to register instance of UNICODE string

Alexander Bubnov <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hello!

I tried to register an instance of UNICODE string:

static const wchar_t* nstAgentSubagentObject = L"ABC";

void
init_nstAgentSubagentObject(void)
{
  oid nstAgentSubagentObject_oid[] =
  { 1, 3, 6, 1, 4, 1, 8072, 2, 4, 1, 1, 2, 0 };

  netsnmp_handler_registration *reginfo;
  netsnmp_watcher_info *watcher_info;
  int watcher_flags = WATCHER_FIXED_SIZE;
  watcher_info =
  netsnmp_create_watcher_info(
  &nstAgentSubagentObject,
  wcslen(nstAgentSubagentObject),
  ASN_OCTET_STR,
  watcher_flags);

  reginfo = netsnmp_create_handler_registration(
  "my instance",
  0,
  nstAgentSubagentObject_oid,
  OID_LENGTH(nstAgentSubagentObject_oid),
  HANDLER_CAN_RONLY|HANDLER_CAN_NOT_CREATE);


  netsnmp_register_watched_instance(reginfo, watcher_info);
}



But snmpget prints strange set of characters:

f560-2k1 snmp/mibs# snmpget -v2c -c rwpublic localhost
NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0
NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 = STRING: <-



f560-2k1 snmp/mibs# snmptranslate -M+. -mNET-SNMP-TUTORIAL-MIB -Tp -IR
netSnmpTutorialMIB
+--netSnmpTutorialMIB(4)
  |
  +--nstMIBObjects(1)
  | |
  | +--nstAgentModules(1)
  | |
  | +-- -RW- Integer32 nstAgentModuleObject(1)
  | +-- -R-- String nstAgentSubagentObject(2)
  | | Textual Convention: SnmpAdminString
  | | Size: 0..255
  | +-- -RW- Integer32 nstAgentPluginObject(3)
  |
  +--nstMIBConformance(2)



Can you please help me to find out what is wrong?

may by a special storage of UTF strings exist as for counter64?


-- 
/BR, Alexander

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H

_______________________________________________
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.