2015-02-07 10:49:12 +01:00
|
|
|
/*
|
|
|
|
This file is part of libcapwap.
|
|
|
|
|
|
|
|
libcapwap is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
libcapwap is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2015-10-18 09:49:14 +02:00
|
|
|
/**
|
|
|
|
*@file
|
|
|
|
*@brief
|
|
|
|
*/
|
2015-02-07 10:49:12 +01:00
|
|
|
|
2015-10-18 09:49:14 +02:00
|
|
|
//#include <string.h>
|
2015-02-07 10:49:12 +01:00
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
#include "dbg.h"
|
2015-02-07 10:49:12 +01:00
|
|
|
|
2015-10-18 09:49:14 +02:00
|
|
|
/**
|
|
|
|
*@addtogroup DbgOptions
|
|
|
|
*@{
|
|
|
|
*/
|
2015-02-07 10:49:12 +01:00
|
|
|
|
2015-10-18 10:31:06 +02:00
|
|
|
|
2015-10-18 09:49:14 +02:00
|
|
|
/**
|
|
|
|
* Debug strings
|
|
|
|
*/
|
|
|
|
struct cw_strlist_elem cw_dbg_strings[] = {
|
2015-04-11 19:00:51 +02:00
|
|
|
{ DBG_INFO, "info" },
|
|
|
|
{ DBG_PKT_IN, "pkt_in" },
|
|
|
|
{ DBG_PKT_OUT, "pkt_out" },
|
2015-04-12 19:19:29 +02:00
|
|
|
{ DBG_PKT_ERR, "pkt_err" },
|
|
|
|
{ DBG_PKT_DMP, "pkt_dmp" },
|
|
|
|
{ DBG_RFC, "rfc" },
|
2015-04-12 23:28:55 +02:00
|
|
|
{ DBG_SUBELEM, "subelem" },
|
|
|
|
{ DBG_SUBELEM_DMP, "subelem_dmp" },
|
2015-04-12 10:19:02 +02:00
|
|
|
{ DBG_MSG_IN, "msg_in" },
|
2015-04-13 11:00:46 +02:00
|
|
|
{ DBG_MSG_OUT, "msg_out"},
|
2015-04-12 10:19:02 +02:00
|
|
|
{ DBG_MSG_ERR, "msg_err" },
|
|
|
|
{ DBG_ELEM, "elem" },
|
|
|
|
{ DBG_ELEM_DMP, "elem_dmp" },
|
|
|
|
{ DBG_ELEM_ERR, "elem_err" },
|
2015-04-12 23:28:55 +02:00
|
|
|
{ DBG_DTLS, "dtls" },
|
|
|
|
{ DBG_DTLS_BIO, "dtls_bio" },
|
2015-04-18 12:02:58 +02:00
|
|
|
{ DBG_WARN, "warn" },
|
2015-04-12 19:19:29 +02:00
|
|
|
|
2015-04-12 10:19:02 +02:00
|
|
|
{ DBG_X,"dbgx" },
|
2015-04-11 19:00:51 +02:00
|
|
|
{ CW_STR_STOP, NULL }
|
|
|
|
};
|
|
|
|
|
2015-10-18 09:49:14 +02:00
|
|
|
/**
|
|
|
|
*@}
|
|
|
|
*/
|
2015-04-11 19:00:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2015-02-08 13:28:18 +01:00
|
|
|
struct cw_dbg_cfgstrs cw_dbg_cfgstrs[] = {
|
2015-02-07 10:49:12 +01:00
|
|
|
|
|
|
|
{"info",DBG_CW_INFO},
|
2015-03-28 12:51:34 +01:00
|
|
|
{"msg",DBG_MSG},
|
2015-04-05 02:07:59 +02:00
|
|
|
{"elem",DBG_ELEM},
|
|
|
|
{"elem_dmp",DBG_ELEM_DMP},
|
2015-02-07 10:49:12 +01:00
|
|
|
{"rfc",DBG_CW_RFC},
|
2015-02-07 10:49:58 +01:00
|
|
|
{"pkt_in",DBG_CW_PKT_IN},
|
|
|
|
{"pkt_out",DBG_CW_PKT_OUT},
|
2015-03-23 07:48:27 +01:00
|
|
|
{"pkt_dtl",DBG_CW_PKT_DTL},
|
2015-02-07 10:49:58 +01:00
|
|
|
{"pkt",(DBG_CW_PKT_IN | DBG_CW_PKT_OUT)},
|
2015-02-07 10:49:12 +01:00
|
|
|
{"pkt_dmp",DBG_CW_PKT_DMP},
|
|
|
|
{"pkt_err",DBG_CW_PKT_ERR},
|
2015-03-31 08:04:03 +02:00
|
|
|
{"msg_err",DBG_MSG_ERR},
|
2015-03-16 21:41:33 +01:00
|
|
|
{"img_dtl",DBG_CW_IMG_DTL},
|
2015-03-31 08:04:03 +02:00
|
|
|
{"elem_err",DBG_ELEM_ERR},
|
2015-02-07 10:49:12 +01:00
|
|
|
|
|
|
|
{"dtls",DBG_DTLS},
|
|
|
|
{"dtls_dietail",DBG_DTLS_DETAIL},
|
|
|
|
{"dtls_bio",DBG_DTLS_BIO},
|
|
|
|
{"dtls_bio_dmp",DBG_DTLS_BIO_DMP},
|
|
|
|
|
|
|
|
|
|
|
|
{"all",DBG_ALL},
|
|
|
|
{"err",DBG_ERR},
|
|
|
|
{0,0}
|
|
|
|
|
|
|
|
};
|
2015-04-11 19:00:51 +02:00
|
|
|
*/
|
2015-02-07 10:49:12 +01:00
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
/*
|
2015-02-07 10:49:12 +01:00
|
|
|
int cw_log_str2dbglevel(const char * str)
|
|
|
|
{
|
|
|
|
int i;
|
2015-02-08 13:28:18 +01:00
|
|
|
for (i=0; cw_dbg_cfgstrs[i].name; i++) {
|
|
|
|
if (!strcmp(str,cw_dbg_cfgstrs[i].name))
|
|
|
|
return cw_dbg_cfgstrs[i].level;
|
2015-02-07 10:49:12 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2015-04-11 19:00:51 +02:00
|
|
|
*/
|