Re: (RADIATOR) PostAuthHook and Vendor Attributes

2000-05-02 Thread Mike McCauley


--- Forwarded mail from [EMAIL PROTECTED]

Date: Tue, 2 May 2000 23:40:20 +1000 (EST)
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: BOUNCE [EMAIL PROTECTED]:Non-member submission from [Michael
Dustin <[EMAIL PROTECTED]>]

>From owner-radiator  Tue May  2 23:40:15 2000
Received: by oscar.open.com.au (8.9.0/8.9.0) id XAA10584;
Tue, 2 May 2000 23:40:14 +1000 (EST)
>Received: from alastair.tir.com (alastair.tir.com [216.40.128.69]) by
perki.connect.com.au with ESMTP id XAA13325
  (8.8.8/IDA-1.7); Tue, 2 May 2000 23:20:13 +1000 (EST)
Received: from alastair.tir.com (alastair.tir.com [216.40.128.69]) by
perki.connect.com.au with ESMTP id XAA13325
  (8.8.8/IDA-1.7); Tue, 2 May 2000 23:20:13 +1000 (EST)
Received: from darren.tir.com (darren.tir.com [216.40.128.70])
by alastair.tir.com (8.9.1/8.9.1) with ESMTP id JAA17824;
Tue, 2 May 2000 09:20:10 -0400 (EDT)
Received: from localhost (dusty@localhost)
by darren.tir.com (8.9.1/8.9.1) with ESMTP id JAA19275;
Tue, 2 May 2000 09:20:09 -0400 (EDT)
X-Authentication-Warning: darren.tir.com: dusty owned process doing -bs
Date: Tue, 2 May 2000 09:20:09 -0400 (EDT)
From: Michael Dustin <[EMAIL PROTECTED]>
To: Hugh Irvine <[EMAIL PROTECTED]>
cc: [EMAIL PROTECTED]
Subject: Re: (RADIATOR) PostAuthHook and Vendor Attributes
In-Reply-To: <00050216252504.27586@hugo>
Message-ID: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hugh,

Thanks, from your comments I was able to figure out the code I needed
to access the attributes.  The code below works for getting Attributes
with a PostAuthHook that are Vendor specific.

$shelfno = $p->get_attr('Ascend-Modem-ShelfNo') ;

  if ($shelfno) {
   $Ascend = "yes" ;
   $slotno = $p->get_attr('Ascend-Modem-SlotNo') ;
   $portno = $p->get_attr('Ascend-Modem-PortNo') ;
   $port=$shelfno.$slotno.$portno ;
  }
  else {
   $Annex = "yes" ;
  }


-thanx
-dusty
On Tue, 2 May 2000, Hugh Irvine wrote:

>
> Hello Dusty -
>
> >
> > I am working on a PostAuthHook that will give us more compact
> > logging but I have run into a problem.  I can get standard
> > attributes pretty easily by using the examples I have seen
> > in the Docs and the list.  However when I try to get Vendor
> > Specific Attributes I come up empty handed.  Can anyone give
> > me example code where they are pulling vendor specific
> > attributes using a hook ?? I have attached some code from my
> > hook.
> >
> > my $p = ${$_[0]};
> > #These come through fine
> > my $username = $p->getAttrByNum($Radius::Radius::USER_NAME);
> > my $nasaddress = $p->getAttrByNum($Radius::Radius::NAS_IP_ADDRESS);
> > my $ipaddress = $p->getAttrByNum($Radius::Radius::FRAMED_IP_ADDRESS);
> > my $called = $p->getAttrByNum($Radius::Radius::CALLING_STATION_ID);
> > my $calling = $p->getAttrByNum($Radius::Radius::CALLED_STATION_ID);
> > my $nasport = $p->getAttrByNum($Radius::Radius::NAS_PORT);
> >
>
> Yes - these attributes are defined in the file "Radius/Radius.pm", so you can
> happily do what you've shown above.
>
> > #These "specific to Ascend Attributes" do not seem to be available
> > #using this code even though they do show up in the main logfile
> > #
> > my $shelfno = $r->getAttrByNum($Radius::Radius::ASCEND_MODEM_SHELFNO) ;
> > my $slotno = $r->getAttrByNum($Radius::Radius::ASCEND_MODEM_SLOTNO) ;
> > my $portno = $r->getAttrByNum($Radius::Radius::Ascend_Modem_PortNo) ;
> >
>
> However, these attributes are defined in the dictionary file, not
> "Radius/Radius.pm, so you will need to use get_attr, for example.
>
> I notice from the above that you are using $p in the first series and $r in
the
> second series. Are these in fact the same packet? Note that the PostAuthHook
> has access to both the request packet and the reply packet.
>
> You may also be interested in having a look at a few example hooks that are
in
> the patches area:
>
> http://www.open.com.au/radiator/downloads/patches-2.15/hooks.txt
>
> hth
>
> Hugh
>
> --
> Radiator: the most portable, flexible and configurable RADIUS server
> anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
> Platypus, Freeside, Interbiller, TACACS+, PAM, external, etc, etc.
> Available on Unix, Linux, FreeBSD, Windows 95/98/2000, NT, MacOS X.
>
>
>




---End of forwarded mail from [EMAIL PROTECTED]

-- 
Mike McCauley   [EMAIL PROTECTED]
Open System Consultants Pty. LtdUnix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia   http://www.open.com.au
Phone +61 3 9598-0985   Fax   +61 3 95

Re: (RADIATOR) PostAuthHook and Vendor Attributes

2000-05-01 Thread Hugh Irvine


Hello Dusty -

> 
> I am working on a PostAuthHook that will give us more compact
> logging but I have run into a problem.  I can get standard
> attributes pretty easily by using the examples I have seen
> in the Docs and the list.  However when I try to get Vendor
> Specific Attributes I come up empty handed.  Can anyone give
> me example code where they are pulling vendor specific
> attributes using a hook ?? I have attached some code from my
> hook.
> 
> my $p = ${$_[0]};
> #These come through fine
> my $username = $p->getAttrByNum($Radius::Radius::USER_NAME);
> my $nasaddress = $p->getAttrByNum($Radius::Radius::NAS_IP_ADDRESS);
> my $ipaddress = $p->getAttrByNum($Radius::Radius::FRAMED_IP_ADDRESS);
> my $called = $p->getAttrByNum($Radius::Radius::CALLING_STATION_ID);
> my $calling = $p->getAttrByNum($Radius::Radius::CALLED_STATION_ID);
> my $nasport = $p->getAttrByNum($Radius::Radius::NAS_PORT);
> 

Yes - these attributes are defined in the file "Radius/Radius.pm", so you can
happily do what you've shown above.

> #These "specific to Ascend Attributes" do not seem to be available
> #using this code even though they do show up in the main logfile
> #
> my $shelfno = $r->getAttrByNum($Radius::Radius::ASCEND_MODEM_SHELFNO) ;
> my $slotno = $r->getAttrByNum($Radius::Radius::ASCEND_MODEM_SLOTNO) ;
> my $portno = $r->getAttrByNum($Radius::Radius::Ascend_Modem_PortNo) ;
> 

However, these attributes are defined in the dictionary file, not
"Radius/Radius.pm, so you will need to use get_attr, for example.

I notice from the above that you are using $p in the first series and $r in the
second series. Are these in fact the same packet? Note that the PostAuthHook
has access to both the request packet and the reply packet.

You may also be interested in having a look at a few example hooks that are in
the patches area:

http://www.open.com.au/radiator/downloads/patches-2.15/hooks.txt

hth

Hugh

-- 
Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, Interbiller, TACACS+, PAM, external, etc, etc.
Available on Unix, Linux, FreeBSD, Windows 95/98/2000, NT, MacOS X.



===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.



(RADIATOR) PostAuthHook and Vendor Attributes

2000-05-01 Thread Mike McCauley


--- Forwarded mail from [EMAIL PROTECTED]

Date: Tue, 2 May 2000 05:10:14 +1000 (EST)
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: BOUNCE [EMAIL PROTECTED]:Non-member submission from [Michael
Dustin <[EMAIL PROTECTED]>]

>From owner-radiator  Tue May  2 05:10:10 2000
Received: by oscar.open.com.au (8.9.0/8.9.0) id FAA00661
for [EMAIL PROTECTED]; Tue, 2 May 2000 05:10:09 +1000 (EST)
>Received: from alastair.tir.com (alastair.tir.com [216.40.128.69]) by
perki.connect.com.au with ESMTP id EAA21743
  (8.8.8/IDA-1.7 for <[EMAIL PROTECTED]>); Tue, 2 May 2000 04:56:07 +1000
(EST)
Received: from alastair.tir.com (alastair.tir.com [216.40.128.69]) by
perki.connect.com.au with ESMTP id EAA21743
  (8.8.8/IDA-1.7 for <[EMAIL PROTECTED]>); Tue, 2 May 2000 04:56:07 +1000
(EST)
Received: from darren.tir.com (darren.tir.com [216.40.128.70])
by alastair.tir.com (8.9.1/8.9.1) with ESMTP id OAA11703
for <[EMAIL PROTECTED]>; Mon, 1 May 2000 14:55:51 -0400 (EDT)
Received: from localhost (dusty@localhost)
by darren.tir.com (8.9.1/8.9.1) with ESMTP id OAA09906
for <[EMAIL PROTECTED]>; Mon, 1 May 2000 14:55:41 -0400 (EDT)
X-Authentication-Warning: darren.tir.com: dusty owned process doing -bs
Date: Mon, 1 May 2000 14:55:41 -0400 (EDT)
From: Michael Dustin <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: PostAuthHook and Vendor Attributes
Message-ID: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hello,

I am working on a PostAuthHook that will give us more compact
logging but I have run into a problem.  I can get standard
attributes pretty easily by using the examples I have seen
in the Docs and the list.  However when I try to get Vendor
Specific Attributes I come up empty handed.  Can anyone give
me example code where they are pulling vendor specific
attributes using a hook ?? I have attached some code from my
hook.

my $p = ${$_[0]};
#These come through fine
my $username = $p->getAttrByNum($Radius::Radius::USER_NAME);
my $nasaddress = $p->getAttrByNum($Radius::Radius::NAS_IP_ADDRESS);
my $ipaddress = $p->getAttrByNum($Radius::Radius::FRAMED_IP_ADDRESS);
my $called = $p->getAttrByNum($Radius::Radius::CALLING_STATION_ID);
my $calling = $p->getAttrByNum($Radius::Radius::CALLED_STATION_ID);
my $nasport = $p->getAttrByNum($Radius::Radius::NAS_PORT);

#These "specific to Ascend Attributes" do not seem to be available
#using this code even though they do show up in the main logfile
#
my $shelfno = $r->getAttrByNum($Radius::Radius::ASCEND_MODEM_SHELFNO) ;
my $slotno = $r->getAttrByNum($Radius::Radius::ASCEND_MODEM_SLOTNO) ;
my $portno = $r->getAttrByNum($Radius::Radius::Ascend_Modem_PortNo) ;


-thanx
-dusty





---End of forwarded mail from [EMAIL PROTECTED]

-- 
Mike McCauley   [EMAIL PROTECTED]
Open System Consultants Pty. LtdUnix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia   http://www.open.com.au
Phone +61 3 9598-0985   Fax   +61 3 9598-0955

Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, TACACS+, PAM, external, etc etc on Unix, Win95/8, 
2000, NT, MacOS X
===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.