version 1.0; ns junos = "http://xml.juniper.net/junos/*/junos"; ns xnm = "http://xml.juniper.net/xnm/1.1/xnm"; ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0"; import "../import/junos.xsl"; match configuration { var $ospfInts = protocols/ospf/area[name = '0.0.0.0']/interface; var $ints = interfaces/interface/unit; var $rsvpInts = protocols/rsvp/interface; var $min-mtu = 4484; var $routing_instance = routing-instances/instance; for-each ($ints) { var $unit = name; var $int = ../name; var $name = ../name _ '.' _ name; var $mtu= ../mtu; if ($ospfInts[name = $name]) { if (not($rsvpInts[name = $name]) and not($rsvpInts[name = 'all']) and not($ospfInts[name = $name]/passive)) { { call jcs:statement(); { expr "COMMIT_SCRIPT_FAILURE. interface is configured in OSPF but not in RSVP..."; expr $name; } } } if ($mtu < $min-mtu) { { call jcs:statement(); { expr "COMMIT_SCRIPT_FAILURE. MTU on this interface must be above 4484..."; expr $name; } } } } if ($rsvpInts[name = $name]) { if (not($ospfInts[name = $name])) { { call jcs:statement(); { expr "COMMIT_SCRIPT_FAILURE. interface is configured in RSVP but not in OSPF..."; expr $name; } } } } } for-each ($routing_instance) { var $r_name = .; if (protocols/l2vpn) { if (not(protocols/l2vpn/no-control-word)) { { call jcs:edit-path(); call jcs:statement(); "COMMIT_SCRIPT_FAILURE. no-control-word required on l2vpn instance."; } } } else if (protocols/vpls) { if (not(protocols/vpls/no-tunnel-services)) { { call jcs:edit-path(); call jcs:statement(); "COMMIT_SCRIPT_FAILURE. no-tunnel-services required on vpls instance."; } } if (not(forwarding-options/family/vpls/flood[starts-with(input, 'VPLS_FTF_POLIC')])) { { call jcs:edit-path(); call jcs:statement(); "COMMIT_SCRIPT_FAILURE. filter VPLS_FTF_POLICER required on vpls instance."; } } } } }