Changeset e652e5f8 in rtems


Ignore:
Timestamp:
Aug 20, 2012, 10:10:03 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
90e2026
Parents:
3850af9
git-author:
Sebastian Huber <sebastian.huber@…> (08/20/12 10:10:03)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/28/12 13:41:33)
Message:

telnetd: Inform client that we will echo

The standard line editor rtems_shell_line_editor() produces an echo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/telnetd/pty.c

    r3850af9 re652e5f8  
    8989static rtems_device_major_number pty_major;
    9090
     91static
     92int send_iac(int minor,unsigned char mode,unsigned char option)
     93{
     94  unsigned char buf[3];
     95
     96  buf[0]=IAC_ESC;
     97  buf[1]=mode;
     98  buf[2]=option;
     99  return write(telnet_ptys[minor].socket,buf,sizeof(buf));
     100}
    91101
    92102/* This procedure returns the devname for a pty slot free.
     
    119129        setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, &t, sizeof(t));
    120130        telnet_ptys[ndx].socket=socket;
     131
     132        /* inform the client that we will echo */
     133        send_iac(ndx, IAC_WILL, 1);
     134
    121135        return telnet_ptys[ndx].devname;
    122136      };
     
    138152static const char IAC_BRK_RSP[]="<*Break*>";
    139153static const char IAC_IP_RSP []="<*Interrupt*>";
    140 
    141 static
    142 int send_iac(int minor,unsigned char mode,unsigned char option)
    143 {
    144   unsigned char buf[3];
    145 
    146   buf[0]=IAC_ESC;
    147   buf[1]=mode;
    148   buf[2]=option;
    149   return write(telnet_ptys[minor].socket,buf,sizeof(buf));
    150 }
    151154
    152155static int
     
    285288              send_iac(minor,IAC_WILL,    3);  /* GO AHEAD*/
    286289           } else  if (value==1) {
    287               /* ECHO */
     290              send_iac(minor,IAC_WILL,    1);  /* ECHO */
    288291           } else {
    289292              send_iac(minor,IAC_WONT,value);
Note: See TracChangeset for help on using the changeset viewer.