IP packet from scratch
IP packet from scratch
- Subject: IP packet from scratch
- From: Allan Hoeltje <email@hidden>
- Date: Thu, 15 Sep 2005 14:16:46 -0700
Sorry if this has been asked before. I have an application that needs to
insert new outgoing IP packets into the stack. (I have a kernel extension
listening to the user app via a socket, etc. etc...)
My question concerns the setting of certain fields in the IP header. Most
of it is pretty clear but I want to be sure about these:
Ip_len:
Do I need to do an htons() on the length or is that done in the kernel?
Ip_id
Can I just set this to zero?
Ip_sum
If I set this to zero does the kernel calculate the check sum?
The scenario here is my KEXT is diverting some IP packets to my user app.
The user app looks at the packets and returns some back to the KEXT
unmodified and the KEXT puts them back into the IP stack. That much I have
working just fine.
In addition to this, I want my user app to occasionally create new IP
packets (with a UDP and RTP payload) and send them to the KEXT as outgoing
packets.
Also, if my user app does modify the IP payload, such as lengthen or shorten
the payload) do I need to adjust anything other than ip_len in the IP
header, such as ip_sum?
If there are any gotchas that are waiting to trip a KEXT neophyte like me
please advise!
Thanks!!
-Allan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden