Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
teverett committed Jun 16, 2024
1 parent 3161621 commit c41f4b9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/main/java/com/khubla/telnet/nvt/NVT.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public NVT(Socket socket) throws IOException {
* send config
*/
sendConfigParameters();
/*
* send GA
*/
if (!nvtOptions.isSuppressGoAhead()) {
// sendIACCommand(IACIAC.IAC_COMMAND_GA);
}
}

@Override
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/khubla/telnet/nvt/NVTOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,16 @@ public class NVTOptions {
*/
// RFC 727, default is false
private boolean logout = false;
/**
* suppress go-ahead
*/
// RFC 858, default is false
private boolean suppressGoAhead = false;

public void show() {
System.out.println("NVT Options:");
System.out.println("EOR: " + eor);
System.out.println("suppressGoAhead: " + suppressGoAhead);
System.out.println("clientcanextendedascii: " + clientcanextendedascii);
System.out.println("clientcancharset: " + clientcancharset);
System.out.println("binaryMode: " + binaryMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ public void process(NVT nvt, int cmd) throws IOException {
case IAC.IAC_COMMAND_DO:
logger.info("Received IAC DO SG");
nvt.sendIACCommand(IAC.IAC_COMMAND_WILL, IAC_CODE_SUPPRESS_GOAHEAD);
nvt.getNvtOptions().setSuppressGoAhead(true);
break;
case IAC.IAC_COMMAND_DONT:
logger.info("Received IAC DONT SG");
// we always suppress go-ahead!
nvt.sendIACCommand(IAC.IAC_COMMAND_WILL, IAC_CODE_SUPPRESS_GOAHEAD);
nvt.sendIACCommand(IAC.IAC_COMMAND_WONT, IAC_CODE_SUPPRESS_GOAHEAD);
nvt.getNvtOptions().setSuppressGoAhead(false);
break;
case IAC.IAC_COMMAND_WILL:
logger.info("Received IAC WILL SG");
Expand Down

0 comments on commit c41f4b9

Please sign in to comment.