• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

Network layer program ?

How to write a network layer program ?
(Examples : a simple IP packet filtering program )
0
thanhnl
Asked:
thanhnl
  • 2
  • 2
1 Solution
 
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
 
helverCommented:
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
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.

Join & Write a Comment

Featured Post

Firewall Management 201 with Professor Wool

In this whiteboard video, Professor Wool highlights the challenges, benefits and trade-offs of utilizing zero-touch automation for security policy change management. Watch and Learn!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now