# File lib/net/ssh/authentication/session.rb, line 80
 80:     def next_message
 81:       loop do
 82:         packet = transport.next_message
 83: 
 84:         case packet.type
 85:         when USERAUTH_BANNER
 86:           info { packet[:message] }
 87:           # TODO add a hook for people to retrieve the banner when it is sent
 88: 
 89:         when USERAUTH_FAILURE
 90:           @allowed_auth_methods = packet[:authentications].split(/,/)
 91:           debug { "allowed methods: #{packet[:authentications]}" }
 92:           return packet
 93: 
 94:         when USERAUTH_METHOD_RANGE, SERVICE_ACCEPT
 95:           return packet
 96: 
 97:         when USERAUTH_SUCCESS
 98:           transport.hint :authenticated
 99:           return packet
100: 
101:         else
102:           raise Net::SSH::Exception, "unexpected message #{packet.type} (#{packet})"
103:         end
104:       end
105:     end