lp 4646 src/decNumber/decNumber.c uLong *lp; // .. lp 4757 src/decNumber/decNumber.c for (lp=zacc; lp<zacc+iacc; lp++) *lp=0; lp 4778 src/decNumber/decNumber.c lp=zacc+(rip-zrhi); // where to add the lhs lp 4779 src/decNumber/decNumber.c for (lip=zlhi; lip<=lmsi; lip++, lp++) { // over each item in lhs lp 4780 src/decNumber/decNumber.c *lp+=(uLong)(*lip)*(*rip); // [this should in-line] lp 4786 src/decNumber/decNumber.c for (lp=zacc; lp<zacc+iacc; lp++) { lp 4787 src/decNumber/decNumber.c if (*lp<FASTBASE) continue; // it fits lp 4788 src/decNumber/decNumber.c lcarry=*lp/FASTBASE; // top part [slow divide] lp 4796 src/decNumber/decNumber.c *(lp+2)+=carry2; // add to item+2 lp 4797 src/decNumber/decNumber.c *lp-=((uLong)FASTBASE*FASTBASE*carry2); // [slow] lp 4800 src/decNumber/decNumber.c *(lp+1)+=carry; // add to item above [inline] lp 4801 src/decNumber/decNumber.c *lp-=((uLong)FASTBASE*carry); // [inline] lp 4811 src/decNumber/decNumber.c for (lp=zacc, up=acc; lp<zacc+iacc; lp++) { lp 4812 src/decNumber/decNumber.c uInt item=(uInt)*lp; // decapitate to uInt lp 1554 src/dps8/dps8_console.c uint lp = (uint)narrow_char; lp 1557 src/dps8/dps8_console.c if (lp == 060 /* + */ || lp == 075 /* = */) { // POLTS lp 1561 src/dps8/dps8_console.c if (lp == 0) lp 1562 src/dps8/dps8_console.c lp = 1; lp 1563 src/dps8/dps8_console.c if (lp >= 16) { lp 1567 src/dps8/dps8_console.c for (uint i = 0; i < lp; i ++) { lp 398 src/simh/sim_console.c TMLN *lp; lp 417 src/simh/sim_console.c lp = &sim_rem_con_tmxr.ldsc[i]; lp 418 src/simh/sim_console.c if (!lp->conn) lp 423 src/simh/sim_console.c tmxr_fconns (st, lp, i); lp 442 src/simh/sim_console.c TMLN *lp = &sim_rem_con_tmxr.ldsc[c]; lp 446 src/simh/sim_console.c lp->rcve = 1; /* rcv enabled */ lp 457 src/simh/sim_console.c tmxr_linemsgf (lp, "%s Remote Console\r\n" lp 464 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush buffered data */ lp 586 src/simh/sim_console.c static void _sim_rem_log_out (TMLN *lp) lp 597 src/simh/sim_console.c tmxr_linemsgf (lp, "%s", cbuf); lp 598 src/simh/sim_console.c if (!tmxr_input_pending_ln (lp)) { lp 600 src/simh/sim_console.c unwritten = tmxr_send_buffered_data (lp); lp 601 src/simh/sim_console.c if (unwritten == lp->txbsz) lp 603 src/simh/sim_console.c } while (unwritten == lp->txbsz); lp 644 src/simh/sim_console.c TMLN *lp; lp 657 src/simh/sim_console.c lp = &sim_rem_con_tmxr.ldsc[i]; lp 658 src/simh/sim_console.c if (!lp->conn) lp 661 src/simh/sim_console.c tmxr_linemsgf (lp, "\nMaster Mode Session\r\n"); lp 662 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 674 src/simh/sim_console.c _sim_rem_log_out (lp); lp 687 src/simh/sim_console.c tmxr_linemsgf (lpj, "\nRemote Master Console(%s) Entering Commands\n", lp->ipad); lp 690 src/simh/sim_console.c lp = &sim_rem_con_tmxr.ldsc[i]; lp 694 src/simh/sim_console.c c = tmxr_getc_ln (lp); lp 705 src/simh/sim_console.c _sim_rem_log_out (lp); lp 710 src/simh/sim_console.c tmxr_linemsgf (lpj, "\nRemote Console %lu(%s) Entering Commands\n", (unsigned long)i, lp->ipad); lp 713 src/simh/sim_console.c lp = &sim_rem_con_tmxr.ldsc[i]; lp 715 src/simh/sim_console.c tmxr_linemsg (lp, "\r\nSimulator paused.\r\n"); lp 717 src/simh/sim_console.c tmxr_linemsgf (lp, "Simulation will resume automatically if input is not received in %lu seconds\n", (unsigned long)sim_rem_read_timeouts[i]); lp 718 src/simh/sim_console.c tmxr_linemsgf (lp, "\r\n"); lp 719 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 728 src/simh/sim_console.c tmxr_linemsgf (lp, "\r\nGoodbye\r\n"); lp 729 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 730 src/simh/sim_console.c tmxr_reset_ln (lp); lp 736 src/simh/sim_console.c tmxr_linemsgf (lp, "\r\n%s", sim_prompt); lp 738 src/simh/sim_console.c tmxr_linemsgf (lp, "\r\n%s", sim_is_running ? "SIM> " : "sim> "); lp 740 src/simh/sim_console.c if (!tmxr_input_pending_ln (lp)) lp 741 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 753 src/simh/sim_console.c tmxr_linemsg (lp, "sim> "); lp 755 src/simh/sim_console.c tmxr_linemsg (lp, sim_prompt); lp 756 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 760 src/simh/sim_console.c c = tmxr_getc_ln (lp); lp 762 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 767 src/simh/sim_console.c tmxr_linemsg (lp, "\b \b"); lp 775 src/simh/sim_console.c tmxr_linemsgf (lp, "%s\n", sim_rem_buf[i]); lp 781 src/simh/sim_console.c if (!lp->conn) { /* if connection lost? */ lp 796 src/simh/sim_console.c tmxr_linemsg (lp, "\b \b"); lp 803 src/simh/sim_console.c tmxr_linemsg (lp, "\b \b"); lp 812 src/simh/sim_console.c tmxr_linemsg (lp, "\r\n"); lp 818 src/simh/sim_console.c sim_debug (DBG_RCV, &sim_remote_console, "Got Command (%lu bytes still in buffer): %s\n", (unsigned long)tmxr_input_pending_ln (lp), sim_rem_buf[i]); lp 824 src/simh/sim_console.c tmxr_linemsg (lp, "\b \b"); lp 833 src/simh/sim_console.c tmxr_linemsgf (lp, "%s\n", sim_rem_buf[i]); lp 839 src/simh/sim_console.c tmxr_putc_ln (lp, c); lp 851 src/simh/sim_console.c if ((!got_command) && (sim_rem_single_mode[i]) && (tmxr_input_pending_ln (lp))) { lp 852 src/simh/sim_console.c c = tmxr_getc_ln (lp); lp 856 src/simh/sim_console.c if (!tmxr_input_pending_ln (lp)) lp 857 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 861 src/simh/sim_console.c sim_printf ("Remote Console Command from %s> %s\r\n", lp->ipad, sim_rem_buf[i]); lp 865 src/simh/sim_console.c tmxr_linemsgf (lp, "\nLine too long. Ignored. Continuing Simulator execution\n"); lp 866 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* try to flush any buffered data */ lp 954 src/simh/sim_console.c _sim_rem_log_out (lp); lp 976 src/simh/sim_console.c tmxr_linemsg (lp, "Simulator Running..."); lp 977 src/simh/sim_console.c tmxr_send_buffered_data (lp); lp 994 src/simh/sim_console.c tmxr_linemsgf (lp, "%s", "sim> "); lp 996 src/simh/sim_console.c tmxr_linemsgf (lp, "%s", sim_prompt); lp 997 src/simh/sim_console.c tmxr_send_buffered_data (lp); lp 1009 src/simh/sim_console.c tmxr_linemsgf (lp, "\r\nGoodbye\r\n"); lp 1010 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 1011 src/simh/sim_console.c tmxr_reset_ln (lp); lp 1027 src/simh/sim_console.c lp = &sim_rem_con_tmxr.ldsc[0]; lp 1028 src/simh/sim_console.c tmxr_linemsgf (lp, "Non Master Mode Session..."); /* report transition */ lp 1029 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 249 src/simh/sim_tmxr.c static void tmxr_init_line (TMLN *lp) lp 251 src/simh/sim_tmxr.c lp->tsta = 0; /* init telnet state */ lp 252 src/simh/sim_tmxr.c lp->xmte = 1; /* enable transmit */ lp 253 src/simh/sim_tmxr.c lp->dstb = 0; /* default bin mode */ lp 254 src/simh/sim_tmxr.c lp->rxbpr = lp->rxbpi = lp->rxcnt = lp->rxpcnt = 0; /* init receive indexes */ lp 255 src/simh/sim_tmxr.c if (!lp->txbfd || lp->notelnet) /* if not buffered telnet */ lp 256 src/simh/sim_tmxr.c lp->txbpr = lp->txbpi = lp->txcnt = lp->txpcnt = 0; /* init transmit indexes */ lp 257 src/simh/sim_tmxr.c lp->txdrp = 0; lp 258 src/simh/sim_tmxr.c tmxr_set_get_modem_bits (lp, 0, 0, NULL); lp 259 src/simh/sim_tmxr.c if ((!lp->mp->buffered) && (!lp->txbfd)) { lp 260 src/simh/sim_tmxr.c lp->txbfd = 0; //-V1048 lp 261 src/simh/sim_tmxr.c lp->txbsz = TMXR_MAXBUF; lp 262 src/simh/sim_tmxr.c lp->txb = (char *)realloc (lp->txb, lp->txbsz); lp 263 src/simh/sim_tmxr.c if (!lp->txb) lp 275 src/simh/sim_tmxr.c lp->rxbsz = TMXR_MAXBUF; lp 276 src/simh/sim_tmxr.c lp->rxb = (char *)realloc(lp->rxb, lp->rxbsz); lp 277 src/simh/sim_tmxr.c if (!lp->rxb) lp 289 src/simh/sim_tmxr.c lp->rbr = (char *)realloc(lp->rbr, lp->rxbsz); lp 290 src/simh/sim_tmxr.c if (!lp->rbr) lp 303 src/simh/sim_tmxr.c if (lp->loopback) { lp 304 src/simh/sim_tmxr.c lp->lpbsz = lp->rxbsz; lp 305 src/simh/sim_tmxr.c lp->lpb = (char *)realloc(lp->lpb, lp->lpbsz); lp 306 src/simh/sim_tmxr.c if (!lp->lpb) lp 318 src/simh/sim_tmxr.c lp->lpbcnt = lp->lpbpi = lp->lpbpr = 0; lp 320 src/simh/sim_tmxr.c if (lp->rxpb) { lp 321 src/simh/sim_tmxr.c lp->rxpboffset = lp->rxpbsize = 0; lp 322 src/simh/sim_tmxr.c FREE (lp->rxpb); lp 323 src/simh/sim_tmxr.c lp->rxpb = NULL; lp 325 src/simh/sim_tmxr.c if (lp->txpb) { lp 326 src/simh/sim_tmxr.c lp->txpbsize = lp->txppsize = lp->txppoffset = 0; lp 327 src/simh/sim_tmxr.c FREE (lp->txpb); lp 328 src/simh/sim_tmxr.c lp->txpb = NULL; lp 330 src/simh/sim_tmxr.c memset (lp->rbr, 0, lp->rxbsz); /* clear break status array */ lp 347 src/simh/sim_tmxr.c static void tmxr_report_connection (TMXR *mp, TMLN *lp) lp 355 src/simh/sim_tmxr.c if ((!lp->notelnet) || (sim_switches & SWMASK ('V'))) { lp 363 src/simh/sim_tmxr.c sprintf (lmsg, ", line %d", (int)(lp-mp->ldsc));/* report the line number */ lp 370 src/simh/sim_tmxr.c lp->txbpi = 0; /* init buf pointers */ lp 371 src/simh/sim_tmxr.c lp->txbpr = (int32)(lp->txbsz - strlen (msgbuf)); lp 372 src/simh/sim_tmxr.c lp->rxcnt = lp->txcnt = lp->txdrp = 0; /* init counters */ lp 373 src/simh/sim_tmxr.c lp->rxpcnt = lp->txpcnt = 0; lp 376 src/simh/sim_tmxr.c if (lp->txcnt > lp->txbsz) lp 377 src/simh/sim_tmxr.c lp->txbpr = (lp->txbpi + 1) % lp->txbsz; lp 379 src/simh/sim_tmxr.c lp->txbpr = (int32)(lp->txbsz - strlen (msgbuf)); lp 381 src/simh/sim_tmxr.c psave = lp->txbpi; /* save insertion pointer */ lp 382 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr; /* insert connection message */ lp 383 src/simh/sim_tmxr.c tmxr_linemsg (lp, msgbuf); /* beginning of buffer */ lp 384 src/simh/sim_tmxr.c lp->txbpi = psave; /* restore insertion pointer */ lp 386 src/simh/sim_tmxr.c unwritten = tmxr_send_buffered_data (lp); /* send the message */ lp 389 src/simh/sim_tmxr.c lp->xmte = 1; /* reenable transmission if paused */ lp 391 src/simh/sim_tmxr.c lp->txcnt -= (int32)strlen (msgbuf); /* adjust statistics */ lp 405 src/simh/sim_tmxr.c static void tmxr_report_disconnection (TMLN *lp) lp 407 src/simh/sim_tmxr.c if (lp->notelnet) lp 409 src/simh/sim_tmxr.c tmxr_linemsgf (lp, "\r\nDisconnected from the %s simulator\r\n\n", sim_name);/* report disconnection */ lp 413 src/simh/sim_tmxr.c static int32 loop_write_ex (TMLN *lp, char *buf, int32 length, t_bool prefix_datagram) lp 416 src/simh/sim_tmxr.c int32 loopfree = lp->lpbsz - lp->lpbcnt; lp 418 src/simh/sim_tmxr.c if (lp->datagram && prefix_datagram) { lp 421 src/simh/sim_tmxr.c loop_write_ex (lp, (char *)&length, sizeof(length), FALSE); lp 426 src/simh/sim_tmxr.c loopfree = lp->lpbsz - lp->lpbcnt; lp 431 src/simh/sim_tmxr.c if (lp->lpbpi >= lp->lpbpr) lp 432 src/simh/sim_tmxr.c chunksize = lp->lpbsz - lp->lpbpi; lp 434 src/simh/sim_tmxr.c chunksize = lp->lpbpr - lp->lpbpi; lp 437 src/simh/sim_tmxr.c memcpy (&lp->lpb[lp->lpbpi], buf, chunksize); lp 441 src/simh/sim_tmxr.c lp->lpbpi = (lp->lpbpi + chunksize) % lp->lpbsz; lp 443 src/simh/sim_tmxr.c lp->lpbcnt += written; lp 447 src/simh/sim_tmxr.c static int32 loop_write (TMLN *lp, char *buf, int32 length) lp 449 src/simh/sim_tmxr.c return loop_write_ex (lp, buf, length, TRUE); lp 452 src/simh/sim_tmxr.c static int32 loop_read_ex (TMLN *lp, char *buf, int32 bufsize) lp 458 src/simh/sim_tmxr.c int32 loopused = lp->lpbcnt; lp 464 src/simh/sim_tmxr.c if (lp->lpbpi > lp->lpbpr) lp 465 src/simh/sim_tmxr.c chunksize = lp->lpbpi - lp->lpbpr; lp 467 src/simh/sim_tmxr.c chunksize = lp->lpbsz - lp->lpbpr; lp 470 src/simh/sim_tmxr.c memcpy (buf, &lp->lpb[lp->lpbpr], chunksize); lp 474 src/simh/sim_tmxr.c lp->lpbpr = (lp->lpbpr + chunksize) % lp->lpbsz; lp 476 src/simh/sim_tmxr.c lp->lpbcnt -= bytesread; lp 480 src/simh/sim_tmxr.c static int32 loop_read (TMLN *lp, char *buf, int32 bufsize) lp 482 src/simh/sim_tmxr.c if (lp->datagram) { lp 485 src/simh/sim_tmxr.c if (lp->lpbcnt < (int32)sizeof(pktsize)) lp 487 src/simh/sim_tmxr.c if ((sizeof(pktsize) != loop_read_ex (lp, (char *)&pktsize, sizeof(pktsize))) || lp 492 src/simh/sim_tmxr.c return loop_read_ex (lp, buf, bufsize); lp 503 src/simh/sim_tmxr.c static int32 tmxr_read (TMLN *lp, int32 length) lp 505 src/simh/sim_tmxr.c int32 i = lp->rxbpi; lp 507 src/simh/sim_tmxr.c if (lp->loopback) lp 508 src/simh/sim_tmxr.c return loop_read (lp, &(lp->rxb[i]), length); lp 510 src/simh/sim_tmxr.c return sim_read_sock (lp->sock, &(lp->rxb[i]), length); lp 520 src/simh/sim_tmxr.c static int32 tmxr_write (TMLN *lp, int32 length) lp 523 src/simh/sim_tmxr.c int32 i = lp->txbpr; lp 525 src/simh/sim_tmxr.c if (lp->loopback) lp 526 src/simh/sim_tmxr.c return loop_write (lp, &(lp->txb[i]), length); lp 528 src/simh/sim_tmxr.c written = sim_write_sock (lp->sock, &(lp->txb[i]), length); lp 531 src/simh/sim_tmxr.c if (lp->datagram) lp 546 src/simh/sim_tmxr.c static void tmxr_rmvrc (TMLN *lp, int32 p) lp 548 src/simh/sim_tmxr.c for ( ; p < lp->rxbpi; p++) { /* work from "p" through end of buffer */ lp 549 src/simh/sim_tmxr.c lp->rxb[p] = lp->rxb[p + 1]; /* slide following character down */ lp 550 src/simh/sim_tmxr.c lp->rbr[p] = lp->rbr[p + 1]; /* adjust break status too */ lp 553 src/simh/sim_tmxr.c lp->rbr[p] = 0; /* clear potential break from vacated slot */ lp 554 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpi - 1; /* drop buffer insert index */ lp 607 src/simh/sim_tmxr.c TMLN *lp = NULL; lp 614 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, mp->lines, mp); /* determine line from unit */ lp 616 src/simh/sim_tmxr.c if (lp == NULL) /* invalid line number? */ lp 627 src/simh/sim_tmxr.c lp = mp->ldsc + (int32) ln; /* use as index to determine line */ lp 633 src/simh/sim_tmxr.c return lp; /* return pointer to line descriptor */ lp 680 src/simh/sim_tmxr.c TMLN *lp; lp 695 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 697 src/simh/sim_tmxr.c lptr = tmxr_line_attach_string(lp); lp 728 src/simh/sim_tmxr.c char *tmxr_line_attach_string(TMLN *lp) lp 736 src/simh/sim_tmxr.c if (lp->destination || lp->port || lp->txlogname) { lp 737 src/simh/sim_tmxr.c if ((lp->mp->lines > 1) || (lp->port)) lp 738 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 32), "Line=%d", (int)(lp-lp->mp->ldsc)); lp 739 src/simh/sim_tmxr.c if (lp->modem_control != lp->mp->modem_control) lp 740 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 32), ",%s", lp->modem_control ? "Modem" : "NoModem"); lp 741 src/simh/sim_tmxr.c if (lp->txbfd && (lp->txbsz != lp->mp->buffered)) lp 742 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 32), ",Buffered=%d", lp->txbsz); lp 743 src/simh/sim_tmxr.c if (!lp->txbfd && (lp->mp->buffered > 0)) lp 745 src/simh/sim_tmxr.c if (lp->mp->datagram != lp->datagram) lp 746 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 8), ",%s", lp->datagram ? "UDP" : "TCP"); lp 747 src/simh/sim_tmxr.c if (lp->mp->packet != lp->packet) lp 749 src/simh/sim_tmxr.c if (lp->port) lp 750 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 32 + strlen (lp->port)), ",%s%s", lp->port, ((lp->mp->notelnet != lp->notelnet) && (!lp->datagram)) ? (lp->notelnet ? ";notelnet" : ";telnet") : ""); lp 751 src/simh/sim_tmxr.c if (lp->destination) { lp 752 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 25 + strlen (lp->destination)), ",Connect=%s%s", lp->destination, ((lp->mp->notelnet != lp->notelnet) && (!lp->datagram)) ? (lp->notelnet ? ";notelnet" : ";telnet") : ""); lp 754 src/simh/sim_tmxr.c if (lp->txlogname) lp 755 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 12 + strlen (lp->txlogname)), ",Log=%s", lp->txlogname); lp 756 src/simh/sim_tmxr.c if (lp->loopback) lp 802 src/simh/sim_tmxr.c TMLN *lp = NULL; lp 814 src/simh/sim_tmxr.c (void)lp; lp 943 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get pointer to line descriptor */ lp 944 src/simh/sim_tmxr.c if ((lp->conn == FALSE) && /* is the line available? */ lp 945 src/simh/sim_tmxr.c (lp->destination == NULL) && lp 946 src/simh/sim_tmxr.c (lp->master == 0) && lp 947 src/simh/sim_tmxr.c (lp->ser_connect_pending == FALSE) && lp 948 src/simh/sim_tmxr.c (lp->modem_control ? ((lp->modembits & TMXR_MDM_DTR) != 0) : TRUE)) lp 956 src/simh/sim_tmxr.c lp = mp->ldsc + j; /* get pointer to line descriptor */ lp 957 src/simh/sim_tmxr.c if ((lp->conn == FALSE) && /* is the line available? */ lp 958 src/simh/sim_tmxr.c (lp->destination == NULL) && lp 959 src/simh/sim_tmxr.c (lp->master == 0) && lp 960 src/simh/sim_tmxr.c (lp->ser_connect_pending == FALSE) && lp 961 src/simh/sim_tmxr.c ((lp->modembits & TMXR_MDM_DTR) == 0)) { lp 963 src/simh/sim_tmxr.c tmxr_set_get_modem_bits (lp, TMXR_MDM_RNG, 0, NULL); lp 981 src/simh/sim_tmxr.c for (ln = 0; ln < lp->mp->lines; ln++) { lp 982 src/simh/sim_tmxr.c TMLN *tlp = lp->mp->ldsc + ln; lp 1001 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 1002 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 1003 src/simh/sim_tmxr.c lp->sock = newsock; /* save socket */ lp 1004 src/simh/sim_tmxr.c lp->ipad = address; /* ip address */ lp 1005 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init line */ lp 1006 src/simh/sim_tmxr.c lp->notelnet = mp->notelnet; /* apply mux default telnet setting */ lp 1007 src/simh/sim_tmxr.c if (!lp->notelnet) { lp 1009 src/simh/sim_tmxr.c lp->telnet_sent_opts = (uint8 *)realloc (lp->telnet_sent_opts, 256); lp 1010 src/simh/sim_tmxr.c if (!lp->telnet_sent_opts) lp 1022 src/simh/sim_tmxr.c memset (lp->telnet_sent_opts, 0, 256); lp 1024 src/simh/sim_tmxr.c tmxr_report_connection (mp, lp); lp 1025 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); /* time of connection */ lp 1034 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get pointer to line descriptor */ lp 1036 src/simh/sim_tmxr.c if (lp->ser_connect_pending) { lp 1037 src/simh/sim_tmxr.c lp->ser_connect_pending = FALSE; lp 1038 src/simh/sim_tmxr.c lp->conn = TRUE; lp 1044 src/simh/sim_tmxr.c if (lp->loopback) lp 1059 src/simh/sim_tmxr.c if (lp->connecting) { /* connecting? */ lp 1062 src/simh/sim_tmxr.c switch (sim_check_conn(lp->connecting, FALSE)) lp 1065 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 1066 src/simh/sim_tmxr.c lp->sock = lp->connecting; /* it now looks normal */ lp 1067 src/simh/sim_tmxr.c lp->connecting = 0; lp 1069 src/simh/sim_tmxr.c if (lp->destination != NULL) lp 1070 src/simh/sim_tmxr.c lpdlen = 1+strlen (lp->destination); lp 1071 src/simh/sim_tmxr.c lp->ipad = (char *)realloc (lp->ipad, lpdlen); lp 1072 src/simh/sim_tmxr.c if (!lp->ipad) lp 1084 src/simh/sim_tmxr.c if (lp->destination != NULL) lp 1085 src/simh/sim_tmxr.c (void)strcpy (lp->ipad, lp->destination); lp 1086 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); lp 1087 src/simh/sim_tmxr.c sim_getnames_sock (lp->sock, &sockname, &peername); lp 1088 src/simh/sim_tmxr.c if (lp->destination) lp 1089 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_poll_conn() - Outgoing Line Connection to %s (%s->%s) established", lp->destination, sockname, peername); lp 1094 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_poll_conn() - Outgoing Line Connection to %s failed", lp->destination); lp 1095 src/simh/sim_tmxr.c tmxr_reset_ln (lp); /* retry */ lp 1101 src/simh/sim_tmxr.c if (lp->master) { /* Check for a pending Telnet/tcp connection */ lp 1102 src/simh/sim_tmxr.c while (INVALID_SOCKET != (newsock = sim_accept_conn_ex (lp->master, &address, (lp->packet ? SIM_SOCK_OPT_NODELAY : 0)))) {/* got a live one? */ lp 1111 src/simh/sim_tmxr.c if (lp->destination) { /* Virtual Null Modem Cable? */ lp 1114 src/simh/sim_tmxr.c if (sim_parse_addr (lp->destination, host, sizeof(host), NULL, NULL, 0, NULL, address)) { lp 1121 src/simh/sim_tmxr.c if (lp->connecting) { lp 1122 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_poll_conn() - aborting outgoing line connection attempt to: %s", lp->destination); lp 1123 src/simh/sim_tmxr.c sim_close_sock (lp->connecting); /* abort our as yet unconnnected socket */ lp 1124 src/simh/sim_tmxr.c lp->connecting = 0; lp 1127 src/simh/sim_tmxr.c if (lp->conn == FALSE) { /* is the line available? */ lp 1128 src/simh/sim_tmxr.c if ((!lp->modem_control) || (lp->modembits & TMXR_MDM_DTR)) { lp 1129 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 1130 src/simh/sim_tmxr.c lp->sock = newsock; /* save socket */ lp 1131 src/simh/sim_tmxr.c lp->ipad = address; /* ip address */ lp 1132 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init line */ lp 1133 src/simh/sim_tmxr.c if (!lp->notelnet) { lp 1135 src/simh/sim_tmxr.c lp->telnet_sent_opts = (uint8 *)realloc (lp->telnet_sent_opts, 256); lp 1136 src/simh/sim_tmxr.c if (!lp->telnet_sent_opts) lp 1148 src/simh/sim_tmxr.c memset (lp->telnet_sent_opts, 0, 256); lp 1150 src/simh/sim_tmxr.c tmxr_report_connection (mp, lp); lp 1151 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); /* time of connection */ lp 1172 src/simh/sim_tmxr.c if (lp->destination && (!lp->sock) && (!lp->connecting) && lp 1173 src/simh/sim_tmxr.c (!lp->modem_control || (lp->modembits & TMXR_MDM_DTR))) { lp 1174 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_poll_conn() - establishing outgoing connection to: %s", lp->destination); lp 1175 src/simh/sim_tmxr.c lp->connecting = sim_connect_sock_ex (lp->datagram ? lp->port : NULL, lp->destination, "localhost", NULL, (lp->datagram ? SIM_SOCK_OPT_DATAGRAM : 0) | lp 1176 src/simh/sim_tmxr.c (lp->mp->packet ? SIM_SOCK_OPT_NODELAY : 0) | lp 1187 src/simh/sim_tmxr.c static t_stat tmxr_reset_ln_ex (TMLN *lp, t_bool closeserial) lp 1191 src/simh/sim_tmxr.c if (lp->txlog) lp 1192 src/simh/sim_tmxr.c fflush (lp->txlog); /* flush log */ lp 1194 src/simh/sim_tmxr.c tmxr_send_buffered_data (lp); /* send any buffered data */ lp 1198 src/simh/sim_tmxr.c if (lp->sock) { lp 1199 src/simh/sim_tmxr.c sim_close_sock (lp->sock); /* close socket */ lp 1200 src/simh/sim_tmxr.c FREE (lp->telnet_sent_opts); lp 1201 src/simh/sim_tmxr.c lp->telnet_sent_opts = NULL; lp 1202 src/simh/sim_tmxr.c lp->sock = 0; lp 1203 src/simh/sim_tmxr.c lp->conn = FALSE; lp 1204 src/simh/sim_tmxr.c lp->cnms = 0; lp 1205 src/simh/sim_tmxr.c lp->xmte = 1; lp 1207 src/simh/sim_tmxr.c FREE(lp->ipad); lp 1208 src/simh/sim_tmxr.c lp->ipad = NULL; lp 1209 src/simh/sim_tmxr.c if ((lp->destination) lp 1211 src/simh/sim_tmxr.c if (lp->connecting) { lp 1212 src/simh/sim_tmxr.c sim_close_sock (lp->connecting); lp 1213 src/simh/sim_tmxr.c lp->connecting = 0; lp 1215 src/simh/sim_tmxr.c if ((!lp->modem_control) || (lp->modembits & TMXR_MDM_DTR)) { lp 1216 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_reset_ln_ex() - connecting to %s", lp->destination); lp 1217 src/simh/sim_tmxr.c lp->connecting = sim_connect_sock_ex (lp->datagram ? lp->port : NULL, lp->destination, "localhost", NULL, (lp->datagram ? SIM_SOCK_OPT_DATAGRAM : 0) | lp 1218 src/simh/sim_tmxr.c (lp->packet ? SIM_SOCK_OPT_NODELAY : 0) | lp 1222 src/simh/sim_tmxr.c tmxr_init_line (lp); /* initialize line state */ lp 1226 src/simh/sim_tmxr.c t_stat tmxr_close_ln (TMLN *lp) lp 1228 src/simh/sim_tmxr.c return tmxr_reset_ln_ex (lp, TRUE); lp 1231 src/simh/sim_tmxr.c t_stat tmxr_reset_ln (TMLN *lp) lp 1233 src/simh/sim_tmxr.c return tmxr_reset_ln_ex (lp, FALSE); lp 1248 src/simh/sim_tmxr.c t_stat tmxr_set_get_modem_bits (TMLN *lp, int32 bits_to_set, int32 bits_to_clear, int32 *incoming_bits) lp 1257 src/simh/sim_tmxr.c before_modem_bits = lp->modembits; lp 1258 src/simh/sim_tmxr.c lp->modembits |= bits_to_set; lp 1259 src/simh/sim_tmxr.c lp->modembits &= ~(bits_to_clear | TMXR_MDM_INCOMING); lp 1260 src/simh/sim_tmxr.c if ((lp->sock) lp 1261 src/simh/sim_tmxr.c || (lp->loopback)) { lp 1262 src/simh/sim_tmxr.c if (lp->modembits & TMXR_MDM_DTR) { lp 1264 src/simh/sim_tmxr.c if (lp->modembits & TMXR_MDM_RTS) lp 1266 src/simh/sim_tmxr.c if (lp->halfduplex) { lp 1274 src/simh/sim_tmxr.c incoming_state = TMXR_MDM_DCD | TMXR_MDM_DSR | ((lp->modembits & TMXR_MDM_DTR) ? 0 : TMXR_MDM_RNG); lp 1278 src/simh/sim_tmxr.c ((lp->modembits & TMXR_MDM_DTR) != 0) && lp 1279 src/simh/sim_tmxr.c (lp->conn == FALSE) && /* Not connected */ lp 1280 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_RNG)) { /* and Ring Signal Present */ lp 1281 src/simh/sim_tmxr.c if ((lp->destination == NULL) && lp 1282 src/simh/sim_tmxr.c (lp->master == 0) && lp 1283 src/simh/sim_tmxr.c (lp->mp && (lp->mp->ring_sock))) { lp 1286 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 1287 src/simh/sim_tmxr.c lp->sock = lp->mp->ring_sock; /* save socket */ lp 1288 src/simh/sim_tmxr.c lp->mp->ring_sock = INVALID_SOCKET; lp 1289 src/simh/sim_tmxr.c lp->ipad = lp->mp->ring_ipad; /* ip address */ lp 1290 src/simh/sim_tmxr.c lp->mp->ring_ipad = NULL; lp 1291 src/simh/sim_tmxr.c lp->mp->ring_start_time = 0; lp 1292 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init line */ lp 1293 src/simh/sim_tmxr.c lp->notelnet = lp->mp->notelnet; /* apply mux default telnet setting */ lp 1294 src/simh/sim_tmxr.c if (!lp->notelnet) { lp 1295 src/simh/sim_tmxr.c sim_write_sock (lp->sock, (char *)mantra, sizeof(mantra)); lp 1296 src/simh/sim_tmxr.c lp->telnet_sent_opts = (uint8 *)realloc (lp->telnet_sent_opts, 256); lp 1297 src/simh/sim_tmxr.c if (!lp->telnet_sent_opts) lp 1309 src/simh/sim_tmxr.c memset (lp->telnet_sent_opts, 0, 256); lp 1311 src/simh/sim_tmxr.c tmxr_report_connection (lp->mp, lp); lp 1312 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); /* time of connection */ lp 1313 src/simh/sim_tmxr.c lp->modembits &= ~TMXR_MDM_RNG; /* turn off ring on this line*/ lp 1315 src/simh/sim_tmxr.c for (ln = 0; ln < lp->mp->lines; ln++) { lp 1316 src/simh/sim_tmxr.c TMLN *tlp = lp->mp->ldsc + ln; lp 1323 src/simh/sim_tmxr.c if ((lp->master) || (lp->mp && lp->mp->master) || lp 1324 src/simh/sim_tmxr.c (lp->port && lp->destination)) lp 1329 src/simh/sim_tmxr.c lp->modembits |= incoming_state; lp 1330 src/simh/sim_tmxr.c dptr = (lp->dptr ? lp->dptr : (lp->mp ? lp->mp->dptr : NULL)); lp 1331 src/simh/sim_tmxr.c if ((lp->modembits != before_modem_bits) && (sim_deb && lp->mp && dptr)) { lp 1332 src/simh/sim_tmxr.c sim_debug_bits (TMXR_DBG_MDM, dptr, tmxr_modem_bits, before_modem_bits, lp->modembits, FALSE); lp 1333 src/simh/sim_tmxr.c sim_debug (TMXR_DBG_MDM, dptr, " - Line %d - %p\n", (int)(lp-lp->mp->ldsc), lp->txb); lp 1336 src/simh/sim_tmxr.c *incoming_bits = lp->modembits; lp 1337 src/simh/sim_tmxr.c if (lp->mp && lp->modem_control) { /* This API ONLY works on modem_control enabled multiplexer lines */ lp 1339 src/simh/sim_tmxr.c if (lp->loopback) { lp 1340 src/simh/sim_tmxr.c if ((lp->modembits ^ before_modem_bits) & TMXR_MDM_DTR) { /* DTR changed? */ lp 1341 src/simh/sim_tmxr.c lp->ser_connect_pending = (lp->modembits & TMXR_MDM_DTR); lp 1342 src/simh/sim_tmxr.c lp->conn = !(lp->modembits & TMXR_MDM_DTR); lp 1346 src/simh/sim_tmxr.c if ((lp->sock) || (lp->connecting)) { lp 1348 src/simh/sim_tmxr.c if (lp->sock) lp 1349 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report closure */ lp 1350 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 1354 src/simh/sim_tmxr.c if ((lp->destination) && /* Virtual Null Modem Cable */ lp 1359 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_set_get_modem_bits() - establishing outgoing connection to: %s", lp->destination); lp 1360 src/simh/sim_tmxr.c lp->connecting = sim_connect_sock_ex (lp->datagram ? lp->port : NULL, lp->destination, "localhost", NULL, (lp->datagram ? SIM_SOCK_OPT_DATAGRAM : 0) | lp 1361 src/simh/sim_tmxr.c (lp->packet ? SIM_SOCK_OPT_NODELAY : 0) | lp 1368 src/simh/sim_tmxr.c if ((lp->sock) || (lp->connecting)) { lp 1370 src/simh/sim_tmxr.c if (lp->sock) lp 1371 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report closure */ lp 1372 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 1387 src/simh/sim_tmxr.c t_stat tmxr_set_line_loopback (TMLN *lp, t_bool enable_loopback) lp 1389 src/simh/sim_tmxr.c if (lp->loopback == (enable_loopback != FALSE)) lp 1391 src/simh/sim_tmxr.c lp->loopback = (enable_loopback != FALSE); lp 1392 src/simh/sim_tmxr.c if (lp->loopback) { lp 1393 src/simh/sim_tmxr.c lp->lpbsz = lp->rxbsz; lp 1394 src/simh/sim_tmxr.c lp->lpb = (char *)realloc(lp->lpb, lp->lpbsz); lp 1395 src/simh/sim_tmxr.c if (!lp->lpb) lp 1407 src/simh/sim_tmxr.c lp->lpbcnt = lp->lpbpi = lp->lpbpr = 0; lp 1408 src/simh/sim_tmxr.c if (!lp->conn) lp 1409 src/simh/sim_tmxr.c lp->ser_connect_pending = TRUE; lp 1412 src/simh/sim_tmxr.c FREE (lp->lpb); lp 1413 src/simh/sim_tmxr.c lp->lpb = NULL; lp 1414 src/simh/sim_tmxr.c lp->lpbsz = 0; lp 1419 src/simh/sim_tmxr.c t_bool tmxr_get_line_loopback (TMLN *lp) lp 1421 src/simh/sim_tmxr.c return (lp->loopback != FALSE); lp 1438 src/simh/sim_tmxr.c t_stat tmxr_set_line_halfduplex (TMLN *lp, t_bool enable_halfduplex) lp 1440 src/simh/sim_tmxr.c if (lp->halfduplex == (enable_halfduplex != FALSE)) lp 1442 src/simh/sim_tmxr.c lp->halfduplex = (enable_halfduplex != FALSE); lp 1446 src/simh/sim_tmxr.c t_bool tmxr_get_line_halfduplex (TMLN *lp) lp 1448 src/simh/sim_tmxr.c return (lp->halfduplex != FALSE); lp 1465 src/simh/sim_tmxr.c int32 tmxr_input_pending_ln (TMLN *lp) lp 1467 src/simh/sim_tmxr.c return (lp->rxbpi - lp->rxbpr); lp 1470 src/simh/sim_tmxr.c int32 tmxr_getc_ln (TMLN *lp) lp 1476 src/simh/sim_tmxr.c if ((lp->conn && lp->rcve) && /* conn & enb & */ lp 1477 src/simh/sim_tmxr.c ((!lp->rxbps) || /* (!rate limited || enough time passed)? */ lp 1478 src/simh/sim_tmxr.c (sim_gtime () >= lp->rxnexttime))) { lp 1479 src/simh/sim_tmxr.c if (!sim_send_poll_data (&lp->send, &val)) { /* injected input characters available? */ lp 1480 src/simh/sim_tmxr.c j = lp->rxbpi - lp->rxbpr; /* # input chrs */ lp 1482 src/simh/sim_tmxr.c tmp = lp->rxb[lp->rxbpr]; /* get char */ lp 1484 src/simh/sim_tmxr.c if (lp->rbr[lp->rxbpr]) { /* break? */ lp 1485 src/simh/sim_tmxr.c lp->rbr[lp->rxbpr] = 0; /* clear status */ lp 1488 src/simh/sim_tmxr.c lp->rxbpr = lp->rxbpr + 1; /* adv pointer */ lp 1492 src/simh/sim_tmxr.c if (lp->rxbpi == lp->rxbpr) /* empty? zero ptrs */ lp 1493 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpr = 0; lp 1494 src/simh/sim_tmxr.c if (lp->rxbps) { lp 1496 src/simh/sim_tmxr.c lp->rxnexttime = floor (sim_gtime () + ((lp->rxdelta * sim_timer_inst_per_sec ())/lp->rxbpsfactor)); lp 1520 src/simh/sim_tmxr.c t_stat tmxr_get_packet_ln (TMLN *lp, const uint8 **pbuf, size_t *psize) lp 1522 src/simh/sim_tmxr.c return tmxr_get_packet_ln_ex (lp, pbuf, psize, 0); lp 1525 src/simh/sim_tmxr.c t_stat tmxr_get_packet_ln_ex (TMLN *lp, const uint8 **pbuf, size_t *psize, uint8 frame_byte) lp 1531 src/simh/sim_tmxr.c while (TMXR_VALID & (c = tmxr_getc_ln (lp))) { lp 1532 src/simh/sim_tmxr.c if (lp->rxpboffset + 3 > lp->rxpbsize) { lp 1533 src/simh/sim_tmxr.c lp->rxpbsize += 512; lp 1534 src/simh/sim_tmxr.c lp->rxpb = (uint8 *)realloc (lp->rxpb, lp->rxpbsize); lp 1535 src/simh/sim_tmxr.c if (!lp->rxpb) lp 1548 src/simh/sim_tmxr.c if ((lp->rxpboffset == 0) && (fc_size) && (c != frame_byte)) { lp 1551 src/simh/sim_tmxr.c if ((lp->datagram) && (lp->rxpboffset == fc_size)) { lp 1556 src/simh/sim_tmxr.c lp->rxpb[lp->rxpboffset++] = (uint8)(((1 + lp->rxbpi - lp->rxbpr) >> 8) & 0xFF); lp 1557 src/simh/sim_tmxr.c lp->rxpb[lp->rxpboffset++] = (uint8)((1 + lp->rxbpi - lp->rxbpr) & 0xFF); lp 1559 src/simh/sim_tmxr.c lp->rxpb[lp->rxpboffset++] = c & 0xFF; lp 1560 src/simh/sim_tmxr.c if (lp->rxpboffset >= (2 + fc_size)) { lp 1561 src/simh/sim_tmxr.c pktsize = (lp->rxpb[0+fc_size] << 8) | lp->rxpb[1+fc_size]; lp 1562 src/simh/sim_tmxr.c if (pktsize == (lp->rxpboffset - 2)) { lp 1563 src/simh/sim_tmxr.c ++lp->rxpcnt; lp 1564 src/simh/sim_tmxr.c *pbuf = &lp->rxpb[2+fc_size]; lp 1566 src/simh/sim_tmxr.c lp->rxpboffset = 0; lp 1573 src/simh/sim_tmxr.c if (lp->conn) lp 1588 src/simh/sim_tmxr.c TMLN *lp; lp 1591 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 1592 src/simh/sim_tmxr.c if (!(lp->sock lp 1593 src/simh/sim_tmxr.c || lp->loopback) || lp 1594 src/simh/sim_tmxr.c !(lp->rcve)) /* skip if not connected */ lp 1598 src/simh/sim_tmxr.c if (lp->rxbpi == 0) /* need input? */ lp 1599 src/simh/sim_tmxr.c nbytes = tmxr_read (lp, /* yes, read */ lp 1600 src/simh/sim_tmxr.c lp->rxbsz - TMXR_GUARD); /* leave spc for Telnet cruft */ lp 1601 src/simh/sim_tmxr.c else if (lp->tsta) /* in Telnet seq? */ lp 1602 src/simh/sim_tmxr.c nbytes = tmxr_read (lp, /* yes, read to end */ lp 1603 src/simh/sim_tmxr.c lp->rxbsz - lp->rxbpi); lp 1606 src/simh/sim_tmxr.c if (!lp->datagram) { /* ignore errors reading UDP sockets */ lp 1607 src/simh/sim_tmxr.c if (!lp->txbfd || lp->notelnet) lp 1608 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; /* Drop the data we already know we can't send */ lp 1609 src/simh/sim_tmxr.c tmxr_close_ln (lp); /* disconnect line */ lp 1615 src/simh/sim_tmxr.c j = lp->rxbpi; /* start of data */ lp 1616 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpi + nbytes; /* adv pointers */ lp 1617 src/simh/sim_tmxr.c lp->rxcnt = lp->rxcnt + nbytes; lp 1621 src/simh/sim_tmxr.c if (!lp->notelnet) { /* Are we looking for telnet interpretation? */ lp 1622 src/simh/sim_tmxr.c for (; j < lp->rxbpi; ) { /* loop thru char */ lp 1623 src/simh/sim_tmxr.c u_char tmp = (u_char)lp->rxb[j]; /* get char */ lp 1624 src/simh/sim_tmxr.c switch (lp->tsta) { /* case tlnt state */ lp 1628 src/simh/sim_tmxr.c lp->tsta = TNS_IAC; /* change state */ lp 1629 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove char */ lp 1632 src/simh/sim_tmxr.c if ((tmp == TN_CR) && lp->dstb) /* CR, no bin */ lp 1633 src/simh/sim_tmxr.c lp->tsta = TNS_CRPAD; /* skip pad char */ lp 1639 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* treat as normal */ lp 1644 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* treat as normal */ lp 1645 src/simh/sim_tmxr.c lp->rxb[j] = 0; /* char is null */ lp 1646 src/simh/sim_tmxr.c lp->rbr[j] = 1; /* flag break */ lp 1652 src/simh/sim_tmxr.c lp->tsta = TNS_WILL; lp 1655 src/simh/sim_tmxr.c lp->tsta = TNS_WONT; lp 1658 src/simh/sim_tmxr.c lp->tsta = TNS_DO; lp 1661 src/simh/sim_tmxr.c lp->tsta = TNS_SKIP; /* IAC + other */ lp 1667 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; //-V1037 /* ignore */ lp 1672 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; //-V1037 /* ignore */ lp 1675 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove char */ lp 1713 src/simh/sim_tmxr.c if (0 == (lp->telnet_sent_opts[tmp] & TNOS_DONT)) { lp 1714 src/simh/sim_tmxr.c lp->notelnet = TRUE; /* Temporarily disable so */ lp 1715 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_IAC); /* IAC gets injected bare */ lp 1716 src/simh/sim_tmxr.c lp->notelnet = FALSE; lp 1717 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_DONT); lp 1718 src/simh/sim_tmxr.c tmxr_putc_ln (lp, tmp); lp 1719 src/simh/sim_tmxr.c lp->telnet_sent_opts[tmp] |= TNOS_DONT;/* Record DONT sent */ lp 1725 src/simh/sim_tmxr.c if (lp->tsta == TNS_WILL) { lp 1726 src/simh/sim_tmxr.c lp->dstb = 0; lp 1729 src/simh/sim_tmxr.c lp->dstb = 1; lp 1732 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove it */ lp 1733 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* next normal */ lp 1751 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* next normal */ lp 1754 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove it */ lp 1792 src/simh/sim_tmxr.c if (0 == (lp->telnet_sent_opts[tmp] & TNOS_WONT)) { lp 1793 src/simh/sim_tmxr.c lp->notelnet = TRUE; /* Temporarily disable so */ lp 1794 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_IAC); /* IAC gets injected bare */ lp 1795 src/simh/sim_tmxr.c lp->notelnet = FALSE; lp 1796 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_WONT); lp 1797 src/simh/sim_tmxr.c tmxr_putc_ln (lp, tmp); lp 1798 src/simh/sim_tmxr.c lp->telnet_sent_opts[tmp] |= TNOS_WONT;/* Record WONT sent */ lp 1803 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove char */ lp 1804 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* next normal */ lp 1812 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 1813 src/simh/sim_tmxr.c if (lp->rxbpi == lp->rxbpr) /* if buf empty, */ lp 1814 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpr = 0; /* reset pointers */ lp 1821 src/simh/sim_tmxr.c int32 tmxr_rqln_bare (const TMLN *lp, t_bool speed) lp 1823 src/simh/sim_tmxr.c if ((speed) && (lp->rxbps)) { /* consider speed and rate limiting? */ lp 1824 src/simh/sim_tmxr.c if (sim_gtime () < lp->rxnexttime) /* too soon? */ lp 1827 src/simh/sim_tmxr.c return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz : 0)) ? 1 : 0; lp 1829 src/simh/sim_tmxr.c return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz: 0)); lp 1832 src/simh/sim_tmxr.c int32 tmxr_rqln (const TMLN *lp) lp 1834 src/simh/sim_tmxr.c return tmxr_rqln_bare (lp, TRUE); lp 1850 src/simh/sim_tmxr.c t_stat tmxr_putc_ln (TMLN *lp, int32 chr) lp 1852 src/simh/sim_tmxr.c if ((lp->conn == FALSE) && /* no conn & not buffered telnet? */ lp 1853 src/simh/sim_tmxr.c (!lp->txbfd || lp->notelnet)) { lp 1854 src/simh/sim_tmxr.c ++lp->txdrp; /* lost */ lp 1858 src/simh/sim_tmxr.c #define TXBUF_AVAIL(lp) (lp->txbsz - tmxr_tqln (lp)) lp 1860 src/simh/sim_tmxr.c #define TXBUF_CHAR(lp, c) { \ lp 1861 src/simh/sim_tmxr.c lp->txb[lp->txbpi++] = (char)(c); \ lp 1862 src/simh/sim_tmxr.c lp->txbpi %= lp->txbsz; \ lp 1863 src/simh/sim_tmxr.c if (lp->txbpi == lp->txbpr) \ lp 1864 src/simh/sim_tmxr.c lp->txbpr = (1+lp->txbpr)%lp->txbsz, ++lp->txdrp; \ lp 1867 src/simh/sim_tmxr.c if ((lp->txbfd && !lp->notelnet) || (TXBUF_AVAIL(lp) > 1)) {/* room for char (+ IAC)? */ lp 1868 src/simh/sim_tmxr.c if ((TN_IAC == (u_char) chr) && (!lp->notelnet)) /* char == IAC in telnet session? */ lp 1869 src/simh/sim_tmxr.c TXBUF_CHAR (lp, TN_IAC); /* stuff extra IAC char */ lp 1870 src/simh/sim_tmxr.c TXBUF_CHAR (lp, chr); /* buffer char & adv pointer */ lp 1871 src/simh/sim_tmxr.c if ((!lp->txbfd) && ((unsigned long int)TXBUF_AVAIL (lp) <= TMXR_GUARD)) /* near full? */ lp 1872 src/simh/sim_tmxr.c lp->xmte = 0; /* disable line */ lp 1873 src/simh/sim_tmxr.c if (lp->txlog) /* log if available */ lp 1874 src/simh/sim_tmxr.c fputc (chr, lp->txlog); lp 1875 src/simh/sim_tmxr.c sim_exp_check (&lp->expect, chr); /* process expect rules as needed */ lp 1878 src/simh/sim_tmxr.c ++lp->txdrp; lp->xmte = 0; /* no room, dsbl line */ lp 1899 src/simh/sim_tmxr.c t_stat tmxr_put_packet_ln (TMLN *lp, const uint8 *buf, size_t size) lp 1901 src/simh/sim_tmxr.c return tmxr_put_packet_ln_ex (lp, buf, size, 0); lp 1904 src/simh/sim_tmxr.c t_stat tmxr_put_packet_ln_ex (TMLN *lp, const uint8 *buf, size_t size, uint8 frame_byte) lp 1908 src/simh/sim_tmxr.c size_t pktlen_size = (lp->datagram ? 0 : 2); lp 1910 src/simh/sim_tmxr.c if ((!lp->conn) && (!lp->loopback)) lp 1912 src/simh/sim_tmxr.c if (lp->txppoffset < lp->txppsize) { lp 1915 src/simh/sim_tmxr.c if (lp->txpbsize < size + pktlen_size + fc_size) { lp 1916 src/simh/sim_tmxr.c lp->txpbsize = size + pktlen_size + fc_size; lp 1917 src/simh/sim_tmxr.c lp->txpb = (uint8 *)realloc (lp->txpb, lp->txpbsize); lp 1918 src/simh/sim_tmxr.c if (!lp->txpb) lp 1931 src/simh/sim_tmxr.c lp->txpb[0] = frame_byte; lp 1932 src/simh/sim_tmxr.c if (!lp->datagram) { lp 1933 src/simh/sim_tmxr.c lp->txpb[0+fc_size] = (size >> 8) & 0xFF; lp 1934 src/simh/sim_tmxr.c lp->txpb[1+fc_size] = size & 0xFF; lp 1936 src/simh/sim_tmxr.c memcpy (lp->txpb + pktlen_size + fc_size, buf, size); lp 1937 src/simh/sim_tmxr.c lp->txppsize = size + pktlen_size + fc_size; lp 1938 src/simh/sim_tmxr.c lp->txppoffset = 0; lp 1939 src/simh/sim_tmxr.c ++lp->txpcnt; lp 1940 src/simh/sim_tmxr.c while ((lp->txppoffset < lp->txppsize) && lp 1941 src/simh/sim_tmxr.c (SCPE_OK == (r = tmxr_putc_ln (lp, lp->txpb[lp->txppoffset])))) lp 1942 src/simh/sim_tmxr.c ++lp->txppoffset; lp 1944 src/simh/sim_tmxr.c tmxr_send_buffered_data (lp); lp 1945 src/simh/sim_tmxr.c return (lp->conn || lp->loopback) ? SCPE_OK : SCPE_LOST; lp 1959 src/simh/sim_tmxr.c TMLN *lp; lp 1962 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 1963 src/simh/sim_tmxr.c if (!lp->conn) /* skip if !conn */ lp 1965 src/simh/sim_tmxr.c nbytes = tmxr_send_buffered_data (lp); /* buffered bytes */ lp 1967 src/simh/sim_tmxr.c lp->xmte = 1; /* enable line transmit */ lp 1981 src/simh/sim_tmxr.c int32 tmxr_send_buffered_data (TMLN *lp) lp 1986 src/simh/sim_tmxr.c nbytes = tmxr_tqln(lp); /* avail bytes */ lp 1988 src/simh/sim_tmxr.c if (lp->txbpr < lp->txbpi) /* no wrap? */ lp 1989 src/simh/sim_tmxr.c sbytes = tmxr_write (lp, nbytes); /* write all data */ lp 1991 src/simh/sim_tmxr.c sbytes = tmxr_write (lp, lp->txbsz - lp->txbpr);/* write to end buf */ lp 1993 src/simh/sim_tmxr.c lp->txbpr = (lp->txbpr + sbytes); /* update remove ptr */ lp 1994 src/simh/sim_tmxr.c if (lp->txbpr >= lp->txbsz) /* wrap? */ lp 1995 src/simh/sim_tmxr.c lp->txbpr = 0; lp 1996 src/simh/sim_tmxr.c lp->txcnt = lp->txcnt + sbytes; /* update counts */ lp 1998 src/simh/sim_tmxr.c if ((nbytes == 0) && (lp->datagram)) /* if Empty buffer on datagram line */ lp 1999 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; /* Start next packet at beginning of buffer */ lp 2002 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; /* Drop the data we already know we can't send */ lp 2003 src/simh/sim_tmxr.c lp->rxpboffset = lp->txppoffset = lp->txppsize = 0;/* Drop the data we already know we can't send */ lp 2004 src/simh/sim_tmxr.c tmxr_close_ln (lp); /* close line/port on error */ lp 2007 src/simh/sim_tmxr.c if (nbytes && (lp->txbpr == 0)) { /* more data and wrap? */ lp 2008 src/simh/sim_tmxr.c sbytes = tmxr_write (lp, nbytes); lp 2010 src/simh/sim_tmxr.c lp->txbpr = (lp->txbpr + sbytes); /* update remove ptr */ lp 2011 src/simh/sim_tmxr.c if (lp->txbpr >= lp->txbsz) /* wrap? */ lp 2012 src/simh/sim_tmxr.c lp->txbpr = 0; lp 2013 src/simh/sim_tmxr.c lp->txcnt = lp->txcnt + sbytes; /* update counts */ lp 2018 src/simh/sim_tmxr.c while ((lp->txppoffset < lp->txppsize) && /* buffered packet data? */ lp 2019 src/simh/sim_tmxr.c (lp->txbsz > nbytes) && /* and room in xmt buffer */ lp 2020 src/simh/sim_tmxr.c (SCPE_OK == (r = tmxr_putc_ln (lp, lp->txpb[lp->txppoffset])))) lp 2021 src/simh/sim_tmxr.c ++lp->txppoffset; lp 2023 src/simh/sim_tmxr.c if ((nbytes == 0) && (tmxr_tqln(lp) > 0)) lp 2024 src/simh/sim_tmxr.c return tmxr_send_buffered_data (lp); lp 2025 src/simh/sim_tmxr.c return tmxr_tqln(lp) + tmxr_tpqln(lp); lp 2030 src/simh/sim_tmxr.c int32 tmxr_tqln (const TMLN *lp) lp 2032 src/simh/sim_tmxr.c return (lp->txbpi - lp->txbpr + ((lp->txbpi < lp->txbpr)? lp->txbsz: 0)); lp 2037 src/simh/sim_tmxr.c int32 tmxr_tpqln (const TMLN *lp) lp 2039 src/simh/sim_tmxr.c return (lp->txppsize - lp->txppoffset); lp 2044 src/simh/sim_tmxr.c t_bool tmxr_tpbusyln (const TMLN *lp) lp 2046 src/simh/sim_tmxr.c return (0 != (lp->txppsize - lp->txppoffset)); lp 2049 src/simh/sim_tmxr.c static void _mux_detach_line (TMLN *lp, t_bool close_listener, t_bool close_connecting) lp 2051 src/simh/sim_tmxr.c if (close_listener && lp->master) { lp 2052 src/simh/sim_tmxr.c sim_close_sock (lp->master); lp 2053 src/simh/sim_tmxr.c lp->master = 0; lp 2054 src/simh/sim_tmxr.c FREE (lp->port); lp 2055 src/simh/sim_tmxr.c lp->port = NULL; lp 2057 src/simh/sim_tmxr.c if (lp->sock) { /* if existing tcp, drop it */ lp 2058 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report disconnection */ lp 2059 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 2062 src/simh/sim_tmxr.c FREE (lp->destination); lp 2063 src/simh/sim_tmxr.c lp->destination = NULL; lp 2064 src/simh/sim_tmxr.c if (lp->connecting) { /* if existing outgoing tcp, drop it */ lp 2065 src/simh/sim_tmxr.c lp->sock = lp->connecting; lp 2066 src/simh/sim_tmxr.c lp->connecting = 0; lp 2067 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 2070 src/simh/sim_tmxr.c tmxr_set_line_loopback (lp, FALSE); lp 2073 src/simh/sim_tmxr.c t_stat tmxr_detach_ln (TMLN *lp) lp 2077 src/simh/sim_tmxr.c _mux_detach_line (lp, TRUE, TRUE); lp 2078 src/simh/sim_tmxr.c if (lp->mp) { lp 2079 src/simh/sim_tmxr.c if (lp->uptr) lp 2080 src/simh/sim_tmxr.c uptr = lp->uptr; lp 2082 src/simh/sim_tmxr.c uptr = lp->mp->uptr; lp 2086 src/simh/sim_tmxr.c uptr->filename = tmxr_mux_attach_string (uptr->filename, lp->mp); lp 2089 src/simh/sim_tmxr.c tmxr_detach (lp->mp, uptr); lp 2140 src/simh/sim_tmxr.c t_stat tmxr_set_line_speed (TMLN *lp, CONST char *speed) lp 2150 src/simh/sim_tmxr.c if (lp == NULL) lp 2152 src/simh/sim_tmxr.c lp->rxbps = (uint32)strtotv (speed, &cptr, 10); lp 2157 src/simh/sim_tmxr.c lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE * rxbpsfactor; lp 2159 src/simh/sim_tmxr.c lp->rxdelta = _tmln_speed_delta (speed); lp 2160 src/simh/sim_tmxr.c lp->rxnexttime = 0.0; lp 2161 src/simh/sim_tmxr.c uptr = lp->uptr; lp 2162 src/simh/sim_tmxr.c if ((!uptr) && (lp->mp)) lp 2163 src/simh/sim_tmxr.c uptr = lp->mp->uptr; lp 2165 src/simh/sim_tmxr.c uptr->wait = lp->rxdelta; lp 2166 src/simh/sim_tmxr.c if (lp->rxbpsfactor == 0.0) lp 2167 src/simh/sim_tmxr.c lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE; lp 2168 src/simh/sim_tmxr.c lp->txbps = lp->rxbps; lp 2169 src/simh/sim_tmxr.c lp->txdelta = lp->rxdelta; lp 2170 src/simh/sim_tmxr.c lp->txnexttime = lp->rxnexttime; lp 2190 src/simh/sim_tmxr.c TMLN *lp = NULL; lp 2196 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2197 src/simh/sim_tmxr.c lp->mp = mp; /* set the back pointer */ lp 2198 src/simh/sim_tmxr.c lp->modem_control = mp->modem_control; lp 2199 src/simh/sim_tmxr.c if (lp->rxbpsfactor == 0.0) lp 2200 src/simh/sim_tmxr.c lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE; lp 2412 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2413 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2414 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2415 src/simh/sim_tmxr.c lp->txlogname = (char *)realloc(lp->txlogname, CBUFSIZE); lp 2416 src/simh/sim_tmxr.c if (!lp->txlogname) lp 2429 src/simh/sim_tmxr.c sprintf(lp->txlogname, "%s_%d", mp->logfiletmpl, i); lp 2431 src/simh/sim_tmxr.c (void)strcpy (lp->txlogname, mp->logfiletmpl); lp 2432 src/simh/sim_tmxr.c r = sim_open_logfile (lp->txlogname, TRUE, &lp->txlog, &lp->txlogref); lp 2434 src/simh/sim_tmxr.c setvbuf (lp->txlog, NULL, _IOFBF, 65536); lp 2436 src/simh/sim_tmxr.c FREE (lp->txlogname); lp 2437 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2444 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2446 src/simh/sim_tmxr.c lp->txbsz = mp->buffered; lp 2447 src/simh/sim_tmxr.c lp->txbfd = 1; lp 2448 src/simh/sim_tmxr.c lp->rxbsz = mp->buffered; lp 2451 src/simh/sim_tmxr.c lp->txbsz = TMXR_MAXBUF; lp 2452 src/simh/sim_tmxr.c lp->txbfd = 0; lp 2453 src/simh/sim_tmxr.c lp->rxbsz = TMXR_MAXBUF; lp 2455 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; lp 2456 src/simh/sim_tmxr.c lp->txb = (char *)realloc(lp->txb, lp->txbsz); lp 2457 src/simh/sim_tmxr.c if (!lp->txb) lp 2469 src/simh/sim_tmxr.c lp->rxb = (char *)realloc(lp->rxb, lp->rxbsz); lp 2470 src/simh/sim_tmxr.c if (!lp->rxb) lp 2482 src/simh/sim_tmxr.c lp->rbr = (char *)realloc(lp->rbr, lp->rxbsz); lp 2483 src/simh/sim_tmxr.c if (!lp->rbr) lp 2499 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2500 src/simh/sim_tmxr.c FREE(lp->txlogname); lp 2501 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2502 src/simh/sim_tmxr.c if (lp->txlog) { lp 2503 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2504 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2542 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2543 src/simh/sim_tmxr.c lp->mp = mp; /* set the back pointer */ lp 2544 src/simh/sim_tmxr.c lp->packet = mp->packet; lp 2546 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 2547 src/simh/sim_tmxr.c tmxr_init_line (lp); /* initialize line state */ lp 2548 src/simh/sim_tmxr.c lp->sock = 0; /* clear the socket */ lp 2556 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2557 src/simh/sim_tmxr.c tmxr_set_line_loopback (lp, loopback); lp 2559 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 2565 src/simh/sim_tmxr.c lp = &mp->ldsc[0]; lp 2566 src/simh/sim_tmxr.c lp->datagram = datagram; lp 2569 src/simh/sim_tmxr.c lp->port = (char *)realloc (lp->port, 1 + strlen (listen)); lp 2570 src/simh/sim_tmxr.c if (!lp->port) lp 2582 src/simh/sim_tmxr.c (void)strcpy (lp->port, listen); /* save port */ lp 2587 src/simh/sim_tmxr.c lp->packet = packet; lp 2592 src/simh/sim_tmxr.c _mux_detach_line (lp, FALSE, TRUE); lp 2593 src/simh/sim_tmxr.c lp->destination = (char *)malloc(1+strlen(hostport)); lp 2594 src/simh/sim_tmxr.c if (!lp->destination) lp 2606 src/simh/sim_tmxr.c (void)strcpy (lp->destination, hostport); lp 2607 src/simh/sim_tmxr.c lp->mp = mp; lp 2608 src/simh/sim_tmxr.c if (!lp->modem_control || (lp->modembits & TMXR_MDM_DTR)) { lp 2609 src/simh/sim_tmxr.c lp->connecting = sock; lp 2610 src/simh/sim_tmxr.c lp->ipad = (char *)malloc (1 + strlen (lp->destination)); lp 2611 src/simh/sim_tmxr.c if (!lp->ipad) lp 2623 src/simh/sim_tmxr.c (void)strcpy (lp->ipad, lp->destination); lp 2627 src/simh/sim_tmxr.c lp->notelnet = notelnet; lp 2628 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init the line state */ lp 2630 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 2638 src/simh/sim_tmxr.c lp = &mp->ldsc[line]; lp 2639 src/simh/sim_tmxr.c lp->mp = mp; lp 2641 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2642 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2643 src/simh/sim_tmxr.c lp->txlogname = (char *)realloc (lp->txlogname, 1 + strlen (logfiletmpl)); lp 2644 src/simh/sim_tmxr.c if (!lp->txlogname) lp 2656 src/simh/sim_tmxr.c (void)strcpy (lp->txlogname, logfiletmpl); lp 2657 src/simh/sim_tmxr.c r = sim_open_logfile (lp->txlogname, TRUE, &lp->txlog, &lp->txlogref); lp 2659 src/simh/sim_tmxr.c setvbuf(lp->txlog, NULL, _IOFBF, 65536); lp 2661 src/simh/sim_tmxr.c FREE (lp->txlogname); lp 2662 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2667 src/simh/sim_tmxr.c lp->rxbsz = lp->txbsz = TMXR_MAXBUF; lp 2668 src/simh/sim_tmxr.c lp->txbfd = 0; lp 2671 src/simh/sim_tmxr.c lp->rxbsz = lp->txbsz = atoi(buffered); lp 2672 src/simh/sim_tmxr.c lp->txbfd = 1; lp 2674 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; lp 2675 src/simh/sim_tmxr.c lp->txb = (char *)realloc (lp->txb, lp->txbsz); lp 2676 src/simh/sim_tmxr.c if (!lp->txb) lp 2688 src/simh/sim_tmxr.c lp->rxb = (char *)realloc (lp->rxb, lp->rxbsz); lp 2689 src/simh/sim_tmxr.c if (!lp->rxb) lp 2701 src/simh/sim_tmxr.c lp->rbr = (char *)realloc (lp->rbr, lp->rxbsz); lp 2702 src/simh/sim_tmxr.c if (!lp->rbr) lp 2714 src/simh/sim_tmxr.c lp->packet = packet; lp 2716 src/simh/sim_tmxr.c FREE(lp->txlogname); lp 2717 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2718 src/simh/sim_tmxr.c if (lp->txlog) { lp 2719 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2720 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2731 src/simh/sim_tmxr.c _mux_detach_line (lp, TRUE, FALSE); lp 2733 src/simh/sim_tmxr.c lp->port = (char *)realloc (lp->port, 1 + strlen (listen)); lp 2734 src/simh/sim_tmxr.c if (!lp->port) lp 2746 src/simh/sim_tmxr.c (void)strcpy (lp->port, listen); /* save port */ lp 2747 src/simh/sim_tmxr.c lp->master = sock; /* save master socket */ lp 2749 src/simh/sim_tmxr.c lp->notelnet = listennotelnet; lp 2751 src/simh/sim_tmxr.c lp->notelnet = mp->notelnet; lp 2754 src/simh/sim_tmxr.c lp->datagram = datagram; lp 2757 src/simh/sim_tmxr.c lp->port = (char *)realloc (lp->port, 1 + strlen (listen)); lp 2758 src/simh/sim_tmxr.c if (!lp->port) lp 2770 src/simh/sim_tmxr.c (void)strcpy (lp->port, listen); /* save port */ lp 2777 src/simh/sim_tmxr.c _mux_detach_line (lp, FALSE, TRUE); lp 2778 src/simh/sim_tmxr.c lp->destination = (char *)malloc(1+strlen(hostport)); lp 2779 src/simh/sim_tmxr.c if (!lp->destination) lp 2791 src/simh/sim_tmxr.c (void)strcpy (lp->destination, hostport); lp 2792 src/simh/sim_tmxr.c if (!lp->modem_control || (lp->modembits & TMXR_MDM_DTR)) { lp 2793 src/simh/sim_tmxr.c lp->connecting = sock; lp 2794 src/simh/sim_tmxr.c lp->ipad = (char *)malloc (1 + strlen (lp->destination)); lp 2795 src/simh/sim_tmxr.c if (!lp->ipad) lp 2807 src/simh/sim_tmxr.c (void)strcpy (lp->ipad, lp->destination); lp 2811 src/simh/sim_tmxr.c lp->notelnet = notelnet; lp 2812 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init the line state */ lp 2819 src/simh/sim_tmxr.c if (lp != NULL) { lp 2820 src/simh/sim_tmxr.c tmxr_set_line_loopback (lp, loopback); lp 2824 src/simh/sim_tmxr.c if (lp != NULL) lp->modem_control = modem_control; lp 2827 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 3049 src/simh/sim_tmxr.c TMLN *lp; lp 3086 src/simh/sim_tmxr.c lp = mp->ldsc + j; lp 3088 src/simh/sim_tmxr.c if (lp->dptr && (mp->dptr != lp->dptr)) lp 3089 src/simh/sim_tmxr.c fprintf (st, "Device: %s ", sim_dname(lp->dptr)); lp 3091 src/simh/sim_tmxr.c if (mp->notelnet != lp->notelnet) lp 3092 src/simh/sim_tmxr.c fprintf (st, " - %stelnet", lp->notelnet ? "no" : ""); lp 3093 src/simh/sim_tmxr.c if (lp->uptr && (lp->uptr != lp->mp->uptr)) lp 3094 src/simh/sim_tmxr.c fprintf (st, " - Unit: %s", sim_uname (lp->uptr)); lp 3095 src/simh/sim_tmxr.c if (mp->modem_control != lp->modem_control) lp 3096 src/simh/sim_tmxr.c fprintf(st, ", ModemControl=%s", lp->modem_control ? "enabled" : "disabled"); lp 3097 src/simh/sim_tmxr.c if (lp->loopback) lp 3099 src/simh/sim_tmxr.c if (lp->rxbps) { lp 3100 src/simh/sim_tmxr.c fprintf(st, ", Speed=%lu", (unsigned long)lp->rxbps); lp 3101 src/simh/sim_tmxr.c if (lp->rxbpsfactor != TMXR_RX_BPS_UNIT_SCALE) lp 3102 src/simh/sim_tmxr.c fprintf(st, "*%.0f", lp->rxbpsfactor/TMXR_RX_BPS_UNIT_SCALE); lp 3107 src/simh/sim_tmxr.c if ((!lp->sock) && (!lp->connecting) lp 3108 src/simh/sim_tmxr.c && (!lp->master)) { lp 3109 src/simh/sim_tmxr.c if (lp->modem_control) lp 3110 src/simh/sim_tmxr.c tmxr_fconns (st, lp, -1); lp 3113 src/simh/sim_tmxr.c tmxr_fconns (st, lp, -1); lp 3114 src/simh/sim_tmxr.c tmxr_fstats (st, lp, -1); lp 3131 src/simh/sim_tmxr.c TMLN *lp; lp 3134 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 3136 src/simh/sim_tmxr.c if (!lp->destination && lp->sock) { /* not serial and is connected? */ lp 3137 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report disconnection */ lp 3138 src/simh/sim_tmxr.c tmxr_reset_ln (lp); /* disconnect line */ lp 3141 src/simh/sim_tmxr.c if (lp->sock) { lp 3142 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report disconnection */ lp 3143 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 3145 src/simh/sim_tmxr.c FREE (lp->destination); lp 3146 src/simh/sim_tmxr.c lp->destination = NULL; lp 3147 src/simh/sim_tmxr.c if (lp->connecting) { lp 3148 src/simh/sim_tmxr.c lp->sock = lp->connecting; lp 3149 src/simh/sim_tmxr.c lp->connecting = 0; lp 3150 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 3152 src/simh/sim_tmxr.c lp->conn = FALSE; lp 3154 src/simh/sim_tmxr.c if (lp->master) { lp 3155 src/simh/sim_tmxr.c sim_close_sock (lp->master); /* close master socket */ lp 3156 src/simh/sim_tmxr.c lp->master = 0; lp 3157 src/simh/sim_tmxr.c FREE (lp->port); lp 3158 src/simh/sim_tmxr.c lp->port = NULL; lp 3160 src/simh/sim_tmxr.c lp->txbfd = 0; lp 3161 src/simh/sim_tmxr.c FREE (lp->txb); lp 3162 src/simh/sim_tmxr.c lp->txb = NULL; lp 3163 src/simh/sim_tmxr.c FREE (lp->rxb); lp 3164 src/simh/sim_tmxr.c lp->rxb = NULL; lp 3165 src/simh/sim_tmxr.c FREE (lp->rbr); lp 3166 src/simh/sim_tmxr.c lp->rbr = NULL; lp 3167 src/simh/sim_tmxr.c lp->modembits = 0; lp 3450 src/simh/sim_tmxr.c void tmxr_linemsg (TMLN *lp, const char *msg) lp 3453 src/simh/sim_tmxr.c while (SCPE_STALL == tmxr_putc_ln (lp, (int32)(*msg))) lp 3454 src/simh/sim_tmxr.c if (lp->txbsz == tmxr_send_buffered_data (lp)) lp 3463 src/simh/sim_tmxr.c void tmxr_linemsgf (TMLN *lp, const char *fmt, ...) lp 3468 src/simh/sim_tmxr.c tmxr_linemsgvf (lp, fmt, arglist); lp 3472 src/simh/sim_tmxr.c void tmxr_linemsgvf (TMLN *lp, const char *fmt, va_list arglist) lp 3514 src/simh/sim_tmxr.c while (SCPE_STALL == tmxr_putc_ln (lp, '\r')) lp 3515 src/simh/sim_tmxr.c if (lp->txbsz == tmxr_send_buffered_data (lp)) lp 3518 src/simh/sim_tmxr.c while (SCPE_STALL == tmxr_putc_ln (lp, buf[i])) lp 3519 src/simh/sim_tmxr.c if (lp->txbsz == tmxr_send_buffered_data (lp)) lp 3529 src/simh/sim_tmxr.c void tmxr_fconns (FILE *st, const TMLN *lp, int32 ln) lp 3537 src/simh/sim_tmxr.c if ((lp->sock) || (lp->connecting)) { /* tcp connection? */ lp 3538 src/simh/sim_tmxr.c if (lp->destination) /* remote connection? */ lp 3539 src/simh/sim_tmxr.c if (lp->datagram) lp 3540 src/simh/sim_tmxr.c fprintf (st, "Datagram Connection from %s to remote port %s\n", lp->port, lp->destination);/* print port name */ lp 3542 src/simh/sim_tmxr.c fprintf (st, "Connection to remote port %s\n", lp->destination);/* print port name */ lp 3544 src/simh/sim_tmxr.c fprintf (st, "Connection from IP address %s\n", lp->ipad); lp 3547 src/simh/sim_tmxr.c if (lp->destination) /* remote connection? */ lp 3548 src/simh/sim_tmxr.c fprintf (st, "Connecting to remote port %s\n", lp->destination);/* print port name */ lp 3549 src/simh/sim_tmxr.c if (lp->sock) { lp 3552 src/simh/sim_tmxr.c sim_getnames_sock (lp->sock, &sockname, &peername); lp 3558 src/simh/sim_tmxr.c if ((lp->port) && (!lp->datagram)) lp 3559 src/simh/sim_tmxr.c fprintf (st, "Listening on port %s\n", lp->port); /* print port name */ lp 3560 src/simh/sim_tmxr.c if (lp->cnms) { lp 3561 src/simh/sim_tmxr.c tctime = (sim_os_msec () - lp->cnms) / 1000; lp 3566 src/simh/sim_tmxr.c fprintf (st, " %s %02d:%02d:%02d\n", lp->connecting ? "Connecting for" : "Connected", hr, mn, sc); lp 3571 src/simh/sim_tmxr.c if (lp->modem_control) { lp 3572 src/simh/sim_tmxr.c fprintf (st, " Modem Bits: %s%s%s%s%s%s\n", (lp->modembits & TMXR_MDM_DTR) ? "DTR " : "", lp 3573 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_RTS) ? "RTS " : "", lp 3574 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_DCD) ? "DCD " : "", lp 3575 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_RNG) ? "RNG " : "", lp 3576 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_CTS) ? "CTS " : "", lp 3577 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_DSR) ? "DSR " : ""); lp 3581 src/simh/sim_tmxr.c (lp->sock) && (!lp->datagram)) lp 3582 src/simh/sim_tmxr.c fprintf (st, " %s\n", (lp->notelnet) ? "Telnet disabled (RAW data)" : "Telnet protocol"); lp 3583 src/simh/sim_tmxr.c if (lp->send.buffer) lp 3584 src/simh/sim_tmxr.c sim_show_send_input (st, &lp->send); lp 3585 src/simh/sim_tmxr.c if (lp->expect.buf) lp 3586 src/simh/sim_tmxr.c sim_exp_showall (st, &lp->expect); lp 3587 src/simh/sim_tmxr.c if (lp->txlog) lp 3588 src/simh/sim_tmxr.c fprintf (st, " Logging to %s\n", lp->txlogname); lp 3594 src/simh/sim_tmxr.c void tmxr_fstats (FILE *st, const TMLN *lp, int32 ln) lp 3601 src/simh/sim_tmxr.c if ((!lp->sock) && (!lp->connecting) lp 3607 src/simh/sim_tmxr.c fprintf (st, " input (%s)", (lp->rcve? enab: dsab)); lp 3608 src/simh/sim_tmxr.c if (lp->rxcnt) lp 3609 src/simh/sim_tmxr.c fprintf (st, " queued/total = %d/%d", tmxr_rqln (lp), lp->rxcnt); lp 3610 src/simh/sim_tmxr.c if (lp->rxpcnt) lp 3611 src/simh/sim_tmxr.c fprintf (st, " packets = %d", lp->rxpcnt); lp 3612 src/simh/sim_tmxr.c fprintf (st, "\n output (%s)", (lp->xmte? enab: dsab)); lp 3613 src/simh/sim_tmxr.c if (lp->txcnt || lp->txbpi) lp 3614 src/simh/sim_tmxr.c fprintf (st, " queued/total = %d/%d", tmxr_tqln (lp), lp->txcnt); lp 3615 src/simh/sim_tmxr.c if (lp->txpcnt || tmxr_tpqln (lp)) lp 3617 src/simh/sim_tmxr.c tmxr_tpqln (lp), lp->txpcnt); lp 3620 src/simh/sim_tmxr.c if (lp->txbfd) lp 3621 src/simh/sim_tmxr.c fprintf (st, " output buffer size = %d\n", lp->txbsz); lp 3622 src/simh/sim_tmxr.c if (lp->txcnt || lp->txbpi) lp 3624 src/simh/sim_tmxr.c ((lp->txcnt > 0) && (lp->txcnt > lp->txbsz)) ? lp->txbsz : lp->txbpi); lp 3625 src/simh/sim_tmxr.c if (lp->txdrp) lp 3626 src/simh/sim_tmxr.c fprintf (st, " dropped = %d\n", lp->txdrp); lp 3659 src/simh/sim_tmxr.c TMLN *lp; lp 3665 src/simh/sim_tmxr.c lp = tmxr_get_ldsc (uptr, cptr, mp, &status); /* get referenced line */ lp 3667 src/simh/sim_tmxr.c if (lp == NULL) /* bad line number? */ lp 3670 src/simh/sim_tmxr.c if ((lp->sock) lp 3672 src/simh/sim_tmxr.c if (!lp->notelnet) lp 3673 src/simh/sim_tmxr.c tmxr_linemsg (lp, "\r\nOperator disconnected line\r\n\n");/* report closure */ lp 3674 src/simh/sim_tmxr.c tmxr_reset_ln_ex (lp, (sim_switches & SWMASK ('C'))); /* drop the line */ lp 3685 src/simh/sim_tmxr.c TMLN *lp; lp 3690 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, val, mp); /* find line desc */ lp 3691 src/simh/sim_tmxr.c if (lp == NULL) lp 3693 src/simh/sim_tmxr.c if (lp->txlog) /* close existing log */ lp 3695 src/simh/sim_tmxr.c lp->txlogname = (char *) calloc (CBUFSIZE, sizeof (char)); /* alloc namebuf */ lp 3696 src/simh/sim_tmxr.c if (lp->txlogname == NULL) /* can't? */ lp 3698 src/simh/sim_tmxr.c strncpy (lp->txlogname, cptr, CBUFSIZE-1); /* save file name */ lp 3699 src/simh/sim_tmxr.c r = sim_open_logfile (cptr, TRUE, &lp->txlog, &lp->txlogref); /* open log */ lp 3701 src/simh/sim_tmxr.c FREE (lp->txlogname); /* free buffer */ lp 3704 src/simh/sim_tmxr.c if (lp->txlog == NULL) { /* error? */ lp 3705 src/simh/sim_tmxr.c FREE (lp->txlogname); /* free buffer */ lp 3709 src/simh/sim_tmxr.c lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp); lp 3718 src/simh/sim_tmxr.c TMLN *lp; lp 3722 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, val, mp); /* find line desc */ lp 3723 src/simh/sim_tmxr.c if (lp == NULL) lp 3725 src/simh/sim_tmxr.c if (lp->txlog) { /* logging? */ lp 3726 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); /* close log */ lp 3727 src/simh/sim_tmxr.c FREE (lp->txlogname); /* free namebuf */ lp 3728 src/simh/sim_tmxr.c lp->txlog = NULL; lp 3729 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 3732 src/simh/sim_tmxr.c lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp); lp 3741 src/simh/sim_tmxr.c TMLN *lp; lp 3743 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, val, mp); /* find line desc */ lp 3744 src/simh/sim_tmxr.c if (lp == NULL) lp 3746 src/simh/sim_tmxr.c if (lp->txlog) lp 3747 src/simh/sim_tmxr.c fprintf (st, "logging to %s", lp->txlogname); lp 218 src/simh/sim_tmxr.h t_stat tmxr_reset_ln (TMLN *lp); lp 219 src/simh/sim_tmxr.h t_stat tmxr_detach_ln (TMLN *lp); lp 220 src/simh/sim_tmxr.h int32 tmxr_input_pending_ln (TMLN *lp); lp 221 src/simh/sim_tmxr.h int32 tmxr_getc_ln (TMLN *lp); lp 222 src/simh/sim_tmxr.h t_stat tmxr_get_packet_ln (TMLN *lp, const uint8 **pbuf, size_t *psize); lp 223 src/simh/sim_tmxr.h t_stat tmxr_get_packet_ln_ex (TMLN *lp, const uint8 **pbuf, size_t *psize, uint8 frame_byte); lp 225 src/simh/sim_tmxr.h t_stat tmxr_putc_ln (TMLN *lp, int32 chr); lp 226 src/simh/sim_tmxr.h t_stat tmxr_put_packet_ln (TMLN *lp, const uint8 *buf, size_t size); lp 227 src/simh/sim_tmxr.h t_stat tmxr_put_packet_ln_ex (TMLN *lp, const uint8 *buf, size_t size, uint8 frame_byte); lp 229 src/simh/sim_tmxr.h int32 tmxr_send_buffered_data (TMLN *lp); lp 235 src/simh/sim_tmxr.h char *tmxr_line_attach_string(TMLN *lp); lp 236 src/simh/sim_tmxr.h t_stat tmxr_set_get_modem_bits (TMLN *lp, int32 bits_to_set, int32 bits_to_clear, int32 *incoming_bits); lp 237 src/simh/sim_tmxr.h t_stat tmxr_set_line_loopback (TMLN *lp, t_bool enable_loopback); lp 238 src/simh/sim_tmxr.h t_bool tmxr_get_line_loopback (TMLN *lp); lp 239 src/simh/sim_tmxr.h t_stat tmxr_set_line_halfduplex (TMLN *lp, t_bool enable_loopback); lp 240 src/simh/sim_tmxr.h t_bool tmxr_get_line_halfduplex (TMLN *lp); lp 241 src/simh/sim_tmxr.h t_stat tmxr_set_line_speed (TMLN *lp, CONST char *speed); lp 247 src/simh/sim_tmxr.h void tmxr_linemsg (TMLN *lp, const char *msg); lp 248 src/simh/sim_tmxr.h void tmxr_linemsgf (TMLN *lp, const char *fmt, ...); lp 249 src/simh/sim_tmxr.h void tmxr_linemsgvf (TMLN *lp, const char *fmt, va_list args); lp 250 src/simh/sim_tmxr.h void tmxr_fconns (FILE *st, const TMLN *lp, int32 ln); lp 251 src/simh/sim_tmxr.h void tmxr_fstats (FILE *st, const TMLN *lp, int32 ln); lp 256 src/simh/sim_tmxr.h int32 tmxr_rqln (const TMLN *lp); lp 257 src/simh/sim_tmxr.h int32 tmxr_tqln (const TMLN *lp); lp 258 src/simh/sim_tmxr.h int32 tmxr_tpqln (const TMLN *lp); lp 259 src/simh/sim_tmxr.h t_bool tmxr_tpbusyln (const TMLN *lp); lp 275 src/simh/sim_tmxr.h void _tmxr_debug (uint32 dbits, TMLN *lp, const char *msg, char *buf, int bufsize); lp 276 src/simh/sim_tmxr.h # define tmxr_debug(dbits, lp, msg, buf, bufsize) do {if (sim_deb && (lp)->mp && (lp)->mp->dptr && ((dbits) & (lp)->mp->dptr->dctrl)) _tmxr_debug (dbits, lp, msg, buf, bufsize); } while (0) lp 277 src/simh/sim_tmxr.h # define tmxr_debug_msg(dbits, lp, msg) do {if (sim_deb && (lp)->mp && (lp)->mp->dptr && ((dbits) & (lp)->mp->dptr->dctrl)) sim_debug (dbits, (lp)->mp->dptr, "%s", msg); } while (0) lp 278 src/simh/sim_tmxr.h # define tmxr_debug_return(lp, val) do {if (sim_deb && (val) && (lp)->mp && (lp)->mp->dptr && (TMXR_DBG_RET & (lp)->mp->dptr->dctrl)) { if ((lp)->rxbps) sim_debug (TMXR_DBG_RET, (lp)->mp->dptr, "Ln%d: 0x%x - Next after: %.0f\n", (int)((lp)-(lp)->mp->ldsc), val, (lp)->rxnexttime); else sim_debug (TMXR_DBG_RET, (lp)->mp->dptr, "Ln%d: 0x%x\n", (int)((lp)-(lp)->mp->ldsc), val); } } while (0) lp 280 src/simh/sim_tmxr.h # define tmxr_debug_trace_line(lp, msg) do {if (sim_deb && (lp)->mp && (lp)->mp->dptr && (TMXR_DBG_TRC & (lp)->mp->dptr->dctrl)) sim_debug (TMXR_DBG_TRC, (lp)->mp->dptr, "Ln%d:%s\n", (int)((lp)-(lp)->mp->ldsc), (msg)); } while (0) lp 282 src/simh/sim_tmxr.h # define tmxr_debug_connect_line(lp, msg) do {if (sim_deb && (lp)->mp && (lp)->mp->dptr && (TMXR_DBG_CON & (lp)->mp->dptr->dctrl)) sim_debug (TMXR_DBG_CON, (lp)->mp->dptr, "Ln%d:%s\n", (int)((lp)-(lp)->mp->ldsc), (msg)); } while (0)