Re: ipf_inject_input returns ENOTSUP
Re: ipf_inject_input returns ENOTSUP
- Subject: Re: ipf_inject_input returns ENOTSUP
- From: Josh Graessley <email@hidden>
- Date: Wed, 21 Sep 2005 15:18:23 -0700
On Sep 21, 2005, at 2:38 PM, Allan Hoeltje wrote:
So, my user application sends a fully formed IP packet back to the
kext
using send(). The kext receives this data as an mbuf via
ctl_send_func.
How does the kernel know that the data I am sending back has a IP
packet
header in it, especially if the user app has prepended my own
additional
control header?
The data your application sends to the kernel is probably an IP
packet, including the IP header, with a small kext/app specific
header prepended. When your kext receives this data in the
ctl_send_func is specified, it will receive the data in a chain of
mbufs. The kext should inspect the prepended header and gather the
information it needs out of that. The kext should then use mbuf_adj
to trim the app/kext specific header off the start of the mbuf chain,
leaving the IP header at the start of the mbuf chain.
The kernel looks at the start of the mbuf chain to determine whether
the packet is an IPv4 or IPv6 packet. It does this by looking at the
first nibble. The first nibble must be 4 or 6. The rest of the data
in the mbuf chain really should be an IP packet, but the kernel
doesn't do any additional checking at that point.
-josh
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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