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 1546 src/dps8/dps8_console.c uint lp = (uint)narrow_char; lp 1549 src/dps8/dps8_console.c if (lp == 060 /* + */ || lp == 075 /* = */) { // POLTS lp 1553 src/dps8/dps8_console.c if (lp == 0) lp 1554 src/dps8/dps8_console.c lp = 1; lp 1555 src/dps8/dps8_console.c if (lp >= 16) { lp 1559 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 232 src/simh/sim_tmxr.c static void tmxr_init_line (TMLN *lp) lp 234 src/simh/sim_tmxr.c lp->tsta = 0; /* init telnet state */ lp 235 src/simh/sim_tmxr.c lp->xmte = 1; /* enable transmit */ lp 236 src/simh/sim_tmxr.c lp->dstb = 0; /* default bin mode */ lp 237 src/simh/sim_tmxr.c lp->rxbpr = lp->rxbpi = lp->rxcnt = lp->rxpcnt = 0; /* init receive indexes */ lp 238 src/simh/sim_tmxr.c if (!lp->txbfd || lp->notelnet) /* if not buffered telnet */ lp 239 src/simh/sim_tmxr.c lp->txbpr = lp->txbpi = lp->txcnt = lp->txpcnt = 0; /* init transmit indexes */ lp 240 src/simh/sim_tmxr.c lp->txdrp = 0; lp 241 src/simh/sim_tmxr.c tmxr_set_get_modem_bits (lp, 0, 0, NULL); lp 242 src/simh/sim_tmxr.c if ((!lp->mp->buffered) && (!lp->txbfd)) { lp 243 src/simh/sim_tmxr.c lp->txbfd = 0; //-V1048 lp 244 src/simh/sim_tmxr.c lp->txbsz = TMXR_MAXBUF; lp 245 src/simh/sim_tmxr.c lp->txb = (char *)realloc (lp->txb, lp->txbsz); lp 246 src/simh/sim_tmxr.c if (!lp->txb) lp 258 src/simh/sim_tmxr.c lp->rxbsz = TMXR_MAXBUF; lp 259 src/simh/sim_tmxr.c lp->rxb = (char *)realloc(lp->rxb, lp->rxbsz); lp 260 src/simh/sim_tmxr.c if (!lp->rxb) lp 272 src/simh/sim_tmxr.c lp->rbr = (char *)realloc(lp->rbr, lp->rxbsz); lp 273 src/simh/sim_tmxr.c if (!lp->rbr) lp 286 src/simh/sim_tmxr.c if (lp->loopback) { lp 287 src/simh/sim_tmxr.c lp->lpbsz = lp->rxbsz; lp 288 src/simh/sim_tmxr.c lp->lpb = (char *)realloc(lp->lpb, lp->lpbsz); lp 289 src/simh/sim_tmxr.c if (!lp->lpb) lp 301 src/simh/sim_tmxr.c lp->lpbcnt = lp->lpbpi = lp->lpbpr = 0; lp 303 src/simh/sim_tmxr.c if (lp->rxpb) { lp 304 src/simh/sim_tmxr.c lp->rxpboffset = lp->rxpbsize = 0; lp 305 src/simh/sim_tmxr.c FREE (lp->rxpb); lp 306 src/simh/sim_tmxr.c lp->rxpb = NULL; lp 308 src/simh/sim_tmxr.c if (lp->txpb) { lp 309 src/simh/sim_tmxr.c lp->txpbsize = lp->txppsize = lp->txppoffset = 0; lp 310 src/simh/sim_tmxr.c FREE (lp->txpb); lp 311 src/simh/sim_tmxr.c lp->txpb = NULL; lp 313 src/simh/sim_tmxr.c memset (lp->rbr, 0, lp->rxbsz); /* clear break status array */ lp 330 src/simh/sim_tmxr.c static void tmxr_report_connection (TMXR *mp, TMLN *lp) lp 338 src/simh/sim_tmxr.c if ((!lp->notelnet) || (sim_switches & SWMASK ('V'))) { lp 346 src/simh/sim_tmxr.c sprintf (lmsg, ", line %d", (int)(lp-mp->ldsc));/* report the line number */ lp 353 src/simh/sim_tmxr.c lp->txbpi = 0; /* init buf pointers */ lp 354 src/simh/sim_tmxr.c lp->txbpr = (int32)(lp->txbsz - strlen (msgbuf)); lp 355 src/simh/sim_tmxr.c lp->rxcnt = lp->txcnt = lp->txdrp = 0; /* init counters */ lp 356 src/simh/sim_tmxr.c lp->rxpcnt = lp->txpcnt = 0; lp 359 src/simh/sim_tmxr.c if (lp->txcnt > lp->txbsz) lp 360 src/simh/sim_tmxr.c lp->txbpr = (lp->txbpi + 1) % lp->txbsz; lp 362 src/simh/sim_tmxr.c lp->txbpr = (int32)(lp->txbsz - strlen (msgbuf)); lp 364 src/simh/sim_tmxr.c psave = lp->txbpi; /* save insertion pointer */ lp 365 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr; /* insert connection message */ lp 366 src/simh/sim_tmxr.c tmxr_linemsg (lp, msgbuf); /* beginning of buffer */ lp 367 src/simh/sim_tmxr.c lp->txbpi = psave; /* restore insertion pointer */ lp 369 src/simh/sim_tmxr.c unwritten = tmxr_send_buffered_data (lp); /* send the message */ lp 372 src/simh/sim_tmxr.c lp->xmte = 1; /* reenable transmission if paused */ lp 374 src/simh/sim_tmxr.c lp->txcnt -= (int32)strlen (msgbuf); /* adjust statistics */ lp 388 src/simh/sim_tmxr.c static void tmxr_report_disconnection (TMLN *lp) lp 390 src/simh/sim_tmxr.c if (lp->notelnet) lp 392 src/simh/sim_tmxr.c tmxr_linemsgf (lp, "\r\nDisconnected from the %s simulator\r\n\n", sim_name);/* report disconnection */ lp 396 src/simh/sim_tmxr.c static int32 loop_write_ex (TMLN *lp, char *buf, int32 length, t_bool prefix_datagram) lp 399 src/simh/sim_tmxr.c int32 loopfree = lp->lpbsz - lp->lpbcnt; lp 401 src/simh/sim_tmxr.c if (lp->datagram && prefix_datagram) { lp 404 src/simh/sim_tmxr.c loop_write_ex (lp, (char *)&length, sizeof(length), FALSE); lp 409 src/simh/sim_tmxr.c loopfree = lp->lpbsz - lp->lpbcnt; lp 414 src/simh/sim_tmxr.c if (lp->lpbpi >= lp->lpbpr) lp 415 src/simh/sim_tmxr.c chunksize = lp->lpbsz - lp->lpbpi; lp 417 src/simh/sim_tmxr.c chunksize = lp->lpbpr - lp->lpbpi; lp 420 src/simh/sim_tmxr.c memcpy (&lp->lpb[lp->lpbpi], buf, chunksize); lp 424 src/simh/sim_tmxr.c lp->lpbpi = (lp->lpbpi + chunksize) % lp->lpbsz; lp 426 src/simh/sim_tmxr.c lp->lpbcnt += written; lp 430 src/simh/sim_tmxr.c static int32 loop_write (TMLN *lp, char *buf, int32 length) lp 432 src/simh/sim_tmxr.c return loop_write_ex (lp, buf, length, TRUE); lp 435 src/simh/sim_tmxr.c static int32 loop_read_ex (TMLN *lp, char *buf, int32 bufsize) lp 441 src/simh/sim_tmxr.c int32 loopused = lp->lpbcnt; lp 447 src/simh/sim_tmxr.c if (lp->lpbpi > lp->lpbpr) lp 448 src/simh/sim_tmxr.c chunksize = lp->lpbpi - lp->lpbpr; lp 450 src/simh/sim_tmxr.c chunksize = lp->lpbsz - lp->lpbpr; lp 453 src/simh/sim_tmxr.c memcpy (buf, &lp->lpb[lp->lpbpr], chunksize); lp 457 src/simh/sim_tmxr.c lp->lpbpr = (lp->lpbpr + chunksize) % lp->lpbsz; lp 459 src/simh/sim_tmxr.c lp->lpbcnt -= bytesread; lp 463 src/simh/sim_tmxr.c static int32 loop_read (TMLN *lp, char *buf, int32 bufsize) lp 465 src/simh/sim_tmxr.c if (lp->datagram) { lp 468 src/simh/sim_tmxr.c if (lp->lpbcnt < (int32)sizeof(pktsize)) lp 470 src/simh/sim_tmxr.c if ((sizeof(pktsize) != loop_read_ex (lp, (char *)&pktsize, sizeof(pktsize))) || lp 475 src/simh/sim_tmxr.c return loop_read_ex (lp, buf, bufsize); lp 486 src/simh/sim_tmxr.c static int32 tmxr_read (TMLN *lp, int32 length) lp 488 src/simh/sim_tmxr.c int32 i = lp->rxbpi; lp 490 src/simh/sim_tmxr.c if (lp->loopback) lp 491 src/simh/sim_tmxr.c return loop_read (lp, &(lp->rxb[i]), length); lp 493 src/simh/sim_tmxr.c return sim_read_sock (lp->sock, &(lp->rxb[i]), length); lp 503 src/simh/sim_tmxr.c static int32 tmxr_write (TMLN *lp, int32 length) lp 506 src/simh/sim_tmxr.c int32 i = lp->txbpr; lp 508 src/simh/sim_tmxr.c if (lp->loopback) lp 509 src/simh/sim_tmxr.c return loop_write (lp, &(lp->txb[i]), length); lp 511 src/simh/sim_tmxr.c written = sim_write_sock (lp->sock, &(lp->txb[i]), length); lp 514 src/simh/sim_tmxr.c if (lp->datagram) lp 529 src/simh/sim_tmxr.c static void tmxr_rmvrc (TMLN *lp, int32 p) lp 531 src/simh/sim_tmxr.c for ( ; p < lp->rxbpi; p++) { /* work from "p" through end of buffer */ lp 532 src/simh/sim_tmxr.c lp->rxb[p] = lp->rxb[p + 1]; /* slide following character down */ lp 533 src/simh/sim_tmxr.c lp->rbr[p] = lp->rbr[p + 1]; /* adjust break status too */ lp 536 src/simh/sim_tmxr.c lp->rbr[p] = 0; /* clear potential break from vacated slot */ lp 537 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpi - 1; /* drop buffer insert index */ lp 590 src/simh/sim_tmxr.c TMLN *lp = NULL; lp 597 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, mp->lines, mp); /* determine line from unit */ lp 599 src/simh/sim_tmxr.c if (lp == NULL) /* invalid line number? */ lp 610 src/simh/sim_tmxr.c lp = mp->ldsc + (int32) ln; /* use as index to determine line */ lp 616 src/simh/sim_tmxr.c return lp; /* return pointer to line descriptor */ lp 663 src/simh/sim_tmxr.c TMLN *lp; lp 678 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 680 src/simh/sim_tmxr.c lptr = tmxr_line_attach_string(lp); lp 711 src/simh/sim_tmxr.c char *tmxr_line_attach_string(TMLN *lp) lp 719 src/simh/sim_tmxr.c if (lp->destination || lp->port || lp->txlogname) { lp 720 src/simh/sim_tmxr.c if ((lp->mp->lines > 1) || (lp->port)) lp 721 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 32), "Line=%d", (int)(lp-lp->mp->ldsc)); lp 722 src/simh/sim_tmxr.c if (lp->modem_control != lp->mp->modem_control) lp 723 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 32), ",%s", lp->modem_control ? "Modem" : "NoModem"); lp 724 src/simh/sim_tmxr.c if (lp->txbfd && (lp->txbsz != lp->mp->buffered)) lp 725 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 32), ",Buffered=%d", lp->txbsz); lp 726 src/simh/sim_tmxr.c if (!lp->txbfd && (lp->mp->buffered > 0)) lp 728 src/simh/sim_tmxr.c if (lp->mp->datagram != lp->datagram) lp 729 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 8), ",%s", lp->datagram ? "UDP" : "TCP"); lp 730 src/simh/sim_tmxr.c if (lp->mp->packet != lp->packet) lp 732 src/simh/sim_tmxr.c if (lp->port) lp 733 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 734 src/simh/sim_tmxr.c if (lp->destination) { lp 735 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 737 src/simh/sim_tmxr.c if (lp->txlogname) lp 738 src/simh/sim_tmxr.c sprintf (growstring(&tptr, 12 + strlen (lp->txlogname)), ",Log=%s", lp->txlogname); lp 739 src/simh/sim_tmxr.c if (lp->loopback) lp 766 src/simh/sim_tmxr.c TMLN *lp = NULL; lp 775 src/simh/sim_tmxr.c (void)lp; lp 849 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get pointer to line descriptor */ lp 850 src/simh/sim_tmxr.c if ((lp->conn == FALSE) && /* is the line available? */ lp 851 src/simh/sim_tmxr.c (lp->destination == NULL) && lp 852 src/simh/sim_tmxr.c (lp->master == 0) && lp 853 src/simh/sim_tmxr.c (lp->ser_connect_pending == FALSE) && lp 854 src/simh/sim_tmxr.c (lp->modem_control ? ((lp->modembits & TMXR_MDM_DTR) != 0) : TRUE)) lp 862 src/simh/sim_tmxr.c lp = mp->ldsc + j; /* get pointer to line descriptor */ lp 863 src/simh/sim_tmxr.c if ((lp->conn == FALSE) && /* is the line available? */ lp 864 src/simh/sim_tmxr.c (lp->destination == NULL) && lp 865 src/simh/sim_tmxr.c (lp->master == 0) && lp 866 src/simh/sim_tmxr.c (lp->ser_connect_pending == FALSE) && lp 867 src/simh/sim_tmxr.c ((lp->modembits & TMXR_MDM_DTR) == 0)) { lp 869 src/simh/sim_tmxr.c tmxr_set_get_modem_bits (lp, TMXR_MDM_RNG, 0, NULL); lp 887 src/simh/sim_tmxr.c for (ln = 0; ln < lp->mp->lines; ln++) { lp 888 src/simh/sim_tmxr.c TMLN *tlp = lp->mp->ldsc + ln; lp 907 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 908 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 909 src/simh/sim_tmxr.c lp->sock = newsock; /* save socket */ lp 910 src/simh/sim_tmxr.c lp->ipad = address; /* ip address */ lp 911 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init line */ lp 912 src/simh/sim_tmxr.c lp->notelnet = mp->notelnet; /* apply mux default telnet setting */ lp 913 src/simh/sim_tmxr.c if (!lp->notelnet) { lp 915 src/simh/sim_tmxr.c lp->telnet_sent_opts = (uint8 *)realloc (lp->telnet_sent_opts, 256); lp 916 src/simh/sim_tmxr.c if (!lp->telnet_sent_opts) lp 928 src/simh/sim_tmxr.c memset (lp->telnet_sent_opts, 0, 256); lp 930 src/simh/sim_tmxr.c tmxr_report_connection (mp, lp); lp 931 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); /* time of connection */ lp 940 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get pointer to line descriptor */ lp 942 src/simh/sim_tmxr.c if (lp->ser_connect_pending) { lp 943 src/simh/sim_tmxr.c lp->ser_connect_pending = FALSE; lp 944 src/simh/sim_tmxr.c lp->conn = TRUE; lp 950 src/simh/sim_tmxr.c if (lp->loopback) lp 965 src/simh/sim_tmxr.c if (lp->connecting) { /* connecting? */ lp 968 src/simh/sim_tmxr.c switch (sim_check_conn(lp->connecting, FALSE)) lp 971 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 972 src/simh/sim_tmxr.c lp->sock = lp->connecting; /* it now looks normal */ lp 973 src/simh/sim_tmxr.c lp->connecting = 0; lp 975 src/simh/sim_tmxr.c if (lp->destination != NULL) lp 976 src/simh/sim_tmxr.c lpdlen = 1+strlen (lp->destination); lp 977 src/simh/sim_tmxr.c lp->ipad = (char *)realloc (lp->ipad, lpdlen); lp 978 src/simh/sim_tmxr.c if (!lp->ipad) lp 990 src/simh/sim_tmxr.c if (lp->destination != NULL) lp 991 src/simh/sim_tmxr.c strcpy (lp->ipad, lp->destination); lp 992 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); lp 993 src/simh/sim_tmxr.c sim_getnames_sock (lp->sock, &sockname, &peername); lp 994 src/simh/sim_tmxr.c if (lp->destination) lp 995 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 1000 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_poll_conn() - Outgoing Line Connection to %s failed", lp->destination); lp 1001 src/simh/sim_tmxr.c tmxr_reset_ln (lp); /* retry */ lp 1007 src/simh/sim_tmxr.c if (lp->master) { /* Check for a pending Telnet/tcp connection */ lp 1008 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 1017 src/simh/sim_tmxr.c if (lp->destination) { /* Virtual Null Modem Cable? */ lp 1020 src/simh/sim_tmxr.c if (sim_parse_addr (lp->destination, host, sizeof(host), NULL, NULL, 0, NULL, address)) { lp 1027 src/simh/sim_tmxr.c if (lp->connecting) { lp 1028 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_poll_conn() - aborting outgoing line connection attempt to: %s", lp->destination); lp 1029 src/simh/sim_tmxr.c sim_close_sock (lp->connecting); /* abort our as yet unconnnected socket */ lp 1030 src/simh/sim_tmxr.c lp->connecting = 0; lp 1033 src/simh/sim_tmxr.c if (lp->conn == FALSE) { /* is the line available? */ lp 1034 src/simh/sim_tmxr.c if ((!lp->modem_control) || (lp->modembits & TMXR_MDM_DTR)) { lp 1035 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 1036 src/simh/sim_tmxr.c lp->sock = newsock; /* save socket */ lp 1037 src/simh/sim_tmxr.c lp->ipad = address; /* ip address */ lp 1038 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init line */ lp 1039 src/simh/sim_tmxr.c if (!lp->notelnet) { lp 1041 src/simh/sim_tmxr.c lp->telnet_sent_opts = (uint8 *)realloc (lp->telnet_sent_opts, 256); lp 1042 src/simh/sim_tmxr.c if (!lp->telnet_sent_opts) lp 1054 src/simh/sim_tmxr.c memset (lp->telnet_sent_opts, 0, 256); lp 1056 src/simh/sim_tmxr.c tmxr_report_connection (mp, lp); lp 1057 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); /* time of connection */ lp 1078 src/simh/sim_tmxr.c if (lp->destination && (!lp->sock) && (!lp->connecting) && lp 1079 src/simh/sim_tmxr.c (!lp->modem_control || (lp->modembits & TMXR_MDM_DTR))) { lp 1080 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_poll_conn() - establishing outgoing connection to: %s", lp->destination); lp 1081 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 1082 src/simh/sim_tmxr.c (lp->mp->packet ? SIM_SOCK_OPT_NODELAY : 0) | lp 1093 src/simh/sim_tmxr.c static t_stat tmxr_reset_ln_ex (TMLN *lp, t_bool closeserial) lp 1097 src/simh/sim_tmxr.c if (lp->txlog) lp 1098 src/simh/sim_tmxr.c fflush (lp->txlog); /* flush log */ lp 1100 src/simh/sim_tmxr.c tmxr_send_buffered_data (lp); /* send any buffered data */ lp 1104 src/simh/sim_tmxr.c if (lp->sock) { lp 1105 src/simh/sim_tmxr.c sim_close_sock (lp->sock); /* close socket */ lp 1106 src/simh/sim_tmxr.c FREE (lp->telnet_sent_opts); lp 1107 src/simh/sim_tmxr.c lp->telnet_sent_opts = NULL; lp 1108 src/simh/sim_tmxr.c lp->sock = 0; lp 1109 src/simh/sim_tmxr.c lp->conn = FALSE; lp 1110 src/simh/sim_tmxr.c lp->cnms = 0; lp 1111 src/simh/sim_tmxr.c lp->xmte = 1; lp 1113 src/simh/sim_tmxr.c FREE(lp->ipad); lp 1114 src/simh/sim_tmxr.c lp->ipad = NULL; lp 1115 src/simh/sim_tmxr.c if ((lp->destination) lp 1117 src/simh/sim_tmxr.c if (lp->connecting) { lp 1118 src/simh/sim_tmxr.c sim_close_sock (lp->connecting); lp 1119 src/simh/sim_tmxr.c lp->connecting = 0; lp 1121 src/simh/sim_tmxr.c if ((!lp->modem_control) || (lp->modembits & TMXR_MDM_DTR)) { lp 1122 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_reset_ln_ex() - connecting to %s", lp->destination); lp 1123 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 1124 src/simh/sim_tmxr.c (lp->packet ? SIM_SOCK_OPT_NODELAY : 0) | lp 1128 src/simh/sim_tmxr.c tmxr_init_line (lp); /* initialize line state */ lp 1132 src/simh/sim_tmxr.c t_stat tmxr_close_ln (TMLN *lp) lp 1134 src/simh/sim_tmxr.c return tmxr_reset_ln_ex (lp, TRUE); lp 1137 src/simh/sim_tmxr.c t_stat tmxr_reset_ln (TMLN *lp) lp 1139 src/simh/sim_tmxr.c return tmxr_reset_ln_ex (lp, FALSE); lp 1154 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 1163 src/simh/sim_tmxr.c before_modem_bits = lp->modembits; lp 1164 src/simh/sim_tmxr.c lp->modembits |= bits_to_set; lp 1165 src/simh/sim_tmxr.c lp->modembits &= ~(bits_to_clear | TMXR_MDM_INCOMING); lp 1166 src/simh/sim_tmxr.c if ((lp->sock) lp 1167 src/simh/sim_tmxr.c || (lp->loopback)) { lp 1168 src/simh/sim_tmxr.c if (lp->modembits & TMXR_MDM_DTR) { lp 1170 src/simh/sim_tmxr.c if (lp->modembits & TMXR_MDM_RTS) lp 1172 src/simh/sim_tmxr.c if (lp->halfduplex) { lp 1180 src/simh/sim_tmxr.c incoming_state = TMXR_MDM_DCD | TMXR_MDM_DSR | ((lp->modembits & TMXR_MDM_DTR) ? 0 : TMXR_MDM_RNG); lp 1184 src/simh/sim_tmxr.c ((lp->modembits & TMXR_MDM_DTR) != 0) && lp 1185 src/simh/sim_tmxr.c (lp->conn == FALSE) && /* Not connected */ lp 1186 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_RNG)) { /* and Ring Signal Present */ lp 1187 src/simh/sim_tmxr.c if ((lp->destination == NULL) && lp 1188 src/simh/sim_tmxr.c (lp->master == 0) && lp 1189 src/simh/sim_tmxr.c (lp->mp && (lp->mp->ring_sock))) { lp 1192 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 1193 src/simh/sim_tmxr.c lp->sock = lp->mp->ring_sock; /* save socket */ lp 1194 src/simh/sim_tmxr.c lp->mp->ring_sock = INVALID_SOCKET; lp 1195 src/simh/sim_tmxr.c lp->ipad = lp->mp->ring_ipad; /* ip address */ lp 1196 src/simh/sim_tmxr.c lp->mp->ring_ipad = NULL; lp 1197 src/simh/sim_tmxr.c lp->mp->ring_start_time = 0; lp 1198 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init line */ lp 1199 src/simh/sim_tmxr.c lp->notelnet = lp->mp->notelnet; /* apply mux default telnet setting */ lp 1200 src/simh/sim_tmxr.c if (!lp->notelnet) { lp 1201 src/simh/sim_tmxr.c sim_write_sock (lp->sock, (char *)mantra, sizeof(mantra)); lp 1202 src/simh/sim_tmxr.c lp->telnet_sent_opts = (uint8 *)realloc (lp->telnet_sent_opts, 256); lp 1203 src/simh/sim_tmxr.c if (!lp->telnet_sent_opts) lp 1215 src/simh/sim_tmxr.c memset (lp->telnet_sent_opts, 0, 256); lp 1217 src/simh/sim_tmxr.c tmxr_report_connection (lp->mp, lp); lp 1218 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); /* time of connection */ lp 1219 src/simh/sim_tmxr.c lp->modembits &= ~TMXR_MDM_RNG; /* turn off ring on this line*/ lp 1221 src/simh/sim_tmxr.c for (ln = 0; ln < lp->mp->lines; ln++) { lp 1222 src/simh/sim_tmxr.c TMLN *tlp = lp->mp->ldsc + ln; lp 1229 src/simh/sim_tmxr.c if ((lp->master) || (lp->mp && lp->mp->master) || lp 1230 src/simh/sim_tmxr.c (lp->port && lp->destination)) lp 1235 src/simh/sim_tmxr.c lp->modembits |= incoming_state; lp 1236 src/simh/sim_tmxr.c dptr = (lp->dptr ? lp->dptr : (lp->mp ? lp->mp->dptr : NULL)); lp 1237 src/simh/sim_tmxr.c if ((lp->modembits != before_modem_bits) && (sim_deb && lp->mp && dptr)) { lp 1238 src/simh/sim_tmxr.c sim_debug_bits (TMXR_DBG_MDM, dptr, tmxr_modem_bits, before_modem_bits, lp->modembits, FALSE); lp 1239 src/simh/sim_tmxr.c sim_debug (TMXR_DBG_MDM, dptr, " - Line %d - %p\n", (int)(lp-lp->mp->ldsc), lp->txb); lp 1242 src/simh/sim_tmxr.c *incoming_bits = lp->modembits; lp 1243 src/simh/sim_tmxr.c if (lp->mp && lp->modem_control) { /* This API ONLY works on modem_control enabled multiplexer lines */ lp 1245 src/simh/sim_tmxr.c if (lp->loopback) { lp 1246 src/simh/sim_tmxr.c if ((lp->modembits ^ before_modem_bits) & TMXR_MDM_DTR) { /* DTR changed? */ lp 1247 src/simh/sim_tmxr.c lp->ser_connect_pending = (lp->modembits & TMXR_MDM_DTR); lp 1248 src/simh/sim_tmxr.c lp->conn = !(lp->modembits & TMXR_MDM_DTR); lp 1252 src/simh/sim_tmxr.c if ((lp->sock) || (lp->connecting)) { lp 1254 src/simh/sim_tmxr.c if (lp->sock) lp 1255 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report closure */ lp 1256 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 1260 src/simh/sim_tmxr.c if ((lp->destination) && /* Virtual Null Modem Cable */ lp 1265 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_set_get_modem_bits() - establishing outgoing connection to: %s", lp->destination); lp 1266 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 1267 src/simh/sim_tmxr.c (lp->packet ? SIM_SOCK_OPT_NODELAY : 0) | lp 1274 src/simh/sim_tmxr.c if ((lp->sock) || (lp->connecting)) { lp 1276 src/simh/sim_tmxr.c if (lp->sock) lp 1277 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report closure */ lp 1278 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 1293 src/simh/sim_tmxr.c t_stat tmxr_set_line_loopback (TMLN *lp, t_bool enable_loopback) lp 1295 src/simh/sim_tmxr.c if (lp->loopback == (enable_loopback != FALSE)) lp 1297 src/simh/sim_tmxr.c lp->loopback = (enable_loopback != FALSE); lp 1298 src/simh/sim_tmxr.c if (lp->loopback) { lp 1299 src/simh/sim_tmxr.c lp->lpbsz = lp->rxbsz; lp 1300 src/simh/sim_tmxr.c lp->lpb = (char *)realloc(lp->lpb, lp->lpbsz); lp 1301 src/simh/sim_tmxr.c if (!lp->lpb) lp 1313 src/simh/sim_tmxr.c lp->lpbcnt = lp->lpbpi = lp->lpbpr = 0; lp 1314 src/simh/sim_tmxr.c if (!lp->conn) lp 1315 src/simh/sim_tmxr.c lp->ser_connect_pending = TRUE; lp 1318 src/simh/sim_tmxr.c FREE (lp->lpb); lp 1319 src/simh/sim_tmxr.c lp->lpb = NULL; lp 1320 src/simh/sim_tmxr.c lp->lpbsz = 0; lp 1325 src/simh/sim_tmxr.c t_bool tmxr_get_line_loopback (TMLN *lp) lp 1327 src/simh/sim_tmxr.c return (lp->loopback != FALSE); lp 1344 src/simh/sim_tmxr.c t_stat tmxr_set_line_halfduplex (TMLN *lp, t_bool enable_halfduplex) lp 1346 src/simh/sim_tmxr.c if (lp->halfduplex == (enable_halfduplex != FALSE)) lp 1348 src/simh/sim_tmxr.c lp->halfduplex = (enable_halfduplex != FALSE); lp 1352 src/simh/sim_tmxr.c t_bool tmxr_get_line_halfduplex (TMLN *lp) lp 1354 src/simh/sim_tmxr.c return (lp->halfduplex != FALSE); lp 1371 src/simh/sim_tmxr.c int32 tmxr_input_pending_ln (TMLN *lp) lp 1373 src/simh/sim_tmxr.c return (lp->rxbpi - lp->rxbpr); lp 1376 src/simh/sim_tmxr.c int32 tmxr_getc_ln (TMLN *lp) lp 1382 src/simh/sim_tmxr.c if ((lp->conn && lp->rcve) && /* conn & enb & */ lp 1383 src/simh/sim_tmxr.c ((!lp->rxbps) || /* (!rate limited || enough time passed)? */ lp 1384 src/simh/sim_tmxr.c (sim_gtime () >= lp->rxnexttime))) { lp 1385 src/simh/sim_tmxr.c if (!sim_send_poll_data (&lp->send, &val)) { /* injected input characters available? */ lp 1386 src/simh/sim_tmxr.c j = lp->rxbpi - lp->rxbpr; /* # input chrs */ lp 1388 src/simh/sim_tmxr.c tmp = lp->rxb[lp->rxbpr]; /* get char */ lp 1390 src/simh/sim_tmxr.c if (lp->rbr[lp->rxbpr]) { /* break? */ lp 1391 src/simh/sim_tmxr.c lp->rbr[lp->rxbpr] = 0; /* clear status */ lp 1394 src/simh/sim_tmxr.c lp->rxbpr = lp->rxbpr + 1; /* adv pointer */ lp 1398 src/simh/sim_tmxr.c if (lp->rxbpi == lp->rxbpr) /* empty? zero ptrs */ lp 1399 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpr = 0; lp 1400 src/simh/sim_tmxr.c if (lp->rxbps) { lp 1402 src/simh/sim_tmxr.c lp->rxnexttime = floor (sim_gtime () + ((lp->rxdelta * sim_timer_inst_per_sec ())/lp->rxbpsfactor)); lp 1426 src/simh/sim_tmxr.c t_stat tmxr_get_packet_ln (TMLN *lp, const uint8 **pbuf, size_t *psize) lp 1428 src/simh/sim_tmxr.c return tmxr_get_packet_ln_ex (lp, pbuf, psize, 0); lp 1431 src/simh/sim_tmxr.c t_stat tmxr_get_packet_ln_ex (TMLN *lp, const uint8 **pbuf, size_t *psize, uint8 frame_byte) lp 1437 src/simh/sim_tmxr.c while (TMXR_VALID & (c = tmxr_getc_ln (lp))) { lp 1438 src/simh/sim_tmxr.c if (lp->rxpboffset + 3 > lp->rxpbsize) { lp 1439 src/simh/sim_tmxr.c lp->rxpbsize += 512; lp 1440 src/simh/sim_tmxr.c lp->rxpb = (uint8 *)realloc (lp->rxpb, lp->rxpbsize); lp 1441 src/simh/sim_tmxr.c if (!lp->rxpb) lp 1454 src/simh/sim_tmxr.c if ((lp->rxpboffset == 0) && (fc_size) && (c != frame_byte)) { lp 1457 src/simh/sim_tmxr.c if ((lp->datagram) && (lp->rxpboffset == fc_size)) { lp 1462 src/simh/sim_tmxr.c lp->rxpb[lp->rxpboffset++] = (uint8)(((1 + lp->rxbpi - lp->rxbpr) >> 8) & 0xFF); lp 1463 src/simh/sim_tmxr.c lp->rxpb[lp->rxpboffset++] = (uint8)((1 + lp->rxbpi - lp->rxbpr) & 0xFF); lp 1465 src/simh/sim_tmxr.c lp->rxpb[lp->rxpboffset++] = c & 0xFF; lp 1466 src/simh/sim_tmxr.c if (lp->rxpboffset >= (2 + fc_size)) { lp 1467 src/simh/sim_tmxr.c pktsize = (lp->rxpb[0+fc_size] << 8) | lp->rxpb[1+fc_size]; lp 1468 src/simh/sim_tmxr.c if (pktsize == (lp->rxpboffset - 2)) { lp 1469 src/simh/sim_tmxr.c ++lp->rxpcnt; lp 1470 src/simh/sim_tmxr.c *pbuf = &lp->rxpb[2+fc_size]; lp 1472 src/simh/sim_tmxr.c lp->rxpboffset = 0; lp 1479 src/simh/sim_tmxr.c if (lp->conn) lp 1494 src/simh/sim_tmxr.c TMLN *lp; lp 1497 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 1498 src/simh/sim_tmxr.c if (!(lp->sock lp 1499 src/simh/sim_tmxr.c || lp->loopback) || lp 1500 src/simh/sim_tmxr.c !(lp->rcve)) /* skip if not connected */ lp 1504 src/simh/sim_tmxr.c if (lp->rxbpi == 0) /* need input? */ lp 1505 src/simh/sim_tmxr.c nbytes = tmxr_read (lp, /* yes, read */ lp 1506 src/simh/sim_tmxr.c lp->rxbsz - TMXR_GUARD); /* leave spc for Telnet cruft */ lp 1507 src/simh/sim_tmxr.c else if (lp->tsta) /* in Telnet seq? */ lp 1508 src/simh/sim_tmxr.c nbytes = tmxr_read (lp, /* yes, read to end */ lp 1509 src/simh/sim_tmxr.c lp->rxbsz - lp->rxbpi); lp 1512 src/simh/sim_tmxr.c if (!lp->datagram) { /* ignore errors reading UDP sockets */ lp 1513 src/simh/sim_tmxr.c if (!lp->txbfd || lp->notelnet) lp 1514 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; /* Drop the data we already know we can't send */ lp 1515 src/simh/sim_tmxr.c tmxr_close_ln (lp); /* disconnect line */ lp 1521 src/simh/sim_tmxr.c j = lp->rxbpi; /* start of data */ lp 1522 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpi + nbytes; /* adv pointers */ lp 1523 src/simh/sim_tmxr.c lp->rxcnt = lp->rxcnt + nbytes; lp 1527 src/simh/sim_tmxr.c if (!lp->notelnet) { /* Are we looking for telnet interpretation? */ lp 1528 src/simh/sim_tmxr.c for (; j < lp->rxbpi; ) { /* loop thru char */ lp 1529 src/simh/sim_tmxr.c u_char tmp = (u_char)lp->rxb[j]; /* get char */ lp 1530 src/simh/sim_tmxr.c switch (lp->tsta) { /* case tlnt state */ lp 1534 src/simh/sim_tmxr.c lp->tsta = TNS_IAC; /* change state */ lp 1535 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove char */ lp 1538 src/simh/sim_tmxr.c if ((tmp == TN_CR) && lp->dstb) /* CR, no bin */ lp 1539 src/simh/sim_tmxr.c lp->tsta = TNS_CRPAD; /* skip pad char */ lp 1545 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* treat as normal */ lp 1550 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* treat as normal */ lp 1551 src/simh/sim_tmxr.c lp->rxb[j] = 0; /* char is null */ lp 1552 src/simh/sim_tmxr.c lp->rbr[j] = 1; /* flag break */ lp 1558 src/simh/sim_tmxr.c lp->tsta = TNS_WILL; lp 1561 src/simh/sim_tmxr.c lp->tsta = TNS_WONT; lp 1564 src/simh/sim_tmxr.c lp->tsta = TNS_DO; lp 1567 src/simh/sim_tmxr.c lp->tsta = TNS_SKIP; /* IAC + other */ lp 1573 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; //-V1037 /* ignore */ lp 1578 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; //-V1037 /* ignore */ lp 1581 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove char */ lp 1619 src/simh/sim_tmxr.c if (0 == (lp->telnet_sent_opts[tmp] & TNOS_DONT)) { lp 1620 src/simh/sim_tmxr.c lp->notelnet = TRUE; /* Temporarily disable so */ lp 1621 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_IAC); /* IAC gets injected bare */ lp 1622 src/simh/sim_tmxr.c lp->notelnet = FALSE; lp 1623 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_DONT); lp 1624 src/simh/sim_tmxr.c tmxr_putc_ln (lp, tmp); lp 1625 src/simh/sim_tmxr.c lp->telnet_sent_opts[tmp] |= TNOS_DONT;/* Record DONT sent */ lp 1631 src/simh/sim_tmxr.c if (lp->tsta == TNS_WILL) { lp 1632 src/simh/sim_tmxr.c lp->dstb = 0; lp 1635 src/simh/sim_tmxr.c lp->dstb = 1; lp 1638 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove it */ lp 1639 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* next normal */ lp 1657 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* next normal */ lp 1660 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove it */ lp 1698 src/simh/sim_tmxr.c if (0 == (lp->telnet_sent_opts[tmp] & TNOS_WONT)) { lp 1699 src/simh/sim_tmxr.c lp->notelnet = TRUE; /* Temporarily disable so */ lp 1700 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_IAC); /* IAC gets injected bare */ lp 1701 src/simh/sim_tmxr.c lp->notelnet = FALSE; lp 1702 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_WONT); lp 1703 src/simh/sim_tmxr.c tmxr_putc_ln (lp, tmp); lp 1704 src/simh/sim_tmxr.c lp->telnet_sent_opts[tmp] |= TNOS_WONT;/* Record WONT sent */ lp 1709 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove char */ lp 1710 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* next normal */ lp 1718 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 1719 src/simh/sim_tmxr.c if (lp->rxbpi == lp->rxbpr) /* if buf empty, */ lp 1720 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpr = 0; /* reset pointers */ lp 1727 src/simh/sim_tmxr.c int32 tmxr_rqln_bare (const TMLN *lp, t_bool speed) lp 1729 src/simh/sim_tmxr.c if ((speed) && (lp->rxbps)) { /* consider speed and rate limiting? */ lp 1730 src/simh/sim_tmxr.c if (sim_gtime () < lp->rxnexttime) /* too soon? */ lp 1733 src/simh/sim_tmxr.c return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz : 0)) ? 1 : 0; lp 1735 src/simh/sim_tmxr.c return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz: 0)); lp 1738 src/simh/sim_tmxr.c int32 tmxr_rqln (const TMLN *lp) lp 1740 src/simh/sim_tmxr.c return tmxr_rqln_bare (lp, TRUE); lp 1756 src/simh/sim_tmxr.c t_stat tmxr_putc_ln (TMLN *lp, int32 chr) lp 1758 src/simh/sim_tmxr.c if ((lp->conn == FALSE) && /* no conn & not buffered telnet? */ lp 1759 src/simh/sim_tmxr.c (!lp->txbfd || lp->notelnet)) { lp 1760 src/simh/sim_tmxr.c ++lp->txdrp; /* lost */ lp 1764 src/simh/sim_tmxr.c #define TXBUF_AVAIL(lp) (lp->txbsz - tmxr_tqln (lp)) lp 1766 src/simh/sim_tmxr.c #define TXBUF_CHAR(lp, c) { \ lp 1767 src/simh/sim_tmxr.c lp->txb[lp->txbpi++] = (char)(c); \ lp 1768 src/simh/sim_tmxr.c lp->txbpi %= lp->txbsz; \ lp 1769 src/simh/sim_tmxr.c if (lp->txbpi == lp->txbpr) \ lp 1770 src/simh/sim_tmxr.c lp->txbpr = (1+lp->txbpr)%lp->txbsz, ++lp->txdrp; \ lp 1773 src/simh/sim_tmxr.c if ((lp->txbfd && !lp->notelnet) || (TXBUF_AVAIL(lp) > 1)) {/* room for char (+ IAC)? */ lp 1774 src/simh/sim_tmxr.c if ((TN_IAC == (u_char) chr) && (!lp->notelnet)) /* char == IAC in telnet session? */ lp 1775 src/simh/sim_tmxr.c TXBUF_CHAR (lp, TN_IAC); /* stuff extra IAC char */ lp 1776 src/simh/sim_tmxr.c TXBUF_CHAR (lp, chr); /* buffer char & adv pointer */ lp 1777 src/simh/sim_tmxr.c if ((!lp->txbfd) && ((unsigned long int)TXBUF_AVAIL (lp) <= TMXR_GUARD)) /* near full? */ lp 1778 src/simh/sim_tmxr.c lp->xmte = 0; /* disable line */ lp 1779 src/simh/sim_tmxr.c if (lp->txlog) /* log if available */ lp 1780 src/simh/sim_tmxr.c fputc (chr, lp->txlog); lp 1781 src/simh/sim_tmxr.c sim_exp_check (&lp->expect, chr); /* process expect rules as needed */ lp 1784 src/simh/sim_tmxr.c ++lp->txdrp; lp->xmte = 0; /* no room, dsbl line */ lp 1805 src/simh/sim_tmxr.c t_stat tmxr_put_packet_ln (TMLN *lp, const uint8 *buf, size_t size) lp 1807 src/simh/sim_tmxr.c return tmxr_put_packet_ln_ex (lp, buf, size, 0); lp 1810 src/simh/sim_tmxr.c t_stat tmxr_put_packet_ln_ex (TMLN *lp, const uint8 *buf, size_t size, uint8 frame_byte) lp 1814 src/simh/sim_tmxr.c size_t pktlen_size = (lp->datagram ? 0 : 2); lp 1816 src/simh/sim_tmxr.c if ((!lp->conn) && (!lp->loopback)) lp 1818 src/simh/sim_tmxr.c if (lp->txppoffset < lp->txppsize) { lp 1821 src/simh/sim_tmxr.c if (lp->txpbsize < size + pktlen_size + fc_size) { lp 1822 src/simh/sim_tmxr.c lp->txpbsize = size + pktlen_size + fc_size; lp 1823 src/simh/sim_tmxr.c lp->txpb = (uint8 *)realloc (lp->txpb, lp->txpbsize); lp 1824 src/simh/sim_tmxr.c if (!lp->txpb) lp 1837 src/simh/sim_tmxr.c lp->txpb[0] = frame_byte; lp 1838 src/simh/sim_tmxr.c if (!lp->datagram) { lp 1839 src/simh/sim_tmxr.c lp->txpb[0+fc_size] = (size >> 8) & 0xFF; lp 1840 src/simh/sim_tmxr.c lp->txpb[1+fc_size] = size & 0xFF; lp 1842 src/simh/sim_tmxr.c memcpy (lp->txpb + pktlen_size + fc_size, buf, size); lp 1843 src/simh/sim_tmxr.c lp->txppsize = size + pktlen_size + fc_size; lp 1844 src/simh/sim_tmxr.c lp->txppoffset = 0; lp 1845 src/simh/sim_tmxr.c ++lp->txpcnt; lp 1846 src/simh/sim_tmxr.c while ((lp->txppoffset < lp->txppsize) && lp 1847 src/simh/sim_tmxr.c (SCPE_OK == (r = tmxr_putc_ln (lp, lp->txpb[lp->txppoffset])))) lp 1848 src/simh/sim_tmxr.c ++lp->txppoffset; lp 1850 src/simh/sim_tmxr.c tmxr_send_buffered_data (lp); lp 1851 src/simh/sim_tmxr.c return (lp->conn || lp->loopback) ? SCPE_OK : SCPE_LOST; lp 1865 src/simh/sim_tmxr.c TMLN *lp; lp 1868 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 1869 src/simh/sim_tmxr.c if (!lp->conn) /* skip if !conn */ lp 1871 src/simh/sim_tmxr.c nbytes = tmxr_send_buffered_data (lp); /* buffered bytes */ lp 1873 src/simh/sim_tmxr.c lp->xmte = 1; /* enable line transmit */ lp 1887 src/simh/sim_tmxr.c int32 tmxr_send_buffered_data (TMLN *lp) lp 1892 src/simh/sim_tmxr.c nbytes = tmxr_tqln(lp); /* avail bytes */ lp 1894 src/simh/sim_tmxr.c if (lp->txbpr < lp->txbpi) /* no wrap? */ lp 1895 src/simh/sim_tmxr.c sbytes = tmxr_write (lp, nbytes); /* write all data */ lp 1897 src/simh/sim_tmxr.c sbytes = tmxr_write (lp, lp->txbsz - lp->txbpr);/* write to end buf */ lp 1899 src/simh/sim_tmxr.c lp->txbpr = (lp->txbpr + sbytes); /* update remove ptr */ lp 1900 src/simh/sim_tmxr.c if (lp->txbpr >= lp->txbsz) /* wrap? */ lp 1901 src/simh/sim_tmxr.c lp->txbpr = 0; lp 1902 src/simh/sim_tmxr.c lp->txcnt = lp->txcnt + sbytes; /* update counts */ lp 1904 src/simh/sim_tmxr.c if ((nbytes == 0) && (lp->datagram)) /* if Empty buffer on datagram line */ lp 1905 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; /* Start next packet at beginning of buffer */ lp 1908 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; /* Drop the data we already know we can't send */ lp 1909 src/simh/sim_tmxr.c lp->rxpboffset = lp->txppoffset = lp->txppsize = 0;/* Drop the data we already know we can't send */ lp 1910 src/simh/sim_tmxr.c tmxr_close_ln (lp); /* close line/port on error */ lp 1913 src/simh/sim_tmxr.c if (nbytes && (lp->txbpr == 0)) { /* more data and wrap? */ lp 1914 src/simh/sim_tmxr.c sbytes = tmxr_write (lp, nbytes); lp 1916 src/simh/sim_tmxr.c lp->txbpr = (lp->txbpr + sbytes); /* update remove ptr */ lp 1917 src/simh/sim_tmxr.c if (lp->txbpr >= lp->txbsz) /* wrap? */ lp 1918 src/simh/sim_tmxr.c lp->txbpr = 0; lp 1919 src/simh/sim_tmxr.c lp->txcnt = lp->txcnt + sbytes; /* update counts */ lp 1924 src/simh/sim_tmxr.c while ((lp->txppoffset < lp->txppsize) && /* buffered packet data? */ lp 1925 src/simh/sim_tmxr.c (lp->txbsz > nbytes) && /* and room in xmt buffer */ lp 1926 src/simh/sim_tmxr.c (SCPE_OK == (r = tmxr_putc_ln (lp, lp->txpb[lp->txppoffset])))) lp 1927 src/simh/sim_tmxr.c ++lp->txppoffset; lp 1929 src/simh/sim_tmxr.c if ((nbytes == 0) && (tmxr_tqln(lp) > 0)) lp 1930 src/simh/sim_tmxr.c return tmxr_send_buffered_data (lp); lp 1931 src/simh/sim_tmxr.c return tmxr_tqln(lp) + tmxr_tpqln(lp); lp 1936 src/simh/sim_tmxr.c int32 tmxr_tqln (const TMLN *lp) lp 1938 src/simh/sim_tmxr.c return (lp->txbpi - lp->txbpr + ((lp->txbpi < lp->txbpr)? lp->txbsz: 0)); lp 1943 src/simh/sim_tmxr.c int32 tmxr_tpqln (const TMLN *lp) lp 1945 src/simh/sim_tmxr.c return (lp->txppsize - lp->txppoffset); lp 1950 src/simh/sim_tmxr.c t_bool tmxr_tpbusyln (const TMLN *lp) lp 1952 src/simh/sim_tmxr.c return (0 != (lp->txppsize - lp->txppoffset)); lp 1955 src/simh/sim_tmxr.c static void _mux_detach_line (TMLN *lp, t_bool close_listener, t_bool close_connecting) lp 1957 src/simh/sim_tmxr.c if (close_listener && lp->master) { lp 1958 src/simh/sim_tmxr.c sim_close_sock (lp->master); lp 1959 src/simh/sim_tmxr.c lp->master = 0; lp 1960 src/simh/sim_tmxr.c FREE (lp->port); lp 1961 src/simh/sim_tmxr.c lp->port = NULL; lp 1963 src/simh/sim_tmxr.c if (lp->sock) { /* if existing tcp, drop it */ lp 1964 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report disconnection */ lp 1965 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 1968 src/simh/sim_tmxr.c FREE (lp->destination); lp 1969 src/simh/sim_tmxr.c lp->destination = NULL; lp 1970 src/simh/sim_tmxr.c if (lp->connecting) { /* if existing outgoing tcp, drop it */ lp 1971 src/simh/sim_tmxr.c lp->sock = lp->connecting; lp 1972 src/simh/sim_tmxr.c lp->connecting = 0; lp 1973 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 1976 src/simh/sim_tmxr.c tmxr_set_line_loopback (lp, FALSE); lp 1979 src/simh/sim_tmxr.c t_stat tmxr_detach_ln (TMLN *lp) lp 1983 src/simh/sim_tmxr.c _mux_detach_line (lp, TRUE, TRUE); lp 1984 src/simh/sim_tmxr.c if (lp->mp) { lp 1985 src/simh/sim_tmxr.c if (lp->uptr) lp 1986 src/simh/sim_tmxr.c uptr = lp->uptr; lp 1988 src/simh/sim_tmxr.c uptr = lp->mp->uptr; lp 1992 src/simh/sim_tmxr.c uptr->filename = tmxr_mux_attach_string (uptr->filename, lp->mp); lp 1995 src/simh/sim_tmxr.c tmxr_detach (lp->mp, uptr); lp 2046 src/simh/sim_tmxr.c t_stat tmxr_set_line_speed (TMLN *lp, CONST char *speed) lp 2056 src/simh/sim_tmxr.c if (lp == NULL) lp 2058 src/simh/sim_tmxr.c lp->rxbps = (uint32)strtotv (speed, &cptr, 10); lp 2063 src/simh/sim_tmxr.c lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE * rxbpsfactor; lp 2065 src/simh/sim_tmxr.c lp->rxdelta = _tmln_speed_delta (speed); lp 2066 src/simh/sim_tmxr.c lp->rxnexttime = 0.0; lp 2067 src/simh/sim_tmxr.c uptr = lp->uptr; lp 2068 src/simh/sim_tmxr.c if ((!uptr) && (lp->mp)) lp 2069 src/simh/sim_tmxr.c uptr = lp->mp->uptr; lp 2071 src/simh/sim_tmxr.c uptr->wait = lp->rxdelta; lp 2072 src/simh/sim_tmxr.c if (lp->rxbpsfactor == 0.0) lp 2073 src/simh/sim_tmxr.c lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE; lp 2074 src/simh/sim_tmxr.c lp->txbps = lp->rxbps; lp 2075 src/simh/sim_tmxr.c lp->txdelta = lp->rxdelta; lp 2076 src/simh/sim_tmxr.c lp->txnexttime = lp->rxnexttime; lp 2096 src/simh/sim_tmxr.c TMLN *lp = NULL; lp 2102 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2103 src/simh/sim_tmxr.c lp->mp = mp; /* set the back pointer */ lp 2104 src/simh/sim_tmxr.c lp->modem_control = mp->modem_control; lp 2105 src/simh/sim_tmxr.c if (lp->rxbpsfactor == 0.0) lp 2106 src/simh/sim_tmxr.c lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE; lp 2318 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2319 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2320 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2321 src/simh/sim_tmxr.c lp->txlogname = (char *)realloc(lp->txlogname, CBUFSIZE); lp 2322 src/simh/sim_tmxr.c if (!lp->txlogname) lp 2335 src/simh/sim_tmxr.c sprintf(lp->txlogname, "%s_%d", mp->logfiletmpl, i); lp 2337 src/simh/sim_tmxr.c strcpy (lp->txlogname, mp->logfiletmpl); lp 2338 src/simh/sim_tmxr.c r = sim_open_logfile (lp->txlogname, TRUE, &lp->txlog, &lp->txlogref); lp 2340 src/simh/sim_tmxr.c setvbuf (lp->txlog, NULL, _IOFBF, 65536); lp 2342 src/simh/sim_tmxr.c FREE (lp->txlogname); lp 2343 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2350 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2352 src/simh/sim_tmxr.c lp->txbsz = mp->buffered; lp 2353 src/simh/sim_tmxr.c lp->txbfd = 1; lp 2354 src/simh/sim_tmxr.c lp->rxbsz = mp->buffered; lp 2357 src/simh/sim_tmxr.c lp->txbsz = TMXR_MAXBUF; lp 2358 src/simh/sim_tmxr.c lp->txbfd = 0; lp 2359 src/simh/sim_tmxr.c lp->rxbsz = TMXR_MAXBUF; lp 2361 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; lp 2362 src/simh/sim_tmxr.c lp->txb = (char *)realloc(lp->txb, lp->txbsz); lp 2363 src/simh/sim_tmxr.c if (!lp->txb) lp 2375 src/simh/sim_tmxr.c lp->rxb = (char *)realloc(lp->rxb, lp->rxbsz); lp 2376 src/simh/sim_tmxr.c if (!lp->rxb) lp 2388 src/simh/sim_tmxr.c lp->rbr = (char *)realloc(lp->rbr, lp->rxbsz); lp 2389 src/simh/sim_tmxr.c if (!lp->rbr) lp 2405 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2406 src/simh/sim_tmxr.c FREE(lp->txlogname); lp 2407 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2408 src/simh/sim_tmxr.c if (lp->txlog) { lp 2409 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2410 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2448 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2449 src/simh/sim_tmxr.c lp->mp = mp; /* set the back pointer */ lp 2450 src/simh/sim_tmxr.c lp->packet = mp->packet; lp 2452 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 2453 src/simh/sim_tmxr.c tmxr_init_line (lp); /* initialize line state */ lp 2454 src/simh/sim_tmxr.c lp->sock = 0; /* clear the socket */ lp 2462 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2463 src/simh/sim_tmxr.c tmxr_set_line_loopback (lp, loopback); lp 2465 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 2471 src/simh/sim_tmxr.c lp = &mp->ldsc[0]; lp 2472 src/simh/sim_tmxr.c lp->datagram = datagram; lp 2475 src/simh/sim_tmxr.c lp->port = (char *)realloc (lp->port, 1 + strlen (listen)); lp 2476 src/simh/sim_tmxr.c if (!lp->port) lp 2488 src/simh/sim_tmxr.c strcpy (lp->port, listen); /* save port */ lp 2493 src/simh/sim_tmxr.c lp->packet = packet; lp 2498 src/simh/sim_tmxr.c _mux_detach_line (lp, FALSE, TRUE); lp 2499 src/simh/sim_tmxr.c lp->destination = (char *)malloc(1+strlen(hostport)); lp 2500 src/simh/sim_tmxr.c if (!lp->destination) lp 2512 src/simh/sim_tmxr.c strcpy (lp->destination, hostport); lp 2513 src/simh/sim_tmxr.c lp->mp = mp; lp 2514 src/simh/sim_tmxr.c if (!lp->modem_control || (lp->modembits & TMXR_MDM_DTR)) { lp 2515 src/simh/sim_tmxr.c lp->connecting = sock; lp 2516 src/simh/sim_tmxr.c lp->ipad = (char *)malloc (1 + strlen (lp->destination)); lp 2517 src/simh/sim_tmxr.c if (!lp->ipad) lp 2529 src/simh/sim_tmxr.c strcpy (lp->ipad, lp->destination); lp 2533 src/simh/sim_tmxr.c lp->notelnet = notelnet; lp 2534 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init the line state */ lp 2536 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 2544 src/simh/sim_tmxr.c lp = &mp->ldsc[line]; lp 2545 src/simh/sim_tmxr.c lp->mp = mp; lp 2547 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2548 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2549 src/simh/sim_tmxr.c lp->txlogname = (char *)realloc (lp->txlogname, 1 + strlen (logfiletmpl)); lp 2550 src/simh/sim_tmxr.c if (!lp->txlogname) lp 2562 src/simh/sim_tmxr.c strcpy (lp->txlogname, logfiletmpl); lp 2563 src/simh/sim_tmxr.c r = sim_open_logfile (lp->txlogname, TRUE, &lp->txlog, &lp->txlogref); lp 2565 src/simh/sim_tmxr.c setvbuf(lp->txlog, NULL, _IOFBF, 65536); lp 2567 src/simh/sim_tmxr.c FREE (lp->txlogname); lp 2568 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2573 src/simh/sim_tmxr.c lp->rxbsz = lp->txbsz = TMXR_MAXBUF; lp 2574 src/simh/sim_tmxr.c lp->txbfd = 0; lp 2577 src/simh/sim_tmxr.c lp->rxbsz = lp->txbsz = atoi(buffered); lp 2578 src/simh/sim_tmxr.c lp->txbfd = 1; lp 2580 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; lp 2581 src/simh/sim_tmxr.c lp->txb = (char *)realloc (lp->txb, lp->txbsz); lp 2582 src/simh/sim_tmxr.c if (!lp->txb) lp 2594 src/simh/sim_tmxr.c lp->rxb = (char *)realloc (lp->rxb, lp->rxbsz); lp 2595 src/simh/sim_tmxr.c if (!lp->rxb) lp 2607 src/simh/sim_tmxr.c lp->rbr = (char *)realloc (lp->rbr, lp->rxbsz); lp 2608 src/simh/sim_tmxr.c if (!lp->rbr) lp 2620 src/simh/sim_tmxr.c lp->packet = packet; lp 2622 src/simh/sim_tmxr.c FREE(lp->txlogname); lp 2623 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2624 src/simh/sim_tmxr.c if (lp->txlog) { lp 2625 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2626 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2637 src/simh/sim_tmxr.c _mux_detach_line (lp, TRUE, FALSE); lp 2639 src/simh/sim_tmxr.c lp->port = (char *)realloc (lp->port, 1 + strlen (listen)); lp 2640 src/simh/sim_tmxr.c if (!lp->port) lp 2652 src/simh/sim_tmxr.c strcpy (lp->port, listen); /* save port */ lp 2653 src/simh/sim_tmxr.c lp->master = sock; /* save master socket */ lp 2655 src/simh/sim_tmxr.c lp->notelnet = listennotelnet; lp 2657 src/simh/sim_tmxr.c lp->notelnet = mp->notelnet; lp 2660 src/simh/sim_tmxr.c lp->datagram = datagram; lp 2663 src/simh/sim_tmxr.c lp->port = (char *)realloc (lp->port, 1 + strlen (listen)); lp 2664 src/simh/sim_tmxr.c if (!lp->port) lp 2676 src/simh/sim_tmxr.c strcpy (lp->port, listen); /* save port */ lp 2683 src/simh/sim_tmxr.c _mux_detach_line (lp, FALSE, TRUE); lp 2684 src/simh/sim_tmxr.c lp->destination = (char *)malloc(1+strlen(hostport)); lp 2685 src/simh/sim_tmxr.c if (!lp->destination) lp 2697 src/simh/sim_tmxr.c strcpy (lp->destination, hostport); lp 2698 src/simh/sim_tmxr.c if (!lp->modem_control || (lp->modembits & TMXR_MDM_DTR)) { lp 2699 src/simh/sim_tmxr.c lp->connecting = sock; lp 2700 src/simh/sim_tmxr.c lp->ipad = (char *)malloc (1 + strlen (lp->destination)); lp 2701 src/simh/sim_tmxr.c if (!lp->ipad) lp 2713 src/simh/sim_tmxr.c strcpy (lp->ipad, lp->destination); lp 2717 src/simh/sim_tmxr.c lp->notelnet = notelnet; lp 2718 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init the line state */ lp 2725 src/simh/sim_tmxr.c if (lp != NULL) { lp 2726 src/simh/sim_tmxr.c tmxr_set_line_loopback (lp, loopback); lp 2730 src/simh/sim_tmxr.c if (lp != NULL) lp->modem_control = modem_control; lp 2733 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 2955 src/simh/sim_tmxr.c TMLN *lp; lp 2992 src/simh/sim_tmxr.c lp = mp->ldsc + j; lp 2994 src/simh/sim_tmxr.c if (lp->dptr && (mp->dptr != lp->dptr)) lp 2995 src/simh/sim_tmxr.c fprintf (st, "Device: %s ", sim_dname(lp->dptr)); lp 2997 src/simh/sim_tmxr.c if (mp->notelnet != lp->notelnet) lp 2998 src/simh/sim_tmxr.c fprintf (st, " - %stelnet", lp->notelnet ? "no" : ""); lp 2999 src/simh/sim_tmxr.c if (lp->uptr && (lp->uptr != lp->mp->uptr)) lp 3000 src/simh/sim_tmxr.c fprintf (st, " - Unit: %s", sim_uname (lp->uptr)); lp 3001 src/simh/sim_tmxr.c if (mp->modem_control != lp->modem_control) lp 3002 src/simh/sim_tmxr.c fprintf(st, ", ModemControl=%s", lp->modem_control ? "enabled" : "disabled"); lp 3003 src/simh/sim_tmxr.c if (lp->loopback) lp 3005 src/simh/sim_tmxr.c if (lp->rxbps) { lp 3006 src/simh/sim_tmxr.c fprintf(st, ", Speed=%lu", (unsigned long)lp->rxbps); lp 3007 src/simh/sim_tmxr.c if (lp->rxbpsfactor != TMXR_RX_BPS_UNIT_SCALE) lp 3008 src/simh/sim_tmxr.c fprintf(st, "*%.0f", lp->rxbpsfactor/TMXR_RX_BPS_UNIT_SCALE); lp 3013 src/simh/sim_tmxr.c if ((!lp->sock) && (!lp->connecting) lp 3014 src/simh/sim_tmxr.c && (!lp->master)) { lp 3015 src/simh/sim_tmxr.c if (lp->modem_control) lp 3016 src/simh/sim_tmxr.c tmxr_fconns (st, lp, -1); lp 3019 src/simh/sim_tmxr.c tmxr_fconns (st, lp, -1); lp 3020 src/simh/sim_tmxr.c tmxr_fstats (st, lp, -1); lp 3037 src/simh/sim_tmxr.c TMLN *lp; lp 3040 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 3042 src/simh/sim_tmxr.c if (!lp->destination && lp->sock) { /* not serial and is connected? */ lp 3043 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report disconnection */ lp 3044 src/simh/sim_tmxr.c tmxr_reset_ln (lp); /* disconnect line */ lp 3047 src/simh/sim_tmxr.c if (lp->sock) { lp 3048 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report disconnection */ lp 3049 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 3051 src/simh/sim_tmxr.c FREE (lp->destination); lp 3052 src/simh/sim_tmxr.c lp->destination = NULL; lp 3053 src/simh/sim_tmxr.c if (lp->connecting) { lp 3054 src/simh/sim_tmxr.c lp->sock = lp->connecting; lp 3055 src/simh/sim_tmxr.c lp->connecting = 0; lp 3056 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 3058 src/simh/sim_tmxr.c lp->conn = FALSE; lp 3060 src/simh/sim_tmxr.c if (lp->master) { lp 3061 src/simh/sim_tmxr.c sim_close_sock (lp->master); /* close master socket */ lp 3062 src/simh/sim_tmxr.c lp->master = 0; lp 3063 src/simh/sim_tmxr.c FREE (lp->port); lp 3064 src/simh/sim_tmxr.c lp->port = NULL; lp 3066 src/simh/sim_tmxr.c lp->txbfd = 0; lp 3067 src/simh/sim_tmxr.c FREE (lp->txb); lp 3068 src/simh/sim_tmxr.c lp->txb = NULL; lp 3069 src/simh/sim_tmxr.c FREE (lp->rxb); lp 3070 src/simh/sim_tmxr.c lp->rxb = NULL; lp 3071 src/simh/sim_tmxr.c FREE (lp->rbr); lp 3072 src/simh/sim_tmxr.c lp->rbr = NULL; lp 3073 src/simh/sim_tmxr.c lp->modembits = 0; lp 3356 src/simh/sim_tmxr.c void tmxr_linemsg (TMLN *lp, const char *msg) lp 3359 src/simh/sim_tmxr.c while (SCPE_STALL == tmxr_putc_ln (lp, (int32)(*msg))) lp 3360 src/simh/sim_tmxr.c if (lp->txbsz == tmxr_send_buffered_data (lp)) lp 3369 src/simh/sim_tmxr.c void tmxr_linemsgf (TMLN *lp, const char *fmt, ...) lp 3374 src/simh/sim_tmxr.c tmxr_linemsgvf (lp, fmt, arglist); lp 3378 src/simh/sim_tmxr.c void tmxr_linemsgvf (TMLN *lp, const char *fmt, va_list arglist) lp 3420 src/simh/sim_tmxr.c while (SCPE_STALL == tmxr_putc_ln (lp, '\r')) lp 3421 src/simh/sim_tmxr.c if (lp->txbsz == tmxr_send_buffered_data (lp)) lp 3424 src/simh/sim_tmxr.c while (SCPE_STALL == tmxr_putc_ln (lp, buf[i])) lp 3425 src/simh/sim_tmxr.c if (lp->txbsz == tmxr_send_buffered_data (lp)) lp 3435 src/simh/sim_tmxr.c void tmxr_fconns (FILE *st, const TMLN *lp, int32 ln) lp 3443 src/simh/sim_tmxr.c if ((lp->sock) || (lp->connecting)) { /* tcp connection? */ lp 3444 src/simh/sim_tmxr.c if (lp->destination) /* remote connection? */ lp 3445 src/simh/sim_tmxr.c if (lp->datagram) lp 3446 src/simh/sim_tmxr.c fprintf (st, "Datagram Connection from %s to remote port %s\n", lp->port, lp->destination);/* print port name */ lp 3448 src/simh/sim_tmxr.c fprintf (st, "Connection to remote port %s\n", lp->destination);/* print port name */ lp 3450 src/simh/sim_tmxr.c fprintf (st, "Connection from IP address %s\n", lp->ipad); lp 3453 src/simh/sim_tmxr.c if (lp->destination) /* remote connection? */ lp 3454 src/simh/sim_tmxr.c fprintf (st, "Connecting to remote port %s\n", lp->destination);/* print port name */ lp 3455 src/simh/sim_tmxr.c if (lp->sock) { lp 3458 src/simh/sim_tmxr.c sim_getnames_sock (lp->sock, &sockname, &peername); lp 3464 src/simh/sim_tmxr.c if ((lp->port) && (!lp->datagram)) lp 3465 src/simh/sim_tmxr.c fprintf (st, "Listening on port %s\n", lp->port); /* print port name */ lp 3466 src/simh/sim_tmxr.c if (lp->cnms) { lp 3467 src/simh/sim_tmxr.c tctime = (sim_os_msec () - lp->cnms) / 1000; lp 3472 src/simh/sim_tmxr.c fprintf (st, " %s %02d:%02d:%02d\n", lp->connecting ? "Connecting for" : "Connected", hr, mn, sc); lp 3477 src/simh/sim_tmxr.c if (lp->modem_control) { lp 3478 src/simh/sim_tmxr.c fprintf (st, " Modem Bits: %s%s%s%s%s%s\n", (lp->modembits & TMXR_MDM_DTR) ? "DTR " : "", lp 3479 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_RTS) ? "RTS " : "", lp 3480 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_DCD) ? "DCD " : "", lp 3481 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_RNG) ? "RNG " : "", lp 3482 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_CTS) ? "CTS " : "", lp 3483 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_DSR) ? "DSR " : ""); lp 3487 src/simh/sim_tmxr.c (lp->sock) && (!lp->datagram)) lp 3488 src/simh/sim_tmxr.c fprintf (st, " %s\n", (lp->notelnet) ? "Telnet disabled (RAW data)" : "Telnet protocol"); lp 3489 src/simh/sim_tmxr.c if (lp->send.buffer) lp 3490 src/simh/sim_tmxr.c sim_show_send_input (st, &lp->send); lp 3491 src/simh/sim_tmxr.c if (lp->expect.buf) lp 3492 src/simh/sim_tmxr.c sim_exp_showall (st, &lp->expect); lp 3493 src/simh/sim_tmxr.c if (lp->txlog) lp 3494 src/simh/sim_tmxr.c fprintf (st, " Logging to %s\n", lp->txlogname); lp 3500 src/simh/sim_tmxr.c void tmxr_fstats (FILE *st, const TMLN *lp, int32 ln) lp 3507 src/simh/sim_tmxr.c if ((!lp->sock) && (!lp->connecting) lp 3513 src/simh/sim_tmxr.c fprintf (st, " input (%s)", (lp->rcve? enab: dsab)); lp 3514 src/simh/sim_tmxr.c if (lp->rxcnt) lp 3515 src/simh/sim_tmxr.c fprintf (st, " queued/total = %d/%d", tmxr_rqln (lp), lp->rxcnt); lp 3516 src/simh/sim_tmxr.c if (lp->rxpcnt) lp 3517 src/simh/sim_tmxr.c fprintf (st, " packets = %d", lp->rxpcnt); lp 3518 src/simh/sim_tmxr.c fprintf (st, "\n output (%s)", (lp->xmte? enab: dsab)); lp 3519 src/simh/sim_tmxr.c if (lp->txcnt || lp->txbpi) lp 3520 src/simh/sim_tmxr.c fprintf (st, " queued/total = %d/%d", tmxr_tqln (lp), lp->txcnt); lp 3521 src/simh/sim_tmxr.c if (lp->txpcnt || tmxr_tpqln (lp)) lp 3523 src/simh/sim_tmxr.c tmxr_tpqln (lp), lp->txpcnt); lp 3526 src/simh/sim_tmxr.c if (lp->txbfd) lp 3527 src/simh/sim_tmxr.c fprintf (st, " output buffer size = %d\n", lp->txbsz); lp 3528 src/simh/sim_tmxr.c if (lp->txcnt || lp->txbpi) lp 3530 src/simh/sim_tmxr.c ((lp->txcnt > 0) && (lp->txcnt > lp->txbsz)) ? lp->txbsz : lp->txbpi); lp 3531 src/simh/sim_tmxr.c if (lp->txdrp) lp 3532 src/simh/sim_tmxr.c fprintf (st, " dropped = %d\n", lp->txdrp); lp 3565 src/simh/sim_tmxr.c TMLN *lp; lp 3571 src/simh/sim_tmxr.c lp = tmxr_get_ldsc (uptr, cptr, mp, &status); /* get referenced line */ lp 3573 src/simh/sim_tmxr.c if (lp == NULL) /* bad line number? */ lp 3576 src/simh/sim_tmxr.c if ((lp->sock) lp 3578 src/simh/sim_tmxr.c if (!lp->notelnet) lp 3579 src/simh/sim_tmxr.c tmxr_linemsg (lp, "\r\nOperator disconnected line\r\n\n");/* report closure */ lp 3580 src/simh/sim_tmxr.c tmxr_reset_ln_ex (lp, (sim_switches & SWMASK ('C'))); /* drop the line */ lp 3591 src/simh/sim_tmxr.c TMLN *lp; lp 3595 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, val, mp); /* find line desc */ lp 3596 src/simh/sim_tmxr.c if (lp == NULL) lp 3598 src/simh/sim_tmxr.c if (lp->txlog) /* close existing log */ lp 3600 src/simh/sim_tmxr.c lp->txlogname = (char *) calloc (CBUFSIZE, sizeof (char)); /* alloc namebuf */ lp 3601 src/simh/sim_tmxr.c if (lp->txlogname == NULL) /* can't? */ lp 3603 src/simh/sim_tmxr.c strncpy (lp->txlogname, cptr, CBUFSIZE-1); /* save file name */ lp 3604 src/simh/sim_tmxr.c sim_open_logfile (cptr, TRUE, &lp->txlog, &lp->txlogref);/* open log */ lp 3605 src/simh/sim_tmxr.c if (lp->txlog == NULL) { /* error? */ lp 3606 src/simh/sim_tmxr.c FREE (lp->txlogname); /* free buffer */ lp 3610 src/simh/sim_tmxr.c lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp); lp 3619 src/simh/sim_tmxr.c TMLN *lp; lp 3623 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, val, mp); /* find line desc */ lp 3624 src/simh/sim_tmxr.c if (lp == NULL) lp 3626 src/simh/sim_tmxr.c if (lp->txlog) { /* logging? */ lp 3627 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); /* close log */ lp 3628 src/simh/sim_tmxr.c FREE (lp->txlogname); /* free namebuf */ lp 3629 src/simh/sim_tmxr.c lp->txlog = NULL; lp 3630 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 3633 src/simh/sim_tmxr.c lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp); lp 3642 src/simh/sim_tmxr.c TMLN *lp; lp 3644 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, val, mp); /* find line desc */ lp 3645 src/simh/sim_tmxr.c if (lp == NULL) lp 3647 src/simh/sim_tmxr.c if (lp->txlog) lp 3648 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)