> This comes up from time to time. The BSD telnet will do it, meaning that
> you can get it from any of the BSD source archives. You're already using
> it with your FreeBSD, NetBSD, &c. (Don't know about Linux.)
>
> The trick is that it's not documented in the man page. The syntax is
> discernable from the source. It's something like "telnet @hop1 @
hop2:dest".
>
Tried it on the following systems..
Sunos 4.1.3_U1
Solaris 2.3
HPUX 10
AIX 3.2
Linux (slackware 2.x release)
All failed because it tried to do a dns lookup on @hop1:dest (yes I used
real machine names :)
> It's also been suggested here that this is easy enough to do on your own
> with setsockopt(2), though I've never looked into it personally.
>
> -KH
>
Yes it is very easy to do..
The basics for IP source routing would be something like:
t = buf;
*t++ = (strict) ? IPOPT_SSRR : IPOPT_LSRR; /* type */
*t++ = 3 + 4 * num; /* length */
*t++ = 4; /* pointer */
for(i=0; i<num; i++) {
bcopy(&add[i].s_addr, t, 4);
t += 4;
}
*t = IPOPT_NOP; /* size = 3 + 4 * num, pad out to multiple of 4 */
if( setsockopt(s, IPPROTO_IP, IP_OPTIONS, buf, 4 * (num + 1)) < 0)
perror("source routing option");
Granted this will not do it alone but it should point anyone with a bit of
skill in the right direction..
|
|