Re: Hello, need some help about socket filter (NKE) development
Re: Hello, need some help about socket filter (NKE) development
- Subject: Re: Hello, need some help about socket filter (NKE) development
- From: Haohao Lee <email@hidden>
- Date: Tue, 25 Sep 2018 14:10:13 +0800
Finally, the solution is to record the local and remote addresses in
sf_notify_fn which will be called in all kinds of state changes
(connecting, connected, etc.), then try to block some of them in
sf_data_cout and sf_data_in by returning errors.
This approach will let the tcp handshake packets pass, but will block the
connection later.
On Tue, Sep 18, 2018 at 3:47 AM Derek Fawcus <
email@hidden> wrote:
> On Fri, Sep 14, 2018 at 02:40:43PM +0800, Haohao Lee wrote:
> > typedef errno_t (*sf_connect_out_func)(void *cookie, socket_t so, const
> > struct sockaddr *to);
> > Only remote address is provided.
> >
> > How can I get the local address in sf_connect_out_func or is there
> another
> > way to achieve this?
>
> I've not checked the darwin source for this, but generally connect seems to
> do an internal bind first if not already called by the user.
>
> So maybe there will be an initial form of bind callback from where you can
> stash the source address?
>
> DF
> _______________________________________________
> 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