On Thu, 20 Jan 2005, Bruce M Simpson wrote:

> On Wed, Jan 19, 2005 at 03:58:23PM -0800, dpk wrote:
> > I just got a test server set up for this. The patch worked fine. I lifted
> > a pppd command line from a linux mailing list:
> >
> > pppd /dev/cuaa4 1382400 crtscts noipdefault noauth lock persist connect 
> > 'chat -v "" CLIENT CLIENTSERVER "\\c"'
> >
> > and I'm able to access the device via the ppp0 interface.
> >
> > FWIW, I am using FreeBSD 4.10 here. Thanks for updating the patch!
>
> Committed to -CURRENT, MFC pending 1 week. Thanks!
>
> BMS

Also, if anyone else is interested, here's a perl script which will let
you send commands (getsysinfo, getsvctag, amongst others) without having
to load up Linux kernel emulation and use the proprietary racadm.

It's rough, probably really rough, but at the very least it might give you
a start. (I'm using it here to setup the RAC NICs, so I don't have to do
it in front of the machine)

It assumes that you ran pppd as stated above.
#!/usr/bin/perl
#
# rac.pl
#
# sends commands to the RAC via previously established PPP
# interface
#
# Needs some work to clean up the output. Let's call this a rough
# draft.
#
# 20050120 [EMAIL PROTECTED] init

use strict;
use Socket;

####
# Variables

my $CMD = shift;

my $HOST = '192.168.234.236';
my $PORT = '5860';

my $paddr;
my $buf;

####
# Program

print ">>> $CMD\n";

$paddr = sockaddr_in ($PORT, inet_aton ($HOST));
my $cnt;
if ($CMD =~ / /) {
        $cnt = chr (length ($CMD) + 6);
        $buf = "P$cnt\000\000$CMD\000";
} else {
        $cnt = chr (length ($CMD) + 7);
        $buf = "P$cnt\000\000$CMD \000";
}

$buf .= (chr (256 - (unpack ("%8C*", ($buf)))));

socket (SOCK, PF_INET, SOCK_STREAM, getprotobyname ('tcp')) || die "socket: $!";
connect (SOCK, $paddr) || die "connect: $!";
syswrite (SOCK, $buf, length ($buf));
sysread (SOCK, $buf, 4096);
if ($buf =~ /^`(.*)
/s) {
        print "<<< '$1'\n";
}

print "||| DONE\n";
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to