Changeset 29524 in vbox for trunk/src/VBox/Frontends/VBoxShell
- Timestamp:
- May 17, 2010 10:24:35 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r29265 r29524 38 38 39 39 def onMousePointerShapeChange(self, visible, alpha, xHot, yHot, width, height, shape): 40 print "%s: onMousePointerShapeChange: visible=%d" %(self.mach.name, visible) 40 print "%s: onMousePointerShapeChange: visible=%d shape=%d bytes" %(self.mach.name, visible,len(shape)) 41 41 42 def onMouseCapabilityChange(self, supportsAbsolute, supportsRelative, needsHostCursor): 42 43 print "%s: onMouseCapabilityChange: supportsAbsolute = %d, supportsRelative = %d, needsHostCursor = %d" %(self.mach.name, supportsAbsolute, supportsRelative, needsHostCursor) … … 2173 2174 2174 2175 def natAlias(ctx, mach, nicnum, nat, args=[]): 2175 """This command shows/alters NAT's alias settings. 2176 """This command shows/alters NAT's alias settings. 2176 2177 usage: nat <vm> <nicnum> alias [default|[log] [proxyonly] [sameports]] 2177 2178 default - set settings to default values 2178 2179 log - switch on alias loging 2179 2180 proxyonly - switch proxyonly mode on 2180 sameports - enforces NAT using the same ports 2181 sameports - enforces NAT using the same ports 2181 2182 """ 2182 2183 alias = { … … 2188 2189 first = 0 2189 2190 msg = '' 2190 for aliasmode, aliaskey in alias.iteritems(): 2191 for aliasmode, aliaskey in alias.iteritems(): 2191 2192 if first == 0: 2192 2193 first = 1 2193 2194 else: 2194 2195 msg += ', ' 2195 if int(nat.aliasMode) & aliaskey: 2196 if int(nat.aliasMode) & aliaskey: 2196 2197 msg += '{0}: {1}'.format(aliasmode, 'on') 2197 2198 else: … … 2214 2215 usage: nat <vm> <nicnum> settings [<mtu> [[<socsndbuf> <sockrcvbuf> [<tcpsndwnd> <tcprcvwnd>]]]] 2215 2216 mtu - set mtu <= 16000 2216 socksndbuf/sockrcvbuf - sets amount of kb for socket sending/receiving buffer 2217 socksndbuf/sockrcvbuf - sets amount of kb for socket sending/receiving buffer 2217 2218 tcpsndwnd/tcprcvwnd - sets size of initial tcp sending/receiving window 2218 2219 """ … … 2233 2234 if not args[i].isdigit() or int(args[i]) < 8 or int(args[i]) > 1024: 2234 2235 print 'invalid {0} parameter ({1} not in range [8-1024])'.format(i, args[i]) 2235 return (1, None) 2236 return (1, None) 2236 2237 a = [args[1]] 2237 2238 if len(args) < 6: 2238 for i in range(2, len(args)): a.append(args[i]) 2239 for i in range(2, len(args)): a.append(args[i]) 2239 2240 for i in range(len(args), 6): a.append(0) 2240 2241 else: 2241 for i in range(2, len(args)): a.append(args[i]) 2242 for i in range(2, len(args)): a.append(args[i]) 2242 2243 #print a 2243 2244 nat.setNetworkSettings(int(a[0]), int(a[1]), int(a[2]), int(a[3]), int(a[4])) … … 2304 2305 def natPortForwarding(ctx, mach, nicnum, nat, args): 2305 2306 """This command shows/manages port-forwarding settings 2306 usage: 2307 usage: 2307 2308 nat <vm> <nicnum> <pf> [ simple tcp|udp <hostport> <guestport>] 2308 |[no_name tcp|udp <hostip> <hostport> <guestip> <guestport>] 2309 |[no_name tcp|udp <hostip> <hostport> <guestip> <guestport>] 2309 2310 |[ex tcp|udp <pf-name> <hostip> <hostport> <guestip> <guestport>] 2310 2311 |[delete <pf-name>] … … 2323 2324 pfcmd = { 2324 2325 'simple': { 2325 'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 5, 2326 'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 5, 2326 2327 'func':lambda: nat.addRedirect('', proto[args[2]], '', int(args[3]), '', int(args[4])) 2327 2328 }, 2328 'no_name': { 2329 'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 7, 2329 'no_name': { 2330 'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 7, 2330 2331 'func': lambda: nat.addRedirect('', proto[args[2]], args[3], int(args[4]), args[5], int(args[6])) 2331 2332 }, 2332 'ex': { 2333 'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 8, 2333 'ex': { 2334 'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 8, 2334 2335 'func': lambda: nat.addRedirect(args[3], proto[args[2]], args[4], int(args[5]), args[6], int(args[7])) 2335 2336 }, … … 2338 2339 'func': lambda: nat.removeRedirect(args[2]) 2339 2340 } 2340 } 2341 } 2341 2342 2342 2343 if not pfcmd[args[1]]['validate'](): … … 2349 2350 2350 2351 def natNetwork(ctx, mach, nicnum, nat, args): 2351 """This command shows/alters NAT network settings 2352 """This command shows/alters NAT network settings 2352 2353 usage: nat <vm> <nicnum> network [<network>] 2353 2354 """ … … 2402 2403 for i in range(3, len(args)): 2403 2404 cmdargs.append(args[i]) 2404 2405 # @todo vvl if nicnum is missed but command is entered 2405 2406 # @todo vvl if nicnum is missed but command is entered 2406 2407 # use NAT func for every adapter on machine. 2407 2408 func = args[3] … … 2415 2416 adapter = mach.getNetworkAdapter(nicnum) 2416 2417 natEngine = adapter.natDriver 2417 (rc, report) = natcommands[func](ctx, mach, nicnum, natEngine, cmdargs) 2418 (rc, report) = natcommands[func](ctx, mach, nicnum, natEngine, cmdargs) 2418 2419 if rosession == 0: 2419 2420 if rc == 0:
Note:
See TracChangeset
for help on using the changeset viewer.