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

import com.jscape.inet.ssh.protocol.messages.Message;

import static com.jscape.util.Parameters.assertGreater;
import static com.jscape.util.Parameters.assertGreaterOrEqual;

/**
 * @author Alex Usun
 */
public abstract class SshMsgChannelOpen<H extends Message.HandlerBase>
        extends Message<H> {

    public final int senderChannel;
    public final long initialWindowSize;
    public final int maxPacketSize;

    protected SshMsgChannelOpen(int senderChannel, long initialWindowSize, int maxPacketSize) {
        this.senderChannel = senderChannel;

        assertGreaterOrEqual(initialWindowSize, 0, "Bad initial window size.");
        this.initialWindowSize = initialWindowSize;

        assertGreater(maxPacketSize, 0, "Bad max packet size.");
        this.maxPacketSize = maxPacketSize;
    }


}
