Logo 
Search:

Networking Articles

Submit Article
Home » Articles » Networking » TCP/IPRSS Feeds

TCP/IP program to handle telnet "will/won't" TRANSMIT-BINARY option

Posted By: Milind Mishra     Category: Networking     Views: 1931

TCP/IP program to handle telnet "will/won't" TRANSMIT-BINARY option.

Code for TCP/IP program to handle telnet "will/won't" TRANSMIT-BINARY option in Networking

#include <sys/types.h>
#include <stdio.h>
#include "telnet.h"char        rcvbinary;    /* non-zero if remote TRANSMIT-BINARY    */extern u_char    option_cmd;

/*ARGSUSED*/int
do_txbinary(FILE *sfp, FILE *tfp, int c)
{
    if (rcvbinary) {
        if (option_cmd == TCWILL)
            return 0;
    } elseif (option_cmd == TCWONT)
        return 0;
    rcvbinary = !rcvbinary;
    (void) putc(TCIAC, sfp);
    if (rcvbinary)
        (void) putc(TCDO, sfp);
    else
        (void) putc(TCDONT, sfp);
    (void) putc((char)c, sfp);
    return 0;
}
  
Share: 



Milind Mishra
Milind Mishra author of TCP/IP program to handle telnet "will/won't" TRANSMIT-BINARY option is from India.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!