• C

Network layer program ?

How to write a network layer program ?
(Examples : a simple IP packet filtering program )
thanhnlAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
helverConnect With a Mentor Commented:
Well...  What you'll want to do is take a look at some of the net header files that solaris provides.  If you grabbing packets using tcpdump or something similiar, then you'll need to slap the different protocol headers onto the data stream and pull out the pieces you're looking for.

If you're looking for source code of a program that does just that, check out
http://jarok.cs.ohiou.edu/software/tcptrace/tcptrace.html 

But the basic idea is to apply the different headers (usually ethernet first, then ip, then tcp/udp) and read the data that's important to you.
0
 
thanhnlAuthor Commented:
Edited text of question
0
 
agreenCommented:
The answer for your question depends on the OS you are using. For the DOS, for example, you have to use/write the packet driver which differs for different network cards.
0
 
agreenCommented:
Please give us more information. What's your OS, what do you want to do etc.
0
 
thanhnlAuthor Commented:
I want to do it in the unix os. I'm using solaris 2.5
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.