#ifndef NET_FS_PORT_CONNECTION_H
#define NET_FS_PORT_CONNECTION_H
#include <OS.h>
#include "AbstractConnection.h"
#include "PortChannel.h"
class PortConnection : public AbstractConnection {
public:
PortConnection();
virtual ~PortConnection();
status_t Init(Channel* channel, int32 upStreamChannels,
int32 downStreamChannels);
virtual status_t Init(const char* parameters);
status_t FinishInitialization();
private:
static status_t _CreateChannel(PortChannel** channel,
PortChannel::Info* info = NULL,
bool inverse = false);
private:
int32 fUpStreamChannels;
int32 fDownStreamChannels;
};
namespace PortConnectionDefs {
struct ConnectRequest {
int32 protocolVersion;
int32 upStreamChannels;
int32 downStreamChannels;
PortChannel::Info channelInfo;
};
struct ConnectReply {
int32 error;
int32 upStreamChannels;
int32 downStreamChannels;
};
extern const int32 kProtocolVersion;
extern const char* kPortConnectionPortName;
extern const int32 kMinUpStreamChannels;
extern const int32 kMaxUpStreamChannels;
extern const int32 kDefaultUpStreamChannels;
extern const int32 kMinDownStreamChannels;
extern const int32 kMaxDownStreamChannels;
extern const int32 kDefaultDownStreamChannels;
}
#endif