>struct _varBind{ struct _varBind * next;
>char *oid; /* Null Terminated */
>unsigned char asn_type;
>int val_len;
>union { int * int_val; char * str_val; } val; };

>0009.00 D pdu_ptr_s       S               *
>0010.00 D pdu_ds          DS                   based(pdu_ptr_s)
>0011.00 D  next                           *
>0012.00 D  oid                            *
>0013.00 D  asn_type                       *
>0014.00 D  val_len                      10I 0
>0015.00 D  result                         *
>So if I do this and snmpget returns OK, the 'result' field
>(from the DS) is
>*NULL but in debug an 'eval pdu_ds' shows 'result' is a valid
>So my 2 questions are:
>1) Is the api translated to rpg ok

I can't help because I don't understand union {}

>2) can i access %str(result) or should I be doing something else.

I would say you should be doing something else.  "result" is a pointer to
something.  You need to create a space for that something, just as you have
for pdu_ds.  The function returns a pointer and that pointer points to the
pdu_ds memory space.  Since I don't know what union {} does, I can't tell
you what sort of space to create; perhaps another data structure?  Then you
could address the data being pointed to by "result."

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].