Hi,
today I tried to use ruby to read data from an ax25 socket using the
socket api.
I think, that some definitions/constants are missing. There are no
constants
for AF_AX25, AF_PACKET and the method htons is missing also.
I have attached two (ugly, undocumented, unportable files, one
containing a small c example, the other the correspoding ruby code.
Output of listen.c
af_packet: 17, sock_packet: 10, htons( AX25): 512
received: 101 bytes
� � h � r
� � � � � � � �
� � @ � � � � b @
� � ` � � @ �
� � � � d @ c � = 4 9 3 2 . 2 3 N / 0 0 8 2 2
. 7 0 E _ . . . / . . . g . . . t 0 4 9 r 0 0 0 p 0 0 0 R 0 0 0 h 5 6 b
1 0 2 3 0
Output of listen.rb
socket: #Socket:0xb7cd8748
received: 101 bytes
� � h � r
� � � � � � � �
� � @ � � � � b @
� � ` � � @ � �
� � � d @ c � = 4 9 3 2 . 2 3 N / 0 0 8 2 2 .
7 0 E _ . . . / . . . g . . . t 0 4 9 r 0 0 0 p 0 0 0 R 0 0 0 h 5 6 b 1
0 2 3 0
Is the incomplete ruby socket api a bug or do I have make something
wrong ?
My dpkg (debian packet tool) says
ii ruby1.8 1.8.6.114-2 Interpreter of object-oriented
scripting lan
Regards
Michael C.