当前位置: 首页>>代码示例>>C++>>正文


C++ DEBUGLVL函数代码示例

本文整理汇总了C++中DEBUGLVL函数的典型用法代码示例。如果您正苦于以下问题:C++ DEBUGLVL函数的具体用法?C++ DEBUGLVL怎么用?C++ DEBUGLVL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DEBUGLVL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: irix_release_kernel_oplock

static void irix_release_kernel_oplock(files_struct *fsp)
{
	if (DEBUGLVL(10)) {
		/*
		 * Check and print out the current kernel
		 * oplock state of this file.
		 */
		int state = sys_fcntl_long(fsp->fh->fd, F_OPLKACK, -1);
		dbgtext("irix_release_kernel_oplock: file %s, dev = %x, "
			"inode = %.0f file_id = %ul, has kernel oplock state "
			"of %x.\n", fsp->fsp_name, (unsigned int)fsp->dev,
                        (double)fsp->inode, fsp->fh->file_id, state );
	}

	/*
	 * Remove the kernel oplock on this file.
	 */
	if(sys_fcntl_long(fsp->fh->fd, F_OPLKACK, OP_REVOKE) < 0) {
		if( DEBUGLVL( 0 )) {
			dbgtext("irix_release_kernel_oplock: Error when "
				"removing kernel oplock on file " );
			dbgtext("%s, dev = %x, inode = %.0f, file_id = %ul. "
				"Error was %s\n",
				fsp->fsp_name, (unsigned int)fsp->dev, 
				(double)fsp->inode, fsp->fh->file_id,
				strerror(errno) );
		}
	}
}
开发者ID:StephenMacras,项目名称:dsl-n55u-bender,代码行数:29,代码来源:oplock_irix.c

示例2: irix_release_kernel_oplock

static void irix_release_kernel_oplock(struct kernel_oplocks *_ctx,
				       files_struct *fsp, int oplock_type)
{
	if (DEBUGLVL(10)) {
		/*
		 * Check and print out the current kernel
		 * oplock state of this file.
		 */
		int state = sys_fcntl_long(fsp->fh->fd, F_OPLKACK, -1);
		dbgtext("irix_release_kernel_oplock: file %s, file_id = %s"
			"gen_id = %ul, has kernel oplock state "
			"of %x.\n", fsp_str_dbg(fsp),
		        file_id_string_tos(&fsp->file_id),
                        fsp->fh->gen_id, state );
	}

	/*
	 * Remove the kernel oplock on this file.
	 */
	if(sys_fcntl_long(fsp->fh->fd, F_OPLKACK, OP_REVOKE) < 0) {
		if( DEBUGLVL( 0 )) {
			dbgtext("irix_release_kernel_oplock: Error when "
				"removing kernel oplock on file " );
			dbgtext("%s, file_id = %s gen_id = %ul. "
				"Error was %s\n",
				fsp_str_dbg(fsp),
			        file_id_string_tos(&fsp->file_id),
				fsp->fh->gen_id,
				strerror(errno) );
		}
	}
}
开发者ID:Alexandr-Galko,项目名称:samba,代码行数:32,代码来源:oplock_irix.c

示例3: linux_release_kernel_oplock

static void linux_release_kernel_oplock(struct kernel_oplocks *ctx,
					files_struct *fsp, int oplock_type)
{
	if (DEBUGLVL(10)) {
		/*
		 * Check and print out the current kernel
		 * oplock state of this file.
		 */
		int state = fcntl(fsp->fh->fd, F_GETLEASE, 0);
		dbgtext("linux_release_kernel_oplock: file %s, file_id = %s "
			"gen_id = %lu has kernel oplock state "
			"of %x.\n", fsp_str_dbg(fsp),
		        file_id_string_tos(&fsp->file_id),
			fsp->fh->gen_id, state );
	}

	/*
	 * Remove the kernel oplock on this file.
	 */
	if ( SMB_VFS_LINUX_SETLEASE(fsp, F_UNLCK) == -1) {
		if (DEBUGLVL(0)) {
			dbgtext("linux_release_kernel_oplock: Error when "
				"removing kernel oplock on file " );
			dbgtext("%s, file_id = %s, gen_id = %lu. "
				"Error was %s\n", fsp_str_dbg(fsp),
				file_id_string_tos(&fsp->file_id),
				fsp->fh->gen_id, strerror(errno) );
		}
	}
}
开发者ID:Arkhont,项目名称:samba,代码行数:30,代码来源:oplock_linux.c

示例4: find_all_domain_master_names_query_success

static void find_all_domain_master_names_query_success(struct subnet_record *subrec,
                        struct userdata_struct *userdata_in,
                        struct nmb_name *q_name, struct in_addr answer_ip, struct res_rec *rrec)
{
  /* 
   * We now have a list of all the domain master browsers for all workgroups
   * that have registered with the WINS server. Now do a node status request
   * to each one and look for the first 1b name in the reply. This will be
   * the workgroup name that we will add to the unicast subnet as a 'non-local'
   * workgroup.
   */

  struct nmb_name nmbname;
  struct in_addr send_ip;
  int i;

  if( DEBUGLVL( 5 ) )
  {
    dbgtext( "find_all_domain_master_names_query_succes:\n" );
    dbgtext( "Got answer from WINS server of %d ", (rrec->rdlength / 6) );
    dbgtext( "IP addresses for Domain Master Browsers.\n" );
  }

  for(i = 0; i < rrec->rdlength / 6; i++)
  {
    /* Initiate the node status requests. */
    make_nmb_name(&nmbname, "*", 0);

    putip((char *)&send_ip, (char *)&rrec->rdata[(i*6) + 2]);

    /* 
     * Don't send node status requests to ourself.
     */

    if(ismyip( send_ip ))
    {
      if( DEBUGLVL( 5 ) )
      {
        dbgtext( "find_all_domain_master_names_query_succes:\n" );
        dbgtext( "Not sending node status to our own IP " );
        dbgtext( "%s.\n", inet_ntoa(send_ip) );
      }
      continue;
    }

    if( DEBUGLVL( 5 ) )
    {
      dbgtext( "find_all_domain_master_names_query_success:\n" );
      dbgtext( "Sending node status request to IP %s.\n", inet_ntoa(send_ip) );
    }

    node_status( subrec, &nmbname, send_ip, 
                 get_domain_master_name_node_status_success,
                 get_domain_master_name_node_status_fail,
                 NULL);
  }
}
开发者ID:jophxy,项目名称:samba,代码行数:57,代码来源:nmbd_browsesync.c

示例5: wreplsrv_process

/*
  receive some data on a WREPL connection
*/
static NTSTATUS wreplsrv_process(struct wreplsrv_in_connection *wrepl_conn,
				 struct wreplsrv_in_call **_call)
{
	struct wrepl_wrap packet_out_wrap;
	NTSTATUS status;
	enum ndr_err_code ndr_err;
	struct wreplsrv_in_call *call = *_call;

	ndr_err = ndr_pull_struct_blob(&call->in, call,
				       &call->req_packet,
				       (ndr_pull_flags_fn_t)ndr_pull_wrepl_packet);
	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
		return ndr_map_error2ntstatus(ndr_err);
	}

	if (DEBUGLVL(10)) {
		DEBUG(10,("Received WINS-Replication packet of length %u\n",
			  (unsigned int) call->in.length + 4));
		NDR_PRINT_DEBUG(wrepl_packet, &call->req_packet);
	}

	status = wreplsrv_in_call(call);
	NT_STATUS_IS_ERR_RETURN(status);
	if (!NT_STATUS_IS_OK(status)) {
		/* w2k just ignores invalid packets, so we do */
		DEBUG(10,("Received WINS-Replication packet was invalid, we just ignore it\n"));
		TALLOC_FREE(call);
		*_call = NULL;
		return NT_STATUS_OK;
	}

	/* and now encode the reply */
	packet_out_wrap.packet = call->rep_packet;
	ndr_err = ndr_push_struct_blob(&call->out, call,
				       &packet_out_wrap,
				       (ndr_push_flags_fn_t) ndr_push_wrepl_wrap);
	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
		return ndr_map_error2ntstatus(ndr_err);
	}

	if (DEBUGLVL(10)) {
		DEBUG(10,("Sending WINS-Replication packet of length %u\n",
			 (unsigned int) call->out.length));
		NDR_PRINT_DEBUG(wrepl_packet, &call->rep_packet);
	}

	return NT_STATUS_OK;
}
开发者ID:AIdrifter,项目名称:samba,代码行数:51,代码来源:wrepl_in_connection.c

示例6: samba_ldb_connect

int samba_ldb_connect(struct ldb_context *ldb, struct loadparm_context *lp_ctx,
		      const char *url, unsigned int flags)
{
	int ret;
	char *real_url = NULL;

	/* allow admins to force non-sync ldb for all databases */
	if (lpcfg_parm_bool(lp_ctx, NULL, "ldb", "nosync", false)) {
		flags |= LDB_FLG_NOSYNC;
	}

	if (DEBUGLVL(10)) {
		flags |= LDB_FLG_ENABLE_TRACING;
	}

	real_url = lpcfg_private_path(ldb, lp_ctx, url);
	if (real_url == NULL) {
		return LDB_ERR_OPERATIONS_ERROR;
	}

	ret = ldb_connect(ldb, real_url, flags, NULL);

	if (ret != LDB_SUCCESS) {
		return ret;
	}

	/* setup for leak detection */
	ldb_set_opaque(ldb, "wrap_url", real_url);

	return LDB_SUCCESS;
}
开发者ID:ebrainte,项目名称:Samba,代码行数:31,代码来源:ldb_wrap.c

示例7: dump_data

void dump_data(int level, const uint8_t *buf, size_t len)
{
	int i=0;

	if (len<=0) return;

	if (!DEBUGLVL(level)) return;

	DEBUG(level, (__location__ " dump data of size %i:\n", (int)len));
	DEBUGADD(level,("[%03X] ",i));
	for (i=0;i<len;) {
		DEBUGADD(level,("%02X ",(int)buf[i]));
		i++;
		if (i%8 == 0) DEBUGADD(level,(" "));
		if (i%16 == 0) {
			print_asc(level,&buf[i-16],8); DEBUGADD(level,(" "));
			print_asc(level,&buf[i-8],8); DEBUGADD(level,("\n"));
			if (i<len) DEBUGADD(level,("[%03X] ",i));
		}
	}
	if (i%16) {
		int n;
		n = 16 - (i%16);
		DEBUGADD(level,(" "));
		if (n>8) DEBUGADD(level,(" "));
		while (n--) DEBUGADD(level,("   "));
		n = MIN(8,i%16);
		print_asc(level,&buf[i-(i%16)],n); DEBUGADD(level,( " " ));
		n = (i%16) - n;
		if (n>0) print_asc(level,&buf[i-n],n);
		DEBUGADD(level,("\n"));
	}
	DEBUG(level, (__location__ " dump data of size %i finished\n", (int)len));
}
开发者ID:AIdrifter,项目名称:samba,代码行数:34,代码来源:debug.c

示例8: torture_smb2_close

/*
  send a close
*/
static NTSTATUS torture_smb2_close(struct smb2_tree *tree, struct smb2_handle handle)
{
	struct smb2_close io;
	NTSTATUS status;
	TALLOC_CTX *tmp_ctx = talloc_new(tree);

	ZERO_STRUCT(io);
	io.in.file.handle	= handle;
	io.in.flags		= SMB2_CLOSE_FLAGS_FULL_INFORMATION;
	status = smb2_close(tree, &io);
	if (!NT_STATUS_IS_OK(status)) {
		printf("close failed - %s\n", nt_errstr(status));
		return status;
	}

	if (DEBUGLVL(1)) {
		printf("Close gave:\n");
		printf("create_time     = %s\n", nt_time_string(tmp_ctx, io.out.create_time));
		printf("access_time     = %s\n", nt_time_string(tmp_ctx, io.out.access_time));
		printf("write_time      = %s\n", nt_time_string(tmp_ctx, io.out.write_time));
		printf("change_time     = %s\n", nt_time_string(tmp_ctx, io.out.change_time));
		printf("alloc_size      = %lld\n", (long long)io.out.alloc_size);
		printf("size            = %lld\n", (long long)io.out.size);
		printf("file_attr       = 0x%x\n", io.out.file_attr);
	}

	talloc_free(tmp_ctx);
	
	return status;
}
开发者ID:Marvin-Lee,项目名称:libwmiclient,代码行数:33,代码来源:connect.c

示例9: announce_and_sync_with_domain_master_browser

void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
                                                   struct work_record *work)
{
  struct nmb_name nmbname;

  /* Only do this if we are using a WINS server. */
  if(we_are_a_wins_client() == False)
  {
    if( DEBUGLVL( 10 ) )
    {
      dbgtext( "announce_and_sync_with_domain_master_browser:\n" );
      dbgtext( "Ignoring, as we are not a WINS client.\n" );
    }
    return;
  }

  make_nmb_name(&nmbname,work->work_group,0x1b);

  /* First, query for the WORKGROUP<1b> name from the WINS server. */
  query_name(unicast_subnet, nmbname.name, nmbname.name_type,
             find_domain_master_name_query_success,
             find_domain_master_name_query_fail,
             NULL);

}
开发者ID:jophxy,项目名称:samba,代码行数:25,代码来源:nmbd_browsesync.c

示例10: collect_all_workgroup_names_from_wins_server

void collect_all_workgroup_names_from_wins_server(time_t t)
{
	static time_t lastrun = 0;
	struct work_record *work;

	/* Only do this if we are using a WINS server. */
	if(we_are_a_wins_client() == False)
		return;

	/* Check to see if we are a domain master browser on the unicast subnet. */
	if((work = find_workgroup_on_subnet( unicast_subnet, lp_workgroup())) == NULL) {
		if( DEBUGLVL( 0 ) ) {
			dbgtext( "collect_all_workgroup_names_from_wins_server:\n" );
			dbgtext( "Cannot find my workgroup %s ", lp_workgroup() );
			dbgtext( "on subnet %s.\n", unicast_subnet->subnet_name );
		}
		return;
	}

	if(!AM_DOMAIN_MASTER_BROWSER(work))
		return;

	if ((lastrun != 0) && (t < lastrun + (15 * 60)))
		return;
     
	lastrun = t;

	/* First, query for the *<1b> name from the WINS server. */
	query_name(unicast_subnet, "*", 0x1b,
		find_all_domain_master_names_query_success,
		find_all_domain_master_names_query_fail,
		NULL);
} 
开发者ID:hajuuk,项目名称:R7000,代码行数:33,代码来源:nmbd_browsesync.c

示例11: msg_close_file

void msg_close_file(struct messaging_context *msg_ctx,
			void *private_data,
			uint32_t msg_type,
			struct server_id server_id,
			DATA_BLOB *data)
{
	files_struct *fsp = NULL;
	struct share_mode_entry e;
	struct smbd_server_connection *sconn =
		talloc_get_type_abort(private_data,
		struct smbd_server_connection);

	message_to_share_mode_entry(&e, (char *)data->data);

	if(DEBUGLVL(10)) {
		char *sm_str = share_mode_str(NULL, 0, &e);
		if (!sm_str) {
			smb_panic("talloc failed");
		}
		DEBUG(10,("msg_close_file: got request to close share mode "
			"entry %s\n", sm_str));
		TALLOC_FREE(sm_str);
	}

	fsp = file_find_dif(sconn, e.id, e.share_file_id);
	if (!fsp) {
		DEBUG(10,("msg_close_file: failed to find file.\n"));
		return;
	}
	close_file(NULL, fsp, NORMAL_CLOSE);
}
开发者ID:vormetriclabs,项目名称:samba,代码行数:31,代码来源:close.c

示例12: nbtd_bad_packet

/*
  we received a badly formed packet - log it
*/
void nbtd_bad_packet(struct nbt_name_packet *packet, 
		     const struct socket_address *src, const char *reason)
{
	DEBUG(2,("nbtd: bad packet '%s' from %s:%d\n", reason, src->addr, src->port));
	if (DEBUGLVL(5)) {
		NDR_PRINT_DEBUG(nbt_name_packet, packet);		
	}
}
开发者ID:Marvin-Lee,项目名称:libwmiclient,代码行数:11,代码来源:packet.c

示例13: announce_local_master_browser_to_domain_master_browser

static void announce_local_master_browser_to_domain_master_browser( struct work_record *work)
{
	char outbuf[1024];
	unstring myname;
	unstring dmb_name;
	char *p;

	if(ismyip_v4(work->dmb_addr)) {
		if( DEBUGLVL( 2 ) ) {
			dbgtext( "announce_local_master_browser_to_domain_master_browser:\n" );
			dbgtext( "We are both a domain and a local master browser for " );
			dbgtext( "workgroup %s.  ", work->work_group );
			dbgtext( "Do not announce to ourselves.\n" );
		}
		return;
	}

	memset(outbuf,'\0',sizeof(outbuf));
	p = outbuf;
	SCVAL(p,0,ANN_MasterAnnouncement);
	p++;

	unstrcpy(myname, lp_netbios_name());
	if (!strupper_m(myname)) {
		DEBUG(2,("strupper_m %s failed\n", myname));
		return;
	}
	myname[15]='\0';
	/* The call below does CH_UNIX -> CH_DOS conversion. JRA */
	push_ascii(p, myname, sizeof(outbuf)-PTR_DIFF(p,outbuf)-1, STR_TERMINATE);

	p = skip_string(outbuf,sizeof(outbuf),p);

	if( DEBUGLVL( 4 ) ) {
		dbgtext( "announce_local_master_browser_to_domain_master_browser:\n" );
		dbgtext( "Sending local master announce to " );
		dbgtext( "%s for workgroup %s.\n", nmb_namestr(&work->dmb_name),
					work->work_group );
	}

	/* Target name for send_mailslot must be in UNIX charset. */
	pull_ascii_nstring(dmb_name, sizeof(dmb_name), work->dmb_name.name);
	send_mailslot(True, BROWSE_MAILSLOT, outbuf,PTR_DIFF(p,outbuf),
		lp_netbios_name(), 0x0, dmb_name, 0x0,
		work->dmb_addr, FIRST_SUBNET->myip, DGRAM_PORT);
}
开发者ID:AIdrifter,项目名称:samba,代码行数:46,代码来源:nmbd_browsesync.c

示例14: sync_with_lmb

/****************************************************************************
As a domain master browser, do a sync with a local master browser.
**************************************************************************/
static void sync_with_lmb(struct browse_cache_record *browc)
{                     
  struct work_record *work;

  if( !(work = find_workgroup_on_subnet(unicast_subnet, browc->work_group)) )
  {
    if( DEBUGLVL( 0 ) )
    {
      dbgtext( "sync_with_lmb:\n" );
      dbgtext( "Failed to get a workgroup for a local master browser " );
      dbgtext( "cache entry workgroup " );
      dbgtext( "%s, server %s\n", browc->work_group, browc->lmb_name );
    }
    return;
  }

  /* We should only be doing this if we are a domain master browser for
     the given workgroup. Ensure this is so. */

  if(!AM_DOMAIN_MASTER_BROWSER(work))
  {
    if( DEBUGLVL( 0 ) )
    {
      dbgtext( "sync_with_lmb:\n" );
      dbgtext( "We are trying to sync with a local master browser " );
      dbgtext( "%s for workgroup %s\n", browc->lmb_name, browc->work_group );
      dbgtext( "and we are not a domain master browser on this workgroup.\n" );
      dbgtext( "Error!\n" );
    }
    return;
  }

  if( DEBUGLVL( 2 ) )
  {
    dbgtext( "sync_with_lmb:\n" );
    dbgtext( "Initiating sync with local master browser " );
    dbgtext( "%s<0x20> at IP %s ", browc->lmb_name, inet_ntoa(browc->ip) );
    dbgtext( "for workgroup %s\n", browc->work_group );
  }

  sync_browse_lists(work, browc->lmb_name, 0x20, browc->ip, True, True);

  browc->sync_time += (CHECK_TIME_DMB_TO_LMB_SYNC * 60);
}
开发者ID:jophxy,项目名称:samba,代码行数:47,代码来源:nmbd_browsesync.c

示例15: get_domain_master_name_node_status_fail

static void get_domain_master_name_node_status_fail(struct subnet_record *subrec,
                       struct response_record *rrec)
{
	if( DEBUGLVL( 0 ) ) {
		dbgtext( "get_domain_master_name_node_status_fail:\n" );
		dbgtext( "Doing a node status request to the domain master browser " );
		dbgtext( "at IP %s failed.\n", inet_ntoa(rrec->packet->ip) );
		dbgtext( "Cannot get workgroup name.\n" );
	}
}
开发者ID:hajuuk,项目名称:R7000,代码行数:10,代码来源:nmbd_browsesync.c


注:本文中的DEBUGLVL函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。