Find the answer to your Linux question:
Results 1 to 2 of 2
I am hoping someone here will help me out. I am trying to make a program that controls my ethernet card's input and output. I kind of want to take ...
  1. #1
    Just Joined! errigour's Avatar
    Join Date
    Jan 2009
    Posts
    51

    I cant control my network card.....

    I am hoping someone here will help me out.
    I am trying to make a program that controls
    my ethernet card's input and output. I kind of
    want to take the control linux has of my eth0
    card and eth1 card and use a program that
    will controll access. I kind of want to better
    understand my network hardware as well.
    I prefer to use perl programming. I still don't
    quite understand c programming the way you should
    to actually make programs worth using. hence my
    rpm2cpio ki, a, program I posted for linux users who
    didn't know theres a command that extracts your
    rpm files into working directories that the rpm would
    be extracted into using the rpm -ivh command.
    unfortunatly programmers like to keep things confidentual
    so some rpm files contain binaries that you would have to
    exrtact cause I don't know how to with linux. Anways
    Please someone if you coould point me in the right direction
    that would help emensly with my self schooling network
    programming.

  2. #2
    Just Joined!
    Join Date
    Feb 2009
    Posts
    45
    Answer:
    Quote Originally Posted by linuxrelik
    I am trying to make a program that controls my ethernet card's input and output. I kind of want to take the control linux has of my eth0 card and eth1 card and use a program that will controll access. […] Anways
    Please someone if you coould point me in the right direction that would help emensly with my self schooling network programming.
    These are the solutions I can think of, sorted by awkwardness, descending:
    1. Hack the network driver for your NIC.
      • Receiving packets: Use «iptables»¹ in conjunction with the «QUEUE» target and «libipq»². This way you can pass network packets through userspace code and possibly drop them.
      • Sending packets: Use the «Raw Socket»³ interface.

    2. Same as in 2., but for sending packets, use one of the many libraries that abstract the «Raw Socket» interface.⁴


    Footnotes:

    1. libipq(3) - Linux man page
    2. raw(7): IPv4 raw sockets - Linux man page
    3. I.e. libpcap: TCPDUMP/LIBPCAP public repository

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...