handle initial requests to http proxy

Ivano Cristofolini Ivano.Cristofolini at ing.unitn.it
Fri May 16 11:54:13 UTC 2008


Hello,

I need to modify coova-chilli to capture http requests directed to a
(NON transparent) http proxy running on port 3128 (keeping current
functionality as well).

I have successfully modified the http parsing functions in redir.c (very
simple: only redirurl changes).

I'm trying to modify the DNAT routines in dhcp.c so that requests to
port 3128 are handled in the same way as regular requests to http
servers (i.e. they are NATted to uamserver).

This is easy for dhcp_doDNAT() (I added the last line):

...
  /* Was it a http request for another server? */
  /* We are changing dest IP and dest port to local UAM server */
  if ((pack->iph.protocol == PKT_IP_PROTO_TCP) &&
      ((tcph->dst == htons(DHCP_HTTP)) || 
       (tcph->dst == htons(3128)))) {
...

I don't know how to do it for dhcp_undoDNAT().

...
/* Was it a reply from redir server? */
...
if (something???) {
  tcph->src = htons(DHCP_HTTP);
else
  tcph->src = htons(3128);
...

Any suggestions?

-- 
Ivano Cristofolini
Presidio Informatico Ingegneria
Direzione Informatica e Telecomunicazioni
Universita' degli Studi di Trento
Via Mesiano 77,
38050 Povo(TN), Italy
Tel: +39 0461/881940
Fax: +39 0461/882628




More information about the Chilli mailing list