• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dmsg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: check_ping_send_dowork

/*
 * Should we ping the remote?
 */
void
check_ping_send_dowork (struct context *c)
{
  c->c2.buf = c->c2.buffers->aux_buf;
  ASSERT (buf_init (&c->c2.buf, FRAME_HEADROOM (&c->c2.frame)));
  ASSERT (buf_safe (&c->c2.buf, MAX_RW_SIZE_TUN (&c->c2.frame)));
  ASSERT (buf_write (&c->c2.buf, ping_string, sizeof (ping_string)));

  /*
   * We will treat the ping like any other outgoing packet,
   * encrypt, sign, etc.
   */
  encrypt_sign (c, true);
  dmsg (D_PING, "SENT PING");
} 
开发者ID:BehzadGhaem,项目名称:android-external-openvpn,代码行数:18,代码来源:ping.c


示例2: check_coarse_timers_dowork

static void
check_coarse_timers_dowork (struct context *c)
{
  const struct timeval save = c->c2.timeval;
  c->c2.timeval.tv_sec = BIG_TIMEOUT;
  c->c2.timeval.tv_usec = 0;
  process_coarse_timers (c);
  c->c2.coarse_timer_wakeup = now + c->c2.timeval.tv_sec; 

  dmsg (D_INTERVAL, "TIMER: coarse timer wakeup %d seconds", (int) c->c2.timeval.tv_sec);

  /* Is the coarse timeout NOT the earliest one? */
  if (c->c2.timeval.tv_sec > save.tv_sec)
    c->c2.timeval = save;
}
开发者ID:Theparerg,项目名称:openvpn,代码行数:15,代码来源:forward.c


示例3: reliable_can_get

/* true if at least one free buffer available */
bool
reliable_can_get (const struct reliable *rel)
{
  struct gc_arena gc = gc_new ();
  int i;
  for (i = 0; i < rel->size; ++i)
    {
      const struct reliable_entry *e = &rel->array[i];
      if (!e->active)
	return true;
    }
  dmsg (D_REL_LOW, "ACK no free receive buffer available: %s", reliable_print_ids (rel, &gc));
  gc_free (&gc);
  return false;
}
开发者ID:BehzadGhaem,项目名称:android-external-openvpn,代码行数:16,代码来源:reliable.c


示例4: plugin_call_item

static int
plugin_call_item (const struct plugin *p,
		  void *per_client_context,
		  const int type,
		  const struct argv *av,
		  struct openvpn_plugin_string_list **retlist,
		  const char **envp)
{
  int status = OPENVPN_PLUGIN_FUNC_SUCCESS;

  /* clear return list */
  if (retlist)
    *retlist = NULL;

  if (p->plugin_handle && (p->plugin_type_mask & OPENVPN_PLUGIN_MASK (type)))
    {
      struct gc_arena gc = gc_new ();
      struct argv a = argv_insert_head (av, p->so_pathname);

      dmsg (D_PLUGIN_DEBUG, "PLUGIN_CALL: PRE type=%s", plugin_type_name (type));
      plugin_show_args_env (D_PLUGIN_DEBUG, (const char **)a.argv, envp);

      /*
       * Call the plugin work function
       */
      if (p->func2)
	status = (*p->func2)(p->plugin_handle, type, (const char **)a.argv, envp, per_client_context, retlist);
      else if (p->func1)
	status = (*p->func1)(p->plugin_handle, type, (const char **)a.argv, envp);
      else
	ASSERT (0);

      msg (D_PLUGIN, "PLUGIN_CALL: POST %s/%s status=%d",
	   p->so_pathname,
	   plugin_type_name (type),
	   status);

      if (status == OPENVPN_PLUGIN_FUNC_ERROR)
	msg (M_WARN, "PLUGIN_CALL: plugin function %s failed with status %d: %s",
	     plugin_type_name (type),
	     status,
	     p->so_pathname);

      argv_reset (&a);
      gc_free (&gc);
    }
  return status;
}
开发者ID:BehzadGhaem,项目名称:android-external-openvpn,代码行数:48,代码来源:plugin.c


示例5: bio_write

/*
 * Write to an OpenSSL BIO in non-blocking mode.
 */
static int
bio_write (BIO *bio, const uint8_t *data, int size, const char *desc)
{
  int i;
  int ret = 0;
  ASSERT (size >= 0);
  if (size)
    {
      /*
       * Free the L_TLS lock prior to calling BIO routines
       * so that foreground thread can still call
       * tls_pre_decrypt or tls_pre_encrypt,
       * allowing tunnel packet forwarding to continue.
       */
#ifdef BIO_DEBUG
      bio_debug_data ("write", bio, data, size, desc);
#endif
      i = BIO_write (bio, data, size);

      if (i < 0)
	{
	  if (BIO_should_retry (bio))
	    {
	      ;
	    }
	  else
	    {
	      msg (D_TLS_ERRORS | M_SSL, "TLS ERROR: BIO write %s error",
		   desc);
	      ret = -1;
	      ERR_clear_error ();
	    }
	}
      else if (i != size)
	{
	  msg (D_TLS_ERRORS | M_SSL,
	       "TLS ERROR: BIO write %s incomplete %d/%d", desc, i, size);
	  ret = -1;
	  ERR_clear_error ();
	}
      else
	{			/* successful write */
	  dmsg (D_HANDSHAKE_VERBOSE, "BIO write %s %d bytes", desc, i);
	  ret = 1;
	}
    }
  return ret;
}
开发者ID:LordZEDith,项目名称:russia_vpn,代码行数:51,代码来源:ssl_openssl.c


示例6: lz4v2_decompress

static void
lz4v2_decompress(struct buffer *buf, struct buffer work,
                 struct compress_context *compctx,
                 const struct frame *frame)
{
    size_t zlen_max = EXPANDED_SIZE(frame);
    uint8_t c;          /* flag indicating whether or not our peer compressed */

    if (buf->len <= 0)
    {
        return;
    }

    ASSERT(buf_init(&work, FRAME_HEADROOM(frame)));

    /* do unframing/swap (assumes buf->len > 0) */
    uint8_t *head = BPTR(buf);
    c = *head;

    /* Not compressed */
    if (c != COMP_ALGV2_INDICATOR_BYTE)
    {
        return;
    }

    /* Packet to short to make sense */
    if (buf->len <= 1)
    {
        buf->len = 0;
        return;
    }

    c = head[1];
    if (c == COMP_ALGV2_LZ4_BYTE) /* packet was compressed */
    {
        buf_advance(buf,2);
        do_lz4_decompress(zlen_max, &work, buf, compctx);
    }
    else if (c == COMP_ALGV2_UNCOMPRESSED_BYTE)
    {
        buf_advance(buf,2);
    }
    else
    {
        dmsg(D_COMP_ERRORS, "Bad LZ4v2 decompression header byte: %d", c);
        buf->len = 0;
    }
}
开发者ID:benjdag,项目名称:openvpn,代码行数:48,代码来源:comp-lz4.c


示例7: reliable_schedule_now

/* schedule all pending packets for immediate retransmit */
void
reliable_schedule_now (struct reliable *rel)
{
  int i;
  dmsg (D_REL_DEBUG, "ACK reliable_schedule_now");
  rel->hold = false;
  for (i = 0; i < rel->size; ++i)
    {
      struct reliable_entry *e = &rel->array[i];
      if (e->active)
	{
	  e->next_try = now;
	  e->timeout = rel->initial_timeout;
	}
    }
}
开发者ID:angelol,项目名称:iOpenVPN,代码行数:17,代码来源:reliable.c


示例8: replay_bind_cont

static void replay_bind_cont(void *st, errval_t err, struct replay_binding *b)
{
    static int slavenum = 0;
    struct slave *sl = &SlState.slaves[slavenum];
    slavenum++;

    dmsg("ENTER\n");
    //printf("%s:%s MY TASKGRAPH IS %p\n", __FILE__, __FUNCTION__, &TG);

    assert(err_is_ok(err));
    sl->b = b;
    b->rx_vtbl = replay_vtbl;
    b->st = &TG;
    bound = true;
    /* printf("assigned binding to %p\n", sl); */
}
开发者ID:huiweics,项目名称:arrakis,代码行数:16,代码来源:master.c


示例9: dmsg

    /**
     * @brief Order loading of a new instrument.
     *
     * The request will go into a queue waiting to be processed by the
     * class internal task thread. This method will immediately return and
     * the instrument will be loaded in the background.
     *
     * @param Filename - file name of the instrument
     * @param uiInstrumentIndex - index of the instrument within the file
     * @param pEngineChannel - engine channel on which the instrument should be loaded
     */
    void InstrumentManagerThread::StartNewLoad(String Filename, uint uiInstrumentIndex, EngineChannel* pEngineChannel) {
        dmsg(1,("Scheduling '%s' (Index=%d) to be loaded in background (if not loaded yet).\n",Filename.c_str(),uiInstrumentIndex));
        // already tell the engine which instrument to load
        pEngineChannel->PrepareLoadInstrument(Filename.c_str(), uiInstrumentIndex);

        command_t cmd;
        cmd.type           = command_t::DIRECT_LOAD;
        cmd.pEngineChannel = pEngineChannel;

        mutex.Lock();
        queue.push_back(cmd);
        mutex.Unlock();

        StartThread(); // ensure thread is running
        conditionJobsLeft.Set(true); // wake up thread
    }
开发者ID:svn2github,项目名称:linuxsampler,代码行数:27,代码来源:InstrumentManagerThread.cpp


示例10: start_threads

static void start_threads(void)
{
	int i;

	tinfo = calloc(nb_thread, sizeof(struct thread_info_s));
        if (tinfo == NULL)
               handle_error("calloc");

	for( i=0; i < nb_thread; i++)
	{
		tinfo[i].thread_num = i;
		if(pthread_create(&tinfo[i].thread_id, NULL, mr_map, &tinfo[i]))
			handle_error("thread create");

		dmsg("Thread number %d launched\n", i);
	}
}
开发者ID:moharaka,项目名称:word-count,代码行数:17,代码来源:main.c


示例11: dmsg

void AudioThread::CacheInitialSamples(gig::Sample* pSample) {
    if (!pSample || pSample->GetCache().Size) return;
    if (pSample->SamplesTotal <= NUM_RAM_PRELOAD_SAMPLES) {
        // Sample is too short for disk streaming, so we load the whole
        // sample into RAM and place 'pAudioIO->FragmentSize << MAX_PITCH'
        // number of '0' samples (silence samples) behind the official buffer
        // border, to allow the interpolator do it's work even at the end of
        // the sample.
        gig::buffer_t buf = pSample->LoadSampleDataWithNullSamplesExtension(pAudioIO->FragmentSize << MAX_PITCH);
        dmsg(("Cached %d Bytes, %d silence bytes.\n", buf.Size, buf.NullExtensionSize));
    }
    else { // we only cache NUM_RAM_PRELOAD_SAMPLES and stream the other sample points from disk
        pSample->LoadSampleData(NUM_RAM_PRELOAD_SAMPLES);
    }

    if (!pSample->GetCache().Size) std::cerr << "Unable to cache sample - maybe memory full!" << std::endl << std::flush;
}
开发者ID:svn2github,项目名称:linuxsampler,代码行数:17,代码来源:audiothread.cpp


示例12: modmult

static void modmult(Bignum r1, Bignum r2, Bignum modulus, Bignum result) {
    Bignum temp = newbn(modulus[0]+1);
    Bignum tmp2 = newbn(modulus[0]+1);
    int i;
    int bit, bits, digit, smallbit;

    enter((">modmult\n"));
    debug(r1);
    debug(r2);
    debug(modulus);

    for (i=1; i<=result[0]; i++)
	result[i] = 0;		       /* result := 0 */
    for (i=1; i<=temp[0]; i++)
	temp[i] = (i > r2[0] ? 0 : r2[i]);   /* temp := r2 */

    bits = 1+msb(r1);

    for (bit = 0; bit < bits; bit++) {
	digit = 1 + bit / 16;
	smallbit = bit % 16;

	debug(temp);
	if (digit <= r1[0] && (r1[digit] & (1<<smallbit))) {
	    dmsg(("bit %d\n", bit));
	    add(temp, result, tmp2);
	    if (ge(tmp2, modulus))
		sub(tmp2, modulus, result);
	    else
		add(tmp2, Zero, result);
	    debug(result);
	}

	add(temp, temp, tmp2);
	if (ge(tmp2, modulus))
	    sub(tmp2, modulus, temp);
	else
	    add(tmp2, Zero, temp);
    }

    freebn(temp);
    freebn(tmp2);

    debug(result);
    leave(("<modmult\n"));
}
开发者ID:rdebath,项目名称:sgt,代码行数:46,代码来源:sshrsa.c


示例13: process_incoming_tun

void
process_incoming_tun (struct context *c)
{
  struct gc_arena gc = gc_new ();

  perf_push (PERF_PROC_IN_TUN);

  if (c->c2.buf.len > 0)
    c->c2.tun_read_bytes += c->c2.buf.len;

#ifdef LOG_RW
  if (c->c2.log_rw && c->c2.buf.len > 0)
    fprintf (stderr, "r");
#endif

  /* Show packet content */
  dmsg (D_TUN_RW, "TUN READ [%d]", BLEN (&c->c2.buf));

  if (c->c2.buf.len > 0)
    {
      if ((c->options.mode == MODE_POINT_TO_POINT) && (!c->options.allow_recursive_routing))
	drop_if_recursive_routing (c, &c->c2.buf);
      /*
       * The --passtos and --mssfix options require
       * us to examine the IP header (IPv4 or IPv6).
       */
      process_ip_header (c, PIPV4_PASSTOS|PIP_MSSFIX|PIPV4_CLIENT_NAT, &c->c2.buf);

#ifdef PACKET_TRUNCATION_CHECK
      /* if (c->c2.buf.len > 1) --c->c2.buf.len; */
      ipv4_packet_size_verify (BPTR (&c->c2.buf),
			       BLEN (&c->c2.buf),
			       TUNNEL_TYPE (c->c1.tuntap),
			       "PRE_ENCRYPT",
			       &c->c2.n_trunc_pre_encrypt);
#endif

      encrypt_sign (c, true);
    }
  else
    {
      buf_reset (&c->c2.to_link);
    }
  perf_pop ();
  gc_free (&gc);
}
开发者ID:themiron,项目名称:asuswrt-merlin,代码行数:46,代码来源:forward.c


示例14: dmsg

 void DirectoryScanner::Scan(String DbDir, String FsDir, bool Flat, bool insDir, ScanProgress* pProgress) {
     dmsg(2,("DirectoryScanner: Scan(DbDir=%s,FsDir=%s,Flat=%d,insDir=%d)\n", DbDir.c_str(), FsDir.c_str(), Flat, insDir));
     if (DbDir.empty() || FsDir.empty()) throw Exception("Directory expected");
     
     this->DbDir = DbDir;
     this->FsDir = FsDir;
     this->insDir = insDir;
     if (DbDir.at(DbDir.length() - 1) != '/') {
         this->DbDir.append("/");
     }
     if (FsDir.at(FsDir.length() - 1) != File::DirSeparator) {
         this->FsDir.push_back(File::DirSeparator);
     }
     this->Flat = Flat;
     this->pProgress = pProgress;
     
     File::WalkDirectoryTree(FsDir, this);
 }
开发者ID:svn2github,项目名称:linuxsampler,代码行数:18,代码来源:InstrumentsDbUtilities.cpp


示例15: proxy_connection_io_recv

static int
proxy_connection_io_recv (struct proxy_connection *pc)
{
  /* recv data from socket */
  const int status = recv (pc->sd, BPTR(&pc->buf), BCAP(&pc->buf), MSG_NOSIGNAL);
  if (status < 0)
    {
      return (errno == EAGAIN) ? IOSTAT_EAGAIN_ON_READ : IOSTAT_READ_ERROR;
    }
  else
    {
      if (!status)
	return IOSTAT_READ_ERROR;
      dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: read[%d] %d", (int)pc->sd, status);
      pc->buf.len = status;
    }
  return IOSTAT_GOOD;
}
开发者ID:AVESH-RAI,项目名称:guizmovpn,代码行数:18,代码来源:ps.c


示例16: prng_init

void
prng_init (const char *md_name, const int nonce_secret_len_parm)
{
  prng_uninit ();
  nonce_md = md_name ? md_kt_get (md_name) : NULL;
  if (nonce_md)
    {
      ASSERT (nonce_secret_len_parm >= NONCE_SECRET_LEN_MIN && nonce_secret_len_parm <= NONCE_SECRET_LEN_MAX);
      nonce_secret_len = nonce_secret_len_parm;
      {
	const int size = md_kt_size(nonce_md) + nonce_secret_len;
	dmsg (D_CRYPTO_DEBUG, "PRNG init md=%s size=%d", md_kt_name(nonce_md), size);
	nonce_data = (uint8_t*) malloc (size);
	check_malloc_return (nonce_data);
	prng_reset_nonce();
      }
    }
}
开发者ID:KatekovAnton,项目名称:iOS-OpenVPN-Sample,代码行数:18,代码来源:crypto.c


示例17: shaper_soonest_event

/*
 * We want to wake up in delay microseconds.  If timeval is larger
 * than delay, set timeval to delay.
 */
bool
shaper_soonest_event(struct timeval *tv, int delay)
{
    bool ret = false;
    if (delay < 1000000)
    {
        if (tv->tv_sec)
        {
            tv->tv_sec = 0;
            tv->tv_usec = delay;
            ret = true;
        }
        else if (delay < tv->tv_usec)
        {
            tv->tv_usec = delay;
            ret = true;
        }
    }
    else
    {
        const int sec = delay / 1000000;
        const int usec = delay % 1000000;

        if (sec < tv->tv_sec)
        {
            tv->tv_sec = sec;
            tv->tv_usec = usec;
            ret = true;
        }
        else if (sec == tv->tv_sec)
        {
            if (usec < tv->tv_usec)
            {
                tv->tv_usec = usec;
                ret = true;
            }
        }
    }
#ifdef SHAPER_DEBUG
    dmsg(D_SHAPER_DEBUG, "SHAPER shaper_soonest_event sec=%d usec=%d ret=%d",
         (int)tv->tv_sec, (int)tv->tv_usec, (int)ret);
#endif
    return ret;
}
开发者ID:neuhalje,项目名称:openvpn,代码行数:48,代码来源:shaper.c


示例18: dbg_write_register

//--------------------------------------------------------------------------
// returns true-lowcnd was false, resumed the application
// nb: recursive calls to this function are not handled in any special way!
bool debmod_t::handle_lowcnd(lowcnd_t *lc, debug_event_t *event)
{
  if ( (debugger_flags & DBG_FLAG_CAN_CONT_BPT) == 0 )
  {
    // difficult case: we have to reset pc, remove the bpt, single step, and resume the app
    handling_lowcnd = true;

    regval_t rv;
    rv._set_int(lc->ea);
    int code = dbg_write_register(event->tid, pc_idx, &rv);
    if ( code <= 0 )
    {
      handling_lowcnd = false;
      return false;
    }

    code = dbg_freeze_threads_except(event->tid);
    if ( code > 0 )
    {
      code = dbg_del_bpt(lc->type, lc->ea, lc->orgbytes.begin(), lc->orgbytes.size());
      if ( code > 0 )
      {
        code = dbg_perform_single_step(event, lc->cmd);
        if ( code <= 0 )
          dmsg("%a: failed to single step\n", event->ea); // may happen

        if ( dbg_add_bpt(lc->type, lc->ea, lc->orgbytes.size()) <= 0 )
        {
          code = 0;
          dwarning("%a: could not restore deleted bpt\n", lc->cmd.ea); // odd
        }
      }
      if ( dbg_thaw_threads_except(event->tid) <= 0 )
      {
        dwarning("%d: could not resume suspended threads\n", event->tid); // odd
        code = 0;
      }
    }
    handling_lowcnd = false;
    if ( code <= 0 || event->eid != STEP )
      return false; // did not resume
  }
  return dbg_continue_after_event(event);
}
开发者ID:nealey,项目名称:vera,代码行数:47,代码来源:debmod.cpp


示例19: reliable_wont_break_sequentiality

/* make sure that incoming packet ID won't deadlock the receive buffer */
bool
reliable_wont_break_sequentiality (const struct reliable *rel, packet_id_type id)
{
  struct gc_arena gc = gc_new ();
  int ret;

  if ((int)id < (int)rel->packet_id + rel->size)
    {
      ret = true;
    }
  else
    {
      dmsg (D_REL_LOW, "ACK " packet_id_format " breaks sequentiality: %s",
	   (packet_id_print_type)id, reliable_print_ids (rel, &gc));
      ret = false;
    }
  gc_free (&gc);
  return ret;
}
开发者ID:angelol,项目名称:iOpenVPN,代码行数:20,代码来源:reliable.c


示例20: key_des_num_cblocks

int
key_des_num_cblocks (const EVP_CIPHER *kt)
{
  int ret = 0;
  const char *name = OBJ_nid2sn (EVP_CIPHER_nid (kt));
  if (name)
    {
      if (!strncmp (name, "DES-", 4))
	{
	  ret = EVP_CIPHER_key_length (kt) / sizeof (DES_cblock);
	}
      else if (!strncmp (name, "DESX-", 5))
	{
	  ret = 1;
	}
    }
  dmsg (D_CRYPTO_DEBUG, "CRYPTO INFO: n_DES_cblocks=%d", ret);
  return ret;
}
开发者ID:AllardJ,项目名称:Tomato,代码行数:19,代码来源:crypto_openssl.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dmu_bonus_hold函数代码示例发布时间:2022-05-30
下一篇:
C++ dmn_assert函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap