本文整理汇总了C++中ISC_LOG_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ ISC_LOG_DEBUG函数的具体用法?C++ ISC_LOG_DEBUG怎么用?C++ ISC_LOG_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ISC_LOG_DEBUG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dump_symboltable
static void
dump_symboltable(void) {
int i;
isc_result_t result;
const char *fname;
const void *addr;
if (isc__backtrace_nsymbols == 0)
return;
if (!isc_log_wouldlog(ns_g_lctx, ISC_LOG_DEBUG(99)))
return;
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
ISC_LOG_DEBUG(99), "Symbol table:");
for (i = 0, result = ISC_R_SUCCESS; result == ISC_R_SUCCESS; i++) {
addr = NULL;
fname = NULL;
result = isc_backtrace_getsymbolfromindex(i, &addr, &fname);
if (result == ISC_R_SUCCESS) {
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, ISC_LOG_DEBUG(99),
"[%d] %p %s", i, addr, fname);
}
}
}
开发者ID:fatman2021,项目名称:netbsd-src,代码行数:27,代码来源:main.c
示例2: try_dscp_v6
static void
try_dscp_v6(void) {
#ifdef ISC_PLATFORM_HAVEIPV6
#ifdef WANT_IPV6
#ifdef IPV6_TCLASS
char strbuf[ISC_STRERRORSIZE];
struct addrinfo hints, *res0;
int s, dscp = 0, n;
#if defined(IPV6_RECVTCLASS)
int on = 1;
#endif /* IPV6_RECVTCLASS */
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP;
#ifdef AI_NUMERICHOST
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
#else
hints.ai_flags = AI_PASSIVE;
#endif
n = getaddrinfo("::1", NULL, &hints, &res0);
if (n != 0 || res0 == NULL) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(10),
"getaddrinfo(::1): %s", gai_strerror(n));
return;
}
s = socket(res0->ai_family, res0->ai_socktype, res0->ai_protocol);
if (s == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(10),
"socket: %s", strbuf);
freeaddrinfo(res0);
return;
}
if (setsockopt(s, IPPROTO_IPV6, IPV6_TCLASS, &dscp, sizeof(dscp)) == 0)
dscp_result |= ISC_NET_DSCPSETV6;
#ifdef IPV6_RECVTCLASS
on = 1;
if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVTCLASS, &on, sizeof(on)) == 0)
dscp_result |= ISC_NET_DSCPRECVV6;
#endif /* IPV6_RECVTCLASS */
#ifdef ISC_NET_BSD44MSGHDR
if (cmsgsend(s, IPPROTO_IPV6, IPV6_TCLASS, res0))
dscp_result |= ISC_NET_DSCPPKTV6;
#endif /* ISC_NET_BSD44MSGHDR */
freeaddrinfo(res0);
close(s);
#endif /* IPV6_TCLASS */
#endif /* WANT_IPV6 */
#endif /* ISC_PLATFORM_HAVEIPV6 */
}
开发者ID:fatman2021,项目名称:netbsd-src,代码行数:60,代码来源:net.c
示例3: dns_dlzdestroy
void
dns_dlzdestroy(dns_dlzdb_t **dbp) {
isc_mem_t *mctx;
dns_dlzdestroy_t destroy;
/* Write debugging message to log */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
"Unloading DLZ driver.");
/*
* Perform checks to make sure data is as we expect it to be.
*/
REQUIRE(dbp != NULL && DNS_DLZ_VALID(*dbp));
#ifdef BIND9
if ((*dbp)->ssutable != NULL) {
dns_ssutable_detach(&(*dbp)->ssutable);
}
#endif
/* call the drivers destroy method */
if ((*dbp) != NULL) {
mctx = (*dbp)->mctx;
destroy = (*dbp)->implementation->methods->destroy;
(*destroy)((*dbp)->implementation->driverarg,(*dbp)->dbdata);
/* return memory */
isc_mem_put(mctx, (*dbp), sizeof(dns_dlzdb_t));
isc_mem_detach(&mctx);
}
*dbp = NULL;
}
开发者ID:pombredanne,项目名称:NetBSD,代码行数:33,代码来源:dlz.c
示例4: dlz_mysql_init
/*%
* Wrapper around dns_sdlzregister().
*/
isc_result_t
dlz_mysql_init(void) {
isc_result_t result;
/*
* Write debugging message to log
*/
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
"Registering DLZ mysql driver.");
/* Driver is always threadsafe. Because of the way MySQL handles
* threads the MySQL driver can only be used when bind is run single
* threaded. Using MySQL with Bind running multi-threaded is not
* allowed. When using the MySQL driver "-n1" should always be
* passed to Bind to guarantee single threaded operation.
*/
result = dns_sdlzregister("mysql", &dlz_mysql_methods, NULL,
DNS_SDLZFLAG_RELATIVEOWNER |
DNS_SDLZFLAG_RELATIVERDATA |
DNS_SDLZFLAG_THREADSAFE,
ns_g_mctx, &dlz_mysql);
/* if we can't register the driver, there are big problems. */
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"dns_sdlzregister() failed: %s",
isc_result_totext(result));
result = ISC_R_UNEXPECTED;
}
return result;
}
开发者ID:gosudream,项目名称:netbsd-src,代码行数:36,代码来源:dlz_mysql_driver.c
示例5: dns_dlzdestroy
void
dns_dlzdestroy(dns_dlzdb_t **dbp) {
dns_dlzdestroy_t destroy;
dns_dlzdb_t *db;
/* Write debugging message to log */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
"Unloading DLZ driver.");
/*
* Perform checks to make sure data is as we expect it to be.
*/
REQUIRE(dbp != NULL && DNS_DLZ_VALID(*dbp));
db = *dbp;
*dbp = NULL;
if (db->ssutable != NULL)
dns_ssutable_detach(&db->ssutable);
/* call the drivers destroy method */
if (db->dlzname != NULL)
isc_mem_free(db->mctx, db->dlzname);
destroy = db->implementation->methods->destroy;
(*destroy)(db->implementation->driverarg, db->dbdata);
/* return memory and detach */
isc_mem_putanddetach(&db->mctx, db, sizeof(dns_dlzdb_t));
}
开发者ID:crossbuild,项目名称:bind,代码行数:29,代码来源:dlz.c
示例6: dlz_postgres_init
/*%
* Wrapper around dns_sdlzregister().
*/
isc_result_t
dlz_postgres_init(void) {
isc_result_t result;
/*
* Write debugging message to log
*/
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
"Registering DLZ postgres driver.");
/*
* Driver is always threadsafe. When multithreaded all
* functions use multithreaded code. When not multithreaded,
* all functions can only be entered once, but only 1 thread
* of operation is available in Bind. So everything is still
* threadsafe.
*/
result = dns_sdlzregister("postgres", &dlz_postgres_methods, NULL,
DNS_SDLZFLAG_RELATIVEOWNER |
DNS_SDLZFLAG_RELATIVERDATA |
DNS_SDLZFLAG_THREADSAFE,
ns_g_mctx, &dlz_postgres);
/* if we can't register the driver, there are big problems. */
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"dns_sdlzregister() failed: %s",
isc_result_totext(result));
result = ISC_R_UNEXPECTED;
}
return result;
}
开发者ID:w796933,项目名称:bind99damp,代码行数:37,代码来源:dlz_postgres_driver.c
示例7: dlz_bdbhpt_init
/*%
* Wrapper around dns_sdlzregister().
*/
isc_result_t
dlz_bdbhpt_init(void) {
isc_result_t result;
/*
* Write debugging message to log
*/
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
"Registering DLZ bdbhpt driver.");
result = dns_sdlzregister("bdbhpt", &dlz_bdbhpt_methods, NULL,
DNS_SDLZFLAG_RELATIVEOWNER |
DNS_SDLZFLAG_RELATIVERDATA |
DNS_SDLZFLAG_THREADSAFE,
ns_g_mctx, &dlz_bdbhpt);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"dns_sdlzregister() failed: %s",
isc_result_totext(result));
result = ISC_R_UNEXPECTED;
}
return result;
}
开发者ID:VargMon,项目名称:netbsd-cvs-mirror,代码行数:29,代码来源:dlz_bdbhpt_driver.c
示例8: ssu_e_log
static void ssu_e_log (int level, const char *fmt, ...)
{
va_list ap;
va_start (ap, fmt);
isc_log_vwrite (dns_lctx, DNS_LOGCATEGORY_SECURITY, DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG (level), fmt, ap);
va_end (ap);
}
开发者ID:274914765,项目名称:C,代码行数:8,代码来源:ssu_external.c
示例9: tkey_log
static void tkey_log (const char *fmt, ...)
{
va_list ap;
va_start (ap, fmt);
isc_log_vwrite (dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_REQUEST, ISC_LOG_DEBUG (4), fmt, ap);
va_end (ap);
}
开发者ID:274914765,项目名称:C,代码行数:8,代码来源:tkey.c
示例10: supervisor_destroy
int supervisor_destroy(supervisor_t *sv) {
zmq_close(sv->zmq_sock_rpc);
zmq_ctx_destroy(sv->zmq_ctx);
free(sv);
supervisor_log(ISC_LOG_DEBUG(1), "supervisor destroyed");
return 0;
}
开发者ID:mduszyk,项目名称:bind,代码行数:8,代码来源:supervisor.c
示例11: freezezones
static isc_result_t
freezezones(dns_zone_t *zone, void *uap) {
isc_boolean_t freeze = *(isc_boolean_t *)uap;
isc_boolean_t frozen;
isc_result_t result = ISC_R_SUCCESS;
char classstr[DNS_RDATACLASS_FORMATSIZE];
char zonename[DNS_NAME_FORMATSIZE];
dns_view_t *view;
char *journal;
const char *vname;
const char *sep;
int level;
if (dns_zone_gettype(zone) != dns_zone_master)
return (ISC_R_SUCCESS);
frozen = dns_zone_getupdatedisabled(zone);
if (freeze) {
if (frozen)
result = DNS_R_FROZEN;
if (result == ISC_R_SUCCESS)
result = dns_zone_flush(zone);
if (result == ISC_R_SUCCESS) {
journal = dns_zone_getjournal(zone);
if (journal != NULL)
(void)isc_file_remove(journal);
}
} else {
if (frozen) {
result = dns_zone_load(zone);
if (result == DNS_R_CONTINUE ||
result == DNS_R_UPTODATE)
result = ISC_R_SUCCESS;
}
}
if (result == ISC_R_SUCCESS)
dns_zone_setupdatedisabled(zone, freeze);
view = dns_zone_getview(zone);
if (strcmp(view->name, "_bind") == 0 ||
strcmp(view->name, "_default") == 0)
{
vname = "";
sep = "";
} else {
vname = view->name;
sep = " ";
}
dns_rdataclass_format(dns_zone_getclass(zone), classstr,
sizeof(classstr));
dns_name_format(dns_zone_getorigin(zone), zonename, sizeof(zonename));
level = (result != ISC_R_SUCCESS) ? ISC_LOG_ERROR : ISC_LOG_DEBUG(1);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_ZONE,
level, "%s zone '%s/%s'%s%s: %s",
freeze ? "freezing" : "thawing",
zonename, classstr, sep, vname,
isc_result_totext(result));
return (result);
}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:58,代码来源:zt.c
示例12: dlopen_log
/*
* Log a message at the given level.
*/
static void dlopen_log(int level, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(level),
fmt, ap);
va_end(ap);
}
开发者ID:crossbuild,项目名称:bind,代码行数:12,代码来源:dlz_dlopen_driver.c
示例13: gss_log
void
gss_log(int level, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_TKEY, ISC_LOG_DEBUG(level), fmt, ap);
va_end(ap);
}
开发者ID:coapp-packages,项目名称:bind,代码行数:9,代码来源:gssapictx.c
示例14: setup_logging
void setup_logging (int verbose, isc_mem_t * mctx, isc_log_t ** logp)
{
isc_result_t result;
isc_logdestination_t destination;
isc_logconfig_t *logconfig = NULL;
isc_log_t *log = NULL;
int level;
if (verbose < 0)
verbose = 0;
switch (verbose)
{
case 0:
/*
* We want to see warnings about things like out-of-zone
* data in the master file even when not verbose.
*/
level = ISC_LOG_WARNING;
break;
case 1:
level = ISC_LOG_INFO;
break;
default:
level = ISC_LOG_DEBUG (verbose - 2 + 1);
break;
}
RUNTIME_CHECK (isc_log_create (mctx, &log, &logconfig) == ISC_R_SUCCESS);
isc_log_setcontext (log);
dns_log_init (log);
dns_log_setcontext (log);
RUNTIME_CHECK (isc_log_settag (logconfig, program) == ISC_R_SUCCESS);
/*
* Set up a channel similar to default_stderr except:
* - the logging level is passed in
* - the program name and logging level are printed
* - no time stamp is printed
*/
destination.file.stream = stderr;
destination.file.name = NULL;
destination.file.versions = ISC_LOG_ROLLNEVER;
destination.file.maximum_size = 0;
result = isc_log_createchannel (logconfig, "stderr",
ISC_LOG_TOFILEDESC, level, &destination, ISC_LOG_PRINTTAG | ISC_LOG_PRINTLEVEL);
check_result (result, "isc_log_createchannel()");
RUNTIME_CHECK (isc_log_usechannel (logconfig, "stderr", NULL, NULL) == ISC_R_SUCCESS);
*logp = log;
}
开发者ID:274914765,项目名称:C,代码行数:56,代码来源:dnssectool.c
示例15: dlz_ldap_clear
/*%
* Wrapper around dns_sdlzunregister().
*/
void dlz_ldap_clear (void)
{
/*
* Write debugging message to log
*/
isc_log_write (dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG (2), "Unregistering DLZ ldap driver.");
if (dlz_ldap != NULL)
dns_sdlzunregister (&dlz_ldap);
}
开发者ID:274914765,项目名称:C,代码行数:14,代码来源:dlz_ldap_driver.c
示例16: dlz_odbc_clear
/*%
* Wrapper around dns_sdlzunregister().
*/
void dlz_odbc_clear (void)
{
/*
* Write debugging message to log
*/
isc_log_write (dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG (2), "Unregistering DLZ odbc driver.");
/* unregister the driver. */
if (dlz_odbc != NULL)
dns_sdlzunregister (&dlz_odbc);
}
开发者ID:274914765,项目名称:C,代码行数:16,代码来源:dlz_odbc_driver.c
示例17: setup_seccomp
static void
setup_seccomp() {
scmp_filter_ctx ctx;
unsigned int i;
int ret;
/* Make sure the lists are in sync */
INSIST((sizeof(scmp_syscalls) / sizeof(int)) ==
(sizeof(scmp_syscall_names) / sizeof(const char *)));
ctx = seccomp_init(SCMP_ACT_KILL);
if (ctx == NULL) {
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, ISC_LOG_WARNING,
"libseccomp activation failed");
return;
}
for (i = 0 ; i < sizeof(scmp_syscalls)/sizeof(*(scmp_syscalls)); i++) {
ret = seccomp_rule_add(ctx, SCMP_ACT_ALLOW,
scmp_syscalls[i], 0);
if (ret < 0)
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, ISC_LOG_WARNING,
"libseccomp rule failed: %s",
scmp_syscall_names[i]);
else
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, ISC_LOG_DEBUG(9),
"added libseccomp rule: %s",
scmp_syscall_names[i]);
}
ret = seccomp_load(ctx);
if (ret < 0) {
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, ISC_LOG_WARNING,
"libseccomp unable to load filter");
} else {
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"libseccomp sandboxing active");
}
/*
* Release filter in ctx. Filters already loaded are not
* affected.
*/
seccomp_release(ctx);
}
开发者ID:fatman2021,项目名称:netbsd-src,代码行数:51,代码来源:main.c
示例18: listener_startclients
static isc_result_t
listener_startclients(ns_lwreslistener_t *listener) {
ns_lwdclientmgr_t *cm;
unsigned int i;
isc_result_t result = ISC_R_SUCCESS;
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_LWRESD, ISC_LOG_DEBUG(6),
"listener_startclients: creating %d "
"managers with %d clients each",
listener->manager->ntasks, listener->manager->nclients);
/*
* Create the client managers.
*/
for (i = 0; i < listener->manager->ntasks; i++) {
result = ns_lwdclientmgr_create(listener,
listener->manager->nclients,
ns_g_taskmgr);
if (result != ISC_R_SUCCESS)
break;
}
/*
* Ensure that we have created at least one.
*/
if (ISC_LIST_EMPTY(listener->cmgrs))
return (result);
/*
* Walk the list of clients and start each one up.
*/
LOCK(&listener->lock);
cm = ISC_LIST_HEAD(listener->cmgrs);
while (cm != NULL) {
result = ns_lwdclient_startrecv(cm);
if (result != ISC_R_SUCCESS)
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_LWRESD, ISC_LOG_ERROR,
"could not start lwres "
"client handler: %s",
isc_result_totext(result));
cm = ISC_LIST_NEXT(cm, link);
}
UNLOCK(&listener->lock);
return (ISC_R_SUCCESS);
}
开发者ID:GabrielCastro,项目名称:bind,代码行数:48,代码来源:lwresd.c
示例19: stub_dlz_findzonedb
static isc_result_t
stub_dlz_findzonedb(void *driverarg, void *dbdata, const char *name)
{
config_data_t *cd;
UNUSED(driverarg);
cd = (config_data_t *) dbdata;
/* Write info message to log */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2),
"dlz_stub findzone looking for '%s'", name);
if (strcmp(cd->myzone, name) == 0)
return (ISC_R_SUCCESS);
else
return (ISC_R_NOTFOUND);
}
开发者ID:VargMon,项目名称:netbsd-cvs-mirror,代码行数:20,代码来源:dlz_stub_driver.c
示例20: ldapdb_bind
static void
ldapdb_bind(const char *zone, struct ldapdb_data *data, LDAP **ldp) {
#ifndef LDAPDB_RFC1823API
const int ver = LDAPDB_LDAP_VERSION;
#endif
int failure = 1, counter = 1, rc;
/* Make sure we try at least three times to connect+bind
* to the LDAP server. Sleep five seconds between each
* attempt => 25 seconds before timeout! */
while((failure == 1) && (counter <= 3)) {
if (*ldp != NULL)
ldap_unbind(*ldp);
/* ----------------------------- */
/* -- Connect to LDAP server. -- */
#ifdef LDAP_API_FEATURE_X_OPENLDAP
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_CONTROL, ISC_LOG_DEBUG(2),
"LDAP sdb zone '%s': ldap_initialize(%s)",
zone, data->url);
/* Connect to LDAP server using URL */
rc = ldap_initialize(ldp, data->url);
if (rc != LDAP_SUCCESS) {
#else
*ldp = ldap_open(data->hostname, data->portno);
if (*ldp == NULL) {
#endif
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ISC_LOG_ERROR,
#ifdef LDAP_API_FEATURE_X_OPENLDAP
"LDAP sdb zone '%s': ldapdb_bind(): ldap_initialize() failed. LDAP URL: %s",
zone, data->url);
#else
"LDAP sdb zone '%s': ldapdb_bind(): ldap_open() failed.",
zone);
#endif
/* Failed - wait five seconds, then try again. */
goto try_bind_again;
} else
开发者ID:Cizin,项目名称:bind9-ldap,代码行数:41,代码来源:ldapdb.c
注:本文中的ISC_LOG_DEBUG函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论