using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IFS
{
public enum ConnectionType
{
Connectionless, /* echo, name resolution, etc. */
BSP, /* FTP, Telnet, CopyDisk, etc. */
EFTP, /* EFTP-based (boot, printing) */
}
public struct PUPProtocolEntry
{
public PUPProtocolEntry(string friendlyName, UInt32 socket, ConnectionType connectionType, PUPProtocolBase implementation)
{
FriendlyName = friendlyName;
Socket = socket;
ConnectionType = connectionType;
ProtocolImplementation = implementation;
WorkerType = null;
}
public PUPProtocolEntry(string friendlyName, UInt32 socket, ConnectionType connectionType, Type workerType)
{
FriendlyName = friendlyName;
Socket = socket;
ConnectionType = connectionType;
WorkerType = workerType;
ProtocolImplementation = null;
}
///
/// Indicates the 'friendly' name for the protocol.
///
public string FriendlyName;
///
/// Indicates the socket used by the protocol
///
public UInt32 Socket;
///
/// Indicates the type of connection (connectionless, BSP-based or EFTP)
///
public ConnectionType ConnectionType;
public PUPProtocolBase ProtocolImplementation;
public Type WorkerType;
}
///
/// Base class for all PUP-based protocols.
///
public abstract class PUPProtocolBase
{
public PUPProtocolBase()
{
}
///
/// Called by dispatcher to send incoming data destined for this protocol.
///
///
public abstract void RecvData(PUP p);
}
}