Network layer program ?

Posted on 1998-10-26
Last Modified: 2010-04-15
How to write a network layer program ?
(Examples : a simple IP packet filtering program )
Question by:thanhnl
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
  • 2

Author Comment

ID: 1253841
Edited text of question

Expert Comment

ID: 1253842
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.

Expert Comment

ID: 1253843
Please give us more information. What's your OS, what do you want to do etc.

Author Comment

ID: 1253844
I want to do it in the unix os. I'm using solaris 2.5

Accepted Solution

helver earned 200 total points
ID: 1253845
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 

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.

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
Suggested Courses

626 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