package com.jscape.inet.ssh.protocol.v2.connection;

import com.jscape.inet.ssh.protocol.v2.marshaling.*;
import com.jscape.inet.ssh.protocol.v2.messages.*;

/**
 * @author Alex Usun
 */
public class ConnectionMessages {

    public static final MessageCodec.Entry[] ENTRIES = {
            new MessageCodec.Entry(1, new SshMsgDisconnectCodec(), SshMsgDisconnect.class),
            new MessageCodec.Entry(2, new SshMsgIgnoreCodec(), SshMsgIgnore.class),
            new MessageCodec.Entry(3, new SshMsgUnimplementedCodec(), SshMsgUnimplemented.class),
            new MessageCodec.Entry(4, new SshMsgDebugCodec(), SshMsgDebug.class),
            new MessageCodec.Entry(5, new SshMsgServiceRequestCodec(), SshMsgServiceRequest.class),
            new MessageCodec.Entry(6, new SshMsgServiceAcceptCodec(), SshMsgServiceAccept.class),
            new MessageCodec.Entry(20, new SshMsgKexInitCodec(), SshMsgKexInit.class),
            new MessageCodec.Entry(21, new SshMsgNewKeysCodec(), SshMsgNewKeys.class),
            new MessageCodec.Entry(51, new SshMsgUserAuthFailureCodec(), SshMsgUserAuthFailure.class),
            new MessageCodec.Entry(52, new SshMsgUserAuthSuccessCodec(), SshMsgUserAuthSuccess.class),
            new MessageCodec.Entry(53, new SshMsgUserAuthBannerCodec(), SshMsgUserAuthBanner.class),
            new MessageCodec.Entry(80, new SshMsgGlobalRequestCodec()),
            new MessageCodec.Entry(82, new SshMsgRequestFailureCodec(), SshMsgRequestFailure.class),
            new MessageCodec.Entry(92, new SshMsgChannelOpenFailureCodec(), SshMsgChannelOpenFailure.class),
            new MessageCodec.Entry(93, new SshMsgChannelWindowAdjustCodec(), SshMsgChannelWindowAdjust.class),
            new MessageCodec.Entry(94, new SshMsgChannelDataCodec(), SshMsgChannelData.class),
            new MessageCodec.Entry(95, new SshMsgChannelExtendedDataCodec(), SshMsgChannelExtendedData.class),
            new MessageCodec.Entry(96, new SshMsgChannelEofCodec(), SshMsgChannelEof.class),
            new MessageCodec.Entry(97, new SshMsgChannelCloseCodec(), SshMsgChannelClose.class),
            new MessageCodec.Entry(99, new SshMsgChannelSuccessCodec(), SshMsgChannelSuccess.class),
            new MessageCodec.Entry(100, new SshMsgChannelFailureCodec(), SshMsgChannelFailure.class),
    };

    public static MessageCodec init(MessageCodec codec) {
        return codec.set(ENTRIES);
    }

    private ConnectionMessages() {
        // empty
    }
}
