/*
+ * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016 VMS Software, Inc. All Rights Reserved.
*
- * Licensed under the OpenSSL license (the "License"). You may not use
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
** Process the terminal input
*/
LogMessage ("Waiting on terminal I/O ...\n");
- len = recv (TermSock, TermBuff, sizeof (TermBuff), 0) ;
+ len = recv (TermSock, TermBuff, sizeof(TermBuff), 0) ;
TermBuff[len] = '\0';
LogMessage ("Received terminal I/O [%s]", TermBuff);
close (TerminalSocketPair[0]);
if (TerminalSocketPair[1])
close (TerminalSocketPair[1]);
- return (TERM_SOCK_FAILURE);
+ return TERM_SOCK_FAILURE;
}
/*
LogMessage ("TerminalSocket: SYS$ASSIGN () - %08X", status);
close (TerminalSocketPair[0]);
close (TerminalSocketPair[1]);
- return (TERM_SOCK_FAILURE);
+ return TERM_SOCK_FAILURE;
}
/*
TerminalDeviceAst,
0,
TerminalDeviceBuff,
- sizeof (TerminalDeviceBuff) - 2,
+ sizeof(TerminalDeviceBuff) - 2,
0, 0, 0, 0);
if (! (status & 1)) {
LogMessage ("TerminalSocket: SYS$QIO () - %08X", status);
close (TerminalSocketPair[0]);
close (TerminalSocketPair[1]);
- return (TERM_SOCK_FAILURE);
+ return TERM_SOCK_FAILURE;
}
/*
LogMessage ("TerminalSocket: SYS$CANCEL () - %08X", status);
close (TerminalSocketPair[0]);
close (TerminalSocketPair[1]);
- return (TERM_SOCK_FAILURE);
+ return TERM_SOCK_FAILURE;
}
/*
LogMessage ("TerminalSocket: SYS$DASSGN () - %08X", status);
close (TerminalSocketPair[0]);
close (TerminalSocketPair[1]);
- return (TERM_SOCK_FAILURE);
+ return TERM_SOCK_FAILURE;
}
/*
** Invalid function code
*/
LogMessage ("TerminalSocket: Invalid Function Code - %d", FunctionCode);
- return (TERM_SOCK_FAILURE);
+ return TERM_SOCK_FAILURE;
break;
}
/*
** Return success
*/
- return (TERM_SOCK_SUCCESS);
+ return TERM_SOCK_SUCCESS;
}
\f
SockDesc1 = socket (SocketFamily, SocketType, 0);
if (SockDesc1 < 0) {
LogMessage ("CreateSocketPair: socket () - %d", errno);
- return (-1);
+ return -1;
}
/*
** Initialize the socket information
*/
- slen = sizeof (sin);
+ slen = sizeof(sin);
memset ((char *) &sin, 0, slen);
sin.sin_family = SocketFamily;
sin.sin_addr.s_addr = inet_addr (LocalHostAddr);
if (status < 0) {
LogMessage ("CreateSocketPair: bind () - %d", errno);
close (SockDesc1);
- return (-1);
+ return -1;
}
/*
if (status < 0) {
LogMessage ("CreateSocketPair: getsockname () - %d", errno);
close (SockDesc1);
- return (-1);
+ return -1;
} else
LocalHostPort = sin.sin_port;
if (! (status & 1)) {
LogMessage ("CreateSocketPair: SYS$BINTIM () - %08X", status);
close (SockDesc1);
- return (-1);
+ return -1;
}
/*
if (! (status & 1)) {
LogMessage ("CreateSocketPair: SYS$ASSIGN () - %08X", status);
close (SockDesc1);
- return (-1);
+ return -1;
}
/*
LogMessage ("CreateSocketPair: SYS$QIO () - %08X", status);
close (SockDesc1);
sys$dassgn (TcpDeviceChan);
- return (-1);
+ return -1;
}
/*
close (SockDesc1);
close (SockDesc2);
sys$dassgn (TcpDeviceChan);
- return (-1);
+ return -1;
}
/*
** Now issue the connect
*/
- memset ((char *) &sin, 0, sizeof (sin)) ;
+ memset ((char *) &sin, 0, sizeof(sin)) ;
sin.sin_family = SocketFamily;
sin.sin_addr.s_addr = inet_addr (LocalHostAddr) ;
sin.sin_port = LocalHostPort ;
- status = connect (SockDesc2, (struct sockaddr *) &sin, sizeof (sin));
+ status = connect (SockDesc2, (struct sockaddr *) &sin, sizeof(sin));
if (status < 0 ) {
LogMessage ("CreateSocketPair: connect () - %d", errno);
sys$cantim (&sptb, 0);
close (SockDesc1);
close (SockDesc2);
sys$dassgn (TcpDeviceChan);
- return (-1);
+ return -1;
}
/*
close (SockDesc1);
close (SockDesc2);
sys$dassgn (TcpDeviceChan);
- return (-1);
+ return -1;
}
/*
strcat (TerminalDeviceBuff, "\n");
/*
- ** Send the data read from the terminal device throught the socket pair
+ ** Send the data read from the terminal device through the socket pair
*/
send (TerminalSocketPair[0], TerminalDeviceBuff,
TerminalDeviceIosb.iosb$w_bcnt + 1, 0);
TerminalDeviceAst,
0,
TerminalDeviceBuff,
- sizeof (TerminalDeviceBuff) - 1,
+ sizeof(TerminalDeviceBuff) - 1,
0, 0, 0, 0);
/*