use frsobjsup; package main; my ($__HashRef, $__k, $__v); ## Processing file bigbchoff.mrs Modify Time: Tue Apr 3 16:12:28 2001 ## use Time::Local; use Time::Local; ## printf "Configuration generated at %s\n\n", scalar localtime; printf "Configuration generated at %s\n\n", scalar localtime; ## $stage = "D:\\staging"; $stage = "D:\\staging"; ## $DC_OU_DN = "ou=domain controllers,dc=frs1221,dc=nttest,dc=microsoft,dc=com"; $DC_OU_DN = "ou=domain controllers,dc=frs1221,dc=nttest,dc=microsoft,dc=com"; ## HUB: FRS_SERVER (/RP="E:\RSB" /SP="$stage" /COMPUTER='frs1221\sudarctest1$' ## /DNS_NAME="sudarctest1.frs1221.nttest.microsoft.com" /MNAME="hub0") $__HashRef = FRS_SERVER->New( RP=>"E:\\RSB", SP=>"$stage", COMPUTER=>'frs1221\\sudarctest1$', DNS_NAME=>"sudarctest1.frs1221.nttest.microsoft.com", MNAME=>"hub0" ); &FRSSUP::AddToSet("HUB", $__HashRef); ## HUB: FRS_SERVER (/RP="E:\RSB" /SP="$stage" /COMPUTER='frs1221\sudarctest2$' ## /DNS_NAME="sudarctest2.frs1221.nttest.microsoft.com" /MNAME="hub1") $__HashRef = FRS_SERVER->New( RP=>"E:\\RSB", SP=>"$stage", COMPUTER=>'frs1221\\sudarctest2$', DNS_NAME=>"sudarctest2.frs1221.nttest.microsoft.com", MNAME=>"hub1" ); &FRSSUP::AddToSet("HUB", $__HashRef); ## for $b (0 .. 200) { for $b (0 .. 200) { ## $bchname = "Branch-$b"; $bchname = "Branch-$b"; ## $Nt4Acct = "frs1221\\$b\$"; $Nt4Acct = "frs1221\\$b\$"; ## BCH: FRS_SERVER (/RP="D:\RSB" /SP="D:\staging" ## /COMPUTER=$Nt4Acct ## /id="-$b" ## /DNS_NAME="$bchname.frs1221.nttest.microsoft.com" ) $__HashRef = FRS_SERVER->New( RP=>"D:\\RSB", SP=>"D:\\staging", COMPUTER=>$Nt4Acct, id=>"-$b", DNS_NAME=>"$bchname.frs1221.nttest.microsoft.com" ); &FRSSUP::AddToSet("BCH", $__HashRef); ## } } ## PRIMARY_SCH: FRS_SCHEDULE (/REPL_INTERVAL=4 /REPL_DURATION="1:30" ## /TIME_ZONE="-5:00" /REPL_OFFSET=0 /STAGGER="0:15" ## /METHOD=1 /NAME='Primary Sched' ## /DISABLE="mo:07:30-mo:18:00,tu:07:30-tu:18:00,we:07:30-we:18:00,th:07:30-th:18:00,fr:07:30-fr:18:00" ## ) $__HashRef = FRS_SCHEDULE->New( REPL_INTERVAL=>4, REPL_DURATION=>"1:30", TIME_ZONE=>"-5:00", REPL_OFFSET=>0, STAGGER=>"0:15", METHOD=>1, NAME=>'Primary Sched', DISABLE=>"mo:07:30-mo:18:00,tu:07:30-tu:18:00,we:07:30-we:18:00,th:07:30-th:18:00,fr:07:30-fr:18:00" ); &FRSSUP::AddToSet("PRIMARY_SCH", $__HashRef); ## FRS_SUB CREATE_HUB_SPOKE_CONN(/HUBSET=SET_REF_SET ## subname = 'CREATE_HUB_SPOKE_CONN', func = 'FRS_SUB', rest = '(/HUBSET=SET_REF_SET ' ## /BCHSET=SET_REF_SET ## /SC1=SCHEDULE ) sub CREATE_HUB_SPOKE_CONN { my %__args = (@_); my ($__HashRef, $__k, $__v); while ( ($__k, $__v) = each %__args ) { print "\t$__k => '$__v'\n"; } ## $Hx = 0; $Hx = 0; ## $NHub = FRS_COUNT_SET(/SET=%HUBSET%); $NHub = scalar @{ $__args{HUBSET} } ; ## print " NHUB = $NHub\n\n"; print " NHUB = $NHub\n\n"; ## print " NBCH FRS _COUNT_SET( /SET= % BCHSET % ) ", FRS_COUNT_SET(/SET= %BCHSET% ), "\n" ; print " NBCH FRS _COUNT_SET( /SET= % BCHSET % ) ", scalar @{ $__args{BCHSET} } , "\n" ; ## foreach $bch (FRS_ARRAY(/SET=%BCHSET%)) { foreach $bch ( @{ $__args{BCHSET} } ) { ## print "working on branch: $bch->{ONAME}\n"; print "working on branch: $bch->{ONAME}\n"; ## $hubsrv = %HUBSET%[$Hx]; $hubsrv = $__args{HUBSET}[$Hx]; ## FRS_CONNECTION (/TO=$bch /FROM=%HUBSET%[$Hx] /SCHED=%SC1% ## /ONAME="FROM-".$hubsrv->{MNAME}."-TO-".$bch->{ONAME} ) FRS_CONNECTION->New( TO=>$bch, FROM=>$__args{HUBSET}[$Hx], SCHED=>$__args{SC1}, ONAME=>"FROM-".$hubsrv->{MNAME}."-TO-".$bch->{ONAME} ); ## FRS_CONNECTION (/TO=%HUBSET%[$Hx] /FROM=$bch /SCHED=%SC1% ## /ONAME="FROM-".$bch->{ONAME}."-TO-".$hubsrv->{MNAME} ) FRS_CONNECTION->New( TO=>$__args{HUBSET}[$Hx], FROM=>$bch, SCHED=>$__args{SC1}, ONAME=>"FROM-".$bch->{ONAME}."-TO-".$hubsrv->{MNAME} ); ## $Hx=($Hx+1) % $NHub; $Hx=($Hx+1) % $NHub; ## if ($Hx == 0) { if ($Hx == 0) { ## FRS_STAGGER (/SCHED=%SC1%) FRS_SCHEDULE::FRS_STAGGER( SCHED=>$__args{SC1} ); ## } } ## } } ## FRS_END_SUB } # FRS_END_SUB ## FRS_SUB CREATE_RING_CONN(/HUBSET=SET_REF_SET ) ## subname = 'CREATE_RING_CONN', func = 'FRS_SUB', rest = '(/HUBSET=SET_REF_SET )' sub CREATE_RING_CONN { my %__args = (@_); my ($__HashRef, $__k, $__v); while ( ($__k, $__v) = each %__args ) { print "\t$__k => '$__v'\n"; } ## FRS_SHOW(/SET=%HUBSET%) FRSSUP::FRS_SHOW( SET=>$__args{HUBSET} ); ## $Ringx = 0; $Ringx = 0; ## $RingCount = FRS_COUNT_SET(/SET=%HUBSET%); $RingCount = scalar @{ $__args{HUBSET} } ; ## print " RingCount = $RingCount\n\n"; print " RingCount = $RingCount\n\n"; ## for ($Ringx=0; $Ringx < $RingCount-1; $Ringx++) { for ($Ringx=0; $Ringx < $RingCount-1; $Ringx++) { ## $RM1 = %HUBSET%[$Ringx]; $RM1 = $__args{HUBSET}[$Ringx]; ## $RM2 = %HUBSET%[($Ringx+1) % $RingCount]; $RM2 = $__args{HUBSET}[($Ringx+1) % $RingCount]; ## FRS_CONNECTION (/TO=$RM1 /FROM=$RM2 /SCHED=ON ## /ONAME="FROM-".$RM2->{MNAME}."-TO-".$RM1->{MNAME} ) FRS_CONNECTION->New( TO=>$RM1, FROM=>$RM2, SCHED=>ON, ONAME=>"FROM-".$RM2->{MNAME}."-TO-".$RM1->{MNAME} ); ## FRS_CONNECTION (/TO=$RM2 /FROM=$RM1 /SCHED=ON ## /ONAME="FROM-".$RM1->{MNAME}."-TO-".$RM2->{MNAME} ) FRS_CONNECTION->New( TO=>$RM2, FROM=>$RM1, SCHED=>ON, ONAME=>"FROM-".$RM1->{MNAME}."-TO-".$RM2->{MNAME} ); ## } } ## FRS_END_SUB } # FRS_END_SUB ## FRS_SUB CREATE_HUB_SPOKE(/HUBSET=SET_REF_SET ## subname = 'CREATE_HUB_SPOKE', func = 'FRS_SUB', rest = '(/HUBSET=SET_REF_SET ' ## /BCHSET=SET_REF_SET ## /SC1=SCHEDULE ## /REPSETDN=SET_ELEMENT) sub CREATE_HUB_SPOKE { my %__args = (@_); my ($__HashRef, $__k, $__v); while ( ($__k, $__v) = each %__args ) { print "\t$__k => '$__v'\n"; } ## FRSSUP::PrintHash(\%__args); FRSSUP::PrintHash(\%__args); ## FRS_SHOW(/SET=%HUBSET%) FRSSUP::FRS_SHOW( SET=>$__args{HUBSET} ); ## # Restriction: All subroutine argument refs are surrounded by "%" # Restriction: All subroutine argument refs are surrounded by "%" ## # notation "->{...}" # notation "->{...}" ## foreach $hub (FRS_ARRAY(/SET=%HUBSET%)) { foreach $hub ( @{ $__args{HUBSET} } ) { ## MOBJHUB: FRS_MEMBER (/UNDER=%REPSETDN% ## /SERVER=$hub ## /COMPUTER=$hub->{COMPUTER} ## /ONAME=$hub->{MNAME} ) $__HashRef = FRS_MEMBER->New( UNDER=>$__args{REPSETDN}, SERVER=>$hub, COMPUTER=>$hub->{COMPUTER}, ONAME=>$hub->{MNAME} ); &FRSSUP::AddToSet("MOBJHUB", $__HashRef); ## } } ## foreach $bch (FRS_SET(/SET=%BCHSET%)) { foreach $bch ( @{ FRSSUP::FRS_SET( SET=>$__args{BCHSET} ) } ) { ## MOBJBCH: FRS_MEMBER (/UNDER=%REPSETDN% ## /SERVER=$bch ## /COMPUTER=$bch->{COMPUTER} ## /ONAME="B".$bch->{id} ) $__HashRef = FRS_MEMBER->New( UNDER=>$__args{REPSETDN}, SERVER=>$bch, COMPUTER=>$bch->{COMPUTER}, ONAME=>"B".$bch->{id} ); &FRSSUP::AddToSet("MOBJBCH", $__HashRef); ## } } ## CREATE_RING_CONN(/HUBSET= ) &CREATE_RING_CONN ( HUBSET=>&FRSSUP::SelectSet(MOBJHUB) ); ## CREATE_HUB_SPOKE_CONN(/HUBSET= ## /BCHSET= ## /SC1=%SC1% ) &CREATE_HUB_SPOKE_CONN ( HUBSET=>&FRSSUP::SelectSet(MOBJHUB), BCHSET=>&FRSSUP::SelectSet(MOBJBCH), SC1=>$__args{SC1} ); ## FRS_END_SUB &FRSSUP::DeleteSet("MOBJHUB"); &FRSSUP::DeleteSet("MOBJBCH"); } # FRS_END_SUB ## SETTINGS: FRS_SETTINGS (/DN="cn=services,cn=configuration,dc=frs1221,dc=nttest,dc=microsoft,dc=com" ## /ONAME="cn=ntfrs test settings") $__HashRef = FRS_SETTINGS->New( DN=>"cn=services,cn=configuration,dc=frs1221,dc=nttest,dc=microsoft,dc=com", ONAME=>"cn=ntfrs test settings" ); &FRSSUP::AddToSet("SETTINGS", $__HashRef); ## SET: FRS_REPLICASET (/UNDER= /TYPE=DFS /ONAME="HubSpokeRepSet") $__HashRef = FRS_REPLICASET->New( UNDER=>&FRSSUP::SelectSet(SETTINGS)->[0], TYPE=>DFS, ONAME=>"HubSpokeRepSet" ); &FRSSUP::AddToSet("SET", $__HashRef); ## CREATE_HUB_SPOKE(/HUBSET= ## /BCHSET= ## /SC1= ## /REPSETDN=) &CREATE_HUB_SPOKE ( HUBSET=>&FRSSUP::SelectSet(HUB), BCHSET=>&FRSSUP::SelectSet(BCH), SC1=>&FRSSUP::SelectSet(PRIMARY_SCH)->[0], REPSETDN=>&FRSSUP::SelectSet(SET)->[0] ); __END__