?
Solved

Linux pakets programming

Posted on 2003-03-28
4
Medium Priority
?
237 Views
Last Modified: 2010-04-20
First, i d like to say hi to the staff,
and thank every expert who share their knowledge with us!

I just registered and i already have a question lol

I m not a newbie in C but when it comes to packets programming...i m lost!
I d like to create a tool (in C) that can send custom packets through the net..
But i need someone to show me some code with little comments if possible.
I ve seen many sources about packets but i need explainations,or a good old faq!

That would help ! thanks.
0
Comment
Question by:onimenokyo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Expert Comment

by:arn0ld
ID: 8228894
i assume you mean sockets/ip. If you know perl, its easier to  
 do sockets programming. Otherwise,
man socket + man the "See Also's"

of course, google:
   linux socket tutorial

which  found the following, from this forum:

 garboua 08/14/2002 08:23AM PST

   ................................
tutorial with excellent examples and tips
http://www.ecst.csuchico.edu/~beej/guide/net/
or go to www.piratehaven.org and check em OUT.
0
 

Author Comment

by:onimenokyo
ID: 8230155

Ok thanx but i ll be more accurate in my question :

I already know sys/socket but i need a simple example about netinet/ip_icmp, ip__udp and netdb.
I ve learned what IHL,TOS,ID,DF... are but i couldn t find out how to declare them.(i ve tryed to explore the "hping" sources but it s not that simple! lol)
I know a bit of perl since it s quite close to C, so should i code my net-tools with it?

The one who can find me a good link or post a little example gets the points!
Thanks.
0
 

Accepted Solution

by:
keramati_h earned 225 total points
ID: 8230262
Hello,
for your purpose, see man page of socket under SOCK_RAW flag.
Or see packet man page. It is a good tutorial for working with packets in OSI layer 2 and above

Enjoy it
0
 

Author Comment

by:onimenokyo
ID: 8231349
yah i ve found many useful tips using "sock_raw flag" as a keyword in my search.
I ve also read the packet and socket man pages and i just finished my first packet_maker
coded in C.

Thank u all.
(the points are for keramati_h)
humm...(packet_maker + ethereal = surprise! lol)
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month13 days, 3 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question