1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
|
hljs.registerLanguage("cisco",function(){"use strict";return function(s){var e=/(?=^\s*[a-z0-9A-Z_]+(?:\(([a-zA-Z\-]*)\)#|#)|[a-zA-Z]+[0-9]\/[0-9]\z)/,n=/(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|9[0-9]|[1-8][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|9[0-9]|[1-8][0-9]|[0-9])(?:\/\d{1,2})?/,a=/(?![^\w:])(([0-9a-f]{1,4}:){1,7}:|:(:[0-9a-f]{1,4}){1,7}|([0-9a-f]{1,4}:){1,7}[0-9a-f]{0,4}(:[0-9a-f]{1,4}){1,7})(?![\w:])/,i=/(?:[aA0-fF9]{4}\.){2}(?:[aA0-fF9]{4})/;return{name:"cisco",case_insensitive:!0,disableAutodetect:!0,contains:[{className:"comment",variants:[{begin:/^VLAN\s*Name/,end:e,returnBegin:!0,contains:[{className:"string",begin:/(?:Fa|Gig)\d\/\d+/},{className:"number",begin:/\b\d+\b/},{className:"keyword",begin:/(?<=^[0-9][0-9]?[0-9]?[0-9]?).+(?=\sactive|\d{6})/}]},{begin:/Cisco\sInternetwork/,end:/is\s[a-fA-F0-9]x[a-fA-F0-9]+/,contains:[{className:"string",variants:[{begin:/"/,end:/"/},{begin:/http/,end:/$/}]},{className:"string",begin:/Processor\sboard/,end:/\(Read\/Write\)/,contains:[{className:"number",begin:/^\d/,end:/(\s|K)/}]}]},{begin:/Interface\s+IP\-Address/,end:e,contains:[{className:"keyword",variants:[{begin:/^\w+((\d\/)+\d?|\d+)/},{begin:/(manual|DHCP|up)/}]},{className:"number",begin:/(?:[0-9]{1,3}\.){3}[0-9]{1,3}/},{className:"number",begin:/(?![^\w:])(([0-9a-f]{1,4}:){1,7}:|:(:[0-9a-f]{1,4}){1,7}|([0-9a-f]{1,4}:){1,7}[0-9a-f]{0,4}(:[0-9a-f]{1,4}){1,7})(?![\w:])/},{className:"string",begin:/(unset|unassigned|administratively\sdown|down)/}]},{begin:/Capability\sCodes/,end:e,contains:[{className:"keyword",begin:/\s(\w|\*)(\d|\w?)\s(?=\-)/},{className:"comment",begin:/Port\sID/,end:/(?=^[a-zA-Z]+(\(([a-zA-Z\-]*)\)#|#)|[a-zA-Z]+[0-9]\/[0-9]\z)/,contains:[{className:"keyword",variants:[{begin:/^[\w\.]+(?=\s)/},{begin:/\b\w\b/}]},{className:"string",begin:/\s\w{1,3}\s[\d\/]+\d?/},{className:"number",begin:/\b\d+\b/}]}]},{begin:/(?<=show\sip\snat\stranslations)/,end:e,contains:[{className:"number",begin:/(?:[0-9]{1,3}\.){3}[0-9]{1,3}/},{className:"keyword",begin:/(?<=\:)\d+(?=\s)/},{className:"string",begin:/(?<=^)\w+(?=\s)/}]},{begin:/(?<=show\sip\snat\sstatistics)/,end:e,contains:[{className:"string",variants:[{begin:/(?<=pool\s)\w+(?=\srefCount)/},{begin:/(?<=Interfaces:\s).+(?=$)/}]},{className:"number",variants:[{begin:/(?:[0-9]{1,3}\.){3}[0-9]{1,3}/},{begin:/\b\d+\b/}]}]},{begin:/(?<=show\sinterface\s[aA-zZ]+\s*\d+(\/\d+(\/\d+)?)?)/,end:e,contains:[{className:"string",variants:[{begin:/\bup\b/},{begin:/Full\-duplex|Half\-duplex/i},{begin:/(?<=type\sis).+(?=$)/}]},{className:"number",variants:[{begin:/\d+.b\/s/},{begin:/(?:.{4}\.){2}(?:.{4})/},{begin:/\b\d+\b/}]}]},{begin:/(?<=show\s(?:ip\s)?ssh)/,end:e,contains:[{className:"string",begin:/(?<=Session\sStarted).+(?=$)/},{className:"number",variants:[{begin:/\b\d+\.\d+\b/},{begin:/\b\d+\b/}]}]},{begin:/(?<=show\sip\sdhcp\sbinding)/,end:e,contains:[{className:"number",begin:/(?:[0-9]{1,3}\.){3}[0-9]{1,3}/},{className:"string",begin:/(?:.{4}\.){2}(?:.{4})/}]},{begin:/(?<=show\sip\sdhcp\spool)/,end:e,contains:[{className:"number",begin:/(?:[0-9]{1,3}\.){3}[0-9]{1,3}/},{className:"string",variants:[{begin:/\b\d+\b/},{begin:/(?<=Pool).+(?=\:)/}]}]},{begin:/(?<=show\smac\saddress\-table)/,end:e,contains:[{className:"string",begin:/(?<=\s)[\w\/]+\d(?=\s*$)/},{className:"number",variants:[{begin:/(?:.{4}\.){2}(?:.{4})/},{begin:/\b\d+\b/}]}]},{begin:/(?<=show\sinterfaces\strunk)/,end:e,contains:[{className:"string",begin:/(?<=\s*)[aA-zZ]+\d+(\/\d+(?:\/\d+)?)?/},{className:"keyword",begin:/802\.1q/},{className:"number",begin:/\b\d+\b/}]},{begin:/(?<=show\sinterfaces\s[aA-zZ]+\s*\d+(\/\d+(\/\d+)?)?\sswitchport)/,end:e,contains:[{className:"string",begin:/(?<=(?:Name|Administrative\sMode|Operational\sMode|Access\sMode\sVLAN|Trunking\sNative\sMode\sVLAN)\:).+(?=$)/},{className:"number",begin:/\b\d+\b/}]},{begin:/(?<=show\sport\-security)/,end:e,contains:[{className:"string",variants:[{begin:/(?<=^)\s+[\w\/]+(?=\s)/},{begin:/(?<=\d)\s+\w+(?=$)/}]},{className:"number",begin:/\b\d+\b/}]},{begin:/(?<=show\sport\-security\sinterface\s[aA-zZ]+\s*\d+(\/\d+(\/\d+)?)?)/,e
|