summaryrefslogtreecommitdiffstats
path: root/libssh/pcap.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-11-27 18:16:10 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2009-11-27 18:16:10 +0100
commit8da712ea61262a0951d14dd42758a01dd6f6c97b (patch)
treecedf9a6b741480d5870d28677fa8c8d0dd360c33 /libssh/pcap.c
parent56cfb8036fe3f42276eca7f8835e069b3b657dd0 (diff)
downloadlibssh-8da712ea61262a0951d14dd42758a01dd6f6c97b.tar.gz
libssh-8da712ea61262a0951d14dd42758a01dd6f6c97b.tar.xz
libssh-8da712ea61262a0951d14dd42758a01dd6f6c97b.zip
Compile in stub for pcap funcs when pcap disabled
Avoid that way linking problems
Diffstat (limited to 'libssh/pcap.c')
-rw-r--r--libssh/pcap.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/libssh/pcap.c b/libssh/pcap.c
index 2da0087..e2e8937 100644
--- a/libssh/pcap.c
+++ b/libssh/pcap.c
@@ -379,6 +379,37 @@ int ssh_set_pcap_file(ssh_session session, ssh_pcap_file pcap){
}
-#endif /* WITH_PCAP */
+#else /* WITH_PCAP */
+
+/* Simple stub returning errors when no pcap compiled in */
+
+#include "libssh/libssh.h"
+#include "libssh/priv.h"
+
+int ssh_pcap_file_close(ssh_pcap_file pcap){
+ (void) pcap;
+ return SSH_ERROR;
+}
+
+void ssh_pcap_file_free(ssh_pcap_file pcap){
+ (void) pcap;
+}
+
+ssh_pcap_file ssh_pcap_file_new(void){
+ return NULL;
+}
+int ssh_pcap_file_open(ssh_pcap_file pcap, const char *filename){
+ (void) pcap;
+ (void) filename;
+ return SSH_ERROR;
+}
+
+int ssh_set_pcap_file(ssh_session session, ssh_pcap_file pcapfile){
+ (void) pcapfile;
+ ssh_set_error(session,SSH_REQUEST_DENIED,"Pcap support not compiled in");
+ return SSH_ERROR;
+}
+
+#endif
/** @} */
/* vim: set ts=2 sw=2 et cindent: */