From: Eric Wong Date: 2012-07-10T05:24:46+09:00 Subject: Re: sock.setsockopt how? Eliezer Croitoru wrote: > i want to use specific tcp\dup socketopts. > in my case i want to use IP_TRANSPARENT SOCKET. > this is the page of tproxy documentation: > http://www.mjmwired.net/kernel/Documentation/networking/tproxy.txt > > the option in the kernel ic constant number 19. Until Ruby exposes the IP_TRANSPARENT constant, you can just use 19 in your code (or define the constant yourself): IP_TRANSPARENT = 19 socket.setsockopt(Socket::SOL_IP, IP_TRANSPARENT, 1) > i have seen some examples on with setsockopt like this > http://pastie.org/314914 or the code in bottom. > but i am unable to understand how am i suppose to set the constant? > i have looked at the ruby source code and didnt found anywhere the > word IP_TRANSPARENT so i suppose it wasnt integrated into the > source. > any suggestions? You should also submit a patch to http://bugs.ruby-lang.org to get IP_TRANSPARENT added to the list of constants Ruby may exposed. There's already a lot of platform-dependent constants that are conditionally defined in ext/socket/mkconstants.rb