Work in progress...

FossilOrigin-Name: 5502c7d7b329b01ff3a42bedb84a087e3bb62e80a7f22ca4abb5a1d0f3db1454
This commit is contained in:
7u83@mail.ru 2015-02-07 09:57:58 +00:00
parent 64fe08312c
commit e74e8bbf89
7 changed files with 31 additions and 76 deletions

View File

@ -1,6 +1,7 @@
#Define SSL Library: OPENSSL or GNUTLS (GNUTLS not supported for now)
SSL_LIBRARY=OPENSSL
SSL_LIBRARY=GNUTLS
#SSL_LIBRARY=OPENSSL
# use openssl library in ../contrib/
USE_CONTRIB_OPENSSL=1

View File

@ -88,19 +88,24 @@
# dbg
# Set debug level
#
# dbg = info - show all kind of infos
# dbg += msg - capwap messages
# dbg += msgelem - capwap message elements
# dbg += msgelem_dmp - print hex dump for capwap messages elements
# dbg += rfc - show warnings if capwap messages don't conform to capwap RFC
# dbg += pkt - capwap packets sent over the network
# dpg += pkt_dmp - hex dump capwap packets
# dbg += pkt_err - show messages about malformed packets when detected
# dbg += msg_err - be verbose about capwap message errors like re-transmission
# dbg += dtls - show messages concerning DTLS
# dbg = info # Show all kind of infos
# dbg += msg # CAPWAP messages
# dbg += msgelem # CAPWAP message elements
# dbg += msgelem_dmp # Print hex dump for capwap messages elements
# dbg += rfc # Show warnings if CAPWAP messages don't conform to RFC
# dbg += pkt_in # CAPWAP packets received
# dbg += pkt_out # CAPWAP packets sent
# dbg += pkt # CAPWAP packets both sent and received
# dpg += pkt_dmp # Hex dump CAPWAP packets.
# dbg += pkt_err # Show messages about malformed packets when detected
# dbg += msg_err # Be verbose about capwap message errors like re-transmission
# dbg += dtls # Messages concerning DTLS
# dbg += dtls_detail # DTLS in more detail
# dbg += dtls_bio # DTLS BIO operations
# dbg += dtls_bio_dmp # Hey dump data in BIO operations
#
# dbg += all - all of the above
# dbg += err - like dbg_err and pkt_err
# dbg += all # all of the above
# dbg += err # Same as dbg_err and pkt_err
#
# Default:
# dbg=

View File

@ -213,11 +213,12 @@ int ac_run()
void process_cw_ctrl_packet(int index,struct sockaddr * addr, uint8_t * buffer, int len)
{
int sock = socklist[index].reply_sockfd;
char hdrstr[1024];
hdr_print(hdrstr,buffer,len);
cw_log_debug2("Header for packet from %s\n%s",sock_addr2str(addr),hdrstr);
cw_dbg(DBG_CW_PKT_IN,"Header for packet from %s\n%s",sock_addr2str(addr),hdrstr);
@ -229,7 +230,7 @@ void process_cw_ctrl_packet(int index,struct sockaddr * addr, uint8_t * buffer,
#else
if (preamble != CAPWAP_PACKET_PREAMBLE ){
#endif
cw_log_debug1("Discarding packet, wrong preamble, preamble = 0x%01X",preamble);
cw_dbg(DBG_CW_PKT_ERR,"Discarding packet, wrong preamble, preamble = 0x%01X",preamble);
return;
}
@ -340,7 +341,7 @@ void process_ctrl_packet(int index,struct sockaddr * addr, uint8_t * buffer, int
#ifdef WITH_CW_LOG_DEBUG
char str[100];
sock_addrtostr(addr,str,100);
cw_log_debug1("Received packet from %s, len = %i, via %s\n",str,len,
cw_dbg(DBG_CW_PKT_IN,"Received packet from %s, len = %i, via %s\n",str,len,
socklist[index].type==SOCKLIST_UNICAST_SOCKET ? "unicast":"bcast/mcast");
cw_log_debug2_dump(buffer,len,"Packet data for packet, recevied from %s",str);
#endif

View File

@ -33,7 +33,7 @@ uint8_t conf_macaddress[12];
uint8_t conf_macaddress_len=0;
const const char * conf_acname = NULL;
const char * conf_acname = NULL;
int conf_acname_len = 0;
char * conf_acid = NULL;
@ -531,62 +531,8 @@ static int conf_read_dbg_level(cfg_t *cfg)
for (i=0; i<n; i++) {
char * str = cfg_getnstr(cfg,name,i);
if (!strcmp(str,"info")){
cw_dbg_opt_level|=DBG_CW_INFO;
continue;
}
if (!strcmp(str,"msg")){
cw_dbg_opt_level|=DBG_CW_MSG;
continue;
}
if (!strcmp(str,"msgelem")){
cw_dbg_opt_level|=DBG_CW_MSGELEM;
continue;
}
if (!strcmp(str,"msgelem_dmp")){
cw_dbg_opt_level|=DBG_CW_MSGELEM_DMP;
continue;
}
if (!strcmp(str,"rfc")){
cw_dbg_opt_level|=DBG_CW_RFC;
continue;
}
if (!strcmp(str,"pkt")){
cw_dbg_opt_level|=DBG_CW_PKT;
continue;
}
if (!strcmp(str,"pkt_dmp")){
cw_dbg_opt_level|=DBG_CW_PKT_DMP;
continue;
}
if (!strcmp(str,"pkt_err")){
cw_dbg_opt_level|=DBG_CW_PKT_ERR;
continue;
}
if (!strcmp(str,"msg_err")){
cw_dbg_opt_level|=DBG_CW_MSG_ERR;
continue;
}
if (!strcmp(str,"dtls")){
cw_dbg_opt_level|=DBG_DTLS;
continue;
}
if (!strcmp(str,"all")){
cw_dbg_opt_level|=DBG_ALL;
continue;
}
if (!strcmp(str,"err")){
cw_dbg_opt_level|=DBG_ERR;
continue;
}
cw_dbg_opt_level|=cw_log_str2dbglevel(str);
}
return 1;

View File

@ -878,11 +878,11 @@ void wtpman_lw_addpacket(struct wtpman *wtpman, uint8_t *packet, int len)
void wtpman_start(struct wtpman * wtpman,int dtlsmode)
{
if ( dtlsmode ){
cw_log_debug1("Starting wtpman in dtls mode");
cw_dbg(DBG_CW_INFO,"Starting wtpman in dtls mode");
pthread_create (&wtpman->thread, NULL, (void *) &wtpman_run, (void *) wtpman);
}
else{
cw_log_debug1("Starting wtpman in non-dtls mode");
cw_dbg(DBG_CW_INFO,"Starting wtpman in non-dtls mode");
pthread_create (&wtpman->thread, NULL, (void *) &wtpman_run_discovery, (void *) wtpman);
}
}

View File

@ -127,7 +127,7 @@ static int process_message(struct conn * conn,struct cwrmsg *cwrmsg,int (*cb)(vo
static void cw_dbg_packet(struct conn * conn, uint8_t * packet, int len)
{
if (!cw_dbg_is_level(DBG_CW_PKT))
if (!cw_dbg_is_level(DBG_CW_PKT_OUT))
return;
/* print the header */
@ -136,7 +136,7 @@ static void cw_dbg_packet(struct conn * conn, uint8_t * packet, int len)
if (!cw_dbg_is_level(DBG_CW_PKT_DMP)){
cw_dbg(DBG_CW_PKT,"Processing capwap packet from %s, len=%d\n%s",sock_addr2str(&conn->addr),len,hdr);
cw_dbg(DBG_CW_PKT_OUT,"Processing capwap packet from %s, len=%d\n%s",sock_addr2str(&conn->addr),len,hdr);
return;
}

View File

@ -60,6 +60,8 @@ static void cw_log_debug2_(const char *format, ...)
closelog();
}
int cw_log_debug_dump_(int level, const uint8_t * data, int len,
const char *format, ...)
{