From a183fad57c9470361cdd3d3599cdf5b11c33b47f Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Sun, 12 Apr 2020 22:53:49 -0700 Subject: [PATCH] added kvmmode console command (backwards compatible) --- agents/meshcore.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/agents/meshcore.js b/agents/meshcore.js index cff452d7..f78c426c 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -1963,6 +1963,8 @@ function createMeshCore(agent) { case 'help': { // Displays available commands var fin = '', f = '', availcommands = 'startupoptions,alert,agentsize,version,help,info,osinfo,args,print,type,dbkeys,dbget,dbset,dbcompact,eval,parseuri,httpget,nwslist,plugin,wsconnect,wssend,wsclose,notify,ls,ps,kill,amt,netinfo,location,power,wakeonlan,setdebug,smbios,rawsmbios,toast,lock,users,sendcaps,openurl,amtreset,amtccm,amtacm,amtdeactivate,amtpolicy,getscript,getclip,setclip,log,av,cpuinfo,sysinfo,apf,scanwifi,scanamt,wallpaper'; if (process.platform == 'win32') { availcommands += ',safemode,wpfhwacceleration'; } + if (require('MeshAgent').maxKvmTileSize != null) { availcommands += ',kvmmode'; } + availcommands = availcommands.split(',').sort(); while (availcommands.length > 0) { if (f.length > 90) { fin += (f + ',\r\n'); f = ''; } @@ -1975,6 +1977,24 @@ function createMeshCore(agent) { case 'startupoptions': response = JSON.stringify(require('MeshAgent').getStartupOptions()); break; + case 'kvmmode': + if (require('MeshAgent').maxKvmTileSize == null) + { + response = "Unknown command \"kvmmode\", type \"help\" for list of avaialble commands."; + } + else + { + if(require('MeshAgent').maxKvmTileSize == 0) + { + response = 'KVM Mode: Full JUMBO'; + } + else + { + response = 'KVM Mode: ' + (require('MeshAgent').maxKvmTileSize <= 65500 ? 'NO JUMBO' : 'Partial JUMBO'); + response += (', TileLimit: ' + (require('MeshAgent').maxKvmTileSize < 1024 ? (require('MeshAgent').maxKvmTileSize + ' bytes') : (Math.round(require('MeshAgent').maxKvmTileSize/1024) + ' Kbytes'))); + } + } + break; case 'alert': if (args['_'].length == 0) {