Re: IP packet from scratch
Re: IP packet from scratch
- Subject: Re: IP packet from scratch
- From: Mike Smith <email@hidden>
- Date: Thu, 15 Sep 2005 22:25:33 -0700
Allan,
Just a thought, but why not inject the outbound IP datagrams in the
"usual" fashion from userland?
= Mike
On Sep 15, 2005, at 2:16 PM, Allan Hoeltje wrote:
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
_______________________________________________
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