![]() |
2009-12-03
, 00:18
|
Posts: 13 |
Thanked: 5 times |
Joined on Nov 2009
|
#2
|
![]() |
2009-12-03
, 17:59
|
Posts: 3 |
Thanked: 0 times |
Joined on Dec 2009
|
#3
|
There is another approach to your problem, if you do not want to involve the kernel/iptables even though it is *THE* cleanest solution, you may consider proxies.
Apache with a modules & Squid.
You can create rules to rewrite part of the query or to route it where ever you want. The only drawback is that the client application need to support HTTP proxy and only TCP connection is supported (yes even non web traffic via 'CONNECT')
The second proxy standard is sock v4 or v5 and support UDP traffic. You can install a sockify application on the client end if this one does not support sock.
Rewriting all the packets on the fly using scapy would be the best solution for this even if I would be really interested to know if it's running on the n900.
As far As I know, I can't just make echo 1 > /proc/net/ipv4/ip_forward on a N900, as this is not a kernel part, and even if it was, it wouldn't do what I plan to dev, that is IP Raw sockets (I would like osi layer 2 handled by kernel), to act like a router, with some packet rewriting purpose (like the user agent
What i'm aiming to do is quite simple in fact, selecting an inside interface (can be USB, WiFi, Bluetooh, everything that has an IP connection), capture packets, reinject them to an outside interface (you guessed this is 3g/edge/... interface), with some packet rewriting, the first would be to do PAT but I would allow further rewrite rules...
Well, you I want your advices guys to tell me if you have such experiences using raw sockets or libpcap on maemo/N900.
I already developped in Qt (that's a while, i'm not a developer
the simpliest (for me) would be to use scapy (very simple framework in python to capture/forge packets), but don't know if the maemo python engine will allow socket manipulation.
In advance, thanks of the advices you would give me.
Finally, I guess there's no gcc on maemo and I have to cross compile for arm processors, right ?