2013-06-23 13:12:25 +08:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
# include "core.h"
|
|
|
|
# include "common.h"
|
|
|
|
# include "debug.h"
|
2015-12-02 04:37:23 +08:00
|
|
|
#include <arpa/inet.h>
|
2013-06-23 13:12:25 +08:00
|
|
|
|
2020-09-21 00:00:10 +08:00
|
|
|
void dump_proxy_chain(proxy_data *pchain, unsigned int count) {
|
2015-12-02 04:37:23 +08:00
|
|
|
char ip_buf[INET6_ADDRSTRLEN];
|
2013-06-25 19:01:14 +08:00
|
|
|
for (; count; pchain++, count--) {
|
2015-12-02 04:37:23 +08:00
|
|
|
if(!inet_ntop(pchain->ip.is_v6?AF_INET6:AF_INET,pchain->ip.addr.v6,ip_buf,sizeof ip_buf)) {
|
|
|
|
proxychains_write_log(LOG_PREFIX "error: ip address conversion failed\n");
|
|
|
|
continue;
|
|
|
|
}
|
2013-06-25 19:01:14 +08:00
|
|
|
PDEBUG("[%s] %s %s:%d", proxy_state_strmap[pchain->ps],
|
|
|
|
proxy_type_strmap[pchain->pt],
|
|
|
|
ip_buf, htons(pchain->port));
|
|
|
|
if (*pchain->user || *pchain->pass) {
|
|
|
|
PSTDERR(" [u=%s,p=%s]", pchain->user, pchain->pass);
|
|
|
|
}
|
|
|
|
PSTDERR("\n");
|
|
|
|
}
|
2013-06-23 13:12:25 +08:00
|
|
|
}
|
|
|
|
|
2023-12-10 23:03:04 +08:00
|
|
|
void dump_buffer(unsigned char * data, size_t len){
|
|
|
|
printf("buffer_dump[");
|
|
|
|
for(int i=0; i<len; i++){
|
|
|
|
printf("%d ", *(data+i));
|
|
|
|
}
|
|
|
|
printf("]\n");
|
|
|
|
}
|
|
|
|
|
2016-12-09 12:43:58 +08:00
|
|
|
#else
|
|
|
|
|
|
|
|
// Do not allow this translation unit to end up empty
|
|
|
|
// for non-DEBUG builds, to satisfy ISO C standards.
|
|
|
|
typedef int __appease_iso_compilers__;
|
|
|
|
|
2013-06-23 13:12:25 +08:00
|
|
|
#endif
|