Re: How to define Structure like C in VB

From: vbgnr (vbgnr_at_programmer.net)
Date: 03/01/04


Date: Tue, 02 Mar 2004 02:25:16 +0800

hi Mike,

thanks for your reply. here are my further question:

On Mon, 1 Mar 2004 12:03:54 -0000, Mike D Sutton @ Work <EDais@mvps.org>
wrote:

>> i want to write a snmp trap monitor program with visual basic. the snmp
>> trap string i read from winsock control is a binary string, i have to
>> determine information in the snmp message body by analysing the string.
>> in C, i can define a structure, then copy the data to the structure,
>> then get each kind of information by access each field in the
>> structure. how can i do same with visual basic?
>
> You'll need to declare a UDT that has the same structure as the
> structure you're receiving and use RtlMoveMemory()/CopyMemory() to
> write the data you receive from SNMP into it. If the structure uses

the lengths of snmp UDP packeks vary according to different trap event, and
the structure of it should be hieratical, looks like the following:

snmp package
   version
   community name
   data (variable)
     type
     agent ip
     time stamp
     trap data (variable)
        oid
        string
          oemid
          text (variable)

does UDT support such type like this? any idea?

thanks in advance!

vbgnr



Relevant Pages

  • Re: How to define Structure like C in VB
    ... ChildName as String ... Child as SubStructure ... >>> i want to write a snmp trap monitor program with visual basic. ...
    (microsoft.public.vb.general.discussion)
  • Re: sending snmp traps from z/OS
    ... Pat is stating that the SNMP command may also be used for ... My experience with the SNMP command - from ... This is the SNMP support for NetView ... And it supports trap generation. ...
    (bit.listserv.ibm-main)
  • Re: Problem with hexvalue
    ... SNMP has a few base types. ... type "OCTET STRING". ... have the mib file. ... The manager uses the MIB to determine how to format return values. ...
    (comp.protocols.snmp)
  • Re: How to define Structure like C in VB
    ... > i want to write a snmp trap monitor program with visual basic. ... > trap string i read from winsock control is a binary string, ... You'll need to declare a UDT that has the same structure as the structure you're receiving and use RtlMoveMemory/CopyMemoryto ...
    (microsoft.public.vb.general.discussion)
  • sending snmp traps from z/OS
    ... I have been trying to send a simple snmp trap from z/OS to another host for ... got some notion about SNMP agents and the needed configuration. ... snmp agent task only gives me the opportunity to RECEIVE TRAPS and not to ...
    (bit.listserv.ibm-main)