Jump to content

SilentButeo2

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by SilentButeo2

  1. something like this? UDPStartUp() $socket = UDPopen($dest_IP, $dest_Port) $SNMP_Command = _SNMPBuildPacket( $your_snmp_settings ) UDPSend($socket, $SNMP_Command)
  2. Just see that it is you that replied to my bug .
  3. @enaiman: 1. The fix you had to release to work with 3.3.80, is probably a bug in the 3.3.80 version. I opened a bug report for that. (http://www.autoitscript.com/trac/autoit/ticket/2094) 2. I adjusted your code to make the INT work. In short i changed next lines: Case $SNMP_data_INT, $SNMP_data_COUNTER, $SNMP_data_GAUGE, $SNMP_data_TIME, $SNMP_data_STR ;(INT, COUNTER, GAUGE, TIME, STR) $p_dVALUE = _StringToHex($p_dVALUE)into Case $SNMP_data_INT ;(INT) $p_dVALUE =Hex(Int($p_dVALUE), 8) Case $SNMP_data_COUNTER, $SNMP_data_GAUGE, $SNMP_data_TIME, $SNMP_data_STR ;(COUNTER, GAUGE, TIME, STR) $p_dVALUE = _StringToHex($p_dVALUE) Now the output is correct if I view the created packet in WireShark. The correct data length is filled (thanks) and the correct data is added. Optimizations could be done. - Only add the number of bytes that are needed. Now there are always 4 bytes added - don't know if the fix for INTEGERS should also be done for COUNTER, GAUGE, TIME? Other smaller fixes i had to do to run without warnings/errors. Add AutoItSetOption ( "MustDeclareVars", 1 )at the beginning of your file to check these warnings/errors. Added my patched UDF file as a reference. SNMP_UDF_testing.au3
  4. just check with the other snmp program and if i send there 1384, i get 02 02 05 68 so the first byte is the integer byte the second will contain the number of bytes and de third and fourth will contain the hex value of 1384
  5. I think i found a bug? When calling Func _SNMPBuildPacket($snmpOID, $snmpCOMM = "public", $snmpVER = 1, $snmpReqID = 1, $PDUType = "A1", $GetBulk = "32", $dataTYPE = "05", $dataVALUE = "00") With $dataTYPE = $SNMP_data_INT and $dataValue to 0 or "00", the packet will contain "30" and "3030" at the end. This is the ascii value of the character "0" One would think that it would be "00" that is be added. Another thing i noticed is that when i send the same write snmp with another snmp program, i get different output. The last bytes of the packet your code: 02 00 other program: 02 01 00 the first byte is the type (INTEGER) the third byte is the data it self (0). If the second packet is opened with the sniffer program, the thrid byte is selected as data byte. If i load you packet, when i select the value info, no bytes are selected in the packet. So that way i supose that the packet is incorrect. When I check your code, i think both errors (if these are errors) can be found in the _Build_Varbind() function. One more question. How should one save the write byte in dataVALUE? dataVALUE="1384" dataVALUE="568" dataVALUE=1384 dataVALUE=0x568 kind regards, and thanks for this great UDF!
  6. I think this could be a bug Doing this: For $i=0 To 10000 Local $text="hallo world" If ($text="hallo world") Then ContinueLoop Nextresults in tmp002.au3 (3) : ==> "ContinueLoop" statement with no matching "While", "Do" or "For" statement.: If ($text="hallo world") Then ContinueLoop But this works fine: For $i=0 To 10000 Local $text="hallo worldX" If ($text="hallo world") Then ContinueLoop Next or this: For $i=0 To 10000 Local $text="hallo world" If ($text="hallo world") Then ContinueLoop EndIf Next AutoIt v3.3.8.0
  7. Thank @Melba23. For the quick reaction. No problem that you can't help out more. Just to make sure that the problem was looked at. Well, this is my first post, but i think i'm already visiting this forum for more then 2 years. But always found the answer on the forum or in the help files (great help files by the way)
  8. I wan't to create multiple GUI's with each there own RichEdit control. But only the first richedit is correctly created. Below you can find demo code to illustrate the problem. Anyone an idea why error 1 is returned and what error 1 means (no such error described in the help files) Test include 1 GUI and creating 2 richedit controls. The other test will create a second window with a new richedit control. Both are failing. #include <GuiRichEdit.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Main() Func Main() Local $hGui, $hRichEdit, $iMsg Local $hGui02, $hRichEdit02, $iMsg02 Local $hGui03 $hGui = GUICreate("Example01 (" & StringTrimRight(@ScriptName, 4) & ")", 320, 350, -1, -1) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 100, 100, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) ConsoleWrite(@error&@CRLF) ; =======> return 0 _GUICtrlRichEdit_AppendText($hRichEdit, @CR & "This is more text") GUISetState() $hRichEdit03 = _GUICtrlRichEdit_Create($hGui, "This is a test.", 120, 120, 100, 100, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) ConsoleWrite(@error&@CRLF) ; =======> return 1 _GUICtrlRichEdit_AppendText($hRichEdit03, @CR & "This is more text") GUISetState() $hGui02 = GUICreate("Example02 (" & StringTrimRight(@ScriptName, 4) & ")", 320, 350, -1, -1) $hRichEdit02 = _GUICtrlRichEdit_Create($hGui02, "This is a test.", 10, 10, 100, 100, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) ConsoleWrite(@error&@CRLF) ; =======> return 1 _GUICtrlRichEdit_AppendText($hRichEdit02, @CR & "This is more text") GUISetState() While True $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes _GUICtrlRichEdit_Destroy($hRichEdit02) ; needed unless script crashes ;~ GUIDelete() ; is OK too Exit EndSelect WEnd EndFunc ;==>Main
×
×
  • Create New...