plptools
Loading...
Searching...
No Matches
NCP Class Reference

#include <ncp.h>

Collaboration diagram for NCP:

Public Member Functions

 NCP (const char *fname, int baud, unsigned short verbose, const int cancellationFd)
 
 ~NCP ()
 
int connect (channel *c)
 
void Register (channel *c)
 
void RegisterAck (int, const char *)
 
void disconnect (int channel)
 
void send (int channel, bufferStore &a)
 
void reset ()
 
int maxLinks ()
 
bool stuffToSend ()
 
bool hasFailed ()
 
bool gotLinkChannel ()
 
PcServerfindPcServer (const char *name)
 
void registerPcServer (TCPSocket *skt, const char *name)
 
void unregisterPcServer (PcServer *server)
 
void setVerbose (unsigned short)
 
unsigned short getVerbose ()
 
short int getProtocolVersion ()
 
int getSpeed ()
 

Private Types

enum  c { MAX_LEN = 200 , LAST_MESS = 1 , NOT_LAST_MESS = 2 }
 
enum  interControllerMessageType {
  NCON_MSG_DATA_XOFF =1 , NCON_MSG_DATA_XON =2 , NCON_MSG_CONNECT_TO_SERVER =3 , NCON_MSG_CONNECT_RESPONSE =4 ,
  NCON_MSG_CHANNEL_CLOSED =5 , NCON_MSG_NCP_INFO =6 , NCON_MSG_CHANNEL_DISCONNECT =7 , NCON_MSG_NCP_END =8
}
 
enum  protocolVersionType { PV_SERIES_5 = 6 , PV_SERIES_3 = 3 }
 

Private Member Functions

void receive (bufferStore s)
 
int getFirstUnusedChan ()
 
bool isValidChannel (int)
 
void decodeControlMessage (bufferStore &buff)
 
void controlChannel (int chan, enum interControllerMessageType t, bufferStore &command)
 
const char * ctrlMsgName (unsigned char)
 

Private Attributes

Linkl
 
unsigned short verbose
 
channel ** channelPtr
 
bufferStoremessageList
 
int * remoteChanList
 
bool failed
 
short int protocolVersion
 
linkChanlChan
 
int maxChannels
 
std::vector< PcServerpcServers
 
int lastSentChannel
 

Friends

class Link
 

Detailed Description

Definition at line 54 of file ncp.h.

Member Enumeration Documentation

◆ c

enum NCP::c
private
Enumerator
MAX_LEN 
LAST_MESS 
NOT_LAST_MESS 

Definition at line 82 of file ncp.h.

◆ interControllerMessageType

Enumerator
NCON_MSG_DATA_XOFF 
NCON_MSG_DATA_XON 
NCON_MSG_CONNECT_TO_SERVER 
NCON_MSG_CONNECT_RESPONSE 
NCON_MSG_CHANNEL_CLOSED 
NCON_MSG_NCP_INFO 
NCON_MSG_CHANNEL_DISCONNECT 
NCON_MSG_NCP_END 

Definition at line 83 of file ncp.h.

◆ protocolVersionType

Enumerator
PV_SERIES_5 
PV_SERIES_3 

Definition at line 94 of file ncp.h.

Constructor & Destructor Documentation

◆ NCP()

NCP::NCP ( const char *  fname,
int  baud,
unsigned short  verbose,
const int  cancellationFd 
)

Definition at line 39 of file ncp.cc.

◆ ~NCP()

NCP::~NCP ( )

Definition at line 60 of file ncp.cc.

Member Function Documentation

◆ connect()

int NCP::connect ( channel c)

Definition at line 412 of file ncp.cc.

◆ controlChannel()

void NCP::controlChannel ( int  chan,
enum interControllerMessageType  t,
bufferStore command 
)
private

Definition at line 148 of file ncp.cc.

◆ ctrlMsgName()

const char * NCP::ctrlMsgName ( unsigned char  msgType)
private

Definition at line 517 of file ncp.cc.

◆ decodeControlMessage()

void NCP::decodeControlMessage ( bufferStore buff)
private

Definition at line 191 of file ncp.cc.

◆ disconnect()

void NCP::disconnect ( int  channel)

Definition at line 464 of file ncp.cc.

◆ findPcServer()

PcServer * NCP::findPcServer ( const char *  name)

Definition at line 162 of file ncp.cc.

◆ getFirstUnusedChan()

int NCP::getFirstUnusedChan ( )
private

Definition at line 359 of file ncp.cc.

◆ getProtocolVersion()

short int NCP::getProtocolVersion ( )

Definition at line 111 of file ncp.cc.

◆ getSpeed()

int NCP::getSpeed ( )

Definition at line 511 of file ncp.cc.

◆ getVerbose()

unsigned short NCP::getVerbose ( )

Definition at line 98 of file ncp.cc.

◆ gotLinkChannel()

bool NCP::gotLinkChannel ( )

Definition at line 505 of file ncp.cc.

◆ hasFailed()

bool NCP::hasFailed ( )

Definition at line 486 of file ncp.cc.

◆ isValidChannel()

bool NCP::isValidChannel ( int  channel)
private

Definition at line 373 of file ncp.cc.

◆ maxLinks()

int NCP::maxLinks ( )

Definition at line 78 of file ncp.cc.

◆ receive()

void NCP::receive ( bufferStore  s)
private

Definition at line 117 of file ncp.cc.

◆ Register()

void NCP::Register ( channel c)

Definition at line 395 of file ncp.cc.

◆ RegisterAck()

void NCP::RegisterAck ( int  chan,
const char *  name 
)

Definition at line 379 of file ncp.cc.

◆ registerPcServer()

void NCP::registerPcServer ( TCPSocket skt,
const char *  name 
)

Definition at line 174 of file ncp.cc.

◆ reset()

void NCP::reset ( )

Definition at line 83 of file ncp.cc.

◆ send()

void NCP::send ( int  channel,
bufferStore a 
)

Definition at line 437 of file ncp.cc.

◆ setVerbose()

void NCP::setVerbose ( unsigned short  _verbose)

Definition at line 104 of file ncp.cc.

◆ stuffToSend()

bool NCP::stuffToSend ( )

Definition at line 480 of file ncp.cc.

◆ unregisterPcServer()

void NCP::unregisterPcServer ( PcServer server)

Definition at line 179 of file ncp.cc.

Friends And Related Function Documentation

◆ Link

friend class Link
friend

Definition at line 80 of file ncp.h.

Member Data Documentation

◆ channelPtr

channel** NCP::channelPtr
private

Definition at line 104 of file ncp.h.

◆ failed

bool NCP::failed
private

Definition at line 107 of file ncp.h.

◆ l

Link* NCP::l
private

Definition at line 102 of file ncp.h.

◆ lastSentChannel

int NCP::lastSentChannel
private

Definition at line 112 of file ncp.h.

◆ lChan

linkChan* NCP::lChan
private

Definition at line 109 of file ncp.h.

◆ maxChannels

int NCP::maxChannels
private

Definition at line 110 of file ncp.h.

◆ messageList

bufferStore* NCP::messageList
private

Definition at line 105 of file ncp.h.

◆ pcServers

std::vector<PcServer> NCP::pcServers
private

Definition at line 111 of file ncp.h.

◆ protocolVersion

short int NCP::protocolVersion
private

Definition at line 108 of file ncp.h.

◆ remoteChanList

int* NCP::remoteChanList
private

Definition at line 106 of file ncp.h.

◆ verbose

unsigned short NCP::verbose
private

Definition at line 103 of file ncp.h.


The documentation for this class was generated from the following files: