From 0ccb4c76a3b5ad65fe1b3ae2dee5095483de8d8d Mon Sep 17 00:00:00 2001 From: pixel Date: Sun, 17 Jun 2007 15:21:50 +0000 Subject: Adding source and dest IP/port. --- lib/HttpServ.cc | 6 +++++- lib/LuaHttp.cc | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc index e24a49d..bc836c4 100644 --- a/lib/HttpServ.cc +++ b/lib/HttpServ.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: HttpServ.cc,v 1.50 2007-06-13 07:01:28 pixel Exp $ */ +/* $Id: HttpServ.cc,v 1.51 2007-06-17 15:21:50 pixel Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -227,6 +227,10 @@ int ProcessRequest::Do() throw(GeneralException) { request.uri = Uri; request.login = login; request.password = password; + request.lip = s.GetAddr(); + request.dip = s.GetDistantAddr(); + request.lport = s.GetPort(); + request.dport = s.GetDistantPort(); d->Do(request, &response); a = response.BuildResponse(&s); } else { diff --git a/lib/LuaHttp.cc b/lib/LuaHttp.cc index d3cbd2a..736739e 100644 --- a/lib/LuaHttp.cc +++ b/lib/LuaHttp.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: LuaHttp.cc,v 1.15 2007-06-11 21:24:48 pixel Exp $ */ +/* $Id: LuaHttp.cc,v 1.16 2007-06-17 15:21:50 pixel Exp $ */ #include "md5.h" #include "Domain.h" @@ -348,6 +348,22 @@ class LuaDomain : public Domain { L->push("password"); L->push(req.password); L->settable(); + + L->push("lip"); + L->push((lua_Number) req.lip); + L->settable(); + + L->push("dip"); + L->push((lua_Number) req.dip); + L->settable(); + + L->push("lport"); + L->push((lua_Number) req.lport); + L->settable(); + + L->push("dport"); + L->push((lua_Number) req.dport); + L->settable(); LuaHttpResponse r(res); r.push(L); -- cgit v1.2.3