17#include "../include/TPlayer.h"
19#include "../include/EventSvc.h"
21#include <isode/messages/ioevent.h>
31 const unsigned TPbuffer::TPBINC;
48 PARAM_tpdusize = 0xC0,
49 PARAM_calling_tsel = 0xC1,
50 PARAM_invalid_tpdu = 0xC1,
51 PARAM_called_tsel = 0xC2,
52 PARAM_respond_tsel = 0xC2,
53 PARAM_checksum = 0xC3,
55 PARAM_protection = 0xC5,
56 PARAM_additional = 0xC6,
57 PARAM_altclasses = 0xC7,
59 PARAM_residerr = 0x86,
60 PARAM_priority = 0x87,
61 PARAM_transitdelay = 0x88,
62 PARAM_throughput = 0x89,
63 PARAM_sequenceno = 0x8A,
64 PARAM_reasstime = 0x8B,
65 PARAM_flowctrl = 0x8C,
66 PARAM_selectack = 0x8F,
68 PARAM_prefmaxtpdu = 0xF0,
69 PARAM_inacttime = 0xF2,
74 pthread_mutex_t Layer::refmutex = PTHREAD_MUTEX_INITIALIZER;
75 unsigned Layer::refvalue = 0;
85 if ( state != CLOSED ) {
87 LOG_DEBUG ((
"TConreq in state %d - ignored", state));
91 if ( provider->GetUser() == 0 ) {
92 InternalError (DR_nosession,
"No user for CR");
98 if ( req->data != 0 && req->cc > 0 ) {
99 connect.data = (
char *) malloc (req->cc);
100 if ( connect.data != 0 )
101 memcpy (connect.data, req->data, req->cc);
109 DisconnectIndication disind;
112 if ( connect.called.ta_addr.na_addrlen == 0 ) {
113 MSG_Tsap_NoNSAPAddress_SET (&disind.msg);
121 MSG_Tsap_Negotiation_SET (&disind.msg);
129 if ( maxtpdu == 0 ) {
131 ( classes & TP_CLASS_2 ) ? MAXTPDU2 : MAXTPDU0;
138 if ( maxtpdu < MINMAXTPDU || maxtpdu > MAXTPDU2 ) {
139 MSG_Tsap_BadMaxTPDUsize_SET (&disind.msg, maxtpdu);
144 LOG_DEBUG ((
"TP %p: TCONreq -> WFNC",
this));
147 net->
ConnectRequest (connect.calling.ta_addr, connect.called.ta_addr);
156 LOG_DEBUG ((
"Ignoring TCONresp in state %d", state));
165 if ( req->responding.ta_selectlen > 0 ) {
166 memcpy (connect.called.ta_selector,
167 req->responding.ta_selector,
168 req->responding.ta_selectlen);
169 connect.called.ta_selectlen = req->responding.ta_selectlen;
172 LOG_DEBUG ((
"TP %p: TCONresp -> OPEN",
this));
181 if ( state !=
OPEN ) {
183 LOG_DEBUG ((
"Ignoring TDTreq in state %d", state));
188 if ( req->expedited ) {
189 InternalError (DR_protocol,
"Expedited data not supported");
193 makeDT (req->uv, req->eot);
206 LOG_DEBUG ((
"Ignoring TDISreq in state %d", state));
223 makeDR (data->reason, data->data, data->cc);
232 makeDR (data->reason, data->data, data->cc);
238 DisconnectIndication disind;
239 MSG_Tsap_NormalDisconnect_SET (&disind.msg);
246 const u_char *dp =
reinterpret_cast<const u_char *
>(qb->qb_data);
248 LOG_DEBUG ((
"NetworkRead: %ld (%d)", (
long)qb->qb_len, *dp));
252 if ( *dp >= qb->qb_len || *dp < 2 ) {
253 MSG_Tsap_RejectUnspecified_LOG (
"Bad length field in TPKT");
254 ProtocolError (qb, 1, Reject_NotSpecified);
259 switch ( dp[1] & 0xF0 ) {
292 LOG_DEBUG ((
"Ignoring TPDU with type 0x%2.2X", dp[1]));
297 MSG_Tsap_RejectBadType_LOG (dp[1]);
298 ProtocolError (qb, 2, Reject_InvalidTPDUtype);
308 switch (MSG2LEVEL(msp)) {
309 case MSGLEVEL_CRITICAL:
316 case MSGLEVEL_NOTICE:
317 switch ( MSG2msgid_err (msp) ) {
318 case MSG_IOevent_ConnectionClosed:
321 MSG_Tsap_NormalDisconnect_SET (msp);
323 MSG_Tsap_NotSpecified_SET(msp);
332 case MSGLEVEL_SUCCESS:
333 switch ( MSG2msgid_err (msp) ) {
334 case MSG_IOevent_Connected:
336 if ( state ==
WFNC ) {
337 LOG_DEBUG ((
"TP %p NCONconf -> WFCC",
this));
355 if ( provider->GetUser() ) {
359 DisconnectIndication disind;
392 void Layer::ProtocolError (
struct qbuf *qb,
394 enum RejectCause cause)
397 makeER (cause,
reinterpret_cast<u_char *
>(qb->qb_data), poffset);
404 void Layer::SendUserDR (
enum DRreason reason,
const char *text)
406 DisconnectIndication disind;
410 case DR_notspecified:
411 MSG_Tsap_NotSpecified_SET (&disind.msg);
415 MSG_Tsap_Congestion_SET (&disind.msg);
419 MSG_Tsap_NoSession_SET (&disind.msg);
423 MSG_Tsap_AddressUnknown_SET (&disind.msg);
427 MSG_Tsap_NormalDisconnect_SET (&disind.msg);
430 case DR_remcongested:
431 MSG_Tsap_RemoteCongestion_SET (&disind.msg);
435 MSG_Tsap_Negotiation_SET (&disind.msg);
439 MSG_Tsap_Duplicate_SET (&disind.msg);
443 MSG_Tsap_Mismatch_SET (&disind.msg);
447 MSG_Tsap_Protocol_SET (&disind.msg);
451 MSG_Tsap_Overflow_SET (&disind.msg);
455 MSG_Tsap_NetRefused_SET (&disind.msg);
459 MSG_Tsap_InvalidLength_SET (&disind.msg);
466 MSG_Tsap_UserData_SET (&addmsg, text);
468 MSGappend (&disind.msg, &addmsg);
471 if ( provider->GetUser() == 0 ) {
473 LOGmessage (&disind.msg);
480 void Layer::InternalError (
enum DRreason reason,
const char *text)
482 if ( state != CLOSED && net != 0 ) {
488 makeDR (reason, 0, 0);
493 SendUserDR (reason, text);
497 static void SaveAddr (
const tsapADDR &ta,
char *selbuf,
char *addbuf)
499 if ( ta.ta_selectlen > 0 )
500 selbuf[explode (selbuf,
501 (
const u_char *)ta.ta_selector,
502 ta.ta_selectlen)] =
'\0';
504 strcpy (selbuf,
"0");
506 addbuf[explode (addbuf,
507 (
const u_char *)ta.ta_addr.na_address,
508 ta.ta_addr.na_addrlen)] =
'\0';
512 static void RestoreAddr (tsapADDR &ta,
const char *selbuf,
const char *addbuf)
514 ta.ta_selectlen = implode ((u_char *)ta.ta_selector,
518 ta.ta_addr.na_addrlen = implode ((u_char *)ta.ta_addr.na_address,
526 char callingsel[2*TSSIZE+1];
527 char callingadd[2*NASIZE+1];
528 char calledsel[2*TSSIZE+1];
529 char calledadd[2*NASIZE+1];
531 SaveAddr (connect.calling, callingsel, callingadd);
532 SaveAddr (connect.called, calledsel, calledadd);
534 if ( snprintf (buffer, buflen,
535 "%u:%u:%u:%u:%d:%d:%s.%s:%s.%s",
536 classes, maxtpdu, srcref, dstref,
538 callingsel, callingadd,
539 calledsel, calledadd) < 0 )
541 buffer[buflen-1] =
'\0';
550 char callingsel[2*TSSIZE+1];
551 char callingadd[2*NASIZE+1];
552 char calledsel[2*TSSIZE+1];
553 char calledadd[2*NASIZE+1];
555 if ( sscanf (buffer,
"%u:%u:%u:%u:%d:%d"
556 ":%[0-9A-Fa-f].%[0-9A-Fa-f]"
557 ":%[0-9A-Fa-f].%[0-9A-Fa-f]",
558 &classes, &maxtpdu, &srcref, &dstref,
560 callingsel, callingadd,
561 calledsel, calledadd) != 10 )
564 RestoreAddr (connect.calling, callingsel, callingadd);
565 RestoreAddr (connect.called, calledsel, calledadd);
567 state =
static_cast<State>(istate);
568 useprefsize = (iuse != 0);
576 void Layer::getCR (
struct qbuf *qb)
578 if ( state !=
WFCR ) {
579 LOG_DEBUG ((
"Ignore CR in state %d", state));
583 if ( provider->GetUser() == 0 ) {
584 MSG_Tsap_NoUser_LOG(
"Layer:getCR");
585 ProtocolError (qb, 1, Reject_NotSpecified);
589 const u_char *dp =
reinterpret_cast<const u_char *
>(qb->qb_data);
592 MSG_Tsap_RejectUnspecified_LOG (
"Bad length field in CR");
593 ProtocolError (qb, 1, Reject_NotSpecified);
597 if ( dp[2] != 0 || dp[3] != 0 ) {
598 MSG_Tsap_RejectBadValue_LOG (
"dst-ref");
599 ProtocolError (qb, 4, Reject_InvalidParameterValue);
604 dstref = (dp[4]<<8) | dp[5];
606 classes = (1U<<(dp[6]>>4));
608 unsigned options = dp[6] & 0xF;
610 if ( options & 0xC ) {
611 MSG_Tsap_RejectBadValue_LOG (
"options");
612 ProtocolError (qb, 7, Reject_InvalidParameterValue);
617 connect.calling.ta_selectlen = 0;
618 connect.called.ta_selectlen = 0;
619 connect.expedited =
false;
622 memset (&connect.qos, 0, sizeof (connect.qos));
624 const u_char *pp = dp + 7;
625 const u_char *ud = dp + dp[0] + 1;
627 unsigned maxsize = MINMAXTPDU;
629 while ( pp < ud - 2 ) {
630 unsigned plen = pp[1];
632 if ( pp + plen > ud - 2 ) {
633 MSG_Tsap_RejectUnspecified_LOG (
"Bad parameter length field");
634 ProtocolError (qb, pp - dp + 2, Reject_NotSpecified);
639 case PARAM_calling_tsel:
640 if ( plen <= TSSIZE ) {
641 memcpy (connect.calling.ta_selector, pp+2, plen);
642 connect.calling.ta_selectlen = plen;
646 case PARAM_called_tsel:
647 if ( plen <= TSSIZE ) {
648 memcpy (connect.called.ta_selector, pp+2, plen);
649 connect.called.ta_selectlen = plen;
655 if ( pp[2] < 7 || 13 < pp[2] ) {
656 MSG_Tsap_RejectBadValue_LOG (
"TPDU size");
666 case PARAM_prefmaxtpdu:
669 for (
unsigned i = 0; i < plen; i++ ) {
677 if ( psize < MINMAXTPDU || 65530 < psize ) {
678 MSG_Tsap_RejectBadValue_LOG (
"Preferred TPDU size");
679 ProtocolError (qb, pp - dp + 2 + plen,
680 Reject_InvalidParameterValue);
691 MSG_Tsap_RejectBadValue_LOG (
"Version number");
692 ProtocolError (qb, pp - dp + 2 + plen,
693 Reject_InvalidParameterValue);
698 case PARAM_additional:
702 case PARAM_altclasses:
704 for (
unsigned i = 0; i < plen; i++ )
705 classes |= (1U<<(pp[i+2]>>4));
710 case PARAM_protection:
712 case PARAM_throughput:
715 case PARAM_transitdelay:
716 case PARAM_reasstime:
717 case PARAM_inacttime:
720 LOG_DEBUG ((
"Ignore parameter type 0x%2.2X", pp[0]));
729 if ( maxsize < maxtpdu )
738 if ( classes == 0 ) {
739 InternalError (DR_negotiation,
"No suitable classes");
743 if ( classes & TP_CLASS_2 )
744 classes = TP_CLASS_2;
753 ConnectIndication conind;
755 conind.newprovider = provider;
756 conind.calling = connect.calling;
757 conind.called = connect.called;
758 conind.expedited =
false;
759 conind.tsdusize = maxtpdu - ((classes &
TP_CLASS_0) ? 3 : 5);
765 provider->GetUser()->Deliver (&conind);
769 void Layer::getCC (
struct qbuf *qb)
773 ProtocolError (qb, 2, Reject_NotSpecified);
777 LOG_DEBUG ((
"CC received in state closing"));
781 SendUserDR (DR_protocol,
"CC received when closed");
790 const u_char *dp =
reinterpret_cast<const u_char *
>(qb->qb_data);
793 MSG_Tsap_RejectUnspecified_LOG (
"Bad length field in CC");
794 ProtocolError (qb, 1, Reject_NotSpecified);
798 if ( !DstRefOK (qb) )
return;
800 classes = (1U<<(dp[6]>>4));
802 unsigned options = dp[6] & 0xF;
804 if ( options & 0xC ) {
805 MSG_Tsap_RejectBadValue_LOG (
"options");
806 ProtocolError (qb, 7, Reject_InvalidParameterValue);
810 const u_char *pp = dp + 7;
811 const u_char *ud = dp + dp[0] + 1;
813 unsigned maxsize = MINMAXTPDU;
815 while ( pp < ud - 2 ) {
816 unsigned plen = pp[1];
818 if ( pp + plen > ud - 2 ) {
819 MSG_Tsap_RejectUnspecified_LOG (
"Bad parameter length field");
820 ProtocolError (qb, pp - dp + 2, Reject_NotSpecified);
825 case PARAM_respond_tsel:
826 if ( plen <= TSSIZE ) {
827 memcpy (connect.called.ta_selector, pp+2, plen);
833 if ( pp[2] < 7 || 13 < pp[2] ) {
834 MSG_Tsap_RejectBadValue_LOG (
"TPDU size");
835 ProtocolError (qb, pp - dp + 2 + plen,
836 Reject_InvalidParameterValue);
840 unsigned psize = 1U<<pp[2];
841 if ( psize > maxsize )
847 case PARAM_prefmaxtpdu:
850 for (
unsigned i = 0; i < plen; i++ ) {
858 if ( psize < MINMAXTPDU || 65530 < psize ) {
859 MSG_Tsap_RejectBadValue_LOG (
"Preferred TPDU size");
860 ProtocolError (qb, pp - dp + 2 + plen,
861 Reject_InvalidParameterValue);
865 if ( psize > maxsize )
870 case PARAM_additional:
874 case PARAM_calling_tsel:
875 case PARAM_protection:
877 case PARAM_throughput:
880 case PARAM_transitdelay:
881 case PARAM_reasstime:
882 case PARAM_inacttime:
884 LOG_DEBUG ((
"Ignore parameter type 0x%2.2X", pp[0]));
888 MSG_Tsap_RejectBadParam_LOG (pp[0]);
889 ProtocolError (qb, pp - dp + 1, Reject_InvalidParameterCode);
898 if ( state ==
WBCL || provider->GetUser() == 0 ) {
903 makeDR (DR_nosession, 0, 0);
911 if ( (options & 1) == 0 && (classes &
TP_CLASS_0) == 0 )
915 ConnectConfirm conconf;
917 conconf.responding = connect.called;
918 conconf.expedited = connect.expedited;
920 conconf.tsdusize = maxtpdu - ((classes &
TP_CLASS_0) ? 3 : 5);
923 if (
static_cast<unsigned>(dp[0] + 1) < qb->qb_len ) {
925 conconf.cc = qb->qb_len - dp[0] - 1;
927 char *userdata =
static_cast<char *
>(malloc (conconf.cc));
929 memcpy (userdata, dp + dp[0] + 1, conconf.cc );
933 conconf.data = userdata;
942 TSnotify (provider->GetUser()->Deliver(&conconf));
949 makeDR (DR_negotiation, 0, 0);
953 DisconnectIndication disind;
955 MSG_Tsap_Negotiation_SET (&disind.msg);
961 void Layer::getDR (
struct qbuf *qb)
963 const u_char *dp =
reinterpret_cast<const u_char *
>(qb->qb_data);
966 MSG_Tsap_RejectUnspecified_LOG (
"Bad length field in DR");
967 ProtocolError (qb, 1, Reject_NotSpecified);
971 if ( !DstRefOK (qb) )
return;
973 uint16_t sourceref = (dp[4]<<8) | dp[5];
975 bool sendTDISind =
true;
977 LOG_DEBUG ((
"getDR (reason=%d)", dp[6]));
1003 if ( (classes &
TP_CLASS_0) == 0 && sourceref != 0 ) {
1013 if ( sendTDISind ) {
1015 SendUserDR (
static_cast<enum DRreason
>(dp[6]), 0);
1020 void Layer::getDC (
struct qbuf *qb)
1022 const u_char *dp =
reinterpret_cast<const u_char *
>(qb->qb_data);
1025 MSG_Tsap_RejectUnspecified_LOG (
"Bad length field");
1026 ProtocolError (qb, 1, Reject_NotSpecified);
1030 if ( !DstRefOK (qb) )
return;
1032 if ( state == CLOSED || state ==
CLOSING ) {
1035 ProtocolError (qb, 1, Reject_NotSpecified);
1041 void Layer::getDT (
struct qbuf *qb)
1043 const u_char *dp =
reinterpret_cast<const u_char *
>(qb->qb_data);
1047 DataIndication dataind;
1049 dataind.expedited =
false;
1052 LOG_DEBUG ((
"getDT (0) (%d %2.2x) %ld",
1053 dp[0], dp[2] & 0xFF, (
long)qb->qb_len - 3));
1056 MSG_Tsap_RejectUnspecified_LOG (
"Bad length field");
1057 ProtocolError (qb, 1, Reject_NotSpecified);
1062 dataind.eot = (dp[2] & 0x80) != 0;
1067 LOG_DEBUG ((
"getDT (2) (%d %2.2x) %ld",
1068 dp[0], dp[4] & 0xFF, (
long)qb->qb_len - 5));
1071 MSG_Tsap_RejectUnspecified_LOG (
"Bad length field");
1072 ProtocolError (qb, 1, Reject_NotSpecified);
1077 if ( !DstRefOK (qb) )
return;
1079 dataind.eot = (dp[4] & 0x80) != 0;
1084 qb->qb_data += poffset;
1085 qb->qb_len -= poffset;
1089 if ( provider->GetUser() != 0 ) {
1090 TSnotify (provider->GetUser()->Deliver (&dataind));
1094 InternalError (DR_nosession,
"Missing user for DT");
1099 void Layer::getED (
struct qbuf *qb)
1102 ProtocolError (qb, 1, Reject_NotSpecified);
1109 void Layer::getER (
struct qbuf *qb)
1111 const u_char *dp =
reinterpret_cast<const u_char *
>(qb->qb_data);
1114 MSG_Tsap_RejectReceived_LOG (dp[4]);
1126 SendUserDR (DR_negotiation,
"ER while in WFCC");
1134 SendUserDR (DR_protocol,
"ER when open");
1142 void Layer::makeCR ()
1145 u_char *dp = fixed + 1;
1155 if ( classes & TP_CLASS_2 ) {
1163 for ( logi = 7; logi < 13; logi++ )
1164 if ( (1U<<logi) >= maxtpdu )
1167 *dp++ = PARAM_tpdusize;
1175 if ( classes & TP_CLASS_2 ) {
1176 *dp++ = PARAM_version;
1182 if ( connect.expedited ) {
1183 *dp++ = PARAM_additional;
1189 if ((classes & TP_CLASS_2) && (classes &
TP_CLASS_0)) {
1190 *dp++ = PARAM_altclasses;
1196 if ( connect.called.ta_selectlen > 0 &&
1197 connect.called.ta_selectlen + (dp-fixed) < (int)
sizeof fixed - 2){
1198 *dp++ = PARAM_called_tsel;
1199 *dp++ = connect.called.ta_selectlen;
1200 memcpy (dp, connect.called.ta_selector, connect.called.ta_selectlen);
1201 dp += connect.called.ta_selectlen;
1205 if ( connect.calling.ta_selectlen > 0 &&
1206 connect.calling.ta_selectlen + (dp-fixed) < (
int)
sizeof fixed - 2){
1207 *dp++ = PARAM_calling_tsel;
1208 *dp++ = connect.calling.ta_selectlen;
1209 memcpy (dp, connect.calling.ta_selector, connect.calling.ta_selectlen);
1210 dp += connect.calling.ta_selectlen;
1214 unsigned len = dp - fixed;
1217 TPbuffer *bufp = GetBuffer();
1218 if ( bufp == 0 )
return;
1221 if ( bufp == 0 )
return;
1223 if ( connect.cc != 0 && (len + connect.cc) <= 128 )
1225 reinterpret_cast<const u_char *
>(connect.data),
1232 void Layer::makeCC ()
1235 u_char *dp = fixed + 1;
1246 if ( classes & TP_CLASS_2 ) {
1253 if ( useprefsize ) {
1256 unsigned pval = maxtpdu >> 7;
1258 *dp++ = PARAM_prefmaxtpdu;
1259 if ( pval & 0xFF00 ) {
1270 for ( logi = 7; logi < 13; logi++ )
1271 if ( (1U<<logi) >= maxtpdu )
1274 *dp++ = PARAM_tpdusize;
1280 if ( connect.expedited ) {
1281 *dp++ = PARAM_additional;
1289 if ( connect.called.ta_selectlen > 0 &&
1290 connect.called.ta_selectlen + (dp-fixed) < (int)
sizeof fixed - 2){
1291 *dp++ = PARAM_called_tsel;
1292 *dp++ = connect.called.ta_selectlen;
1293 memcpy (dp, connect.called.ta_selector, connect.called.ta_selectlen);
1294 dp += connect.called.ta_selectlen;
1298 unsigned len = dp - fixed;
1301 TPbuffer *bufp = GetBuffer();
1302 if ( bufp == 0 )
return;
1305 if ( bufp == 0 )
return;
1307 if ( connect.cc != 0 && (len + connect.cc) <= 128 )
1309 reinterpret_cast<const u_char *
>(connect.data),
1316 void Layer::makeDR (
enum DRreason reason,
1321 u_char *dp = fixed + 1;
1331 if ( state != CLOSED && (classes & TP_CLASS_2) == 0 ) {
1334 case DR_notspecified:
1340 case DR_remcongested:
1341 reason = DR_congestion;
1345 case DR_negotiation:
1353 reason = DR_notspecified;
1360 fixed[0] = dp - fixed - 1;
1362 if ( 0 < cc && cc <= 64 ) {
1363 memcpy (dp, data, cc);
1367 TPbuffer *bufp = GetBuffer();
1368 if ( bufp == 0 )
return;
1374 void Layer::makeDC ()
1377 u_char *dp = fixed + 1;
1387 fixed[0] = dp - fixed - 1;
1389 TPbuffer *bufp = GetBuffer();
1390 if ( bufp == 0 )
return;
1396 void Layer::makeDT (
const struct udvec *uv,
bool eot)
1398 if ( uv == 0 || uv->uv_base == 0 )
return;
1401 u_char *dp = fixed + 1;
1406 if ( classes & TP_CLASS_2 ) {
1412 unsigned eotoff = dp - fixed;
1416 fixed[0] = dp - fixed - 1;
1418 TPbuffer *bufp = GetBuffer();
1419 if ( bufp == 0 )
return;
1421 if ( bufp == 0 )
return;
1423 for ( ; uv->uv_base ; uv++ ) {
1424 const u_char *datap =
reinterpret_cast<const u_char *
>(uv->uv_base);
1425 unsigned dlen = uv->uv_len;
1427 while ( dlen > 0 ) {
1428 unsigned dcopy = dlen;
1430 if ( bufp->dlen + dcopy > maxtpdu )
1431 dcopy = maxtpdu - bufp->dlen;
1435 InternalError (DR_congestion,
"out of memory");
1451 if ( bufp == 0 )
return;
1453 if ( bufp == 0 )
return;
1459 bufp->data[bufp->doff+eotoff] |= EOT_FLAG;
1465 void Layer::makeED (
const u_char *data,
unsigned len)
1468 u_char *dp = fixed + 1;
1478 fixed[0] = dp - fixed - 1;
1480 TPbuffer *bufp = GetBuffer();
1481 if ( bufp == 0 )
return;
1486 static_cast<const u_char *
>(data),
1491 void Layer::makeER (
enum RejectCause cause,
1492 const u_char *tpdu,
unsigned len)
1495 u_char *dp = fixed + 1;
1505 if ( len > 250 ) len = 250;
1506 *dp++ = PARAM_invalid_tpdu;
1508 memcpy (dp, tpdu, len);
1512 fixed[0] = dp - fixed - 1;
1514 TPbuffer *bufp = GetBuffer();
1515 if ( bufp == 0 )
return;
1523 User_ptr_t notifier;
1528 virtual void Deliver () {
1538 !notifier.get()->ShouldNotify())
return;
1542 Event::Manager::GetManager()->Queue (nevent);
EVENTSVC_DLL void TSnotify(const User_ptr_t notifier)
Send a notification to the transport service used via the Event Manager.
#define TP_CLASS_0
Provides a Class 0 and Class 2 interface layer.
virtual void ConnectRequest(struct NSAPaddr &calling, struct NSAPaddr &called)=0
Connect networks.
virtual void DisconnectRequest(bool force=true)=0
Disconnect Network connection.
EVENTSVC_DLL void Deliver(ConnectRequest *req)
TCONreq.
EVENTSVC_DLL void NetworkRead(struct qbuf *qb)
Handle data from network.
EVENTSVC_DLL void GetSaveInfo(char *buffer, size_t buflen)
Get save information from layer.
@ WFCR
Wait for network Connect.
@ WFTRESP
Release in progress.
@ CLOSING
Transport connection is open.
@ OPEN
Wait before releasing.
EVENTSVC_DLL bool NetworkStatus(MSGstruct *msp)
Network status indication.
EVENTSVC_DLL bool SetSaveInfo(const char *buffer)
Set state from save info.
EVENTSVC_DLL void SendConnectIndication()
Send TS user a connect indication.
static TPbuffer * Add(TPbuffer *bufp, const u_char *bytes, unsigned len)
Add bytes to buffer.