chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] how do i set interface for tcp client socket etc.


From: foobar
Subject: Re: [Chicken-users] how do i set interface for tcp client socket etc.
Date: Fri, 16 Mar 2007 10:04:58 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20070103)

John Janecek schrieb:
> I have a linux box.
> It have many network sockets
>
> ie 192.168.1.1
> 192.168.1.2
> etc
> I want to set it so the tcp client will use for example IP addy
> 192.168.1.2
> etc
>
> Also is the way to do same thing for http and xml-rpc client module ?
>
> Thanx

If all these addresses refer to different NICs on your system, then
there is a way to accomplish that.
Libnet provides an interface to work on the system's linklevel.
That means you can specifiy which device to use to send the packet.
The drawback is that you have to build your packet by hand from
ground up. But libnet helps you out here, it makes it
reasonably easy to construct ip,tcp and ethernetpackets.
You can wrap this up in a function for your convinience.
But your code depends on libnet then unless you digg into
libnet's code and see how the guys have done it.

Refer to the libnet documentation to learn more.
You might want to use an older version as it changed much
since i last looked at it.

HTH

greets





reply via email to

[Prev in Thread] Current Thread [Next in Thread]