# Ruby libnet

**URL:** <https://www.ruby-forum.com/t/ruby-libnet/104742>\
**Category:** Ruby\
**Created:** [May 22, 2007, 12:47am UTC](https://www.ruby-forum.com/t/ruby-libnet/104742 "2007-05-22T00:47:33Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 12:47am UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/1 "2007-05-22T00:47:33Z")

</div>

hey,  
I’ve read anansi’s email on this. but i’m having different problems.

when I run ‘ruby extconf.rb’, it says “ruby headers not found”. What  
does this mean?

Also, do I need to download the original libnet files, and ruby-  
libnet is just a port?

thanks,  
ari  
-------------------------------------------|  
Nietzsche is my copilot

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 7:43am UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/2 "2007-05-22T07:43:00Z")

</div>

On Tue, May 22, 2007 at 07:46:18AM +0900, Ari B. wrote:

> when I run ‘ruby extconf.rb’, it says “ruby headers not found”. What  
> does this mean?

It means the ruby header files are missing 🙂

You need to be specific on exactly what platform you’re trying to do  
this  
on.

For example, if you’re on Debian or Ubuntu, then you’ll need to install  
the  
package “ruby1.8-dev” to get these header files.

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 10:35am UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/3 "2007-05-22T10:35:23Z")

</div>

could you get it to work to send a SYN packet?

could you test this script:

#!/usr/bin/env ruby

require ‘libnet’

$VERBOSE = true

l = Libnet.new

10.times do  
l.build\_tcp(31337, 80, rand(2 \*\* 3), 0, Libnet::TH\_SYN, 0, 0, 0,  
Libnet::LIBNET\_TCP\_H, nil, 0, nil)  
l.auto\_build\_ipv4(Libnet::LIBNET\_TCP\_H + Libnet::LIBNET\_IPV4\_H,  
Libnet::IPPROTO\_TCP, “192.168.0.2”)  
l.auto\_build\_ethernet(l.hex\_aton(“00:11:11:94:D4:F5”),  
Libnet::ETHERTYPE\_IP)  
ret = l.write  
l.clear\_packet  
puts l.geterror if ret \< 0  
end

sent,error,written = l.stats  
puts “”  
puts “Sent: #{sent}”  
puts “Error: #{error}”  
puts “Bytes Written: #{written}”

# end of file

because it is always segfaulting ruby on my machine ☹

Ari B. wrote:

> ari  
> -------------------------------------------|  
> Nietzsche is my copilot

–  
greets

```
                        (
                        )
                     (
              /\ .-"""-. /\
             //\\/ ,,, \//\\
             |/\| ,;;;;;, |/\|
             //\\\;-"""-;///\\
            // \/ . \/ \\
           (| ,-_| \ | / |_-, |)
             //` __\.-.-./__ `\\
            // /.-(() ())-.\ \\
           (\ |) '---' (| /)
            ` (| |) `
      jgs \) (/

```

one must still have chaos in oneself to be able to give birth to a  
dancing star

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 2:34pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/4 "2007-05-22T14:34:44Z")

</div>

James:

> I know multiple people have asked you to drop this signature. I’m  
> adding my voice to the list.

Perhaps you could have a smaller (and slightly less chatoic) spider  
instead?

o o  
/|"|\

Or something? I’m not too good at ascii art though, sorry ☹

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 2:16pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/5 "2007-05-22T14:16:42Z")

</div>

On May 22, 2007, at 3:35 AM, anansi wrote:

> ```
> // \/ . \/ \\
> (| ,-_| \ | / |_-, |)
> //` __\.-.-./__ `\\
> // /.-(() ())-.\ \\
> (\ |) '---' (| /)
> ` (| |) `
> jgs \) (/
> 
> ```
> 
> one must still have chaos in oneself to be able to give birth to a  
> dancing star

I know multiple people have asked you to drop this signature. I’m  
adding my voice to the list.

This signature is around 20 lines and you really should try to keep  
them under 4. This means that one of your messages probably contains  
as much fluff as actual content.

The real issue is that you waist the bandwidth of thousands of  
readers every time you send a message to this list. That’s just bad  
manners.

Please, trim the signature.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 3:37pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/6 "2007-05-22T15:37:06Z")

</div>

On 5/22/07, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> o o  
> /|"|\
> 
> Or something? I’m not too good at ascii art though, sorry ☹

I don’t know what you’re talking about, that’s a beautiful hermit crab.

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 5:50pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/7 "2007-05-22T17:50:49Z")

</div>

men calm down -.- …

–  
greets

```
                 one must still have chaos in oneself to be able to

```

give birth to a dancing star

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 6:51pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/8 "2007-05-22T18:51:58Z")

</div>

James Edward G. II wrote:  
…

> The real issue is that you waist the bandwidth of thousands of readers  
> every time you send a message to this list. That’s just bad manners.

A waist is a terrible thing to mind 😉

> Please, trim the signature.

Or replace it with a line of ruby that generates the same characters.

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 3:41pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/9 "2007-05-22T15:41:07Z")

</div>

On 5/22/07, James Edward G. II [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On May 22, 2007, at 3:35 AM, anansi wrote:

> The real issue is that you waist the bandwidth of thousands of  
> readers every time you send a message to this list. That’s just bad  
> manners.

For me the real issue is that it is extremely irritating to look at  
and scroll past. Maybe if people don’t respond to anansi until he  
shows that he can be polite to others on this list and get rid of the  
stupid spider, he’ll get the picture.

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 9:58pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/10 "2007-05-22T21:58:26Z")

</div>

On May 22, 2007, at 1:34 AM, Brian C. wrote:

> On Tue, May 22, 2007 at 07:46:18AM +0900, Ari B. wrote:
> 
> > when I run ‘ruby extconf.rb’, it says “ruby headers not found”. What  
> > does this mean?
> 
> It means the ruby header files are missing 🙂
> 
> You need to be specific on exactly what platform you’re trying to  
> do this  
> on.  
> Sorry about that.

I’m using Mac OS 10.4. Ruby is already installed, so I’m HOPING that  
the dev files are already installed. However, I keep getting that  
message. What’s going on? Anyone else ever have this problem?

thanks,  
-------------------------------------------------------|  
~ Ari  
crap my sig won’t fit

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 10:09pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/11 "2007-05-22T22:09:28Z")

</div>

On May 22, 2007, at 4:35 AM, anansi wrote:

> because it is always segfaulting ruby on my machine ☹

I can’t require the libnet file. I tried downloading and installing  
that (like a normal source program), but i couldn’t require it. Maybe  
I installed it incorrectly?

I then attempted downloading ruby-libnet, but I am missing the header  
files for ruby.

yargh  
-------------------------------------------|  
Nietzsche is my copilot

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 10:10pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/12 "2007-05-22T22:10:28Z")

</div>

On May 22, 2007, at 9:40 AM, Gregory B. wrote:

> stupid spider, he’ll get the picture.  
> Only after he helps me solve my problem.

-------------------------------------------|  
Nietzsche is my copilot

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 22, 2007, 11:20pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/13 "2007-05-22T23:20:35Z")

</div>

Also, for the missing header files on Mac OS X, I did a locate  
command, and found the file.

It was in my ruby folder, but once again, I CAN’T access it apparently.

Save me  
~ Ari  
English is like a pseudo-random number generator - there are a  
bajillion rules to it, but nobody cares.

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 23, 2007, 12:30am UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/14 "2007-05-23T00:30:41Z")

</div>

On Tue, May 22, 2007 at 10:36:36PM +0900, Gregory B. wrote:

> On 5/22/07, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > o o  
> > /|"|\
> > 
> > Or something? I’m not too good at ascii art though, sorry ☹
> 
> I don’t know what you’re talking about, that’s a beautiful hermit crab.

. . . minus the claws. I played around with adding some, but failed.

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 23, 2007, 12:40am UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/15 "2007-05-23T00:40:43Z")

</div>

On 5/22/07, Joel VanderWerf [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Or replace it with a line of ruby that generates the same characters.  
> Before the inevitable “how do I do that discussion”, let’s hope he can  
> just  
> use this 🙂

require’base64’;require’zlib’;puts Zlib::Inflate.inflate(Base64.decode64  
(%q{eJx  
dkLEOAyEMQ/f7CovliETwB/ArkWCrdGtXPr6B9go6MxAb5w0AS/HAQ/JMVoUGZA0haB7mzkkjkFICjC  
vutI5UhtI0W9/KxBSuPjnWfXD2HH4P0SFaOwwdRK/qMFmoVqtl9cNa28Zi1hgFUUSz/VkOEb9PVT2/b  
N6sNtyS99pxvd7TmOz/wQ+15Dg3}.tr(“\n”,‘’)))

Or not…

Cheers,  
Peter C.

> **[Ruby Inside: The Ruby Blog](http://www.rubyinside.com/)**
>
> The biggest Ruby and Rails blog since 2006 - tutorials, news, and lots more

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 23, 2007, 12:56am UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/16 "2007-05-23T00:56:44Z")

</div>

Peter C. wrote:

> On 5/22/07, Joel VanderWerf [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
> …  
> vutI5UhtI0W9/KxBSuPjnWfXD2HH4P0SFaOwwdRK/qMFmoVqtl9cNa28Zi1hgFUUSz/VkOEb9PVT2/b
> 
> N6sNtyS99pxvd7TmOz/wQ+15Dg3}.tr(“\n”,‘’)))

Cute, but it needs some golfing 😉

[/tmp] cat t.rb  
require’base64’;require’zlib’;puts  
Zlib::Inflate.inflate(Base64.decode64(  
%q{eJxdkLEOAyEMQ/f7CovliETwB/ArkWCrdGtXPr6B9go6MxAb5w0AS/HAQ/JMVoUGZA0ha  
B7mzkkjkFICjCvutI5UhtI0W9/KxBSuPjnWfXD2HH4P0SFaOwwdRK/qMFmoVqtl9cNa28Zi1h  
gFUUSz/VkOEb9PVT2/bN6sNtyS99pxvd7TmOz/wQ+15Dg3}.tr(“\n”,‘’)))

[/tmp] ruby t.rb | wc  
14 42 322  
[/tmp] cat t.rb | wc  
4 5 283

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 23, 2007, 10:13am UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/17 "2007-05-23T10:13:57Z")

</div>

Joel VanderWerf wrote:

> Cute, but it needs some golfing 😉
> 
> [/tmp] cat t.rb  
> require’base64’;require’zlib’;puts  
> Zlib::Inflate.inflate(Base64.decode64(  
> %q{eJxdkLEOAyEMQ/f7CovliETwB/ArkWCrdGtXPr6B9go6MxAb5w0AS/HAQ/JMVoUGZA0ha  
> B7mzkkjkFICjCvutI5UhtI0W9/KxBSuPjnWfXD2HH4P0SFaOwwdRK/qMFmoVqtl9cNa28Zi1h  
> gFUUSz/VkOEb9PVT2/bN6sNtyS99pxvd7TmOz/wQ+15Dg3}.tr("\n",’’)))
> 
> [/tmp] ruby t.rb | wc  
> 14 42 322  
> [/tmp] cat t.rb | wc  
> 4 5 283  
> require’zlib’;puts Zlib::Inflate.inflate(  
> %q{eJxdkLEOAyEMQ/f7CovliETwB/ArkWCrdGtXPr6B9go6MxAb5w0AS/HAQ/JMVoUGZA0ha  
> B7mzkkjkFICjCvutI5UhtI0W9/KxBSuPjnWfXD2HH4P0SFaOwwdRK/qMFmoVqtl9cNa28Zi1h  
> gFUUSz/VkOEb9PVT2/bN6sNtyS99pxvd7TmOz/wQ+15Dg3}.tr("\n",’’).unpack(‘m’)[0])

$ ruby t.rb | wc  
14 42 322  
$ cat t.rb | wc  
4 5 265

🙂

Kind regards  
Jan

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 23, 2007, 5:34pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/18 "2007-05-23T17:34:33Z")

</div>

On 5/23/07, Karl von Laudermann [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On May 22, 8:15 am, James Edward G. II [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > The real issue is that you waist the bandwidth of thousands of  
> > readers every time you send a message to this list. That’s just bad  
> > manners.
> 
> Actually, a linefeed character doesn’t use up any more bandwidth than  
> any other character.

True. I think the commodity being wasted isn’t really net bandwidth,  
though, but rather screen real estate (pixel bandwidth), which can be  
a little annoying. I have an old development system that I frequently  
use to check my mail on. It has a crappy monitor. Can I scroll  
through the fluff? Of course. But I like having as much info on the  
screen at one time. Besides, the same artwork on “every” post gets  
tiresome. Maybe if it was ruby code that depicted something new every  
time 🙂

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [May 23, 2007, 3:51pm UTC](https://www.ruby-forum.com/t/ruby-libnet/104742/19 "2007-05-23T15:51:14Z")

</div>

On May 22, 8:15 am, James Edward G. II [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> On May 22, 2007, at 3:35 AM, anansi wrote:

> This signature is around 20 lines and you really should try to keep  
> them under 4. This means that one of your messages probably contains  
> as much fluff as actual content.
> 
> The real issue is that you waist the bandwidth of thousands of  
> readers every time you send a message to this list. That’s just bad  
> manners.

Actually, a linefeed character doesn’t use up any more bandwidth than  
any other character. Thus, the whole “more than 4 lines = wasted  
bandwidth” idea is rather arbitrary. A 300-character signature wastes  
no more bandwidth if 20 of those characters are linefeeds than if only  
3 of them are. If he simply deletes most of the space characters that  
are being used to center the spider, thus shifting the spider over to  
the left edge, his signature would be using fewer characters than a  
signature consisting of 4 full 80-character lines.

Also, I note that you felt the need to quote the entire “waste of  
bandwidth” in your reply. 🙂
