lp 4626 src/decNumber/decNumber.c uLong *lp; // .. lp 4737 src/decNumber/decNumber.c for (lp=zacc; lp<zacc+iacc; lp++) *lp=0; lp 4758 src/decNumber/decNumber.c lp=zacc+(rip-zrhi); // where to add the lhs lp 4759 src/decNumber/decNumber.c for (lip=zlhi; lip<=lmsi; lip++, lp++) { // over each item in lhs lp 4760 src/decNumber/decNumber.c *lp+=(uLong)(*lip)*(*rip); // [this should in-line] lp 4766 src/decNumber/decNumber.c for (lp=zacc; lp<zacc+iacc; lp++) { lp 4767 src/decNumber/decNumber.c if (*lp<FASTBASE) continue; // it fits lp 4768 src/decNumber/decNumber.c lcarry=*lp/FASTBASE; // top part [slow divide] lp 4776 src/decNumber/decNumber.c *(lp+2)+=carry2; // add to item+2 lp 4777 src/decNumber/decNumber.c *lp-=((uLong)FASTBASE*FASTBASE*carry2); // [slow] lp 4780 src/decNumber/decNumber.c *(lp+1)+=carry; // add to item above [inline] lp 4781 src/decNumber/decNumber.c *lp-=((uLong)FASTBASE*carry); // [inline] lp 4791 src/decNumber/decNumber.c for (lp=zacc, up=acc; lp<zacc+iacc; lp++) { lp 4792 src/decNumber/decNumber.c uInt item=(uInt)*lp; // decapitate to uInt lp 1563 src/dps8/dps8_console.c uint lp = (uint)narrow_char; lp 1566 src/dps8/dps8_console.c if (lp == 060 /* + */ || lp == 075 /* = */) { // POLTS lp 1570 src/dps8/dps8_console.c if (lp == 0) lp 1571 src/dps8/dps8_console.c lp = 1; lp 1572 src/dps8/dps8_console.c if (lp >= 16) { lp 1576 src/dps8/dps8_console.c for (uint i = 0; i < lp; i ++) { lp 400 src/simh/sim_console.c TMLN *lp; lp 423 src/simh/sim_console.c lp = &sim_rem_con_tmxr.ldsc[i]; lp 424 src/simh/sim_console.c if (!lp->conn) lp 429 src/simh/sim_console.c tmxr_fconns (st, lp, i); lp 450 src/simh/sim_console.c TMLN *lp = &sim_rem_con_tmxr.ldsc[c]; lp 454 src/simh/sim_console.c lp->rcve = 1; /* rcv enabled */ lp 465 src/simh/sim_console.c tmxr_linemsgf (lp, "%s Remote Console\r\n" lp 472 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush buffered data */ lp 594 src/simh/sim_console.c static void _sim_rem_log_out (TMLN *lp) lp 605 src/simh/sim_console.c tmxr_linemsgf (lp, "%s", cbuf); lp 606 src/simh/sim_console.c if (!tmxr_input_pending_ln (lp)) { lp 608 src/simh/sim_console.c unwritten = tmxr_send_buffered_data (lp); lp 609 src/simh/sim_console.c if (unwritten == lp->txbsz) lp 611 src/simh/sim_console.c } while (unwritten == lp->txbsz); lp 652 src/simh/sim_console.c TMLN *lp; lp 668 src/simh/sim_console.c lp = &sim_rem_con_tmxr.ldsc[i]; lp 669 src/simh/sim_console.c if (!lp->conn) lp 672 src/simh/sim_console.c tmxr_linemsgf (lp, "\nMaster Mode Session\r\n"); lp 673 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 685 src/simh/sim_console.c _sim_rem_log_out (lp); lp 698 src/simh/sim_console.c tmxr_linemsgf (lpj, "\nRemote Master Console(%s) Entering Commands\n", lp->ipad); lp 701 src/simh/sim_console.c lp = &sim_rem_con_tmxr.ldsc[i]; lp 705 src/simh/sim_console.c c = tmxr_getc_ln (lp); lp 716 src/simh/sim_console.c _sim_rem_log_out (lp); lp 722 src/simh/sim_console.c (unsigned long)i, lp->ipad); lp 725 src/simh/sim_console.c lp = &sim_rem_con_tmxr.ldsc[i]; lp 727 src/simh/sim_console.c tmxr_linemsg (lp, "\r\nSimulator paused.\r\n"); lp 729 src/simh/sim_console.c tmxr_linemsgf (lp, "Simulation will resume automatically if input is not received in %lu seconds\n", lp 731 src/simh/sim_console.c tmxr_linemsgf (lp, "\r\n"); lp 732 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 741 src/simh/sim_console.c tmxr_linemsgf (lp, "\r\nGoodbye\r\n"); lp 742 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 743 src/simh/sim_console.c tmxr_reset_ln (lp); lp 749 src/simh/sim_console.c tmxr_linemsgf (lp, "\r\n%s", sim_prompt); lp 751 src/simh/sim_console.c tmxr_linemsgf (lp, "\r\n%s", sim_is_running ? "SIM> " : "sim> "); lp 753 src/simh/sim_console.c if (!tmxr_input_pending_ln (lp)) lp 754 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 766 src/simh/sim_console.c tmxr_linemsg (lp, "sim> "); lp 768 src/simh/sim_console.c tmxr_linemsg (lp, sim_prompt); lp 769 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 773 src/simh/sim_console.c c = tmxr_getc_ln (lp); lp 775 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 780 src/simh/sim_console.c tmxr_linemsg (lp, "\b \b"); lp 788 src/simh/sim_console.c tmxr_linemsgf (lp, "%s\n", sim_rem_buf[i]); lp 794 src/simh/sim_console.c if (!lp->conn) { /* if connection lost? */ lp 809 src/simh/sim_console.c tmxr_linemsg (lp, "\b \b"); lp 816 src/simh/sim_console.c tmxr_linemsg (lp, "\b \b"); lp 825 src/simh/sim_console.c tmxr_linemsg (lp, "\r\n"); lp 833 src/simh/sim_console.c (unsigned long)tmxr_input_pending_ln (lp), sim_rem_buf[i]); lp 839 src/simh/sim_console.c tmxr_linemsg (lp, "\b \b"); lp 848 src/simh/sim_console.c tmxr_linemsgf (lp, "%s\n", sim_rem_buf[i]); lp 854 src/simh/sim_console.c tmxr_putc_ln (lp, c); lp 866 src/simh/sim_console.c if ((!got_command) && (sim_rem_single_mode[i]) && (tmxr_input_pending_ln (lp))) { lp 867 src/simh/sim_console.c c = tmxr_getc_ln (lp); lp 871 src/simh/sim_console.c if (!tmxr_input_pending_ln (lp)) lp 872 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 876 src/simh/sim_console.c sim_printf ("Remote Console Command from %s> %s\r\n", lp->ipad, sim_rem_buf[i]); lp 880 src/simh/sim_console.c tmxr_linemsgf (lp, "\nLine too long. Ignored. Continuing Simulator execution\n"); lp 881 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* try to flush any buffered data */ lp 972 src/simh/sim_console.c _sim_rem_log_out (lp); lp 994 src/simh/sim_console.c tmxr_linemsg (lp, "Simulator Running..."); lp 995 src/simh/sim_console.c tmxr_send_buffered_data (lp); lp 1012 src/simh/sim_console.c tmxr_linemsgf (lp, "%s", "sim> "); lp 1014 src/simh/sim_console.c tmxr_linemsgf (lp, "%s", sim_prompt); lp 1015 src/simh/sim_console.c tmxr_send_buffered_data (lp); lp 1027 src/simh/sim_console.c tmxr_linemsgf (lp, "\r\nGoodbye\r\n"); lp 1028 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 1029 src/simh/sim_console.c tmxr_reset_ln (lp); lp 1045 src/simh/sim_console.c lp = &sim_rem_con_tmxr.ldsc[0]; lp 1046 src/simh/sim_console.c tmxr_linemsgf (lp, "Non Master Mode Session..."); /* report transition */ lp 1047 src/simh/sim_console.c tmxr_send_buffered_data (lp); /* flush any buffered data */ lp 240 src/simh/sim_tmxr.c static void tmxr_init_line (TMLN *lp) lp 242 src/simh/sim_tmxr.c lp->tsta = 0; /* init telnet state */ lp 243 src/simh/sim_tmxr.c lp->xmte = 1; /* enable transmit */ lp 244 src/simh/sim_tmxr.c lp->dstb = 0; /* default bin mode */ lp 245 src/simh/sim_tmxr.c lp->rxbpr = lp->rxbpi = lp->rxcnt = lp->rxpcnt = 0; /* init receive indexes */ lp 246 src/simh/sim_tmxr.c if (!lp->txbfd || lp->notelnet) /* if not buffered telnet */ lp 247 src/simh/sim_tmxr.c lp->txbpr = lp->txbpi = lp->txcnt = lp->txpcnt = 0; /* init transmit indexes */ lp 248 src/simh/sim_tmxr.c lp->txdrp = 0; lp 249 src/simh/sim_tmxr.c tmxr_set_get_modem_bits (lp, 0, 0, NULL); lp 250 src/simh/sim_tmxr.c if ((!lp->mp->buffered) && (!lp->txbfd)) { lp 251 src/simh/sim_tmxr.c lp->txbfd = 0; //-V1048 lp 252 src/simh/sim_tmxr.c lp->txbsz = TMXR_MAXBUF; lp 253 src/simh/sim_tmxr.c lp->txb = (char *)realloc (lp->txb, lp->txbsz); lp 254 src/simh/sim_tmxr.c if (!lp->txb) lp 266 src/simh/sim_tmxr.c lp->rxbsz = TMXR_MAXBUF; lp 267 src/simh/sim_tmxr.c lp->rxb = (char *)realloc(lp->rxb, lp->rxbsz); lp 268 src/simh/sim_tmxr.c if (!lp->rxb) lp 280 src/simh/sim_tmxr.c lp->rbr = (char *)realloc(lp->rbr, lp->rxbsz); lp 281 src/simh/sim_tmxr.c if (!lp->rbr) lp 294 src/simh/sim_tmxr.c if (lp->loopback) { lp 295 src/simh/sim_tmxr.c lp->lpbsz = lp->rxbsz; lp 296 src/simh/sim_tmxr.c lp->lpb = (char *)realloc(lp->lpb, lp->lpbsz); lp 297 src/simh/sim_tmxr.c if (!lp->lpb) lp 309 src/simh/sim_tmxr.c lp->lpbcnt = lp->lpbpi = lp->lpbpr = 0; lp 311 src/simh/sim_tmxr.c if (lp->rxpb) { lp 312 src/simh/sim_tmxr.c lp->rxpboffset = lp->rxpbsize = 0; lp 313 src/simh/sim_tmxr.c FREE (lp->rxpb); lp 314 src/simh/sim_tmxr.c lp->rxpb = NULL; lp 316 src/simh/sim_tmxr.c if (lp->txpb) { lp 317 src/simh/sim_tmxr.c lp->txpbsize = lp->txppsize = lp->txppoffset = 0; lp 318 src/simh/sim_tmxr.c FREE (lp->txpb); lp 319 src/simh/sim_tmxr.c lp->txpb = NULL; lp 321 src/simh/sim_tmxr.c (void)memset (lp->rbr, 0, lp->rxbsz); /* clear break status array */ lp 338 src/simh/sim_tmxr.c static void tmxr_report_connection (TMXR *mp, TMLN *lp) lp 346 src/simh/sim_tmxr.c if ((!lp->notelnet) || (sim_switches & SWMASK ('V'))) { lp 354 src/simh/sim_tmxr.c (void)sprintf (lmsg, ", line %d", (int)(lp-mp->ldsc));/* report the line number */ lp 361 src/simh/sim_tmxr.c lp->txbpi = 0; /* init buf pointers */ lp 362 src/simh/sim_tmxr.c lp->txbpr = (int32)(lp->txbsz - strlen (msgbuf)); lp 363 src/simh/sim_tmxr.c lp->rxcnt = lp->txcnt = lp->txdrp = 0; /* init counters */ lp 364 src/simh/sim_tmxr.c lp->rxpcnt = lp->txpcnt = 0; lp 367 src/simh/sim_tmxr.c if (lp->txcnt > lp->txbsz) lp 368 src/simh/sim_tmxr.c lp->txbpr = (lp->txbpi + 1) % lp->txbsz; lp 370 src/simh/sim_tmxr.c lp->txbpr = (int32)(lp->txbsz - strlen (msgbuf)); lp 372 src/simh/sim_tmxr.c psave = lp->txbpi; /* save insertion pointer */ lp 373 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr; /* insert connection message */ lp 374 src/simh/sim_tmxr.c tmxr_linemsg (lp, msgbuf); /* beginning of buffer */ lp 375 src/simh/sim_tmxr.c lp->txbpi = psave; /* restore insertion pointer */ lp 377 src/simh/sim_tmxr.c unwritten = tmxr_send_buffered_data (lp); /* send the message */ lp 380 src/simh/sim_tmxr.c lp->xmte = 1; /* re-enable transmission if paused */ lp 382 src/simh/sim_tmxr.c lp->txcnt -= (int32)strlen (msgbuf); /* adjust statistics */ lp 396 src/simh/sim_tmxr.c static void tmxr_report_disconnection (TMLN *lp) lp 398 src/simh/sim_tmxr.c if (lp->notelnet) lp 400 src/simh/sim_tmxr.c tmxr_linemsgf (lp, "\r\nDisconnected from the %s simulator\r\n\n", sim_name);/* report disconnection */ lp 404 src/simh/sim_tmxr.c static int32 loop_write_ex (TMLN *lp, char *buf, int32 length, t_bool prefix_datagram) lp 407 src/simh/sim_tmxr.c int32 loopfree = lp->lpbsz - lp->lpbcnt; lp 409 src/simh/sim_tmxr.c if (lp->datagram && prefix_datagram) { lp 412 src/simh/sim_tmxr.c loop_write_ex (lp, (char *)&length, sizeof(length), FALSE); lp 417 src/simh/sim_tmxr.c loopfree = lp->lpbsz - lp->lpbcnt; lp 422 src/simh/sim_tmxr.c if (lp->lpbpi >= lp->lpbpr) lp 423 src/simh/sim_tmxr.c chunksize = lp->lpbsz - lp->lpbpi; lp 425 src/simh/sim_tmxr.c chunksize = lp->lpbpr - lp->lpbpi; lp 428 src/simh/sim_tmxr.c memcpy (&lp->lpb[lp->lpbpi], buf, chunksize); lp 432 src/simh/sim_tmxr.c lp->lpbpi = (lp->lpbpi + chunksize) % lp->lpbsz; lp 434 src/simh/sim_tmxr.c lp->lpbcnt += written; lp 438 src/simh/sim_tmxr.c static int32 loop_write (TMLN *lp, char *buf, int32 length) lp 440 src/simh/sim_tmxr.c return loop_write_ex (lp, buf, length, TRUE); lp 443 src/simh/sim_tmxr.c static int32 loop_read_ex (TMLN *lp, char *buf, int32 bufsize) lp 449 src/simh/sim_tmxr.c int32 loopused = lp->lpbcnt; lp 455 src/simh/sim_tmxr.c if (lp->lpbpi > lp->lpbpr) lp 456 src/simh/sim_tmxr.c chunksize = lp->lpbpi - lp->lpbpr; lp 458 src/simh/sim_tmxr.c chunksize = lp->lpbsz - lp->lpbpr; lp 461 src/simh/sim_tmxr.c memcpy (buf, &lp->lpb[lp->lpbpr], chunksize); lp 465 src/simh/sim_tmxr.c lp->lpbpr = (lp->lpbpr + chunksize) % lp->lpbsz; lp 467 src/simh/sim_tmxr.c lp->lpbcnt -= bytesread; lp 471 src/simh/sim_tmxr.c static int32 loop_read (TMLN *lp, char *buf, int32 bufsize) lp 473 src/simh/sim_tmxr.c if (lp->datagram) { lp 476 src/simh/sim_tmxr.c if (lp->lpbcnt < (int32)sizeof(pktsize)) lp 478 src/simh/sim_tmxr.c if ((sizeof(pktsize) != loop_read_ex (lp, (char *)&pktsize, sizeof(pktsize))) || lp 483 src/simh/sim_tmxr.c return loop_read_ex (lp, buf, bufsize); lp 494 src/simh/sim_tmxr.c static int32 tmxr_read (TMLN *lp, int32 length) lp 496 src/simh/sim_tmxr.c int32 i = lp->rxbpi; lp 498 src/simh/sim_tmxr.c if (lp->loopback) lp 499 src/simh/sim_tmxr.c return loop_read (lp, &(lp->rxb[i]), length); lp 501 src/simh/sim_tmxr.c return sim_read_sock (lp->sock, &(lp->rxb[i]), length); lp 511 src/simh/sim_tmxr.c static int32 tmxr_write (TMLN *lp, int32 length) lp 514 src/simh/sim_tmxr.c int32 i = lp->txbpr; lp 516 src/simh/sim_tmxr.c if (lp->loopback) lp 517 src/simh/sim_tmxr.c return loop_write (lp, &(lp->txb[i]), length); lp 519 src/simh/sim_tmxr.c written = sim_write_sock (lp->sock, &(lp->txb[i]), length); lp 522 src/simh/sim_tmxr.c if (lp->datagram) lp 537 src/simh/sim_tmxr.c static void tmxr_rmvrc (TMLN *lp, int32 p) lp 539 src/simh/sim_tmxr.c for ( ; p < lp->rxbpi; p++) { /* work from "p" through end of buffer */ lp 540 src/simh/sim_tmxr.c lp->rxb[p] = lp->rxb[p + 1]; /* slide following character down */ lp 541 src/simh/sim_tmxr.c lp->rbr[p] = lp->rbr[p + 1]; /* adjust break status too */ lp 544 src/simh/sim_tmxr.c lp->rbr[p] = 0; /* clear potential break from vacated slot */ lp 545 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpi - 1; /* drop buffer insert index */ lp 598 src/simh/sim_tmxr.c TMLN *lp = NULL; lp 605 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, mp->lines, mp); /* determine line from unit */ lp 607 src/simh/sim_tmxr.c if (lp == NULL) /* invalid line number? */ lp 618 src/simh/sim_tmxr.c lp = mp->ldsc + (int32) ln; /* use as index to determine line */ lp 624 src/simh/sim_tmxr.c return lp; /* return pointer to line descriptor */ lp 671 src/simh/sim_tmxr.c TMLN *lp; lp 688 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 690 src/simh/sim_tmxr.c lptr = tmxr_line_attach_string(lp); lp 722 src/simh/sim_tmxr.c char *tmxr_line_attach_string(TMLN *lp) lp 730 src/simh/sim_tmxr.c if (lp->destination || lp->port || lp->txlogname) { lp 731 src/simh/sim_tmxr.c if ((lp->mp->lines > 1) || (lp->port)) lp 732 src/simh/sim_tmxr.c (void)sprintf (growstring(&tptr, 32), "Line=%d", (int)(lp-lp->mp->ldsc)); lp 733 src/simh/sim_tmxr.c if (lp->modem_control != lp->mp->modem_control) lp 734 src/simh/sim_tmxr.c (void)sprintf (growstring(&tptr, 32), ",%s", lp->modem_control ? "Modem" : "NoModem"); lp 735 src/simh/sim_tmxr.c if (lp->txbfd && (lp->txbsz != lp->mp->buffered)) lp 736 src/simh/sim_tmxr.c (void)sprintf (growstring(&tptr, 32), ",Buffered=%d", lp->txbsz); lp 737 src/simh/sim_tmxr.c if (!lp->txbfd && (lp->mp->buffered > 0)) lp 739 src/simh/sim_tmxr.c if (lp->mp->datagram != lp->datagram) lp 740 src/simh/sim_tmxr.c (void)sprintf (growstring(&tptr, 8), ",%s", lp->datagram ? "UDP" : "TCP"); lp 741 src/simh/sim_tmxr.c if (lp->mp->packet != lp->packet) lp 743 src/simh/sim_tmxr.c if (lp->port) lp 744 src/simh/sim_tmxr.c (void)sprintf (growstring(&tptr, 32 + strlen (lp->port)), ",%s%s", lp 745 src/simh/sim_tmxr.c lp->port, ((lp->mp->notelnet != lp->notelnet) && \ lp 746 src/simh/sim_tmxr.c (!lp->datagram)) ? (lp->notelnet ? ";notelnet" : ";telnet") : ""); lp 747 src/simh/sim_tmxr.c if (lp->destination) { lp 748 src/simh/sim_tmxr.c (void)sprintf (growstring(&tptr, 25 + strlen (lp->destination)), lp 749 src/simh/sim_tmxr.c ",Connect=%s%s", lp->destination, lp 750 src/simh/sim_tmxr.c ((lp->mp->notelnet != lp->notelnet) && \ lp 751 src/simh/sim_tmxr.c (!lp->datagram)) ? (lp->notelnet ? ";notelnet" : ";telnet") : ""); lp 753 src/simh/sim_tmxr.c if (lp->txlogname) lp 754 src/simh/sim_tmxr.c (void)sprintf (growstring(&tptr, 12 + strlen (lp->txlogname)), ",Log=%s", lp->txlogname); lp 755 src/simh/sim_tmxr.c if (lp->loopback) lp 801 src/simh/sim_tmxr.c TMLN *lp = NULL; lp 810 src/simh/sim_tmxr.c (void)lp; lp 925 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get pointer to line descriptor */ lp 926 src/simh/sim_tmxr.c if ((lp->conn == FALSE) && /* is the line available? */ lp 927 src/simh/sim_tmxr.c (lp->destination == NULL) && lp 928 src/simh/sim_tmxr.c (lp->master == 0) && lp 929 src/simh/sim_tmxr.c (lp->ser_connect_pending == FALSE) && lp 930 src/simh/sim_tmxr.c (lp->modem_control ? ((lp->modembits & TMXR_MDM_DTR) != 0) : TRUE)) lp 938 src/simh/sim_tmxr.c lp = mp->ldsc + j; /* get pointer to line descriptor */ lp 939 src/simh/sim_tmxr.c if ((lp->conn == FALSE) && /* is the line available? */ lp 940 src/simh/sim_tmxr.c (lp->destination == NULL) && lp 941 src/simh/sim_tmxr.c (lp->master == 0) && lp 942 src/simh/sim_tmxr.c (lp->ser_connect_pending == FALSE) && lp 943 src/simh/sim_tmxr.c ((lp->modembits & TMXR_MDM_DTR) == 0)) { lp 945 src/simh/sim_tmxr.c tmxr_set_get_modem_bits (lp, TMXR_MDM_RNG, 0, NULL); lp 963 src/simh/sim_tmxr.c for (ln = 0; ln < lp->mp->lines; ln++) { lp 964 src/simh/sim_tmxr.c TMLN *tlp = lp->mp->ldsc + ln; lp 983 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 984 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 985 src/simh/sim_tmxr.c lp->sock = newsock; /* save socket */ lp 986 src/simh/sim_tmxr.c lp->ipad = address; /* ip address */ lp 987 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init line */ lp 988 src/simh/sim_tmxr.c lp->notelnet = mp->notelnet; /* apply mux default telnet setting */ lp 989 src/simh/sim_tmxr.c if (!lp->notelnet) { lp 991 src/simh/sim_tmxr.c lp->telnet_sent_opts = (uint8 *)realloc (lp->telnet_sent_opts, 256); lp 992 src/simh/sim_tmxr.c if (!lp->telnet_sent_opts) lp 1004 src/simh/sim_tmxr.c (void)memset (lp->telnet_sent_opts, 0, 256); lp 1006 src/simh/sim_tmxr.c tmxr_report_connection (mp, lp); lp 1007 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); /* time of connection */ lp 1016 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get pointer to line descriptor */ lp 1018 src/simh/sim_tmxr.c if (lp->ser_connect_pending) { lp 1019 src/simh/sim_tmxr.c lp->ser_connect_pending = FALSE; lp 1020 src/simh/sim_tmxr.c lp->conn = TRUE; lp 1026 src/simh/sim_tmxr.c if (lp->loopback) lp 1041 src/simh/sim_tmxr.c if (lp->connecting) { /* connecting? */ lp 1044 src/simh/sim_tmxr.c switch (sim_check_conn(lp->connecting, FALSE)) lp 1047 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 1048 src/simh/sim_tmxr.c lp->sock = lp->connecting; /* it now looks normal */ lp 1049 src/simh/sim_tmxr.c lp->connecting = 0; lp 1051 src/simh/sim_tmxr.c if (lp->destination != NULL) lp 1052 src/simh/sim_tmxr.c lpdlen = 1+strlen (lp->destination); lp 1053 src/simh/sim_tmxr.c lp->ipad = (char *)realloc (lp->ipad, lpdlen); lp 1054 src/simh/sim_tmxr.c if (!lp->ipad) lp 1066 src/simh/sim_tmxr.c if (lp->destination != NULL) lp 1067 src/simh/sim_tmxr.c (void)strcpy (lp->ipad, lp->destination); lp 1068 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); lp 1069 src/simh/sim_tmxr.c sim_getnames_sock (lp->sock, &sockname, &peername); lp 1070 src/simh/sim_tmxr.c if (lp->destination) lp 1073 src/simh/sim_tmxr.c lp->destination, sockname, peername); lp 1079 src/simh/sim_tmxr.c lp->destination); lp 1080 src/simh/sim_tmxr.c tmxr_reset_ln (lp); /* retry */ lp 1086 src/simh/sim_tmxr.c if (lp->master) { /* Check for a pending Telnet/tcp connection */ lp 1087 src/simh/sim_tmxr.c while (INVALID_SOCKET != (newsock = sim_accept_conn_ex (lp->master, &address, lp 1088 src/simh/sim_tmxr.c (lp->packet ? SIM_SOCK_OPT_NODELAY : 0)))) {/* got a live one? */ lp 1098 src/simh/sim_tmxr.c if (lp->destination) { /* Virtual Null Modem Cable? */ lp 1101 src/simh/sim_tmxr.c if (sim_parse_addr (lp->destination, host, sizeof(host), NULL, NULL, 0, NULL, address)) { lp 1109 src/simh/sim_tmxr.c if (lp->connecting) { lp 1111 src/simh/sim_tmxr.c lp->destination); lp 1112 src/simh/sim_tmxr.c sim_close_sock (lp->connecting); /* abort our as yet unconnnected socket */ lp 1113 src/simh/sim_tmxr.c lp->connecting = 0; lp 1116 src/simh/sim_tmxr.c if (lp->conn == FALSE) { /* is the line available? */ lp 1117 src/simh/sim_tmxr.c if ((!lp->modem_control) || (lp->modembits & TMXR_MDM_DTR)) { lp 1118 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 1119 src/simh/sim_tmxr.c lp->sock = newsock; /* save socket */ lp 1120 src/simh/sim_tmxr.c lp->ipad = address; /* ip address */ lp 1121 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init line */ lp 1122 src/simh/sim_tmxr.c if (!lp->notelnet) { lp 1124 src/simh/sim_tmxr.c lp->telnet_sent_opts = (uint8 *)realloc (lp->telnet_sent_opts, 256); lp 1125 src/simh/sim_tmxr.c if (!lp->telnet_sent_opts) lp 1137 src/simh/sim_tmxr.c (void)memset (lp->telnet_sent_opts, 0, 256); lp 1139 src/simh/sim_tmxr.c tmxr_report_connection (mp, lp); lp 1140 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); /* time of connection */ lp 1161 src/simh/sim_tmxr.c if (lp->destination && (!lp->sock) && (!lp->connecting) && lp 1162 src/simh/sim_tmxr.c (!lp->modem_control || (lp->modembits & TMXR_MDM_DTR))) { lp 1163 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_poll_conn() - establishing outgoing connection to: %s", lp->destination); lp 1164 src/simh/sim_tmxr.c lp->connecting = sim_connect_sock_ex (lp->datagram ? lp->port : NULL, lp 1165 src/simh/sim_tmxr.c lp->destination, "localhost", NULL, lp 1166 src/simh/sim_tmxr.c (lp->datagram ? SIM_SOCK_OPT_DATAGRAM : 0) | lp 1167 src/simh/sim_tmxr.c (lp->mp->packet ? SIM_SOCK_OPT_NODELAY : 0) | lp 1178 src/simh/sim_tmxr.c static t_stat tmxr_reset_ln_ex (TMLN *lp, t_bool closeserial) lp 1182 src/simh/sim_tmxr.c if (lp->txlog) lp 1183 src/simh/sim_tmxr.c (void)fflush (lp->txlog); /* flush log */ lp 1185 src/simh/sim_tmxr.c tmxr_send_buffered_data (lp); /* send any buffered data */ lp 1189 src/simh/sim_tmxr.c if (lp->sock) { lp 1190 src/simh/sim_tmxr.c sim_close_sock (lp->sock); /* close socket */ lp 1191 src/simh/sim_tmxr.c FREE (lp->telnet_sent_opts); lp 1192 src/simh/sim_tmxr.c lp->telnet_sent_opts = NULL; lp 1193 src/simh/sim_tmxr.c lp->sock = 0; lp 1194 src/simh/sim_tmxr.c lp->conn = FALSE; lp 1195 src/simh/sim_tmxr.c lp->cnms = 0; lp 1196 src/simh/sim_tmxr.c lp->xmte = 1; lp 1198 src/simh/sim_tmxr.c FREE(lp->ipad); lp 1199 src/simh/sim_tmxr.c lp->ipad = NULL; lp 1200 src/simh/sim_tmxr.c if ((lp->destination) lp 1202 src/simh/sim_tmxr.c if (lp->connecting) { lp 1203 src/simh/sim_tmxr.c sim_close_sock (lp->connecting); lp 1204 src/simh/sim_tmxr.c lp->connecting = 0; lp 1206 src/simh/sim_tmxr.c if ((!lp->modem_control) || (lp->modembits & TMXR_MDM_DTR)) { lp 1207 src/simh/sim_tmxr.c snprintf (msg, sizeof(msg)-1, "tmxr_reset_ln_ex() - connecting to %s", lp->destination); lp 1208 src/simh/sim_tmxr.c lp->connecting = sim_connect_sock_ex (lp->datagram ? lp->port : NULL, lp 1209 src/simh/sim_tmxr.c lp->destination, "localhost", NULL, lp 1210 src/simh/sim_tmxr.c (lp->datagram ? SIM_SOCK_OPT_DATAGRAM : 0) | lp 1211 src/simh/sim_tmxr.c (lp->packet ? SIM_SOCK_OPT_NODELAY : 0) | lp 1215 src/simh/sim_tmxr.c tmxr_init_line (lp); /* initialize line state */ lp 1219 src/simh/sim_tmxr.c t_stat tmxr_close_ln (TMLN *lp) lp 1221 src/simh/sim_tmxr.c return tmxr_reset_ln_ex (lp, TRUE); lp 1224 src/simh/sim_tmxr.c t_stat tmxr_reset_ln (TMLN *lp) lp 1226 src/simh/sim_tmxr.c return tmxr_reset_ln_ex (lp, FALSE); lp 1241 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 1250 src/simh/sim_tmxr.c before_modem_bits = lp->modembits; lp 1251 src/simh/sim_tmxr.c lp->modembits |= bits_to_set; lp 1252 src/simh/sim_tmxr.c lp->modembits &= ~(bits_to_clear | TMXR_MDM_INCOMING); lp 1253 src/simh/sim_tmxr.c if ((lp->sock) || (lp->loopback)) { lp 1254 src/simh/sim_tmxr.c if (lp->modembits & TMXR_MDM_DTR) { lp 1256 src/simh/sim_tmxr.c if (lp->modembits & TMXR_MDM_RTS) lp 1258 src/simh/sim_tmxr.c if (lp->halfduplex) { lp 1271 src/simh/sim_tmxr.c ((lp->modembits & TMXR_MDM_DTR) != 0) && lp 1272 src/simh/sim_tmxr.c (lp->conn == FALSE) && /* Not connected */ lp 1273 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_RNG)) { /* and Ring Signal Present */ lp 1274 src/simh/sim_tmxr.c if ((lp->destination == NULL) && lp 1275 src/simh/sim_tmxr.c (lp->master == 0) && lp 1276 src/simh/sim_tmxr.c (lp->mp && (lp->mp->ring_sock))) { lp 1279 src/simh/sim_tmxr.c lp->conn = TRUE; /* record connection */ lp 1280 src/simh/sim_tmxr.c lp->sock = lp->mp->ring_sock; /* save socket */ lp 1281 src/simh/sim_tmxr.c lp->mp->ring_sock = INVALID_SOCKET; lp 1282 src/simh/sim_tmxr.c lp->ipad = lp->mp->ring_ipad; /* ip address */ lp 1283 src/simh/sim_tmxr.c lp->mp->ring_ipad = NULL; lp 1284 src/simh/sim_tmxr.c lp->mp->ring_start_time = 0; lp 1285 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init line */ lp 1286 src/simh/sim_tmxr.c lp->notelnet = lp->mp->notelnet; /* apply mux default telnet setting */ lp 1287 src/simh/sim_tmxr.c if (!lp->notelnet) { lp 1288 src/simh/sim_tmxr.c sim_write_sock (lp->sock, (char *)mantra, sizeof(mantra)); lp 1289 src/simh/sim_tmxr.c lp->telnet_sent_opts = (uint8 *)realloc (lp->telnet_sent_opts, 256); lp 1290 src/simh/sim_tmxr.c if (!lp->telnet_sent_opts) lp 1302 src/simh/sim_tmxr.c (void)memset (lp->telnet_sent_opts, 0, 256); lp 1304 src/simh/sim_tmxr.c tmxr_report_connection (lp->mp, lp); lp 1305 src/simh/sim_tmxr.c lp->cnms = sim_os_msec (); /* time of connection */ lp 1306 src/simh/sim_tmxr.c lp->modembits &= ~TMXR_MDM_RNG; /* turn off ring on this line*/ lp 1308 src/simh/sim_tmxr.c for (ln = 0; ln < lp->mp->lines; ln++) { lp 1309 src/simh/sim_tmxr.c TMLN *tlp = lp->mp->ldsc + ln; lp 1316 src/simh/sim_tmxr.c if ((lp->master) || (lp->mp && lp->mp->master) || lp 1317 src/simh/sim_tmxr.c (lp->port && lp->destination)) lp 1322 src/simh/sim_tmxr.c lp->modembits |= incoming_state; lp 1323 src/simh/sim_tmxr.c dptr = (lp->dptr ? lp->dptr : (lp->mp ? lp->mp->dptr : NULL)); lp 1330 src/simh/sim_tmxr.c *incoming_bits = lp->modembits; lp 1331 src/simh/sim_tmxr.c if (lp->mp && lp->modem_control) { /* This API ONLY works on modem_control enabled multiplexer lines */ lp 1333 src/simh/sim_tmxr.c if (lp->loopback) { lp 1334 src/simh/sim_tmxr.c if ((lp->modembits ^ before_modem_bits) & TMXR_MDM_DTR) { /* DTR changed? */ lp 1335 src/simh/sim_tmxr.c lp->ser_connect_pending = (lp->modembits & TMXR_MDM_DTR); lp 1336 src/simh/sim_tmxr.c lp->conn = !(lp->modembits & TMXR_MDM_DTR); lp 1340 src/simh/sim_tmxr.c if ((lp->sock) || (lp->connecting)) { lp 1342 src/simh/sim_tmxr.c if (lp->sock) lp 1343 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report closure */ lp 1344 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 1348 src/simh/sim_tmxr.c if ((lp->destination) && /* Virtual Null Modem Cable */ lp 1354 src/simh/sim_tmxr.c lp->destination); lp 1355 src/simh/sim_tmxr.c lp->connecting = sim_connect_sock_ex (lp->datagram ? lp->port : NULL, lp->destination, "localhost", NULL, lp 1356 src/simh/sim_tmxr.c (lp->datagram ? SIM_SOCK_OPT_DATAGRAM : 0) | lp 1357 src/simh/sim_tmxr.c (lp->packet ? SIM_SOCK_OPT_NODELAY : 0) | lp 1364 src/simh/sim_tmxr.c if ((lp->sock) || (lp->connecting)) { lp 1366 src/simh/sim_tmxr.c if (lp->sock) lp 1367 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report closure */ lp 1368 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 1383 src/simh/sim_tmxr.c t_stat tmxr_set_line_loopback (TMLN *lp, t_bool enable_loopback) lp 1385 src/simh/sim_tmxr.c if (lp->loopback == (enable_loopback != FALSE)) lp 1387 src/simh/sim_tmxr.c lp->loopback = (enable_loopback != FALSE); lp 1388 src/simh/sim_tmxr.c if (lp->loopback) { lp 1389 src/simh/sim_tmxr.c lp->lpbsz = lp->rxbsz; lp 1390 src/simh/sim_tmxr.c lp->lpb = (char *)realloc(lp->lpb, lp->lpbsz); lp 1391 src/simh/sim_tmxr.c if (!lp->lpb) lp 1403 src/simh/sim_tmxr.c lp->lpbcnt = lp->lpbpi = lp->lpbpr = 0; lp 1404 src/simh/sim_tmxr.c if (!lp->conn) lp 1405 src/simh/sim_tmxr.c lp->ser_connect_pending = TRUE; lp 1408 src/simh/sim_tmxr.c FREE (lp->lpb); lp 1409 src/simh/sim_tmxr.c lp->lpb = NULL; lp 1410 src/simh/sim_tmxr.c lp->lpbsz = 0; lp 1415 src/simh/sim_tmxr.c t_bool tmxr_get_line_loopback (TMLN *lp) lp 1417 src/simh/sim_tmxr.c return (lp->loopback != FALSE); lp 1434 src/simh/sim_tmxr.c t_stat tmxr_set_line_halfduplex (TMLN *lp, t_bool enable_halfduplex) lp 1436 src/simh/sim_tmxr.c if (lp->halfduplex == (enable_halfduplex != FALSE)) lp 1438 src/simh/sim_tmxr.c lp->halfduplex = (enable_halfduplex != FALSE); lp 1442 src/simh/sim_tmxr.c t_bool tmxr_get_line_halfduplex (TMLN *lp) lp 1444 src/simh/sim_tmxr.c return (lp->halfduplex != FALSE); lp 1461 src/simh/sim_tmxr.c int32 tmxr_input_pending_ln (TMLN *lp) lp 1463 src/simh/sim_tmxr.c return (lp->rxbpi - lp->rxbpr); lp 1466 src/simh/sim_tmxr.c int32 tmxr_getc_ln (TMLN *lp) lp 1472 src/simh/sim_tmxr.c if ((lp->conn && lp->rcve) && /* conn & enb & */ lp 1473 src/simh/sim_tmxr.c ((!lp->rxbps) || /* (!rate limited || enough time passed)? */ lp 1474 src/simh/sim_tmxr.c (sim_gtime () >= lp->rxnexttime))) { lp 1475 src/simh/sim_tmxr.c if (!sim_send_poll_data (&lp->send, &val)) { /* injected input characters available? */ lp 1476 src/simh/sim_tmxr.c j = lp->rxbpi - lp->rxbpr; /* # input chrs */ lp 1478 src/simh/sim_tmxr.c tmp = lp->rxb[lp->rxbpr]; /* get char */ lp 1480 src/simh/sim_tmxr.c if (lp->rbr[lp->rxbpr]) { /* break? */ lp 1481 src/simh/sim_tmxr.c lp->rbr[lp->rxbpr] = 0; /* clear status */ lp 1484 src/simh/sim_tmxr.c lp->rxbpr = lp->rxbpr + 1; /* adv pointer */ lp 1488 src/simh/sim_tmxr.c if (lp->rxbpi == lp->rxbpr) /* empty? zero ptrs */ lp 1489 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpr = 0; lp 1490 src/simh/sim_tmxr.c if (lp->rxbps) { lp 1492 src/simh/sim_tmxr.c lp->rxnexttime = floor (sim_gtime () + ((lp->rxdelta * sim_timer_inst_per_sec ())/lp->rxbpsfactor)); lp 1516 src/simh/sim_tmxr.c t_stat tmxr_get_packet_ln (TMLN *lp, const uint8 **pbuf, size_t *psize) lp 1518 src/simh/sim_tmxr.c return tmxr_get_packet_ln_ex (lp, pbuf, psize, 0); lp 1521 src/simh/sim_tmxr.c t_stat tmxr_get_packet_ln_ex (TMLN *lp, const uint8 **pbuf, size_t *psize, uint8 frame_byte) lp 1527 src/simh/sim_tmxr.c while (TMXR_VALID & (c = tmxr_getc_ln (lp))) { lp 1528 src/simh/sim_tmxr.c if (lp->rxpboffset + 3 > lp->rxpbsize) { lp 1529 src/simh/sim_tmxr.c lp->rxpbsize += 512; lp 1530 src/simh/sim_tmxr.c lp->rxpb = (uint8 *)realloc (lp->rxpb, lp->rxpbsize); lp 1531 src/simh/sim_tmxr.c if (!lp->rxpb) lp 1544 src/simh/sim_tmxr.c if ((lp->rxpboffset == 0) && (fc_size) && (c != frame_byte)) { lp 1547 src/simh/sim_tmxr.c if ((lp->datagram) && (lp->rxpboffset == fc_size)) { lp 1552 src/simh/sim_tmxr.c lp->rxpb[lp->rxpboffset++] = (uint8)(((1 + lp->rxbpi - lp->rxbpr) >> 8) & 0xFF); lp 1553 src/simh/sim_tmxr.c lp->rxpb[lp->rxpboffset++] = (uint8)((1 + lp->rxbpi - lp->rxbpr) & 0xFF); lp 1555 src/simh/sim_tmxr.c lp->rxpb[lp->rxpboffset++] = c & 0xFF; lp 1556 src/simh/sim_tmxr.c if (lp->rxpboffset >= (2 + fc_size)) { lp 1557 src/simh/sim_tmxr.c pktsize = (lp->rxpb[0+fc_size] << 8) | lp->rxpb[1+fc_size]; lp 1558 src/simh/sim_tmxr.c if (pktsize == (lp->rxpboffset - 2)) { lp 1559 src/simh/sim_tmxr.c ++lp->rxpcnt; lp 1560 src/simh/sim_tmxr.c *pbuf = &lp->rxpb[2+fc_size]; lp 1562 src/simh/sim_tmxr.c lp->rxpboffset = 0; lp 1569 src/simh/sim_tmxr.c if (lp->conn) lp 1584 src/simh/sim_tmxr.c TMLN *lp; lp 1587 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 1588 src/simh/sim_tmxr.c if (!(lp->sock lp 1589 src/simh/sim_tmxr.c || lp->loopback) || lp 1590 src/simh/sim_tmxr.c !(lp->rcve)) /* skip if not connected */ lp 1594 src/simh/sim_tmxr.c if (lp->rxbpi == 0) /* need input? */ lp 1595 src/simh/sim_tmxr.c nbytes = tmxr_read (lp, /* yes, read */ lp 1596 src/simh/sim_tmxr.c lp->rxbsz - TMXR_GUARD); /* leave spc for Telnet cruft */ lp 1597 src/simh/sim_tmxr.c else if (lp->tsta) /* in Telnet seq? */ lp 1598 src/simh/sim_tmxr.c nbytes = tmxr_read (lp, /* yes, read to end */ lp 1599 src/simh/sim_tmxr.c lp->rxbsz - lp->rxbpi); lp 1602 src/simh/sim_tmxr.c if (!lp->datagram) { /* ignore errors reading UDP sockets */ lp 1603 src/simh/sim_tmxr.c if (!lp->txbfd || lp->notelnet) lp 1604 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; /* Drop the data we already know we can't send */ lp 1605 src/simh/sim_tmxr.c tmxr_close_ln (lp); /* disconnect line */ lp 1611 src/simh/sim_tmxr.c j = lp->rxbpi; /* start of data */ lp 1612 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpi + nbytes; /* adv pointers */ lp 1613 src/simh/sim_tmxr.c lp->rxcnt = lp->rxcnt + nbytes; lp 1617 src/simh/sim_tmxr.c if (!lp->notelnet) { /* Are we looking for telnet interpretation? */ lp 1618 src/simh/sim_tmxr.c for (; j < lp->rxbpi; ) { /* loop thru char */ lp 1619 src/simh/sim_tmxr.c u_char tmp = (u_char)lp->rxb[j]; /* get char */ lp 1620 src/simh/sim_tmxr.c switch (lp->tsta) { /* case tlnt state */ lp 1624 src/simh/sim_tmxr.c lp->tsta = TNS_IAC; /* change state */ lp 1625 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove char */ lp 1628 src/simh/sim_tmxr.c if ((tmp == TN_CR) && lp->dstb) /* CR, no bin */ lp 1629 src/simh/sim_tmxr.c lp->tsta = TNS_CRPAD; /* skip pad char */ lp 1635 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* treat as normal */ lp 1640 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* treat as normal */ lp 1641 src/simh/sim_tmxr.c lp->rxb[j] = 0; /* char is null */ lp 1642 src/simh/sim_tmxr.c lp->rbr[j] = 1; /* flag break */ lp 1648 src/simh/sim_tmxr.c lp->tsta = TNS_WILL; lp 1651 src/simh/sim_tmxr.c lp->tsta = TNS_WONT; lp 1654 src/simh/sim_tmxr.c lp->tsta = TNS_DO; lp 1657 src/simh/sim_tmxr.c lp->tsta = TNS_SKIP; /* IAC + other */ lp 1663 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; //-V1037 /* ignore */ lp 1668 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; //-V1037 /* ignore */ lp 1671 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove char */ lp 1709 src/simh/sim_tmxr.c if (0 == (lp->telnet_sent_opts[tmp] & TNOS_DONT)) { lp 1710 src/simh/sim_tmxr.c lp->notelnet = TRUE; /* Temporarily disable so */ lp 1711 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_IAC); /* IAC gets injected bare */ lp 1712 src/simh/sim_tmxr.c lp->notelnet = FALSE; lp 1713 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_DONT); lp 1714 src/simh/sim_tmxr.c tmxr_putc_ln (lp, tmp); lp 1715 src/simh/sim_tmxr.c lp->telnet_sent_opts[tmp] |= TNOS_DONT;/* Record DONT sent */ lp 1721 src/simh/sim_tmxr.c if (lp->tsta == TNS_WILL) { lp 1722 src/simh/sim_tmxr.c lp->dstb = 0; lp 1725 src/simh/sim_tmxr.c lp->dstb = 1; lp 1728 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove it */ lp 1729 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* next normal */ lp 1747 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* next normal */ lp 1750 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove it */ lp 1788 src/simh/sim_tmxr.c if (0 == (lp->telnet_sent_opts[tmp] & TNOS_WONT)) { lp 1789 src/simh/sim_tmxr.c lp->notelnet = TRUE; /* Temporarily disable so */ lp 1790 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_IAC); /* IAC gets injected bare */ lp 1791 src/simh/sim_tmxr.c lp->notelnet = FALSE; lp 1792 src/simh/sim_tmxr.c tmxr_putc_ln (lp, TN_WONT); lp 1793 src/simh/sim_tmxr.c tmxr_putc_ln (lp, tmp); lp 1794 src/simh/sim_tmxr.c lp->telnet_sent_opts[tmp] |= TNOS_WONT;/* Record WONT sent */ lp 1799 src/simh/sim_tmxr.c tmxr_rmvrc (lp, j); /* remove char */ lp 1800 src/simh/sim_tmxr.c lp->tsta = TNS_NORM; /* next normal */ lp 1808 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 1809 src/simh/sim_tmxr.c if (lp->rxbpi == lp->rxbpr) /* if buf empty, */ lp 1810 src/simh/sim_tmxr.c lp->rxbpi = lp->rxbpr = 0; /* reset pointers */ lp 1817 src/simh/sim_tmxr.c int32 tmxr_rqln_bare (const TMLN *lp, t_bool speed) lp 1819 src/simh/sim_tmxr.c if ((speed) && (lp->rxbps)) { /* consider speed and rate limiting? */ lp 1820 src/simh/sim_tmxr.c if (sim_gtime () < lp->rxnexttime) /* too soon? */ lp 1823 src/simh/sim_tmxr.c return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz : 0)) ? 1 : 0; lp 1825 src/simh/sim_tmxr.c return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz: 0)); lp 1828 src/simh/sim_tmxr.c int32 tmxr_rqln (const TMLN *lp) lp 1830 src/simh/sim_tmxr.c return tmxr_rqln_bare (lp, TRUE); lp 1846 src/simh/sim_tmxr.c t_stat tmxr_putc_ln (TMLN *lp, int32 chr) lp 1848 src/simh/sim_tmxr.c if ((lp->conn == FALSE) && /* no conn & not buffered telnet? */ lp 1849 src/simh/sim_tmxr.c (!lp->txbfd || lp->notelnet)) { lp 1850 src/simh/sim_tmxr.c ++lp->txdrp; /* lost */ lp 1854 src/simh/sim_tmxr.c #define TXBUF_AVAIL(lp) (lp->txbsz - tmxr_tqln (lp)) lp 1856 src/simh/sim_tmxr.c #define TXBUF_CHAR(lp, c) { \ lp 1857 src/simh/sim_tmxr.c lp->txb[lp->txbpi++] = (char)(c); \ lp 1858 src/simh/sim_tmxr.c lp->txbpi %= lp->txbsz; \ lp 1859 src/simh/sim_tmxr.c if (lp->txbpi == lp->txbpr) \ lp 1860 src/simh/sim_tmxr.c lp->txbpr = (1+lp->txbpr)%lp->txbsz, ++lp->txdrp; \ lp 1863 src/simh/sim_tmxr.c if ((lp->txbfd && !lp->notelnet) || (TXBUF_AVAIL(lp) > 1)) {/* room for char (+ IAC)? */ lp 1864 src/simh/sim_tmxr.c if ((TN_IAC == (u_char) chr) && (!lp->notelnet)) /* char == IAC in telnet session? */ lp 1865 src/simh/sim_tmxr.c TXBUF_CHAR (lp, TN_IAC); /* stuff extra IAC char */ lp 1866 src/simh/sim_tmxr.c TXBUF_CHAR (lp, chr); /* buffer char & adv pointer */ lp 1867 src/simh/sim_tmxr.c if ((!lp->txbfd) && ((unsigned long int)TXBUF_AVAIL (lp) <= TMXR_GUARD)) /* near full? */ lp 1868 src/simh/sim_tmxr.c lp->xmte = 0; /* disable line */ lp 1869 src/simh/sim_tmxr.c if (lp->txlog) /* log if available */ lp 1870 src/simh/sim_tmxr.c fputc (chr, lp->txlog); lp 1871 src/simh/sim_tmxr.c sim_exp_check (&lp->expect, chr); /* process expect rules as needed */ lp 1874 src/simh/sim_tmxr.c ++lp->txdrp; lp->xmte = 0; /* no room, dsbl line */ lp 1895 src/simh/sim_tmxr.c t_stat tmxr_put_packet_ln (TMLN *lp, const uint8 *buf, size_t size) lp 1897 src/simh/sim_tmxr.c return tmxr_put_packet_ln_ex (lp, buf, size, 0); lp 1900 src/simh/sim_tmxr.c t_stat tmxr_put_packet_ln_ex (TMLN *lp, const uint8 *buf, size_t size, uint8 frame_byte) lp 1904 src/simh/sim_tmxr.c size_t pktlen_size = (lp->datagram ? 0 : 2); lp 1906 src/simh/sim_tmxr.c if ((!lp->conn) && (!lp->loopback)) lp 1908 src/simh/sim_tmxr.c if (lp->txppoffset < lp->txppsize) { lp 1911 src/simh/sim_tmxr.c if (lp->txpbsize < size + pktlen_size + fc_size) { lp 1912 src/simh/sim_tmxr.c lp->txpbsize = size + pktlen_size + fc_size; lp 1913 src/simh/sim_tmxr.c lp->txpb = (uint8 *)realloc (lp->txpb, lp->txpbsize); lp 1914 src/simh/sim_tmxr.c if (!lp->txpb) lp 1927 src/simh/sim_tmxr.c lp->txpb[0] = frame_byte; lp 1928 src/simh/sim_tmxr.c if (!lp->datagram) { lp 1929 src/simh/sim_tmxr.c lp->txpb[0+fc_size] = (size >> 8) & 0xFF; lp 1930 src/simh/sim_tmxr.c lp->txpb[1+fc_size] = size & 0xFF; lp 1932 src/simh/sim_tmxr.c memcpy (lp->txpb + pktlen_size + fc_size, buf, size); lp 1933 src/simh/sim_tmxr.c lp->txppsize = size + pktlen_size + fc_size; lp 1934 src/simh/sim_tmxr.c lp->txppoffset = 0; lp 1935 src/simh/sim_tmxr.c ++lp->txpcnt; lp 1936 src/simh/sim_tmxr.c while ((lp->txppoffset < lp->txppsize) && lp 1937 src/simh/sim_tmxr.c (SCPE_OK == (r = tmxr_putc_ln (lp, lp->txpb[lp->txppoffset])))) lp 1938 src/simh/sim_tmxr.c ++lp->txppoffset; lp 1940 src/simh/sim_tmxr.c tmxr_send_buffered_data (lp); lp 1941 src/simh/sim_tmxr.c return (lp->conn || lp->loopback) ? SCPE_OK : SCPE_LOST; lp 1955 src/simh/sim_tmxr.c TMLN *lp; lp 1958 src/simh/sim_tmxr.c lp = mp->ldsc + i; /* get line desc */ lp 1959 src/simh/sim_tmxr.c if (!lp->conn) /* skip if !conn */ lp 1961 src/simh/sim_tmxr.c nbytes = tmxr_send_buffered_data (lp); /* buffered bytes */ lp 1963 src/simh/sim_tmxr.c lp->xmte = 1; /* enable line transmit */ lp 1977 src/simh/sim_tmxr.c int32 tmxr_send_buffered_data (TMLN *lp) lp 1982 src/simh/sim_tmxr.c nbytes = tmxr_tqln(lp); /* avail bytes */ lp 1984 src/simh/sim_tmxr.c if (lp->txbpr < lp->txbpi) /* no wrap? */ lp 1985 src/simh/sim_tmxr.c sbytes = tmxr_write (lp, nbytes); /* write all data */ lp 1987 src/simh/sim_tmxr.c sbytes = tmxr_write (lp, lp->txbsz - lp->txbpr);/* write to end buf */ lp 1989 src/simh/sim_tmxr.c lp->txbpr = (lp->txbpr + sbytes); /* update remove ptr */ lp 1990 src/simh/sim_tmxr.c if (lp->txbpr >= lp->txbsz) /* wrap? */ lp 1991 src/simh/sim_tmxr.c lp->txbpr = 0; lp 1992 src/simh/sim_tmxr.c lp->txcnt = lp->txcnt + sbytes; /* update counts */ lp 1994 src/simh/sim_tmxr.c if ((nbytes == 0) && (lp->datagram)) /* if Empty buffer on datagram line */ lp 1995 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; /* Start next packet at beginning of buffer */ lp 1998 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; /* Drop the data we already know we can't send */ lp 1999 src/simh/sim_tmxr.c lp->rxpboffset = lp->txppoffset = lp->txppsize = 0;/* Drop the data we already know we can't send */ lp 2000 src/simh/sim_tmxr.c tmxr_close_ln (lp); /* close line/port on error */ lp 2003 src/simh/sim_tmxr.c if (nbytes && (lp->txbpr == 0)) { /* more data and wrap? */ lp 2004 src/simh/sim_tmxr.c sbytes = tmxr_write (lp, nbytes); lp 2006 src/simh/sim_tmxr.c lp->txbpr = (lp->txbpr + sbytes); /* update remove ptr */ lp 2007 src/simh/sim_tmxr.c if (lp->txbpr >= lp->txbsz) /* wrap? */ lp 2008 src/simh/sim_tmxr.c lp->txbpr = 0; lp 2009 src/simh/sim_tmxr.c lp->txcnt = lp->txcnt + sbytes; /* update counts */ lp 2014 src/simh/sim_tmxr.c while ((lp->txppoffset < lp->txppsize) && /* buffered packet data? */ lp 2015 src/simh/sim_tmxr.c (lp->txbsz > nbytes) && /* and room in xmt buffer */ lp 2016 src/simh/sim_tmxr.c (SCPE_OK == (r = tmxr_putc_ln (lp, lp->txpb[lp->txppoffset])))) lp 2017 src/simh/sim_tmxr.c ++lp->txppoffset; lp 2019 src/simh/sim_tmxr.c if ((nbytes == 0) && (tmxr_tqln(lp) > 0)) lp 2020 src/simh/sim_tmxr.c return tmxr_send_buffered_data (lp); lp 2021 src/simh/sim_tmxr.c return tmxr_tqln(lp) + tmxr_tpqln(lp); lp 2026 src/simh/sim_tmxr.c int32 tmxr_tqln (const TMLN *lp) lp 2028 src/simh/sim_tmxr.c return (lp->txbpi - lp->txbpr + ((lp->txbpi < lp->txbpr)? lp->txbsz: 0)); lp 2033 src/simh/sim_tmxr.c int32 tmxr_tpqln (const TMLN *lp) lp 2035 src/simh/sim_tmxr.c return (lp->txppsize - lp->txppoffset); lp 2040 src/simh/sim_tmxr.c t_bool tmxr_tpbusyln (const TMLN *lp) lp 2042 src/simh/sim_tmxr.c return (0 != (lp->txppsize - lp->txppoffset)); lp 2045 src/simh/sim_tmxr.c static void _mux_detach_line (TMLN *lp, t_bool close_listener, t_bool close_connecting) lp 2047 src/simh/sim_tmxr.c if (close_listener && lp->master) { lp 2048 src/simh/sim_tmxr.c sim_close_sock (lp->master); lp 2049 src/simh/sim_tmxr.c lp->master = 0; lp 2050 src/simh/sim_tmxr.c FREE (lp->port); lp 2051 src/simh/sim_tmxr.c lp->port = NULL; lp 2053 src/simh/sim_tmxr.c if (lp->sock) { /* if existing tcp, drop it */ lp 2054 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report disconnection */ lp 2055 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 2058 src/simh/sim_tmxr.c FREE (lp->destination); lp 2059 src/simh/sim_tmxr.c lp->destination = NULL; lp 2060 src/simh/sim_tmxr.c if (lp->connecting) { /* if existing outgoing tcp, drop it */ lp 2061 src/simh/sim_tmxr.c lp->sock = lp->connecting; lp 2062 src/simh/sim_tmxr.c lp->connecting = 0; lp 2063 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 2066 src/simh/sim_tmxr.c tmxr_set_line_loopback (lp, FALSE); lp 2069 src/simh/sim_tmxr.c t_stat tmxr_detach_ln (TMLN *lp) lp 2073 src/simh/sim_tmxr.c _mux_detach_line (lp, TRUE, TRUE); lp 2074 src/simh/sim_tmxr.c if (lp->mp) { lp 2075 src/simh/sim_tmxr.c if (lp->uptr) lp 2076 src/simh/sim_tmxr.c uptr = lp->uptr; lp 2078 src/simh/sim_tmxr.c uptr = lp->mp->uptr; lp 2082 src/simh/sim_tmxr.c uptr->filename = tmxr_mux_attach_string (uptr->filename, lp->mp); lp 2085 src/simh/sim_tmxr.c tmxr_detach (lp->mp, uptr); lp 2136 src/simh/sim_tmxr.c t_stat tmxr_set_line_speed (TMLN *lp, CONST char *speed) lp 2146 src/simh/sim_tmxr.c if (lp == NULL) lp 2148 src/simh/sim_tmxr.c lp->rxbps = (uint32)strtotv (speed, &cptr, 10); lp 2153 src/simh/sim_tmxr.c lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE * rxbpsfactor; lp 2155 src/simh/sim_tmxr.c lp->rxdelta = _tmln_speed_delta (speed); lp 2156 src/simh/sim_tmxr.c lp->rxnexttime = 0.0; lp 2157 src/simh/sim_tmxr.c uptr = lp->uptr; lp 2158 src/simh/sim_tmxr.c if ((!uptr) && (lp->mp)) lp 2159 src/simh/sim_tmxr.c uptr = lp->mp->uptr; lp 2161 src/simh/sim_tmxr.c uptr->wait = lp->rxdelta; lp 2162 src/simh/sim_tmxr.c if (lp->rxbpsfactor == 0.0) lp 2163 src/simh/sim_tmxr.c lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE; lp 2164 src/simh/sim_tmxr.c lp->txbps = lp->rxbps; lp 2165 src/simh/sim_tmxr.c lp->txdelta = lp->rxdelta; lp 2166 src/simh/sim_tmxr.c lp->txnexttime = lp->rxnexttime; lp 2186 src/simh/sim_tmxr.c TMLN *lp = NULL; lp 2192 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2193 src/simh/sim_tmxr.c lp->mp = mp; /* set the back pointer */ lp 2194 src/simh/sim_tmxr.c lp->modem_control = mp->modem_control; lp 2195 src/simh/sim_tmxr.c if (lp->rxbpsfactor == 0.0) lp 2196 src/simh/sim_tmxr.c lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE; lp 2408 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2409 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2410 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2411 src/simh/sim_tmxr.c lp->txlogname = (char *)realloc(lp->txlogname, CBUFSIZE); lp 2412 src/simh/sim_tmxr.c if (!lp->txlogname) lp 2425 src/simh/sim_tmxr.c (void)sprintf(lp->txlogname, "%s_%d", mp->logfiletmpl, i); lp 2427 src/simh/sim_tmxr.c (void)strcpy (lp->txlogname, mp->logfiletmpl); lp 2428 src/simh/sim_tmxr.c r = sim_open_logfile (lp->txlogname, TRUE, &lp->txlog, &lp->txlogref); lp 2430 src/simh/sim_tmxr.c setvbuf (lp->txlog, NULL, _IOFBF, 65536); lp 2432 src/simh/sim_tmxr.c FREE (lp->txlogname); lp 2433 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2440 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2442 src/simh/sim_tmxr.c lp->txbsz = mp->buffered; lp 2443 src/simh/sim_tmxr.c lp->txbfd = 1; lp 2444 src/simh/sim_tmxr.c lp->rxbsz = mp->buffered; lp 2447 src/simh/sim_tmxr.c lp->txbsz = TMXR_MAXBUF; lp 2448 src/simh/sim_tmxr.c lp->txbfd = 0; lp 2449 src/simh/sim_tmxr.c lp->rxbsz = TMXR_MAXBUF; lp 2451 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; lp 2452 src/simh/sim_tmxr.c lp->txb = (char *)realloc(lp->txb, lp->txbsz); lp 2453 src/simh/sim_tmxr.c if (!lp->txb) lp 2465 src/simh/sim_tmxr.c lp->rxb = (char *)realloc(lp->rxb, lp->rxbsz); lp 2466 src/simh/sim_tmxr.c if (!lp->rxb) lp 2478 src/simh/sim_tmxr.c lp->rbr = (char *)realloc(lp->rbr, lp->rxbsz); lp 2479 src/simh/sim_tmxr.c if (!lp->rbr) lp 2495 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2496 src/simh/sim_tmxr.c FREE(lp->txlogname); lp 2497 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2498 src/simh/sim_tmxr.c if (lp->txlog) { lp 2499 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2500 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2538 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2539 src/simh/sim_tmxr.c lp->mp = mp; /* set the back pointer */ lp 2540 src/simh/sim_tmxr.c lp->packet = mp->packet; lp 2542 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 2543 src/simh/sim_tmxr.c tmxr_init_line (lp); /* initialize line state */ lp 2544 src/simh/sim_tmxr.c lp->sock = 0; /* clear the socket */ lp 2552 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 2553 src/simh/sim_tmxr.c tmxr_set_line_loopback (lp, loopback); lp 2555 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 2561 src/simh/sim_tmxr.c lp = &mp->ldsc[0]; lp 2562 src/simh/sim_tmxr.c lp->datagram = datagram; lp 2565 src/simh/sim_tmxr.c lp->port = (char *)realloc (lp->port, 1 + strlen (listen)); lp 2566 src/simh/sim_tmxr.c if (!lp->port) lp 2578 src/simh/sim_tmxr.c (void)strcpy (lp->port, listen); /* save port */ lp 2583 src/simh/sim_tmxr.c lp->packet = packet; lp 2589 src/simh/sim_tmxr.c _mux_detach_line (lp, FALSE, TRUE); lp 2590 src/simh/sim_tmxr.c lp->destination = (char *)malloc(1+strlen(hostport)); lp 2591 src/simh/sim_tmxr.c if (!lp->destination) lp 2603 src/simh/sim_tmxr.c (void)strcpy (lp->destination, hostport); lp 2604 src/simh/sim_tmxr.c lp->mp = mp; lp 2605 src/simh/sim_tmxr.c if (!lp->modem_control || (lp->modembits & TMXR_MDM_DTR)) { lp 2606 src/simh/sim_tmxr.c lp->connecting = sock; lp 2607 src/simh/sim_tmxr.c lp->ipad = (char *)malloc (1 + strlen (lp->destination)); lp 2608 src/simh/sim_tmxr.c if (!lp->ipad) lp 2620 src/simh/sim_tmxr.c (void)strcpy (lp->ipad, lp->destination); lp 2624 src/simh/sim_tmxr.c lp->notelnet = notelnet; lp 2625 src/simh/sim_tmxr.c tmxr_init_line (lp); /* init the line state */ lp 2627 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 2637 src/simh/sim_tmxr.c lp = &mp->ldsc[line]; lp 2638 src/simh/sim_tmxr.c lp->mp = mp; lp 2640 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2641 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2642 src/simh/sim_tmxr.c lp->txlogname = (char *)realloc (lp->txlogname, 1 + strlen (logfiletmpl)); lp 2643 src/simh/sim_tmxr.c if (!lp->txlogname) lp 2655 src/simh/sim_tmxr.c (void)strcpy (lp->txlogname, logfiletmpl); lp 2656 src/simh/sim_tmxr.c r = sim_open_logfile (lp->txlogname, TRUE, &lp->txlog, &lp->txlogref); lp 2658 src/simh/sim_tmxr.c setvbuf(lp->txlog, NULL, _IOFBF, 65536); lp 2660 src/simh/sim_tmxr.c FREE (lp->txlogname); lp 2661 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2666 src/simh/sim_tmxr.c lp->rxbsz = lp->txbsz = TMXR_MAXBUF; lp 2667 src/simh/sim_tmxr.c lp->txbfd = 0; lp 2670 src/simh/sim_tmxr.c lp->rxbsz = lp->txbsz = atoi(buffered); lp 2671 src/simh/sim_tmxr.c lp->txbfd = 1; lp 2673 src/simh/sim_tmxr.c lp->txbpi = lp->txbpr = 0; lp 2674 src/simh/sim_tmxr.c lp->txb = (char *)realloc (lp->txb, lp->txbsz); lp 2675 src/simh/sim_tmxr.c if (!lp->txb) lp 2687 src/simh/sim_tmxr.c lp->rxb = (char *)realloc (lp->rxb, lp->rxbsz); lp 2688 src/simh/sim_tmxr.c if (!lp->rxb) lp 2700 src/simh/sim_tmxr.c lp->rbr = (char *)realloc (lp->rbr, lp->rxbsz); lp 2701 src/simh/sim_tmxr.c if (!lp->rbr) lp 2713 src/simh/sim_tmxr.c lp->packet = packet; lp 2715 src/simh/sim_tmxr.c FREE(lp->txlogname); lp 2716 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 2717 src/simh/sim_tmxr.c if (lp->txlog) { lp 2718 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); lp 2719 src/simh/sim_tmxr.c lp->txlog = NULL; lp 2730 src/simh/sim_tmxr.c _mux_detach_line (lp, TRUE, FALSE); lp 2732 src/simh/sim_tmxr.c lp->port = (char *)realloc (lp->port, 1 + strlen (listen)); lp 2733 src/simh/sim_tmxr.c if (!lp->port) lp 2745 src/simh/sim_tmxr.c (void)strcpy (lp->port, listen); /* save port */ lp 2746 src/simh/sim_tmxr.c lp->master = sock; /* save master socket */ lp 2748 src/simh/sim_tmxr.c lp->notelnet = listennotelnet; lp 2750 src/simh/sim_tmxr.c lp->notelnet = mp->notelnet; lp 2753 src/simh/sim_tmxr.c lp->datagram = datagram; lp 2756 src/simh/sim_tmxr.c lp->port = (char *)realloc (lp->port, 1 + strlen (listen)); lp 2757 src/simh/sim_tmxr.c if (!lp->port) lp 2769 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 2821 src/simh/sim_tmxr.c if (lp != NULL) { lp 2822 src/simh/sim_tmxr.c tmxr_set_line_loopback (lp, loopback); lp 2826 src/simh/sim_tmxr.c if (lp != NULL) lp->modem_control = modem_control; lp 2829 src/simh/sim_tmxr.c tmxr_set_line_speed (lp, speed); lp 3051 src/simh/sim_tmxr.c TMLN *lp; lp 3089 src/simh/sim_tmxr.c lp = mp->ldsc + j; lp 3091 src/simh/sim_tmxr.c if (lp->dptr && (mp->dptr != lp->dptr)) lp 3092 src/simh/sim_tmxr.c fprintf (st, "Device: %s ", sim_dname(lp->dptr)); lp 3094 src/simh/sim_tmxr.c if (mp->notelnet != lp->notelnet) lp 3095 src/simh/sim_tmxr.c fprintf (st, " - %stelnet", lp->notelnet ? "no" : ""); lp 3096 src/simh/sim_tmxr.c if (lp->uptr && (lp->uptr != lp->mp->uptr)) lp 3097 src/simh/sim_tmxr.c fprintf (st, " - Unit: %s", sim_uname (lp->uptr)); lp 3098 src/simh/sim_tmxr.c if (mp->modem_control != lp->modem_control) lp 3099 src/simh/sim_tmxr.c fprintf(st, ", ModemControl=%s", lp->modem_control ? "enabled" : "disabled"); lp 3100 src/simh/sim_tmxr.c if (lp->loopback) lp 3102 src/simh/sim_tmxr.c if (lp->rxbps) { lp 3103 src/simh/sim_tmxr.c fprintf(st, ", Speed=%lu", (unsigned long)lp->rxbps); lp 3104 src/simh/sim_tmxr.c if (lp->rxbpsfactor != TMXR_RX_BPS_UNIT_SCALE) lp 3105 src/simh/sim_tmxr.c fprintf(st, "*%.0f", lp->rxbpsfactor/TMXR_RX_BPS_UNIT_SCALE); lp 3110 src/simh/sim_tmxr.c if ((!lp->sock) && (!lp->connecting) lp 3111 src/simh/sim_tmxr.c && (!lp->master)) { lp 3112 src/simh/sim_tmxr.c if (lp->modem_control) lp 3113 src/simh/sim_tmxr.c tmxr_fconns (st, lp, -1); lp 3116 src/simh/sim_tmxr.c tmxr_fconns (st, lp, -1); lp 3117 src/simh/sim_tmxr.c tmxr_fstats (st, lp, -1); lp 3134 src/simh/sim_tmxr.c TMLN *lp; lp 3137 src/simh/sim_tmxr.c lp = mp->ldsc + i; lp 3139 src/simh/sim_tmxr.c if (!lp->destination && lp->sock) { /* not serial and is connected? */ lp 3140 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report disconnection */ lp 3141 src/simh/sim_tmxr.c tmxr_reset_ln (lp); /* disconnect line */ lp 3144 src/simh/sim_tmxr.c if (lp->sock) { lp 3145 src/simh/sim_tmxr.c tmxr_report_disconnection (lp); /* report disconnection */ lp 3146 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 3148 src/simh/sim_tmxr.c FREE (lp->destination); lp 3149 src/simh/sim_tmxr.c lp->destination = NULL; lp 3150 src/simh/sim_tmxr.c if (lp->connecting) { lp 3151 src/simh/sim_tmxr.c lp->sock = lp->connecting; lp 3152 src/simh/sim_tmxr.c lp->connecting = 0; lp 3153 src/simh/sim_tmxr.c tmxr_reset_ln (lp); lp 3155 src/simh/sim_tmxr.c lp->conn = FALSE; lp 3157 src/simh/sim_tmxr.c if (lp->master) { lp 3158 src/simh/sim_tmxr.c sim_close_sock (lp->master); /* close master socket */ lp 3159 src/simh/sim_tmxr.c lp->master = 0; lp 3160 src/simh/sim_tmxr.c FREE (lp->port); lp 3161 src/simh/sim_tmxr.c lp->port = NULL; lp 3163 src/simh/sim_tmxr.c lp->txbfd = 0; lp 3164 src/simh/sim_tmxr.c FREE (lp->txb); lp 3165 src/simh/sim_tmxr.c lp->txb = NULL; lp 3166 src/simh/sim_tmxr.c FREE (lp->rxb); lp 3167 src/simh/sim_tmxr.c lp->rxb = NULL; lp 3168 src/simh/sim_tmxr.c FREE (lp->rbr); lp 3169 src/simh/sim_tmxr.c lp->rbr = NULL; lp 3170 src/simh/sim_tmxr.c lp->modembits = 0; lp 3453 src/simh/sim_tmxr.c void tmxr_linemsg (TMLN *lp, const char *msg) lp 3456 src/simh/sim_tmxr.c while (SCPE_STALL == tmxr_putc_ln (lp, (int32)(*msg))) lp 3457 src/simh/sim_tmxr.c if (lp->txbsz == tmxr_send_buffered_data (lp)) lp 3466 src/simh/sim_tmxr.c void tmxr_linemsgf (TMLN *lp, const char *fmt, ...) lp 3471 src/simh/sim_tmxr.c tmxr_linemsgvf (lp, fmt, arglist); lp 3475 src/simh/sim_tmxr.c void tmxr_linemsgvf (TMLN *lp, const char *fmt, va_list arglist) lp 3519 src/simh/sim_tmxr.c while (SCPE_STALL == tmxr_putc_ln (lp, '\r')) lp 3520 src/simh/sim_tmxr.c if (lp->txbsz == tmxr_send_buffered_data (lp)) lp 3523 src/simh/sim_tmxr.c while (SCPE_STALL == tmxr_putc_ln (lp, buf[i])) lp 3524 src/simh/sim_tmxr.c if (lp->txbsz == tmxr_send_buffered_data (lp)) lp 3534 src/simh/sim_tmxr.c void tmxr_fconns (FILE *st, const TMLN *lp, int32 ln) lp 3542 src/simh/sim_tmxr.c if ((lp->sock) || (lp->connecting)) { /* tcp connection? */ lp 3543 src/simh/sim_tmxr.c if (lp->destination) /* remote connection? */ lp 3544 src/simh/sim_tmxr.c if (lp->datagram) lp 3545 src/simh/sim_tmxr.c fprintf (st, "Datagram Connection from %s to remote port %s\n", lp->port, lp->destination);/* print port name */ lp 3547 src/simh/sim_tmxr.c fprintf (st, "Connection to remote port %s\n", lp->destination);/* print port name */ lp 3549 src/simh/sim_tmxr.c fprintf (st, "Connection from IP address %s\n", lp->ipad); lp 3552 src/simh/sim_tmxr.c if (lp->destination) /* remote connection? */ lp 3553 src/simh/sim_tmxr.c fprintf (st, "Connecting to remote port %s\n", lp->destination);/* print port name */ lp 3554 src/simh/sim_tmxr.c if (lp->sock) { lp 3557 src/simh/sim_tmxr.c sim_getnames_sock (lp->sock, &sockname, &peername); lp 3563 src/simh/sim_tmxr.c if ((lp->port) && (!lp->datagram)) lp 3564 src/simh/sim_tmxr.c fprintf (st, "Listening on port %s\n", lp->port); /* print port name */ lp 3565 src/simh/sim_tmxr.c if (lp->cnms) { lp 3566 src/simh/sim_tmxr.c tctime = (sim_os_msec () - lp->cnms) / 1000; lp 3571 src/simh/sim_tmxr.c fprintf (st, " %s %02d:%02d:%02d\n", lp->connecting ? "Connecting for" : "Connected", hr, mn, sc); lp 3576 src/simh/sim_tmxr.c if (lp->modem_control) { lp 3577 src/simh/sim_tmxr.c fprintf (st, " Modem Bits: %s%s%s%s%s%s\n", (lp->modembits & TMXR_MDM_DTR) ? "DTR " : "", lp 3578 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_RTS) ? "RTS " : "", lp 3579 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_DCD) ? "DCD " : "", lp 3580 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_RNG) ? "RNG " : "", lp 3581 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_CTS) ? "CTS " : "", lp 3582 src/simh/sim_tmxr.c (lp->modembits & TMXR_MDM_DSR) ? "DSR " : ""); lp 3586 src/simh/sim_tmxr.c (lp->sock) && (!lp->datagram)) lp 3587 src/simh/sim_tmxr.c fprintf (st, " %s\n", (lp->notelnet) ? "Telnet disabled (RAW data)" : "Telnet protocol"); lp 3588 src/simh/sim_tmxr.c if (lp->send.buffer) lp 3589 src/simh/sim_tmxr.c sim_show_send_input (st, &lp->send); lp 3590 src/simh/sim_tmxr.c if (lp->expect.buf) lp 3591 src/simh/sim_tmxr.c sim_exp_showall (st, &lp->expect); lp 3592 src/simh/sim_tmxr.c if (lp->txlog) lp 3593 src/simh/sim_tmxr.c fprintf (st, " Logging to %s\n", lp->txlogname); lp 3599 src/simh/sim_tmxr.c void tmxr_fstats (FILE *st, const TMLN *lp, int32 ln) lp 3606 src/simh/sim_tmxr.c if ((!lp->sock) && (!lp->connecting) lp 3612 src/simh/sim_tmxr.c fprintf (st, " input (%s)", (lp->rcve? enab: dsab)); lp 3613 src/simh/sim_tmxr.c if (lp->rxcnt) lp 3614 src/simh/sim_tmxr.c fprintf (st, " queued/total = %d/%d", tmxr_rqln (lp), lp->rxcnt); lp 3615 src/simh/sim_tmxr.c if (lp->rxpcnt) lp 3616 src/simh/sim_tmxr.c fprintf (st, " packets = %d", lp->rxpcnt); lp 3617 src/simh/sim_tmxr.c fprintf (st, "\n output (%s)", (lp->xmte? enab: dsab)); lp 3618 src/simh/sim_tmxr.c if (lp->txcnt || lp->txbpi) lp 3619 src/simh/sim_tmxr.c fprintf (st, " queued/total = %d/%d", tmxr_tqln (lp), lp->txcnt); lp 3620 src/simh/sim_tmxr.c if (lp->txpcnt || tmxr_tpqln (lp)) lp 3622 src/simh/sim_tmxr.c tmxr_tpqln (lp), lp->txpcnt); lp 3625 src/simh/sim_tmxr.c if (lp->txbfd) lp 3626 src/simh/sim_tmxr.c fprintf (st, " output buffer size = %d\n", lp->txbsz); lp 3627 src/simh/sim_tmxr.c if (lp->txcnt || lp->txbpi) lp 3629 src/simh/sim_tmxr.c ((lp->txcnt > 0) && (lp->txcnt > lp->txbsz)) ? lp->txbsz : lp->txbpi); lp 3630 src/simh/sim_tmxr.c if (lp->txdrp) lp 3631 src/simh/sim_tmxr.c fprintf (st, " dropped = %d\n", lp->txdrp); lp 3664 src/simh/sim_tmxr.c TMLN *lp; lp 3670 src/simh/sim_tmxr.c lp = tmxr_get_ldsc (uptr, cptr, mp, &status); /* get referenced line */ lp 3672 src/simh/sim_tmxr.c if (lp == NULL) /* bad line number? */ lp 3675 src/simh/sim_tmxr.c if ((lp->sock) lp 3677 src/simh/sim_tmxr.c if (!lp->notelnet) lp 3678 src/simh/sim_tmxr.c tmxr_linemsg (lp, "\r\nOperator disconnected line\r\n\n");/* report closure */ lp 3679 src/simh/sim_tmxr.c tmxr_reset_ln_ex (lp, (sim_switches & SWMASK ('C'))); /* drop the line */ lp 3690 src/simh/sim_tmxr.c TMLN *lp; lp 3695 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, val, mp); /* find line desc */ lp 3696 src/simh/sim_tmxr.c if (lp == NULL) lp 3698 src/simh/sim_tmxr.c if (lp->txlog) /* close existing log */ lp 3700 src/simh/sim_tmxr.c lp->txlogname = (char *) calloc (CBUFSIZE, sizeof (char)); /* alloc namebuf */ lp 3701 src/simh/sim_tmxr.c if (lp->txlogname == NULL) /* can't? */ lp 3703 src/simh/sim_tmxr.c strncpy (lp->txlogname, cptr, CBUFSIZE-1); /* save file name */ lp 3704 src/simh/sim_tmxr.c r = sim_open_logfile (cptr, TRUE, &lp->txlog, &lp->txlogref); /* open log */ lp 3706 src/simh/sim_tmxr.c FREE (lp->txlogname); /* free buffer */ lp 3709 src/simh/sim_tmxr.c if (lp->txlog == NULL) { /* error? */ lp 3710 src/simh/sim_tmxr.c FREE (lp->txlogname); /* free buffer */ lp 3714 src/simh/sim_tmxr.c lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp); lp 3723 src/simh/sim_tmxr.c TMLN *lp; lp 3727 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, val, mp); /* find line desc */ lp 3728 src/simh/sim_tmxr.c if (lp == NULL) lp 3730 src/simh/sim_tmxr.c if (lp->txlog) { /* logging? */ lp 3731 src/simh/sim_tmxr.c sim_close_logfile (&lp->txlogref); /* close log */ lp 3732 src/simh/sim_tmxr.c FREE (lp->txlogname); /* free namebuf */ lp 3733 src/simh/sim_tmxr.c lp->txlog = NULL; lp 3734 src/simh/sim_tmxr.c lp->txlogname = NULL; lp 3737 src/simh/sim_tmxr.c lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp); lp 3746 src/simh/sim_tmxr.c TMLN *lp; lp 3748 src/simh/sim_tmxr.c lp = tmxr_find_ldsc (uptr, val, mp); /* find line desc */ lp 3749 src/simh/sim_tmxr.c if (lp == NULL) lp 3751 src/simh/sim_tmxr.c if (lp->txlog) lp 3752 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 277 src/simh/sim_tmxr.h # define tmxr_debug(dbits, lp, msg, buf, bufsize) \ lp 278 src/simh/sim_tmxr.h do { if (sim_deb && (lp)->mp && (lp)->mp->dptr && ((dbits) & (lp)->mp->dptr->dctrl)) \ lp 279 src/simh/sim_tmxr.h _tmxr_debug (dbits, lp, msg, buf, bufsize); } while (0) lp 281 src/simh/sim_tmxr.h # define tmxr_debug_msg(dbits, lp, msg) \ lp 282 src/simh/sim_tmxr.h do { if (sim_deb && (lp)->mp && (lp)->mp->dptr && ((dbits) & (lp)->mp->dptr->dctrl)) \ lp 283 src/simh/sim_tmxr.h sim_debug (dbits, (lp)->mp->dptr, "%s", msg); } while (0) lp 285 src/simh/sim_tmxr.h # define tmxr_debug_return(lp, val) \ lp 286 src/simh/sim_tmxr.h do { if (sim_deb && (val) && (lp)->mp && (lp)->mp->dptr && (TMXR_DBG_RET & (lp)->mp->dptr->dctrl)) \ lp 287 src/simh/sim_tmxr.h { if ((lp)->rxbps) sim_debug (TMXR_DBG_RET, (lp)->mp->dptr, "Ln%d: 0x%x - Next after: %.0f\n", \ lp 288 src/simh/sim_tmxr.h (int)((lp)-(lp)->mp->ldsc), val, (lp)->rxnexttime); \ lp 289 src/simh/sim_tmxr.h else sim_debug (TMXR_DBG_RET, (lp)->mp->dptr, "Ln%d: 0x%x\n", (int)((lp)-(lp)->mp->ldsc), val); \ lp 296 src/simh/sim_tmxr.h # define tmxr_debug_trace_line(lp, msg) \ lp 297 src/simh/sim_tmxr.h do { if (sim_deb && (lp)->mp && (lp)->mp->dptr && (TMXR_DBG_TRC & (lp)->mp->dptr->dctrl)) \ lp 298 src/simh/sim_tmxr.h sim_debug (TMXR_DBG_TRC, (lp)->mp->dptr, "Ln%d:%s\n", (int)((lp)-(lp)->mp->ldsc), (msg)); } while (0) lp 304 src/simh/sim_tmxr.h # define tmxr_debug_connect_line(lp, msg) \ lp 305 src/simh/sim_tmxr.h do { if (sim_deb && (lp)->mp && (lp)->mp->dptr && (TMXR_DBG_CON & (lp)->mp->dptr->dctrl)) \ lp 306 src/simh/sim_tmxr.h sim_debug (TMXR_DBG_CON, (lp)->mp->dptr, "Ln%d:%s\n", (int)((lp)-(lp)->mp->ldsc), (msg)); } while (0)