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

#include <ncp.h>

Collaboration diagram for NCP:

Public Member Functions

 NCP (const char *fname, int baud, bool noDSRCheck, unsigned short verbose, const int cancellationFd, NCPStatusCallback statusCallback, void *context)
 
 ~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)
 
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 = false
 
short int protocolVersion
 
LinkChannellChan
 
int maxChannels
 
std::vector< PcServerpcServers
 
int lastSentChannel
 
NCPStatusCallback statusCallback_
 
void * callbackContext_
 

Friends

class Link
 

Detailed Description

Definition at line 55 of file ncp.h.

Member Enumeration Documentation

◆ c

enum NCP::c
private
Enumerator
MAX_LEN 
LAST_MESS 
NOT_LAST_MESS 

Definition at line 87 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 88 of file ncp.h.

◆ protocolVersionType

Enumerator
PV_SERIES_5 
PV_SERIES_3 

Definition at line 99 of file ncp.h.

Constructor & Destructor Documentation

◆ NCP()

NCP::NCP ( const char *  fname,
int  baud,
bool  noDSRCheck,
unsigned short  verbose,
const int  cancellationFd,
NCPStatusCallback  statusCallback,
void *  context 
)

Definition at line 41 of file ncp.cc.

◆ ~NCP()

NCP::~NCP ( )

Definition at line 68 of file ncp.cc.

Member Function Documentation

◆ connect()

int NCP::connect ( Channel c)

Definition at line 392 of file ncp.cc.

◆ controlChannel()

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

Definition at line 138 of file ncp.cc.

◆ ctrlMsgName()

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

Definition at line 486 of file ncp.cc.

◆ decodeControlMessage()

void NCP::decodeControlMessage ( BufferStore buff)
private

Definition at line 175 of file ncp.cc.

◆ disconnect()

void NCP::disconnect ( int  channel)

Definition at line 440 of file ncp.cc.

◆ findPcServer()

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

Definition at line 150 of file ncp.cc.

◆ getFirstUnusedChan()

int NCP::getFirstUnusedChan ( )
private

Definition at line 347 of file ncp.cc.

◆ getProtocolVersion()

short int NCP::getProtocolVersion ( )

Definition at line 103 of file ncp.cc.

◆ getSpeed()

int NCP::getSpeed ( )

Definition at line 482 of file ncp.cc.

◆ gotLinkChannel()

bool NCP::gotLinkChannel ( )

Definition at line 478 of file ncp.cc.

◆ hasFailed()

bool NCP::hasFailed ( )

Definition at line 458 of file ncp.cc.

◆ isValidChannel()

bool NCP::isValidChannel ( int  channel)
private

Definition at line 359 of file ncp.cc.

◆ maxLinks()

int NCP::maxLinks ( )

Definition at line 85 of file ncp.cc.

◆ receive()

void NCP::receive ( BufferStore  s)
private

Definition at line 108 of file ncp.cc.

◆ Register()

void NCP::Register ( Channel c)

Definition at line 377 of file ncp.cc.

◆ RegisterAck()

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

Definition at line 363 of file ncp.cc.

◆ registerPcServer()

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

Definition at line 160 of file ncp.cc.

◆ reset()

void NCP::reset ( )

Definition at line 89 of file ncp.cc.

◆ send()

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

Definition at line 415 of file ncp.cc.

◆ stuffToSend()

bool NCP::stuffToSend ( )

Definition at line 454 of file ncp.cc.

◆ unregisterPcServer()

void NCP::unregisterPcServer ( PcServer server)

Definition at line 164 of file ncp.cc.

Friends And Related Function Documentation

◆ Link

friend class Link
friend

Definition at line 85 of file ncp.h.

Member Data Documentation

◆ callbackContext_

void* NCP::callbackContext_
private

Definition at line 119 of file ncp.h.

◆ channelPtr

Channel** NCP::channelPtr
private

Definition at line 109 of file ncp.h.

◆ failed

bool NCP::failed = false
private

Definition at line 112 of file ncp.h.

◆ l

Link* NCP::l
private

Definition at line 107 of file ncp.h.

◆ lastSentChannel

int NCP::lastSentChannel
private

Definition at line 117 of file ncp.h.

◆ lChan

LinkChannel* NCP::lChan
private

Definition at line 114 of file ncp.h.

◆ maxChannels

int NCP::maxChannels
private

Definition at line 115 of file ncp.h.

◆ messageList

BufferStore* NCP::messageList
private

Definition at line 110 of file ncp.h.

◆ pcServers

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

Definition at line 116 of file ncp.h.

◆ protocolVersion

short int NCP::protocolVersion
private

Definition at line 113 of file ncp.h.

◆ remoteChanList

int* NCP::remoteChanList
private

Definition at line 111 of file ncp.h.

◆ statusCallback_

NCPStatusCallback NCP::statusCallback_
private

Definition at line 118 of file ncp.h.

◆ verbose

unsigned short NCP::verbose
private

Definition at line 108 of file ncp.h.


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