exported / execap

Automatically exported from code.google.com/p/execap
GNU General Public License v3.0
0 stars 0 forks source link

Build failure on OpenBSD 4.8 i386 #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. check out r26 from googlecode SVN
2. call 'make' to build

What is the expected output? What do you see instead?

Expect clean build to complete.

Here is the output that results:

----------
gcc -Wall -march=native -O3 -DEXECAPVER='"0.8"' -c execap.c
In file included from execap.h:59,
                 from execap.c:18:
/usr/include/netinet/ip.h:178: error: expected specifier-qualifier-list before 
'n_time'
In file included from execap.c:18:
execap.h:66:23: error: pcap/pcap.h: No such file or directory
In file included from execap.c:18:
execap.h:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' 
token
execap.h:202: warning: 'struct pcap_pkthdr' declared inside parameter list
execap.h:202: warning: its scope is only this definition or declaration, which 
is probably not what you want
execap.c: In function 'main':
execap.c:26: error: 'PCAP_ERRBUF_SIZE' undeclared (first use in this function)
execap.c:26: error: (Each undeclared identifier is reported only once
execap.c:26: error: for each function it appears in.)
execap.c:29: error: storage size of 'filter_prog' isn't known
execap.c:30: error: 'bpf_u_int32' undeclared (first use in this function)
execap.c:30: error: expected ';' before 'mask'
execap.c:31: error: expected ';' before 'net'
execap.c:33: error: storage size of 'stats' isn't known
execap.c:262: warning: implicit declaration of function 'pcap_lookupnet'
execap.c:262: error: 'net' undeclared (first use in this function)
execap.c:262: error: 'mask' undeclared (first use in this function)
execap.c:277: error: 'pch' undeclared (first use in this function)
execap.c:277: warning: implicit declaration of function 'pcap_create'
execap.c:284: warning: implicit declaration of function 'pcap_set_buffer_size'
execap.c:290: warning: implicit declaration of function 'pcap_set_snaplen'
execap.c:295: warning: implicit declaration of function 'pcap_set_timeout'
execap.c:300: warning: implicit declaration of function 'pcap_set_promisc'
execap.c:305: warning: implicit declaration of function 'pcap_activate'
execap.c:308: error: 'PCAP_WARNING' undeclared (first use in this function)
execap.c:308: error: 'PCAP_ERROR' undeclared (first use in this function)
execap.c:309: warning: implicit declaration of function 'pcap_geterr'
execap.c:309: warning: format '%s' expects type 'char *', but argument 3 has 
type 'int'
execap.c:316: warning: implicit declaration of function 'pcap_datalink'
execap.c:316: error: 'DLT_EN10MB' undeclared (first use in this function)
execap.c:322: warning: implicit declaration of function 'pcap_compile'
execap.c:323: warning: format '%s' expects type 'char *', but argument 3 has 
type 'int'
execap.c:329: warning: implicit declaration of function 'pcap_setfilter'
execap.c:331: warning: format '%s' expects type 'char *', but argument 4 has 
type 'int'
execap.c:388: warning: implicit declaration of function 'pcap_loop'
execap.c:406: warning: implicit declaration of function 'pcap_stats'
execap.c:407: warning: format '%s' expects type 'char *', but argument 3 has 
type 'int'
execap.c:421: warning: implicit declaration of function 'pcap_close'
execap.c:33: warning: unused variable 'stats'
execap.c:29: warning: unused variable 'filter_prog'
execap.c:26: warning: unused variable 'pc_errbuf'
execap.c: At top level:
execap.c:435: warning: 'struct pcap_pkthdr' declared inside parameter list
execap.c:435: error: conflicting types for 'packet_callback'
execap.h:202: error: previous declaration of 'packet_callback' was here
execap.c: In function 'packet_callback':
execap.c:483: error: dereferencing pointer to incomplete type
execap.c:502: error: dereferencing pointer to incomplete type
execap.c:531: error: dereferencing pointer to incomplete type
execap.c:546: error: dereferencing pointer to incomplete type
execap.c: In function 'sig_stop_pcap':
execap.c:1030: warning: implicit declaration of function 'pcap_breakloop'
execap.c:1030: error: 'pch' undeclared (first use in this function)
*** Error code 1

Stop in /home/dspruell/downloads/execap-read-only (line 21 of Makefile).
-----------

What version of the product are you using? On what operating system?

SVN code r26 on OpenBSD 4.8/i386:

OpenBSD molodetz.sancho2k.net 4.8 GENERIC#0 i386

Please provide any additional information below.

execap.h:66:23: error: pcap/pcap.h: No such file or directory  => if this 
indicates linking error because of inability to locate pcap.h, it is located 
here on OpenBSD:

/usr/include/pcap.h

I've tried a few combinations of include dir changes:

CFLAGS += -I/usr/include/pcap
CFLAGS += -I/usr/include
CFLAGS += -I/usr

Original issue reported on code.google.com by phatbuck...@gmail.com on 12 Apr 2011 at 5:21

GoogleCodeExporter commented 9 years ago
Thanks for the report.  The problem is probably that execap.h includes 
<pcap/pcap.h> which is the new location.

Can you uncomment this line in the makefile:

#CFLAGS += -DOLDPCAP

Hopefully that gets farther along.  Also, what version of libpcap do you have?

Original comment by bmenr...@ucsd.edu on 20 Apr 2011 at 12:16

GoogleCodeExporter commented 9 years ago

Original comment by bmenr...@ucsd.edu on 20 Apr 2011 at 12:16

GoogleCodeExporter commented 9 years ago
OpenBSD's libpcap is an in-tree developed library that appears to be
last synced with 0.5 upstream:

http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libpcap/

Uncommenting 'CFLAGS += -DOLDPCAP' appears to resolve that issue.

But now this result:

-----
$ make
gcc -Wall -march=native -O3 -DEXECAPVER='"0.8"' -DOLDPCAP -c execap.c
In file included from execap.h:59,
                 from execap.c:18:
/usr/include/netinet/ip.h:178: error: expected
specifier-qualifier-list before 'n_time'
*** Error code 1

Stop in /home/dspruell/downloads/execap-read-only (line 22 of Makefile).

Original comment by phatbuck...@gmail.com on 25 Apr 2011 at 5:48

GoogleCodeExporter commented 9 years ago
Thanks for continuing to help troubleshoot this.  It seems on some BSD systems 
<netinet/in_systm.h> is a prerequisite to <netinet/ip.h> and some of the other 
headers.  I have committed an fix in change 27.

Can you do a 'svn update' and report back what you get now?

Original comment by bmenr...@ucsd.edu on 26 Apr 2011 at 6:18

GoogleCodeExporter commented 9 years ago
Progress!

At r27 now:

$ make
gcc -Wall -march=native -O3 -DEXECAPVER='"0.8"' -DOLDPCAP -c execap.c
gcc -Wall -march=native -O3 -DEXECAPVER='"0.8"' -DOLDPCAP -c findexe.c
gcc -Wall -march=native -O3 -DEXECAPVER='"0.8"' -DOLDPCAP -c pavl.c
gcc -Wall -march=native -O3 -DEXECAPVER='"0.8"' -DOLDPCAP execap.o
findexe.o pavl.o -o execap -lpcap -lssl -lpthread
execap.o(.text+0xe1): In function `md5_hex':
: warning: sprintf() is often misused, please use snprintf()
execap.o(.text+0xc9): In function `md5_hex':
: undefined reference to `MD5'
execap.o(.text+0x2143): In function `packet_callback':
: undefined reference to `MD5'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_find_type'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_enc_null'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CIPHER_CTX_init'
/usr/lib/libssl.so.15.1: undefined reference to `BUF_strndup'
/usr/lib/libssl.so.15.1: undefined reference to `X509_NAME_dup'
/usr/lib/libssl.so.15.1: undefined reference to `COMP_compress_block'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_rc2_cbc'
/usr/lib/libssl.so.15.1: undefined reference to `sk_new_null'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_get_by_subject'
/usr/lib/libssl.so.15.1: undefined reference to `lh_free'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_X509_EXTENSIONS'
/usr/lib/libssl.so.15.1: undefined reference to `asn1_const_Finish'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_VerifyFinal'
/usr/lib/libssl.so.15.1: undefined reference to `COMP_CTX_new'
/usr/lib/libssl.so.15.1: undefined reference to `sk_dup'
/usr/lib/libssl.so.15.1: undefined reference to `X509_EXTENSION_free'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_CTX_set_ex_data'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_dup'
/usr/lib/libssl.so.15.1: undefined reference to `X509_free'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_set_private_key'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_set_public_key'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_set_group'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_get_ex_data'
/usr/lib/libssl.so.15.1: undefined reference to `ENGINE_finish'
/usr/lib/libssl.so.15.1: undefined reference to `BN_bin2bn'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CIPHER_flags'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_get_ex_new_index'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_DigestFinal_ex'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_EncryptFinal'
/usr/lib/libssl.so.15.1: undefined reference to `BN_CTX_new'
/usr/lib/libssl.so.15.1: undefined reference to `PEM_read_bio_RSAPrivateKey'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_aes_128_cbc'
/usr/lib/libssl.so.15.1: undefined reference to `BN_bn2bin'
/usr/lib/libssl.so.15.1: undefined reference to `RAND_add'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_s_socket'
/usr/lib/libssl.so.15.1: undefined reference to `X509_VERIFY_PARAM_set_purpose'
/usr/lib/libssl.so.15.1: undefined reference to `asn1_add_error'
/usr/lib/libssl.so.15.1: undefined reference to
`ENGINE_get_ssl_client_cert_function'
/usr/lib/libssl.so.15.1: undefined reference to `BUF_MEM_grow_clean'
/usr/lib/libssl.so.15.1: undefined reference to `pqueue_next'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_RSAPrivateKey'
/usr/lib/libssl.so.15.1: undefined reference to `sk_num'
/usr/lib/libssl.so.15.1: undefined reference to `pqueue_insert'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_new'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_free_all'
/usr/lib/libssl.so.15.1: undefined reference to `RSA_up_ref'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_method_type'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_MD_size'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_set_flags'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_get_retry_reason'
/usr/lib/libssl.so.15.1: undefined reference to `OCSP_RESPID_free'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_new'
/usr/lib/libssl.so.15.1: undefined reference to `HMAC_Final'
/usr/lib/libssl.so.15.1: undefined reference to `HMAC_Init_ex'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_PKEY_bits'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_md5'
/usr/lib/libssl.so.15.1: undefined reference to `ASN1_object_size'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_get_cipherbyname'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_dump_indent'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_get0_public_key'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_rc4'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_add_cipher'
/usr/lib/libssl.so.15.1: undefined reference to `ASN1_get_object'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_s_file'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CIPHER_iv_length'
/usr/lib/libssl.so.15.1: undefined reference to `COMP_expand_block'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_snprintf'
/usr/lib/libssl.so.15.1: undefined reference to `ECDSA_sign'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_RSAPrivateKey_bio'
/usr/lib/libssl.so.15.1: undefined reference to `ASN1_dup'
/usr/lib/libssl.so.15.1: undefined reference to `RSA_sign'
/usr/lib/libssl.so.15.1: undefined reference to `ERR_peek_error'
/usr/lib/libssl.so.15.1: undefined reference to `X509_VERIFY_PARAM_new'
/usr/lib/libssl.so.15.1: undefined reference to `PEM_read_bio_PrivateKey'
/usr/lib/libssl.so.15.1: undefined reference to `lh_retrieve'
/usr/lib/libssl.so.15.1: undefined reference to `X509_get_pubkey'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_dup_ex_data'
/usr/lib/libssl.so.15.1: undefined reference to `EC_GROUP_free'
/usr/lib/libssl.so.15.1: undefined reference to `DH_generate_key'
/usr/lib/libssl.so.15.1: undefined reference to `DH_size'
/usr/lib/libssl.so.15.1: undefined reference to `i2d_ASN1_INTEGER'
/usr/lib/libssl.so.15.1: undefined reference to `lh_doall_arg'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_set_ex_data'
/usr/lib/libssl.so.15.1: undefined reference to `pqueue_peek'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_printf'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_lock'
/usr/lib/libssl.so.15.1: undefined reference to `DSA_verify'
/usr/lib/libssl.so.15.1: undefined reference to `sk_pop_free'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_aes_192_cbc'
/usr/lib/libssl.so.15.1: undefined reference to `pqueue_free'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_MD_CTX_cleanup'
/usr/lib/libssl.so.15.1: undefined reference to `HMAC_CTX_set_flags'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_aes_256_cbc'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_MD_CTX_set_flags'
/usr/lib/libssl.so.15.1: undefined reference to `OPENSSL_DIR_read'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_puts'
/usr/lib/libssl.so.15.1: undefined reference to `X509_verify_cert_error_string'
/usr/lib/libssl.so.15.1: undefined reference to `BN_num_bits'
/usr/lib/libssl.so.15.1: undefined reference to `BUF_MEM_new'
/usr/lib/libssl.so.15.1: undefined reference to `EC_GROUP_get_curve_name'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_free'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_dss1'
/usr/lib/libssl.so.15.1: undefined reference to `DH_new'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_PrivateKey'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_set_default_paths'
/usr/lib/libssl.so.15.1: undefined reference to `DSA_sign'
/usr/lib/libssl.so.15.1: undefined reference to `DH_compute_key'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_add_lock'
/usr/lib/libssl.so.15.1: undefined reference to `COMP_CTX_free'
/usr/lib/libssl.so.15.1: undefined reference to `sk_push'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_sha1'
/usr/lib/libssl.so.15.1: undefined reference to `EC_POINT_oct2point'
/usr/lib/libssl.so.15.1: undefined reference to `i2d_X509_EXTENSIONS'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_ctrl'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_CTX_init'
/usr/lib/libssl.so.15.1: undefined reference to `i2d_DHparams'
/usr/lib/libssl.so.15.1: undefined reference to `RSA_private_decrypt'
/usr/lib/libssl.so.15.1: undefined reference to `ERR_put_error'
/usr/lib/libssl.so.15.1: undefined reference to `RSA_new'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_write'
/usr/lib/libssl.so.15.1: undefined reference to `pqueue_find'
/usr/lib/libssl.so.15.1: undefined reference to `sk_set_cmp_func'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_PKEY_assign'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_free'
/usr/lib/libssl.so.15.1: undefined reference to `ENGINE_init'
/usr/lib/libssl.so.15.1: undefined reference to `EC_POINT_new'
/usr/lib/libssl.so.15.1: undefined reference to `OBJ_NAME_add'
/usr/lib/libssl.so.15.1: undefined reference to `sk_new'
/usr/lib/libssl.so.15.1: undefined reference to `pqueue_pop'
/usr/lib/libssl.so.15.1: undefined reference to `pitem_free'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_ASN1_INTEGER'
/usr/lib/libssl.so.15.1: undefined reference to `sk_zero'
/usr/lib/libssl.so.15.1: undefined reference to `X509_verify_cert'
/usr/lib/libssl.so.15.1: undefined reference to `sk_free'
/usr/lib/libssl.so.15.1: undefined reference to `EC_POINT_point2oct'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_new'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_X509_bio'
/usr/lib/libssl.so.15.1: undefined reference to `X509_check_private_key'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_OCSP_RESPID'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CIPHER_CTX_cleanup'
/usr/lib/libssl.so.15.1: undefined reference to `sk_value'
/usr/lib/libssl.so.15.1: undefined reference to `X509_VERIFY_PARAM_get_depth'
/usr/lib/libssl.so.15.1: undefined reference to `EC_POINT_free'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_DigestInit_ex'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_new_ex_data'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_pop'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_PKEY_copy_parameters'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CIPHER_CTX_block_size'
/usr/lib/libssl.so.15.1: undefined reference to `X509_get_subject_name'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_PKEY_new'
/usr/lib/libssl.so.15.1: undefined reference to `i2d_X509_NAME'
/usr/lib/libssl.so.15.1: undefined reference to `RSA_public_encrypt'
/usr/lib/libssl.so.15.1: undefined reference to `ECDH_compute_key'
/usr/lib/libssl.so.15.1: undefined reference to `ENGINE_load_ssl_client_cert'
/usr/lib/libssl.so.15.1: undefined reference to `EC_GROUP_get_degree'
/usr/lib/libssl.so.15.1: undefined reference to `i2d_X509'
/usr/lib/libssl.so.15.1: undefined reference to `PEM_read_bio_X509'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_CTX_get0_param'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_ecdsa'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_generate_key'
/usr/lib/libssl.so.15.1: undefined reference to `HMAC_CTX_cleanup'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_MD_CTX_init'
/usr/lib/libssl.so.15.1: undefined reference to `X509_VERIFY_PARAM_set_depth'
/usr/lib/libssl.so.15.1: undefined reference to `ERR_clear_error'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CIPHER_CTX_cipher'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_DigestUpdate'
/usr/lib/libssl.so.15.1: undefined reference to `ERR_func_error_string'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_DecryptUpdate'
/usr/lib/libssl.so.15.1: undefined reference to `OBJ_obj2nid'
/usr/lib/libssl.so.15.1: undefined reference to `OBJ_bsearch'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_Cipher'
/usr/lib/libssl.so.15.1: undefined reference to `sk_delete'
/usr/lib/libssl.so.15.1: undefined reference to `RAND_bytes'
/usr/lib/libssl.so.15.1: undefined reference to `BUF_memdup'
/usr/lib/libssl.so.15.1: undefined reference to `BN_CTX_free'
/usr/lib/libssl.so.15.1: undefined reference to `BUF_strdup'
/usr/lib/libssl.so.15.1: undefined reference to `pqueue_iterator'
/usr/lib/libssl.so.15.1: undefined reference to `RSAPrivateKey_dup'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_copy_next_retry'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_up_ref'
/usr/lib/libssl.so.15.1: undefined reference to `sk_set'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CIPHER_block_size'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_des_cbc'
/usr/lib/libssl.so.15.1: undefined reference to `OpenSSLDie'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_EncryptInit_ex'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_PKEY_missing_parameters'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_DecryptInit_ex'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_get0_group'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_callback_ctrl'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_PrivateKey_bio'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CIPHER_CTX_key_length'
/usr/lib/libssl.so.15.1: undefined reference to `DH_free'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_CTX_set_default'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_CTX_cleanup'
/usr/lib/libssl.so.15.1: undefined reference to `BUF_MEM_free'
/usr/lib/libssl.so.15.1: undefined reference to `ECDSA_verify'
/usr/lib/libssl.so.15.1: undefined reference to `X509_VERIFY_PARAM_set_trust'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_SignFinal'
/usr/lib/libssl.so.15.1: undefined reference to `sk_find'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_MD_CTX_copy_ex'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_read'
/usr/lib/libssl.so.15.1: undefined reference to `X509_certificate_type'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CIPHER_CTX_iv_length'
/usr/lib/libssl.so.15.1: undefined reference to `ASN1_INTEGER_get'
/usr/lib/libssl.so.15.1: undefined reference to `RSA_free'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_DHparams'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_int_ctrl'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_f_buffer'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_MD_CTX_md'
/usr/lib/libssl.so.15.1: undefined reference to `sk_shift'
/usr/lib/libssl.so.15.1: undefined reference to `EC_POINT_copy'
/usr/lib/libssl.so.15.1: undefined reference to `OPENSSL_cleanse'
/usr/lib/libssl.so.15.1: undefined reference to `lh_new'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_free_ex_data'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_clear_flags'
/usr/lib/libssl.so.15.1: undefined reference to `ASN1_INTEGER_set'
/usr/lib/libssl.so.15.1: undefined reference to `X509_check_purpose'
/usr/lib/libssl.so.15.1: undefined reference to `ERR_peek_last_error'
/usr/lib/libssl.so.15.1: undefined reference to `i2d_ASN1_OCTET_STRING'
/usr/lib/libssl.so.15.1: undefined reference to
`X509_STORE_CTX_get_ex_new_index'
/usr/lib/libssl.so.15.1: undefined reference to `RSA_verify'
/usr/lib/libssl.so.15.1: undefined reference to `BN_dup'
/usr/lib/libssl.so.15.1: undefined reference to `pqueue_new'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_sha256'
/usr/lib/libssl.so.15.1: undefined reference to `ERR_add_error_data'
/usr/lib/libssl.so.15.1: undefined reference to `X509_NAME_cmp'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CIPHER_key_length'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_CipherInit_ex'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_PKEY_size'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_add_digest'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_free'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_EncryptUpdate'
/usr/lib/libssl.so.15.1: undefined reference to `ASN1_const_check_infinite_end'
/usr/lib/libssl.so.15.1: undefined reference to `i2d_OCSP_RESPID'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_push'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_mem_ctrl'
/usr/lib/libssl.so.15.1: undefined reference to `X509_get_issuer_name'
/usr/lib/libssl.so.15.1: undefined reference to `ASN1_put_object'
/usr/lib/libssl.so.15.1: undefined reference to `EC_KEY_get0_private_key'
/usr/lib/libssl.so.15.1: undefined reference to `EC_GROUP_new_by_curve_name'
/usr/lib/libssl.so.15.1: undefined reference to `OPENSSL_DIR_end'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_des_ede3_cbc'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_free'
/usr/lib/libssl.so.15.1: undefined reference to `COMP_zlib'
/usr/lib/libssl.so.15.1: undefined reference to `ERR_load_crypto_strings'
/usr/lib/libssl.so.15.1: undefined reference to `BUF_MEM_grow'
/usr/lib/libssl.so.15.1: undefined reference to `lh_insert'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_load_locations'
/usr/lib/libssl.so.15.1: undefined reference to `X509_NAME_free'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_ASN1_OCTET_STRING'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_test_flags'
/usr/lib/libssl.so.15.1: undefined reference to `CRYPTO_malloc'
/usr/lib/libssl.so.15.1: undefined reference to `lh_delete'
/usr/lib/libssl.so.15.1: undefined reference to `BN_clear_free'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_X509_NAME'
/usr/lib/libssl.so.15.1: undefined reference to `RSA_flags'
/usr/lib/libssl.so.15.1: undefined reference to `d2i_X509'
/usr/lib/libssl.so.15.1: undefined reference to `asn1_GetSequence'
/usr/lib/libssl.so.15.1: undefined reference to `RSA_size'
/usr/lib/libssl.so.15.1: undefined reference to `RAND_pseudo_bytes'
/usr/lib/libssl.so.15.1: undefined reference to `BIO_s_connect'
/usr/lib/libssl.so.15.1: undefined reference to `X509_VERIFY_PARAM_inherit'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_PKEY_free'
/usr/lib/libssl.so.15.1: undefined reference to `pitem_new'
/usr/lib/libssl.so.15.1: undefined reference to `HMAC_Update'
/usr/lib/libssl.so.15.1: undefined reference to `X509_STORE_CTX_set_verify_cb'
/usr/lib/libssl.so.15.1: undefined reference to `ERR_load_strings'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_md2'
/usr/lib/libssl.so.15.1: undefined reference to `X509_VERIFY_PARAM_free'
/usr/lib/libssl.so.15.1: undefined reference to `HMAC_CTX_init'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_get_digestbyname'
/usr/lib/libssl.so.15.1: undefined reference to `EVP_DecryptFinal'
collect2: ld returned 1 exit status
*** Error code 1

Stop in /home/dspruell/downloads/execap-read-only (line 18 of Makefile).

$ ls -l /usr/lib/libssl*
-r--r--r--  1 root  bin  2009850 Dec 12 03:00 /usr/lib/libssl.a
-r--r--r--  1 root  bin  1691591 Jan  5  2010 /usr/lib/libssl.so.15.0
-r--r--r--  1 root  bin  1289929 Dec 12 03:00 /usr/lib/libssl.so.15.1
-r--r--r--  1 root  bin  2020054 Dec 12 03:00 /usr/lib/libssl_p.a
-r--r--r--  1 root  bin  2049766 Dec 12 03:00 /usr/lib/libssl_pic.a

This is the in-tree maintained version 'OpenSSL 0.9.8k 25 Mar 2009'.

I believe sources are found here:

http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libssl/

Since this is OpenBSD 4.8:

http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libssl/?only_with_tag=OPENBSD_4_8

DS

Original comment by phatbuck...@gmail.com on 26 Apr 2011 at 7:35

GoogleCodeExporter commented 9 years ago
It seems either some older version of OpenSSL or the way it is build on OpenBSD 
seperate some of the symbols into two different libraries.  I was only linking 
with -lssl but adding -lcrypto should fix it.  I also fixed the sprintf() 
warning.

If you do a 'svn update' to revision 30 you should be able to get a bit farther.

Thanks again for your help in troubleshooting this!

Original comment by bmenr...@ucsd.edu on 26 Apr 2011 at 9:01

GoogleCodeExporter commented 9 years ago
Great success!

$ make
gcc -Wall -march=native -O3 -DEXECAPVER='"0.8"' -DOLDPCAP -c execap.c
gcc -Wall -march=native -O3 -DEXECAPVER='"0.8"' -DOLDPCAP -c findexe.c
gcc -Wall -march=native -O3 -DEXECAPVER='"0.8"' -DOLDPCAP -c pavl.c
gcc -Wall -march=native -O3 -DEXECAPVER='"0.8"' -DOLDPCAP execap.o
findexe.o pavl.o -o execap -lpcap -lssl -lcrypto -lpthread

$ ./execap -V
execap v0.8
Copyright (C) 2010-2011 Brandon Enright <bmenrigh@ucsd.edu>.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ./execap -h
execap v0.8
Usage: execap -i interface [OPTIONS] [CAPTURE FILTER]

Options:
-i, --interface         specify interface to capture on
-l, --logdir            save logs to this directory
-e, --exedir            save executables to this directory
-v, --verbose           turn on verbose output
-D, --daemonize         run as daemon in background
--pidfile               store daemon pid to this file
-V, --version           display version and exit
-h, --help              display this help and exit

execap web page:  http://code.google.com/p/execap
Report bugs to:   bmenrigh@ucsd.edu / http://code.google.com/p/execap/issues

$ sudo ./execap -i xl0 -l logs -e bins -v
Password:
execap v0.8 started...

PCAP: Going to listen on interface xl0
PCAP: Setting capture filter to: ip and tcp

2011-04-26T23:39:12 (UTC) -- EXE -- 46.43.34.31:80 -> 10.0.1.2:36101
(Size=454656; Machine=0x014c; Subsystem=0x0002; IsDLL=0; IsPE32+=0;
MD5=9bb6826905965c13be1c84cc0ff83f42)
^C
Signal caught, PCAP loop terminated.
Waiting for threads to finish before exiting...

Original comment by phatbuck...@gmail.com on 26 Apr 2011 at 11:45

GoogleCodeExporter commented 9 years ago
That's great to see.  I wasn't thinking about any BSD systems when I wrote it.  
I'm glad I chose to use the BSD version of the TCP structures rather than the 
Linux ones.

If you put more than ~2 Gbps of traffic through execap I'd love to hear what 
the CPU load and general packet drop rate is.

Original comment by bmenr...@ucsd.edu on 26 Apr 2011 at 11:58