aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-11-16 23:20:16 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2009-11-16 23:20:16 +0100
commitae11589205291f78c4cf5e9417f69853440d5307 (patch)
tree6c06f35afa99b2c3005b97213711a8abd7982bd1 /include
parent70b947544958eb982984b4d37d584037d1801c6f (diff)
downloadlibssh-ae11589205291f78c4cf5e9417f69853440d5307.tar.gz
libssh-ae11589205291f78c4cf5e9417f69853440d5307.tar.xz
libssh-ae11589205291f78c4cf5e9417f69853440d5307.zip
Pcap: more cleanup and minimalist API
Diffstat (limited to 'include')
-rw-r--r--include/libssh/libssh.h7
-rw-r--r--include/libssh/pcap.h9
2 files changed, 7 insertions, 9 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index 53423ad3..a17e90a2 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -109,6 +109,7 @@ typedef struct ssh_agent_struct* ssh_agent;
typedef struct ssh_buffer_struct* ssh_buffer;
typedef struct ssh_channel_struct* ssh_channel;
typedef struct ssh_message_struct* ssh_message;
+typedef struct ssh_pcap_file_struct* ssh_pcap_file;
typedef struct ssh_private_key_struct* ssh_private_key;
typedef struct ssh_public_key_struct* ssh_public_key;
typedef struct ssh_scp_struct* ssh_scp;
@@ -377,7 +378,10 @@ LIBSSH_API int ssh_options_getopt(ssh_session session, int *argcptr, char **argv
LIBSSH_API int ssh_options_parse_config(ssh_session session, const char *filename);
LIBSSH_API int ssh_options_set(ssh_session session, enum ssh_options_e type,
const void *value);
-
+LIBSSH_API int ssh_pcap_file_close(ssh_pcap_file pcap);
+LIBSSH_API void ssh_pcap_file_free(ssh_pcap_file pcap);
+LIBSSH_API ssh_pcap_file ssh_pcap_file_new(void);
+LIBSSH_API int ssh_pcap_file_open(ssh_pcap_file pcap, const char *filename);
LIBSSH_API void ssh_print_hexa(const char *descr, const unsigned char *what, size_t len);
LIBSSH_API int ssh_scp_accept_request(ssh_scp scp);
LIBSSH_API int ssh_scp_close(ssh_scp scp);
@@ -403,6 +407,7 @@ LIBSSH_API void ssh_set_fd_except(ssh_session session);
LIBSSH_API void ssh_set_fd_toread(ssh_session session);
LIBSSH_API void ssh_set_fd_towrite(ssh_session session);
LIBSSH_API void ssh_silent_disconnect(ssh_session session);
+LIBSSH_API int ssh_set_pcap_file(ssh_session session, ssh_pcap_file pcapfile);
#ifndef _WIN32
LIBSSH_API int ssh_userauth_agent_pubkey(ssh_session session, const char *username,
ssh_public_key publickey);
diff --git a/include/libssh/pcap.h b/include/libssh/pcap.h
index 558ce563..831a5647 100644
--- a/include/libssh/pcap.h
+++ b/include/libssh/pcap.h
@@ -6,17 +6,11 @@
#ifdef WITH_PCAP
typedef struct ssh_pcap_context_struct* ssh_pcap_context;
-typedef struct ssh_pcap_file_struct* ssh_pcap_file;
-ssh_pcap_file ssh_pcap_file_new(void);
-int ssh_pcap_file_open(ssh_pcap_file pcap, const char *filename);
-int ssh_pcap_file_close(ssh_pcap_file pcap);
-void ssh_pcap_file_free(ssh_pcap_file pcap);
-
-/* to be removed from here after tests */
int ssh_pcap_file_write_packet(ssh_pcap_file pcap, ssh_buffer packet, u_int32_t original_len);
ssh_pcap_context ssh_pcap_context_new(ssh_session session);
+void ssh_pcap_context_free(ssh_pcap_context ctx);
enum ssh_pcap_direction{
SSH_PCAP_DIR_IN,
@@ -26,7 +20,6 @@ void ssh_pcap_context_set_file(ssh_pcap_context, ssh_pcap_file);
int ssh_pcap_context_write(ssh_pcap_context,enum ssh_pcap_direction direction, void *data,
u_int32_t len, u_int32_t origlen);
-void ssh_set_pcap_context(ssh_session session, ssh_pcap_context pcap);
#endif /* WITH_PCAP */
#endif /* PCAP_H_ */