protected boolean handleAgentForwarding(Buffer buffer) throws IOException {
boolean wantReply = buffer.getBoolean();
final ServerSession server = (ServerSession) session;
final ForwardingFilter filter = server.getServerFactoryManager().getTcpipForwardingFilter();
final SshAgentFactory factory = server.getServerFactoryManager().getAgentFactory();
if (factory == null || (filter != null && !filter.canForwardAgent(server))) {
if (wantReply) {
buffer = session.createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_FAILURE, 0);
buffer.putInt(recipient);
writePacket(buffer);
}