1 /* 2 * Created on 18-Jan-2006 3 * Created by Paul Gardner 4 * Copyright (C) Azureus Software, Inc, All Rights Reserved. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 9 * of the License, or (at your option) any later version. 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 */ 19 20 package com.aelitis.azureus.core.networkmanager.impl; 21 22 import java.nio.ByteBuffer; 23 24 public interface 25 ProtocolDecoderAdapter 26 { 27 public static final int MATCH_NONE = 1; 28 public static final int MATCH_CRYPTO_NO_AUTO_FALLBACK = 2; 29 public static final int MATCH_CRYPTO_AUTO_FALLBACK = 3; 30 31 public int getMaximumPlainHeaderLength()32 getMaximumPlainHeaderLength(); 33 34 public int matchPlainHeader( ByteBuffer buffer )35 matchPlainHeader( 36 ByteBuffer buffer ); 37 38 public void gotSecret( byte[] session_secret )39 gotSecret( 40 byte[] session_secret ); 41 42 public void decodeComplete( ProtocolDecoder decoder, ByteBuffer remaining_initial_data )43 decodeComplete( 44 ProtocolDecoder decoder, 45 ByteBuffer remaining_initial_data ); 46 47 public void decodeFailed( ProtocolDecoder decoder, Throwable cause )48 decodeFailed( 49 ProtocolDecoder decoder, 50 Throwable cause ); 51 } 52