[Klone-users] Connected port.
radek.hnilica at gmail.com
radek.hnilica at gmail.com
Wed Dec 19 06:33:00 EST 2007
Thansk much,
On 12/19/07, Stefano Barbato <barbato at koanlogic.com> wrote:
> ---[ my.kl1 ]---
> <%
> addr_t *local, *peer;
>
> local = request_get_addr(request);
> peer = request_get_peer_addr(request);
>
> io_printf(out, "local %s:%d <p>",
> inet_ntoa(local->sa.sin.sin_addr),
> ntohs(local->sa.sin.sin_port));
I forget the ntohs part so I miss the port. Now I seem them so can
change the behavior depending on port.
>
> io_printf(out, "peer %s:%d <p>",
> inet_ntoa(peer->sa.sin.sin_addr),
> ntohs(peer->sa.sin.sin_port));
> %>
> ----------------
But now I'm stuck with network part of local address. I did not find
a way how to get a mask of the local interface. I need this to see if
the client is on local network or not.
-- Radek
More information about the klone-users
mailing list