2 # this file defines some utilities for printing various structures
3 # found in the net-snmp source code. You can source it from within
4 # gdb and then use it to print variable chains, oids, etc directly
7 # as an example, consider the variables:
12 # normally display oids is difficult under gdb, and the best you can
13 # do is to use x/12dw name or so to print the first 12 numbers of the
14 # oid array. however, with this file you can now use:
16 # gdb> printoid name_len name
19 # which will print oids in a more readable fashion. etc...
33 printf "int: %d\n", $arg0->val.integer
36 printf "string: %s\n", $arg0->val.string
42 printoid (($arg0->val_len)/sizeof(oid)) $arg0->val.objid
45 printf "NO SUCH NAME\n"
48 printf "NO SUCH INSTANCE\n"
51 printf "END OF MIB VIEW\n"
54 printf "AGENTX INCL RANGE: "
55 printoid (($arg0->val_len)/sizeof(oid)) $arg0->val.objid
58 printf "AGENTX EXCL RANGE: "
59 printoid (($arg0->val_len)/sizeof(oid)) $arg0->val.objid
64 prints the value part of a net-snmp "struct variable".
65 This is called from inside printvar.
71 printf "%stype: %d\n", $varindent, $arg0->type
72 printf "%soid: ", $varindent
73 printoid $arg0->name_length $arg0->name
74 printf "%s", $varindent
79 prints the variable information contained in a net-snmp struct
80 variable. printvarval POINTER will print it's oid, value type and
89 printf "VARIABLE #%d\n", $tmpcount
91 set $tmpvar = $tmpvar->next_variable
92 set $tmpcount = $tmpcount + 1
98 calls printvar repeatedly on a chain of variables, displaying all
99 the variables in a net-snmp struct variable chain.
103 set $printoid_tmp = 0
104 while $printoid_tmp < $arg0
105 printf ".%d", $arg1[$printoid_tmp]
106 set $printoid_tmp = $printoid_tmp + 1
111 printoid LENGTH OIDPTR
112 prints an oid (.x.y.z...) given it's length and a pointer.
116 printoid $arg0_len $arg0
120 shorthand for 'printoid NAME_len NAME"
124 printoid $arg0_length $arg0
128 shorthand for 'printoid NAME_length NAME"