Register the services that define the "connection" layer of the SSH protocol.
# File lib/net/ssh/connection/services.rb, line 23 23: def register_services( container ) 24: 25: # The :connection namespace contains all of the services in the 26: # connection layer of the SSH protocol. 27: container.namespace_define :connection do |ns| 28: 29: # The :channel namespace contains the channel-specific services. 30: ns.namespace_define :channel do |ch| 31: 32: # The :open service provides a proc object that may be used to 33: # request that a new channel be opened. 34: ch.open do |c,p| 35: require 'net/ssh/connection/channel' 36: lambda do |type, data| 37: Channel.open( c[:driver], 38: c[:log_for, p], 39: c[:transport][:buffers], 40: type, data ) 41: end 42: end 43: 44: # The :create service provides a proc object that may be used to 45: # create new channels, without sending a request to the server. 46: ch.create do |c,p| 47: require 'net/ssh/connection/channel' 48: lambda do |type,rid,wsize,psize| 49: Channel.create( c[:driver], 50: c[:log_for, p], 51: c[:transport][:buffers], 52: type, rid, wsize, psize ) 53: end 54: end 55: end 56: 57: # The :driver service manages the connection layer. 58: ns.driver do |c,p| 59: require 'net/ssh/connection/driver' 60: Driver.new( c[:transport][:session], 61: c[:log_for, p], 62: c[:transport][:buffers], 63: :open => c[:channel][:open], 64: :create => c[:channel][:create] ) 65: end 66: end 67: end