s/input/data/, s/output/send/
diff --git a/libtelnet.c b/libtelnet.c
index f4a218f..3921b16 100644
--- a/libtelnet.c
+++ b/libtelnet.c
@@ -92,7 +92,7 @@
* switch states */
if (byte == LIBTELNET_IAC) {
if (i != start)
- libtelnet_input_cb(telnet, &buffer[start], i - start,
+ libtelnet_data_cb(telnet, &buffer[start], i - start,
user_data);
telnet->state = LIBTELNET_STATE_IAC;
}
@@ -120,7 +120,7 @@
break;
/* IAC escaping */
case LIBTELNET_IAC:
- libtelnet_input_cb(telnet, &byte, 1, user_data);
+ libtelnet_data_cb(telnet, &byte, 1, user_data);
start = i + 1;
telnet->state = LIBTELNET_STATE_TEXT;
break;
@@ -214,21 +214,21 @@
/* pass through any remaining bytes */
if (i != start)
- libtelnet_input_cb(telnet, &buffer[start], i - start, user_data);
+ libtelnet_data_cb(telnet, &buffer[start], i - start, user_data);
}
/* send an iac command */
void libtelnet_send_command(struct libtelnet_t *telnet, unsigned char cmd,
void *user_data) {
unsigned char bytes[2] = { LIBTELNET_IAC, cmd };
- libtelnet_output_cb(telnet, bytes, 2, user_data);
+ libtelnet_send_cb(telnet, bytes, 2, user_data);
}
/* send negotiation */
void libtelnet_send_negotiate(struct libtelnet_t *telnet, unsigned char cmd,
unsigned char opt, void *user_data) {
unsigned char bytes[3] = { LIBTELNET_IAC, cmd, opt };
- libtelnet_output_cb(telnet, bytes, 3, user_data);
+ libtelnet_send_cb(telnet, bytes, 3, user_data);
}
/* send non-command data (escapes IAC bytes) */
@@ -240,7 +240,7 @@
if (buffer[i] == LIBTELNET_IAC) {
/* dump prior text if any */
if (i != l)
- libtelnet_output_cb(telnet, buffer + l, i - l, user_data);
+ libtelnet_send_cb(telnet, buffer + l, i - l, user_data);
l = i + 1;
/* send escape */
@@ -250,7 +250,7 @@
/* send whatever portion of buffer is left */
if (i != l)
- libtelnet_output_cb(telnet, buffer + l, i - l, user_data);
+ libtelnet_send_cb(telnet, buffer + l, i - l, user_data);
}
/* send sub-request */
diff --git a/libtelnet.h b/libtelnet.h
index 01ac509..16e16f0 100644
--- a/libtelnet.h
+++ b/libtelnet.h
@@ -40,7 +40,7 @@
enum libtelnet_error_t {
LIBTELNET_ERROR_OK = 0,
LIBTELNET_ERROR_NOMEM, /* memory allocation failure */
- LIBTELNET_ERROR_OVERFLOW, /* input exceeds buffer size */
+ LIBTELNET_ERROR_OVERFLOW, /* data exceeds buffer size */
LIBTELNET_ERROR_PROTOCOL, /* invalid sequence of special bytes */
LIBTELNET_ERROR_UNKNOWN, /* some crazy unexplainable unknown error */
};
@@ -60,9 +60,9 @@
/* libtelnet callback declarations
* APPLICATION MUST IMPLEMENT THESE FUNCTIONS!!
*/
-extern void libtelnet_input_cb(struct libtelnet_t *telnet,
+extern void libtelnet_data_cb(struct libtelnet_t *telnet,
unsigned char *buffer, unsigned int size, void *user_data);
-extern void libtelnet_output_cb(struct libtelnet_t *telnet,
+extern void libtelnet_send_cb(struct libtelnet_t *telnet,
unsigned char *buffer, unsigned int size, void *user_data);
extern void libtelnet_command_cb(struct libtelnet_t *telnet,
unsigned char cmd, void *user_data);
diff --git a/telnet-proxy.c b/telnet-proxy.c
index 1e15929..0bdb223 100644
--- a/telnet-proxy.c
+++ b/telnet-proxy.c
@@ -50,11 +50,11 @@
}
}
-void libtelnet_input_cb(struct libtelnet_t *telnet, unsigned char *buffer,
+void libtelnet_data_cb(struct libtelnet_t *telnet, unsigned char *buffer,
unsigned int size, void *user_data) {
int sock = *(int*)user_data;
- printf("%s INPUT: ", get_name(sock));
+ printf("%s DATA: ", get_name(sock));
print_buffer(buffer, size);
printf("\e[0m\n");
@@ -62,12 +62,12 @@
other_socket(sock));
}
-void libtelnet_output_cb(struct libtelnet_t *telnet, unsigned char *buffer,
+void libtelnet_send_cb(struct libtelnet_t *telnet, unsigned char *buffer,
unsigned int size, void *user_data) {
int sock = *(int*)user_data;
/* DONT SPAM
- printf("%s OUTPUT: ", get_name(sock));
+ printf("%s SEND: ", get_name(sock));
print_buffer(buffer, size);
printf("\e[0m\n");
*/