networklayermanager.java

来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 52 行

JAVA
52
字号
/*
 * $Id: NetworkLayerManager.java,v 1.2 2004/01/21 16:06:21 epr Exp $
 */
package org.jnode.net;

import java.util.Collection;

import org.jnode.driver.net.NetworkException;

/**
 * This interface must be implemented by the network service of the JNode kernel.
 * It contains methods to register/unregister and obtain NetworkLayers, and
 * it is used by Network drivers to deliver receive packets.
 * <p/>
 * The implementation of this interface must be obtained by invoking a lookup
 * of {@link #NAME} on {@link org.jnode.naming.InitialNaming}.
 * 
 * @author epr
 * @see org.jnode.driver.net.NetDeviceAPI
 */
public interface NetworkLayerManager {

	/** Name used to bind the ptm in the InitialNaming namespace */	
	public static final Class NAME = NetworkLayerManager.class;//"system/net/networklayermanager";

	/**
	 * Get all register packet types.
	 * @return A collection of PacketType instances
	 */
	public Collection getNetworkLayers();
	
	/**
	 * Gets the packet type for a given protocol ID
	 * @param protocolID
	 * @throws NoSuchProtocolException
	 */
	public NetworkLayer getNetworkLayer(int protocolID)
	throws NoSuchProtocolException;
	
	/**
	 * Process a packet that has been received. 
	 * The receive method of all those packettypes that have a matching type
	 * and allow the device(of the packet) is called.
	 * The packet is cloned if more then 1 packettypes want to receive the
	 * packet.
	 * 
	 * @param skbuf
	 */
	public void receive(SocketBuffer skbuf)
	throws NetworkException;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?