COPS-Client
view release on metacpan or search on metacpan
examples/profiles/DownStream.pl view on Meta::CPAN
#!/usr/local/bin/perl
use strict;
use COPS::Client;
my $cops_client = new COPS::Client (
[
VendorID => 'COPS Client',
ServerIP => '192.168.1.1',
ServerPort => '3918',
Timeout => 2,
DataHandler => \&display_data
]
);
if ( $cops_client->connect() )
{
$cops_client->set_command("set");
$cops_client->subscriber_set("ipv4","172.26.65.19");
$cops_client->gate_specification_add(
[
Direction => 'Downstream',
DSCPToSMark => 0,
Priority => 0,
PreEmption => 0,
Gate_Flags => 0,
Gate_TOSField => 0,
Gate_TOSMask => 0,
Gate_Class => 0,
Gate_T1 => 0,
Gate_T2 => 0,
Gate_T3 => 0,
Gate_T4 => 0
]
);
$cops_client->classifier_add(
[
Classifier_Type => 'Classifier',
Classifier_Priority => 64,
Classifier_SourceIP => "172.26.65.19",
Classifier_DestinationIP => "172.26.65.1",
Classifier_ClassifierID => 100,
Classifier_State => 1
]
);
# The envelope_add parameters are broken into 3 groups
#
# authorize
# reserve
# commit
#
# and should be provided as follows
#
# 'Envelope_<type>_<parameter>' => <value>
#
# example would be
#
# 'Envelope_authorize_Traffic Priority' => 0,
#
# Attributes for Downstream profile type are
#
# 'Traffic Priority'
# 'Maximum Sustained Traffic Rate'
# 'Maximum Traffic Burst'
# 'Minimum Reserved Traffic Rate'
# 'Assumed Minimum Reserved Traffic Rate Packet Size'
( run in 0.834 second using v1.01-cache-2.11-cpan-39bf76dae61 )