Hi ho.  I'm trying to get Radiator to do some fun attribute rewriting to
keep my various NASs happy.  Ascends don't seem to like some attributes
when they're IETF standard, so I'm trying to rewrite the attribtes into
the Ascend-specific ones.

At the moment, I'm playing with the PreHandlerHook function, but I'm
having very little success, even with Mike's example.  Using Mike's
   PreHandlerHook sub { $_[0]->add_attr('test-attr', 'test-value'); }

I see the following error:
ERR: Error in PreHandlerHook(): Can't call method "add_attr" on unblessed reference at 
(eval 62) line 1.

But that wasn't where my real problems were.  I was trying to write a
somewhat weird function like this:

        PreHandlerHook sub { \
                my $r; \
                foreach $r (@{$_[0]->{Attributes}}) { \
                        if ($r->[0] eq 'Port-Limit') { \
                                $r->[0] = 'Ascend-Maximum-Channels'; \
                        } \
                        if ($r->[0] eq 'Idle-Timeout') { \
                                $r->[0] = 'Ascend-Idle-Limit'; \
                        } \
                } \

...at which point Perl started complaining about things not being hashes.

There's gotta be a better way to rewrite attribute names (not values!)
based on which client is making the request.  Anyone?

Andrew O. Smith - <[EMAIL PROTECTED]>
Sysadmin, Insync Internet Services
Houston, Texas, USA

To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to