Script Library: 1238 scripts
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

Discussion posts for script snmp.r

24-May-2007 17:10
25-May-2007 8:35
Just a note to say to people to be careful with this piece of code.

I just gave a quick look at the code, and there is at least one buggy 

The encoding of integers in ASN.1 format is wrongly coded : 
- it does not respect the format specified for negative values,

- it does not encode correctly values when a "zero byte" appears 
in the middle of the value (e.g. 0x1100FFFF for example). 

I also suspect the decoding of integers to not be working properly.

If I have some time, I will try to correct the script, right now, 
I will just switch languages. 


Maybe not perfect, but this should decode/encode correctly integer 

Any comments are welcome, i am not a good rebol coder so there should 
be a better way to do this.

*EDIT2: little precision, I just manage the data here, not the length 
nor the identifier

ber: context [

    encode-integer: func [int [integer!]] [
       b: debase/base to-hex int 16
       repeat index len: length? b [

    if all [index = len]           [break] ; we must at least send one 

    if all [b/1 <>   0 b/1 <> 255] [break] ; nor 0x00, nor 
    0xFF, cool

    if all [b/1  =   0 b/2 >= 128] [break] ; we don't have nine 0s 
    in a row

    if all [b/1  = 255 b/2 <  128] [break] ; we don't have nine 1s 
    in a row
       	   b: next b

    decode-integer: func [bin [binary!]] [

     padding: either all [128 > to-integer bin/1] [#{00}][#{FF}]
        repeat index subtract 4 length? bin [insert bin padding]
	to-integer bin

25-Sep-2008 12:45
Hi all,

I am new to rebol, and i am working with the ldap protocol stuff. 
I dont know how to Send a BIND and search the results to Ldap server. 
Please Help me to find out the BER encoding/decoding with BIND, SEARCH, 
UNBIND stuffs.
14-Apr-2021 19:53

This may possibly be quite helpful for some within your work opportunities I plan to never only with my website. I’m sure they’ll be benefited from this site.


Lesly | drywall bend

MakeDoc2 by REBOL- 14-Apr-2021
23-May-2021 8:38

I'll take note of this. It was great for me as a beginner.



Patio Contractor

MakeDoc2 by REBOL- 23-May-2021