How to write packets on ethernet card..

Discussion in 'Ruby' started by Stalin Thangaraj, Mar 11, 2009.

  1. Hi all,
    I want to write raw packets over the Ethernet card. I don't
    how to do it in ruby. If anybody knows help me..
    --
    Posted via http://www.ruby-forum.com/.
     
    Stalin Thangaraj, Mar 11, 2009
    #1
    1. Advertising

  2. On Wed, Mar 11, 2009 at 6:48 AM, Stalin Thangaraj
    <> wrote:
    > Hi all,
    > =A0 =A0 =A0 =A0 =A0I want to write raw packets over the Ethernet card. I =

    don't
    > how to do it in ruby. If anybody knows help me..


    http://tinyurl.com/cb9p7z

    When you have more specific questions, and have researched this a
    little and can show what you have tried so far, post back and I'm sure
    folks will help you.

    -greg


    --=20
    Technical Blaag at: http://blog.majesticseacreature.com
    Non-tech stuff at: http://metametta.blogspot.com
    "Ruby Best Practices" Book now in O'Reilly Roughcuts:
    http://rubybestpractices.com
     
    Gregory Brown, Mar 11, 2009
    #2
    1. Advertising

  3. Stalin Thangaraj wrote:
    > I want to write raw packets over the Ethernet card. I don't
    > how to do it in ruby. If anybody knows help me..


    First find out how to do it in C using the Unix sockets API. Suggested
    resource is "Unix Network Programming volume 1" by Richard Stevens, pub
    Addison Wesley. Or you can find existing code which sends raw packets
    and reverse-engineer that. Ask questions on a kernel/networking mailing
    list if you have problems.

    Once you know this, you can translate easily to Ruby, since ruby's
    Socket is a thin layer on top of this.

    Google "ruby socket" and the first hit is the socket documentation. Also
    look in the sockets documentation at
    http://www.ruby-doc.org/books/ProgrammingRuby (click on "Network and Web
    Libraries")
    --
    Posted via http://www.ruby-forum.com/.
     
    Brian Candler, Mar 11, 2009
    #3
  4. On 11 Mar 2009, at 12:23, Brian Candler wrote:
    > Stalin Thangaraj wrote:
    >> I want to write raw packets over the Ethernet card. I don't
    >> how to do it in ruby. If anybody knows help me..

    >
    > First find out how to do it in C using the Unix sockets API. Suggested
    > resource is "Unix Network Programming volume 1" by Richard Stevens,
    > pub
    > Addison Wesley. Or you can find existing code which sends raw packets
    > and reverse-engineer that. Ask questions on a kernel/networking
    > mailing
    > list if you have problems.
    >
    > Once you know this, you can translate easily to Ruby, since ruby's
    > Socket is a thin layer on top of this.
    >
    > Google "ruby socket" and the first hit is the socket documentation.
    > Also
    > look in the sockets documentation at
    > http://www.ruby-doc.org/books/ProgrammingRuby (click on "Network and
    > Web
    > Libraries")


    Follow the link in my sig and you'll find some presentations bursting
    with code for UDP and TCP network comms. These aren't raw packets in
    the fullest sense of the term but depending on your intent they may
    suffice.


    Ellie

    Eleanor McHugh
    Games With Brains
    http://slides.games-with-brains.net
    ----
    raise ArgumentError unless @reality.responds_to? :reason
     
    Eleanor McHugh, Mar 12, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Nicklas

    Ethernet MAC core

    Michael Nicklas, Nov 12, 2003, in forum: VHDL
    Replies:
    2
    Views:
    3,812
    Allan Herriman
    Nov 13, 2003
  2. Replies:
    1
    Views:
    1,594
    Mike Treseler
    Sep 20, 2005
  3. Mike Wahler
    Replies:
    0
    Views:
    427
    Mike Wahler
    Feb 8, 2004
  4. Martin Ambuhl
    Replies:
    0
    Views:
    394
    Martin Ambuhl
    Feb 8, 2004
  5. Susanne West

    select ethernet card for socket?

    Susanne West, May 20, 2008, in forum: Perl Misc
    Replies:
    0
    Views:
    104
    Susanne West
    May 20, 2008
Loading...

Share This Page