(RADIATOR) PM4 Nas-port ID
jason at freemotion.net
jason at freemotion.net
Tue Mar 16 20:38:42 CST 2004
we are having a problem with a new access server, i am using radiator 3.7.1 in
the auth-by emerald mode.
the new access-server is a Portmaster 4, the problem is this,
Starting in ComOS version 4.1 for the PM4 the NAS-Port specifies the slot,
line, and channel a call came in on instead of just the port. This information
is encoded into a 32bit number.
NAS-Port Number Format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Unused (zeros) | Slot | Line | Channel |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Example of NAS-Port in detail file
Mon Jan 18 09:22:37 1999
Acct-Session-Id = "012D000003"
User-Name = "tc1"
NAS-IP-Address = 192.168.111.25
NAS-Port = 1025
NAS-Port-Type = 5
Acct-Status-Type = Stop
Acct-Session-Time = 57
Acct-Authentic = RADIUS
Connect-Info = "9600 LAPM/V42BIS"
Acct-Input-Octets = 67
Acct-Output-Octets = 2285
Called-Station-Id = "4609993"
Calling-Station-Id = "9254600115"
Acct-Terminate-Cause = User-Request
LE-Terminate-Detail = "User Request - Normal LAPM Disconnect"
Service-Type = Login-User
Login-Service = Telnet
Login-IP-Host = 149.198.1.70
Acct-Delay-Time = 0
Timestamp = 916680157
this is giving me hell with the call records table, is there an easy whay
around this??
attached is a perl script that is supposed to give you all the info from it.
thanks
Jason
-----------------------------------------------------------------------
This message was sent using the Freemotion Internet Messaging Program.
-------------- next part --------------
#!/usr/bin/perl -w
use strict;
$::BITS_CHANNEL = 5;
$::BITS_LINE = 5;
$::BITS_SLOT = 4;
$::BITS_REST = 32 - ($::BITS_CHANNEL + $::BITS_LINE + $::BITS_SLOT);
die "usage: parsenas.pl <integer>\n" unless ($ARGV[0]);
while (defined (my $port = shift @ARGV)) {
my ($slot, $line, $channel) = port_split ($port);
print "Parsed NAS-Port = $port\n";
print "NAS-Port: [$port] = Slot [$slot]; Line [$line];";
print " Channel[$channel];\n";
my @ascii = split (//, join (" ", split (//, unpack ("B32",
pack ("N", $port)))));
my $i = $::BITS_REST;
$ascii[$i * 2 - 1] = "|";
$i += $::BITS_SLOT;
$ascii[$i * 2 - 1] = "|";
$i += $::BITS_LINE;
$ascii[$i * 2 - 1] = "|";
my $ascii = join ("", @ascii);
print <<EOF;
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|$ascii|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Unused (All zeros) Slot Line Channel
EOF
}
sub port_split
{
my ($port) = @_;
my $channel = $port & ((1 << $::BITS_CHANNEL) - 1);
$port >>= $::BITS_CHANNEL;
my $line = $port & ((1 << $::BITS_LINE) - 1);
$port >>= $::BITS_LINE;
my $slot = $port & ((1 << $::BITS_SLOT) - 1);
$port >>= $::BITS_SLOT;
return ($slot, $line, $channel);
}
More information about the radiator
mailing list