Log in to ask questions, share your expertise, or stay connected to content you value. Don’t have a login? Learn how to become a member.
See matching posts in thread - BTW, I attached my configuration of one router a...
/import/junos.xsl"; 018 019 param $session; 020 param $label; 021 param $fec; 022 param $direction; 023 param $logical-router; 024 025 var $arguments = ( 026 <argument> ( 027 <name> "label"; 028 <description> "MPLS label for a FEC"; 029 ) 030 <argument> ( 031 <name> "session"; 032 <description> "IP address of session destination"; 033 ) 034 <argument> ( 035 <name> "fec"; 036 <description> "FEC in inet.3"; 037 ) 038 <argument> ( 039 <name> "direction"; 040 <description> "Direction for session, Input for label from peer, Output for label sent to peer"; 041 ) 042 <argument> ( 043 <name> "logical-router"; 044 <description> "Name of logical system, or 'all'"; 045 ) 046 ) 047 048 match / ( 049 <op-script-results> ( 050 var $ldp = <get-ldp-database-information> ( 051 if (jcs:empty($logical-router)) ( 052 <instance> "master"; 053 ) 054 else ( 055 <logical-router> $logical-router; 056 ) 057 ) 058 var $ldpinfo = jcs:invoke($ldp); 059 <ldp-database-information> ( 060 if ($ldpinfo//xnm:error) ( 061 copy-of $ldpinfo//xnm:error; 062 ) 063 else if (jcs:empty($direction)) ( 064 if (jcs:empty($label) && jcs:empty($session) && jcs:empty($fec)) ( 065 copy-of $ldpinfo/*; 066 ) 067 else if (jcs:empty($label) && not(jcs:empty($session)) && jcs:empty($fec)) ( 068 for-each ($ldpinfo/ldp-database) ( 069 call session($session); 070 ) 071 ) 072 else ( 073 for-each ($ldpinfo/ldp-database[ldp-database-type="Input label database"]/ldp-binding) ( 074 if (not(jcs:empty($label)) && jcs:empty($session) && jcs:empty($fec)) ( 075 call label($label); 076 ) 077 else if (jcs:empty($label) && jcs:empty($session) && not(jcs:empty($fec))) ( 078 call fec($fec); 079 ) 080 else if (not(jcs:empty($label)) && not(jcs:empty($session)) && jcs:empty($fec)) ( 081 call label-session($label,$session); 082 ) 083 else if (jcs:empty($label) && not(jcs:empty($session)) && not(jcs:empty($fec))) ( 084 call session-fec($session,$fec); 085 ) 086 else if (not(jcs:empty($label)) && jcs:empty($session) && not(jcs:empty($fec))) ( 087 call label-fec($label,$fec); 088 ) 089 else ( 090 call session-label-fec($label,$session,$fec); 091 ) 092 ) 093 for-each ($ldpinfo/ldp-database[ldp-database-type="Output label database"]/ldp-binding) ( 094 if (not(jcs:empty($label)) && jcs:empty($session) && jcs:empty($fec)) ( 095 call label($label); 096 ) 097 else if (jcs:empty($label) && jcs:empty($session) && not(jcs:empty($fec))) ( 098 call fec($fec); 099 ) 100 else if (not(jcs:empty($label)) && not(jcs:empty($session)) && jcs:empty($fec)) ( 101 call label-session($label,$session); 102 ) 103 else if (jcs:empty($label) && not(jcs:empty($session)) && not(jcs:empty($fec))) ( 104 call session-fec($session,$fec); 105 ) 106 else if (not(jcs:empty($label)) && jcs:empty($session) && not(jcs:empty($fec))) ( 107 call label-fec($label,$fec); 108 ) 109 else ( 110 call session-label-fec($label,$session,$fec); 111 ) 112 ) 113 ) 114 ) 115 else ( 116 var $path = <output> jcs:printf("%jcs label database",$direction); 117 if ($path = "Input label database" || $path = "Output label database") ( 118 if (jcs:empty($label) && jcs:empty($session) && jcs:empty($fec)) ( 119 copy-of $ldpinfo/ldp-database[ldp-database-type = $path]; 120 ) 121 else if (jcs:empty($label) && not(jcs:empty($session)) && jcs:empty($fec)) ( 122 for-each ($ldpinfo/ldp-database[ldp-database-type=$path]) ( 123 call session($session); 124 ) 125 ) 126 else ( 127 for-each ($ldpinfo/ldp-database[ldp-database-type=$path]/ldp-binding) ( 128 if (not(jcs:empty($label)) && jcs:empty($session) && jcs:empty($fec)) ( 129 call label($label); 130 ) 131 else if (jcs:empty($label) && jcs:empty($session) && not(jcs:empty($fec))) ( 132 call fec($fec); 133 ) 134 else if (not(jcs:empty($label)) && not(jcs:empty($session)) && jcs:empty($fec)) ( 135 call label-session($label,$session); 136 ) 137 else if (jcs:empty($label) && not(jcs:empty($session)) && not(jcs:empty($fec))) ( 138 call session-fec($session,$fec); 139 ) 140 else if (not(jcs:empty($label)) && jcs:empty($session) && not(jcs:empty($fec))) ( 141 call label-fec($label,$fec); 142 ) 143 else ( 144 call session-label-fec($label,$session,$fec); 145 ) 146 ) 147 ) 148 ) 149 else ( 150 <xnm:error> ( 151 <message> "You need to type Input or Output!!"