From: Joel VanderWerf Date: 2008-04-03T06:39:59+09:00 Subject: Re: Socket::Constants incomplete ? Michael Conrad wrote: > 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. Hm, AF_AX25 should get defined in ruby if it is available in C: [ruby/src/ruby/ext/socket] grep AF_AX * socket.c:#ifdef AF_AX25 socket.c: sock_define_const("AF_AX25", AF_AX25); Maybe socket.c isn't including the right header file, in which case it might be a bug in the extconf.rb. Dunno about AF_PACKET--it doesn't seem to be referenced anywhere in the socket extension. For htons(), you can use String#unpack and Array#pack. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407