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

C++ plog函数代码示例

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

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



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

示例1: xdr_statfsokres

bool_t
xdr_statfsokres(XDR *xdrs, nfsstatfsokres *objp)
{
  if (amuDebug(D_XDRTRACE))
    plog(XLOG_DEBUG, "xdr_statfsokres:");

  if (!xdr_u_int(xdrs, &objp->sfrok_tsize)) {
    return (FALSE);
  }
  if (!xdr_u_int(xdrs, &objp->sfrok_bsize)) {
    return (FALSE);
  }
  if (!xdr_u_int(xdrs, &objp->sfrok_blocks)) {
    return (FALSE);
  }
  if (!xdr_u_int(xdrs, &objp->sfrok_bfree)) {
    return (FALSE);
  }
  if (!xdr_u_int(xdrs, &objp->sfrok_bavail)) {
    return (FALSE);
  }
  return (TRUE);
}
开发者ID:raven-au,项目名称:am-utils-6.2,代码行数:23,代码来源:xdr_func.c


示例2: amfs_retry

/*
 * Retry a mount
 */
static void
amfs_retry(int rc, int term, opaque_t arg)
{
  struct continuation *cp = (struct continuation *) arg;
  am_node *mp = cp->mp;
  int error = 0;

  dlog("Commencing retry for mount of %s", mp->am_path);

  new_ttl(mp);

  if ((cp->start + ALLOWED_MOUNT_TIME) < clocktime(NULL)) {
    /*
     * The entire mount has timed out.  Set the error code and skip past all
     * the mntfs's so that amfs_bgmount will not have any more
     * ways to try the mount, thus causing an error.
     */
    plog(XLOG_INFO, "mount of \"%s\" has timed out", mp->am_path);
    error = ETIMEDOUT;
    while (*cp->al)
      cp->al++;
    /* explicitly forbid further retries after timeout */
    cp->retry = FALSE;
  }
  if (error || !IN_PROGRESS(cp))
    error = amfs_bgmount(cp);
  else
    /* Normally it's amfs_bgmount() which frees the continuation. However, if
     * the mount is already in progress and we're in amfs_retry() for another
     * node we don't try mounting the filesystem once again. Still, we have
     * to free the continuation as we won't get called again and thus would
     * leak the continuation structure and our am_loc references.
     */
    free_continuation(cp);

  reschedule_timeout_mp();
}
开发者ID:IIJ-NetBSD,项目名称:netbsd-src,代码行数:40,代码来源:amfs_generic.c


示例3: handle_vendorid

int
handle_vendorid(struct ph1handle *iph1, struct isakmp_gen *gen)
{
	int vid_numeric;

	vid_numeric = check_vendorid(gen);
	if (vid_numeric == VENDORID_UNKNOWN)
		return vid_numeric;

	iph1->vendorid_mask |= BIT(vid_numeric);

#ifdef ENABLE_NATT
	if (natt_vendorid(vid_numeric))
		natt_handle_vendorid(iph1, vid_numeric);
#endif
#ifdef ENABLE_HYBRID
	switch (vid_numeric) {
	case VENDORID_XAUTH:
		iph1->mode_cfg->flags |= ISAKMP_CFG_VENDORID_XAUTH;
		break;
	case VENDORID_UNITY:
		iph1->mode_cfg->flags |= ISAKMP_CFG_VENDORID_UNITY;
		break;
	default:
		break;
	}
#endif
#ifdef ENABLE_DPD
	if (vid_numeric == VENDORID_DPD &&
	    (iph1->rmconf == NULL || iph1->rmconf->dpd)) {
		iph1->dpd_support = 1;
		plog(LLV_DEBUG, LOCATION, NULL, "remote supports DPD\n");
	}
#endif

	return vid_numeric;
}
开发者ID:AdamMajer,项目名称:ipsec-tools,代码行数:37,代码来源:vendorid.c


示例4: while

/**
 * Load a CRL
 */
static x509crl_t *builder_load_crl(certificate_type_t type, va_list args)
{
	chunk_t blob = chunk_empty;
	x509crl_t *crl;

	while (TRUE)
	{
		switch (va_arg(args, builder_part_t))
		{
			case BUILD_BLOB_ASN1_DER:
				blob = va_arg(args, chunk_t);
				continue;
			case BUILD_END:
				break;
			default:
				return NULL;
		}
		break;
	}
	if (blob.ptr)
	{
		crl = malloc_thing(x509crl_t);
		crl->next = NULL;
		crl->distributionPoints = linked_list_create();
		crl->crl = lib->creds->create(lib->creds,
							  		  CRED_CERTIFICATE, CERT_X509_CRL,
							  		  BUILD_BLOB_ASN1_DER, blob,
							  		  BUILD_END);
		if (crl->crl)
		{
			return crl;
		}
		plog("  error in X.509 crl");
		free_crl(crl);
	}
	return NULL;
}
开发者ID:carriercomm,项目名称:vyatta-strongswan,代码行数:40,代码来源:builder.c


示例5: remove_am

/*
 * Remove am from its place in the mount tree
 */
static void
remove_am(am_node *mp)
{
  /*
   * 1.  Consistency check
   */
  if (mp->am_child && mp->am_parent) {
    plog(XLOG_WARNING, "children of \"%s\" still exist - deleting anyway", mp->am_path);
  }

  /*
   * 2.  Update parent's child pointer
   */
  if (mp->am_parent && mp->am_parent->am_child == mp)
    mp->am_parent->am_child = mp->am_osib;

  /*
   * 3.  Unlink from sibling chain
   */
  if (mp->am_ysib)
    mp->am_ysib->am_osib = mp->am_osib;
  if (mp->am_osib)
    mp->am_osib->am_ysib = mp->am_ysib;
}
开发者ID:marulkan,项目名称:am-utils-tcp-workaround,代码行数:27,代码来源:map.c


示例6: xdr_umntrequest

bool_t
xdr_umntrequest(XDR *xdrs, umntrequest *objp)
{
#ifdef DEBUG
  amuDebug(D_XDRTRACE)
    plog(XLOG_DEBUG, "xdr_umntrequest:");
#endif /* DEBUG */

  if (!xdr_int(xdrs, &objp->isdirect))
    return (FALSE);

  if (!xdr_u_int(xdrs, (u_int *) &objp->devid))
    return (FALSE);

#ifdef HAVE_UMNTREQUEST_RDEVID
  if (!xdr_u_long(xdrs, &objp->rdevid))
    return (FALSE);
#endif /* HAVE_UMNTREQUEST_RDEVID */

  if (!xdr_pointer(xdrs, (char **) &objp->next, sizeof(umntrequest), (XDRPROC_T_TYPE) xdr_umntrequest))
    return (FALSE);

  return (TRUE);
}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:24,代码来源:autofs_solaris_v1.c


示例7: plog

void CopyPhotosDialog::receivedPhotos_getInTarget(VKRequest *req)
{
    if((req->reqType!=VKRequest::Photos_get) ||
            (reqPhotosGetInTarget != req->reqId)){
        return;
    }
    reqPhotosGetInTarget = -1;
    plog(tr("Get target album photos description"));

    photosInTarget.clear();

    QDomDocument doc("Photos");
    doc.setContent(req->result);
    QDomElement docElem = doc.documentElement();
    QDomNodeList users = docElem.elementsByTagName ( "photo" );
    for(int i=0; i < users.count(); i++){
        QDomElement userElem = users.at(i).toElement();

        VKAlbumPhoto photo;

        photo.pid = userElem.elementsByTagName("pid").at(0).toElement().text();
        photo.aid = userElem.elementsByTagName("aid").at(0).toElement().text();
        photo.owner_id = userElem.elementsByTagName("owner_id").at(0).toElement().text();
        photo.src = userElem.elementsByTagName("src").at(0).toElement().text();
        photo.src_big = userElem.elementsByTagName("src_big").at(0).toElement().text();
        photo.src_small = userElem.elementsByTagName("src_small").at(0).toElement().text();
        photo.text = userElem.elementsByTagName("text").at(0).toElement().text();
        photo.src_xbig = userElem.elementsByTagName("src_xbig").at(0).toElement().text();
        photo.src_xxbig = userElem.elementsByTagName("src_xxbig").at(0).toElement().text();
        photo.cacheFileName = albumDir + photo.src_big.right(photo.src_big.length() - (photo.src_big.lastIndexOf("/")));

        photosInTarget.append( photo );
    }

    reqPhotosGet = m_vkEngine->reqPhotos_get(gidFrom, aidFrom);
}
开发者ID:PushoN,项目名称:vimka,代码行数:36,代码来源:copyphotosdialog.cpp


示例8: rc_addrpool_assign

/*
 * allocate a peer-specified address from pool
 * returns pointer to struct of address if successful
 * returns 0 if address already used or any error
 *
 * caller must do LIST_INSERT_HEAD(&child_sa->rcf_lease_list, i, link_sa);
 */
struct rcf_address *
rc_addrpool_assign(struct rcf_addresspool *conf, int af, uint8_t *addr)
{
	size_t	addrsize;
	struct rcf_address_pool_item	*i;
	struct rcf_address	*a;

	if (!conf) {
		plog(PLOG_INTERR, PLOGLOC, NULL,
		     "no address pool specified\n");
		return 0;
	}

	addrsize = af_addrsize(af);
	if (addrsize == 0)
		return 0;
	for (i = LIST_FIRST(&conf->pool_list); i != NULL; i = LIST_NEXT(i, link)) {
		if (af != i->af)
			continue;

		if (memcmp(addr, i->start, addrsize) < 0 ||
		    memcmp(addr, i->end, addrsize) > 0)
			continue;	/* out of range, try next */

		if (addrpool_check(i, addr) != 0)
			continue;

		a = rc_address_new(af, addr, IPV6_ADDRESS_PREFIX_LEN, 0,
				   &i->lease_list);
		if (!a)
			return 0;	/* allocation failed */
		return a;
	}

	return 0;
}
开发者ID:hmatyschok,项目名称:MeshBSD,代码行数:43,代码来源:addresspool.c


示例9: BitMapCheckEnd

int BitMapCheckEnd(void)
{
	if (gBitMapInited) {
#if _VBC_DEBUG_
		int maxdepth = 0;

		BMS_MaxDepth(gBMS_Root, 0, &maxdepth);
		plog("   %d full segments, %d segment nodes (max depth was %d nodes)\n",
		       gFullSegments, gSegmentNodes, maxdepth);
#endif
		free(gFullBitmapSegment);
		gFullBitmapSegment = NULL;

		free(gEmptyBitmapSegment);
		gEmptyBitmapSegment = NULL;

		bit_dealloc(gFullSegmentList);
		gFullSegmentList = NULL;

		BMS_DisposeTree();
		gBitMapInited = 0;
	}
	return (0);
}
开发者ID:Leon555,项目名称:Mac-src-essentials,代码行数:24,代码来源:VolumeBitmapCheck.c


示例10: rmdirs

/*
 * Remove as many directories in the path as possible.
 * Give up if the directory doesn't appear to have
 * been created by Amd (not mode dr-x) or an rmdir
 * fails for any reason.
 */
void
rmdirs(char *dir)
{
  char *xdp = xstrdup(dir);
  char *dp;

  do {
    struct stat stb;
    /*
     * Try to find out whether this was
     * created by amd.  Do this by checking
     * for owner write permission.
     */
    if (stat(xdp, &stb) == 0 && (stb.st_mode & 0200) == 0) {
      if (rmdir(xdp) < 0) {
	if (errno != ENOTEMPTY &&
	    errno != EBUSY &&
	    errno != EEXIST &&
	    errno != EROFS &&
	    errno != EINVAL)
	  plog(XLOG_ERROR, "rmdir(%s): %m", xdp);
	break;
      } else {
	dlog("rmdir(%s)", xdp);
      }
    } else {
      break;
    }

    dp = strrchr(xdp, '/');
    if (dp)
      *dp = '\0';
  } while (dp && dp > xdp);

  XFREE(xdp);
}
开发者ID:0mp,项目名称:freebsd,代码行数:42,代码来源:xutil.c


示例11: play_sound

/*
 * Play a sound of type "event".
 */
static void play_sound(int event)
{
	Mix_Chunk *wave = NULL;
	int s;

	/* Paranoia */
	if (event < 0 || event >= MSG_MAX) return;

	/* Check there are samples for this event */
	if (!samples[event].num) return;

	/* Choose a random event */
	s = rand_int(samples[event].num);
	wave = samples[event].wavs[s];

	/* Try loading it, if it's not cached */
	if (!wave)
	{
		/* Verify it exists */
		const char *filename = samples[event].paths[s];
		if (!file_exists(filename)) return;

		/* Load */
		wave = Mix_LoadWAV(filename);
	}

	/* Check to see if we have a wave again */
	if (!wave)
	{
		plog("SDL sound load failed.");
		return;
	}

	/* Actually play the thing */
	Mix_PlayChannel(-1, wave, 0);
}
开发者ID:NickMcConnell,项目名称:OangbandU,代码行数:39,代码来源:snd-sdl.c


示例12: mount_auto_node

/*
 * Mount a top level automount node
 * by calling lookup in the parent
 * (root) node which will cause the
 * automount node to be automounted.
 */
int
mount_auto_node(char *dir, opaque_t arg)
{
  int error = 0;
  am_node *mp = (am_node *) arg;
  am_node *new_mp;

  new_mp = mp->am_mnt->mf_ops->lookup_child(mp, dir, &error, VLOOK_CREATE);
  if (new_mp && error < 0) {
    /*
     * We can't allow the fileid of the root node to change.
     * Should be ok to force it to 1, always.
     */
    new_mp->am_gen = new_mp->am_fattr.na_fileid = 1;

    new_mp = mp->am_mnt->mf_ops->mount_child(new_mp, &error);
  }

  if (error > 0) {
    errno = error;		/* XXX */
    plog(XLOG_ERROR, "Could not mount %s: %m", dir);
  }
  return error;
}
开发者ID:marulkan,项目名称:am-utils-tcp-workaround,代码行数:30,代码来源:map.c


示例13: autofs_get_fh

int
autofs_get_fh(am_node *mp)
{
    autofs_fh_t *fh;
    char buf[MAXHOSTNAMELEN];
    mntfs *mf = mp->am_al->al_mnt;
    struct utsname utsname;

    plog(XLOG_DEBUG, "autofs_get_fh for %s", mp->am_path);
    fh = ALLOC(autofs_fh_t);
    memset((voidp) fh, 0, sizeof(autofs_fh_t)); /* Paranoid */

    /*
     * SET MOUNT ARGS
     */
    if (uname(&utsname) < 0) {
        xstrlcpy(buf, "localhost.autofs", sizeof(buf));
    } else {
        xstrlcpy(buf, utsname.nodename, sizeof(buf));
        xstrlcat(buf, ".autofs", sizeof(buf));
    }
#ifdef HAVE_AUTOFS_ARGS_T_ADDR
    fh->addr.buf = xstrdup(buf);
    fh->addr.len = fh->addr.maxlen = strlen(buf);
#endif /* HAVE_AUTOFS_ARGS_T_ADDR */

    fh->direct = (mf->mf_fsflags & FS_DIRECT) ? 1 : 0;
    fh->rpc_to = 1;		/* XXX: arbitrary */
    fh->mount_to = mp->am_timeo;
    fh->path = mp->am_path;
    fh->opts = "";		/* XXX: arbitrary */
    fh->map = mp->am_path;	/* this is what we get back in readdir */

    mp->am_autofs_fh = fh;
    return 0;
}
开发者ID:ryo,项目名称:netbsd-src,代码行数:36,代码来源:autofs_solaris_v1.c


示例14: mf_mounted

void
mf_mounted(mntfs *mf)
{
  int quoted;
  int wasmounted = mf->mf_flags & MFF_MOUNTED;

  if (!wasmounted) {
    /*
     * If this is a freshly mounted
     * filesystem then update the
     * mntfs structure...
     */
    mf->mf_flags |= MFF_MOUNTED;
    mf->mf_error = 0;

    /*
     * Do mounted callback
     */
    if (mf->mf_ops->mounted) {
      (*mf->mf_ops->mounted) (mf);
    }

    mf->mf_fo = 0;
  }

  /*
   * Log message
   */
  quoted = strchr(mf->mf_info, ' ') != 0;
  plog(XLOG_INFO, "%s%s%s %s fstype %s on %s",
       quoted ? "\"" : "",
       mf->mf_info,
       quoted ? "\"" : "",
       wasmounted ? "referenced" : "mounted",
       mf->mf_ops->fs_type, mf->mf_mount);
}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:36,代码来源:autil.c


示例15: SubmitCrashInfo

// If we can't resolve the symbols, we assume it's because we don't have symbols
// so we'll try to download them and retry. If we can resolve symbols, we'll
// get the callstacks etc. and submit to our server for analysis.
void SubmitCrashInfo()
{
    if (!dir::Create(gSymbolsDir)) {
        plog("SubmitCrashInfo(): couldn't create symbols dir");
        return;
    }

    lf("SubmitCrashInfo(): start");
    lf(L"SubmitCrashInfo(): gSymbolPathW: '%s'", gSymbolPathW);
    if (!CrashHandlerCanUseNet()) {
        plog("SubmitCrashInfo(): internet access not allowed");
        return;
    }

    char *s = NULL;
    if (!dbghelp::Initialize(gSymbolPathW)) {
        plog("SubmitCrashInfo(): dbghelp::Initialize() failed");
        return;
    }

    if (!dbghelp::HasSymbols()) {
        if (!DownloadAndUnzipSymbols(gPdbZipPath, gSymbolsDir)) {
            plog("SubmitCrashInfo(): failed to download symbols");
            return;
        }

        if (!dbghelp::Initialize(gSymbolPathW, true)) {
            plog("SubmitCrashInfo(): second dbghelp::Initialize() failed");
            return;
        }
    }

    if (!dbghelp::HasSymbols()) {
        plog("SubmitCrashInfo(): HasSymbols() false after downloading symbols");
        return;
    }

    s = BuildCrashInfoText();
    if (!s)
        return;
    SendCrashInfo(s);
    gCrashHandlerAllocator->Free(s);
}
开发者ID:DavidWiberg,项目名称:sumatrapdf,代码行数:46,代码来源:CrashHandler.cpp


示例16: showConfig

void showConfig(Config config)
{
	LogLevel logLevel = initLoggerLevel();
	char *msg;
	plog("==== DISPLAY SIMEON CONFIG ==== \n", logLevel.INFO);
	msg= calloc(64, sizeof(char));
	sprintf(msg, "DEFAULT_PORT = %d\n", config.DEFAULT_PORT);
	plog(msg, logLevel.INFO);
	memset(msg, 0, 64);
	
	sprintf(msg, "VERBOSE = %d\n", config.VERBOSE);
	plog(msg, logLevel.INFO);
	memset(msg, 0, 64);

	sprintf(msg, "CONTROL_PORT = %d\n", config.CONTROL_PORT);
	plog(msg, logLevel.INFO);
	memset(msg, 0, 64);

	sprintf(msg, "LOGS_PATH = %s\n", config.LOGS_PATH);
	plog(msg, logLevel.INFO);
	memset(msg, 0, 64);
	plog("=============================== \n", 0);
	free(msg);
}
开发者ID:MatthieuHeurtin,项目名称:Simeon-,代码行数:24,代码来源:configManager.c


示例17: gssapi_get_itoken

int
gssapi_get_itoken(struct ph1handle *iph1, int *lenp)
{
	struct gssapi_ph1_state *gps;
	gss_buffer_desc empty, name_token;
	gss_buffer_t itoken, rtoken, dummy;
	OM_uint32 maj_stat, min_stat;
	gss_name_t partner;

	if (gssapi_get_state(iph1) == NULL && gssapi_init(iph1) < 0)
		return -1;

	gps = gssapi_get_state(iph1);

	empty.length = 0;
	empty.value = NULL;
	dummy = &empty;

	if (iph1->approval != NULL && iph1->approval->gssid != NULL) {
		plog(LLV_DEBUG, LOCATION, NULL,
		    "using provided service '%.*s'\n",
		    iph1->approval->gssid->l, iph1->approval->gssid->v);
		name_token.length = iph1->approval->gssid->l;
		name_token.value = iph1->approval->gssid->v;
		maj_stat = gss_import_name(&min_stat, &name_token,
		    GSS_C_NO_OID, &partner);
		if (GSS_ERROR(maj_stat)) {
			gssapi_error(min_stat, LOCATION, "import of %.*s\n",
			    name_token.length, name_token.value);
			return -1;
		}
	} else
		if (gssapi_get_default_name(iph1, 1, &partner) < 0)
			return -1;

	rtoken = gps->gsscnt_p == 0 ? dummy : &gps->gss_p[gps->gsscnt_p - 1];
	itoken = &gps->gss[gps->gsscnt];

	gps->gss_status = gss_init_sec_context(&min_stat, gps->gss_cred,
	    &gps->gss_context, partner, GSS_C_NO_OID,
	    GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG |
		GSS_C_CONF_FLAG | GSS_C_INTEG_FLAG,
	    0, GSS_C_NO_CHANNEL_BINDINGS, rtoken, NULL,
	    itoken, NULL, NULL);

	if (GSS_ERROR(gps->gss_status)) {
		gssapi_error(min_stat, LOCATION, "init_sec_context\n");
		maj_stat = gss_release_name(&min_stat, &partner);
		if (GSS_ERROR(maj_stat))
			gssapi_error(min_stat, LOCATION, "release name\n");
		return -1;
	}
	maj_stat = gss_release_name(&min_stat, &partner);
	if (GSS_ERROR(maj_stat))
		gssapi_error(min_stat, LOCATION, "release name\n");

	plog(LLV_DEBUG, LOCATION, NULL, "gss_init_sec_context status %x\n",
	    gps->gss_status);

	if (lenp)
		*lenp = itoken->length;

	if (itoken->length != 0)
		gps->gsscnt++;

	return 0;
}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:67,代码来源:gssapi.c


示例18: gssapi_get_id

vchar_t *
gssapi_get_id(struct ph1handle *iph1)
{
	gss_buffer_desc id_buffer;
	gss_buffer_t id = &id_buffer;
	gss_name_t defname, canon_name;
	OM_uint32 min_stat, maj_stat;
	vchar_t *vmbuf;

	if (iph1->rmconf->proposal->gssid != NULL)
		return (vdup(iph1->rmconf->proposal->gssid));

	if (gssapi_get_default_name(iph1, 0, &defname) < 0)
		return NULL;

	maj_stat = gss_canonicalize_name(&min_stat, defname, GSS_C_NO_OID,
	    &canon_name);
	if (GSS_ERROR(maj_stat)) {
		gssapi_error(min_stat, LOCATION, "canonicalize name\n");
		maj_stat = gss_release_name(&min_stat, &defname);
		if (GSS_ERROR(maj_stat))
			gssapi_error(min_stat, LOCATION,
			    "release default name\n");
		return NULL;
	}
	maj_stat = gss_release_name(&min_stat, &defname);
	if (GSS_ERROR(maj_stat))
		gssapi_error(min_stat, LOCATION, "release default name\n");

	maj_stat = gss_export_name(&min_stat, canon_name, id);
	if (GSS_ERROR(maj_stat)) {
		gssapi_error(min_stat, LOCATION, "export name\n");
		maj_stat = gss_release_name(&min_stat, &canon_name);
		if (GSS_ERROR(maj_stat))
			gssapi_error(min_stat, LOCATION,
			    "release canonical name\n");
		return NULL;
	}
	maj_stat = gss_release_name(&min_stat, &canon_name);
	if (GSS_ERROR(maj_stat))
		gssapi_error(min_stat, LOCATION, "release canonical name\n");

#if 0
	/*
	 * XXXJRT Did this debug message ever work?  This is a GSS name
	 * blob at this point.
	 */
	plog(LLV_DEBUG, LOCATION, NULL, "will try to acquire '%.*s' creds\n",
	    id->length, id->value);
#endif

	if (gssapi_gss2vmbuf(id, &vmbuf) < 0) {
		plog(LLV_ERROR, LOCATION, NULL, "gss2vmbuf failed\n");
		maj_stat = gss_release_buffer(&min_stat, id);
		if (GSS_ERROR(maj_stat))
			gssapi_error(min_stat, LOCATION, "release id buffer\n");
		return NULL;
	}
	maj_stat = gss_release_buffer(&min_stat, id);
	if (GSS_ERROR(maj_stat))
		gssapi_error(min_stat, LOCATION, "release id buffer\n");

	return vmbuf;
}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:64,代码来源:gssapi.c


示例19: load_conn

/*
 * parse a conn section
 */
static void load_conn(starter_conn_t *conn, kw_list_t *kw, starter_config_t *cfg)
{
	char *conn_name = (conn->name == NULL)? "%default":conn->name;

	for ( ; kw; kw = kw->next)
	{
		bool assigned = FALSE;

		kw_token_t token = kw->entry->token;

		if (token >= KW_LEFT_FIRST && token <= KW_LEFT_LAST)
		{
			kw_end(conn, &conn->left, token - KW_LEFT_FIRST + KW_END_FIRST
				,  kw, conn_name, cfg);
			continue;
		}
		else if (token >= KW_RIGHT_FIRST && token <= KW_RIGHT_LAST)
		{
			kw_end(conn, &conn->right, token - KW_RIGHT_FIRST + KW_END_FIRST
				 , kw, conn_name, cfg);
			continue;
		}

		if (token == KW_AUTO)
		{
			token = KW_CONN_SETUP;
		}
		else if (token == KW_ALSO)
		{
			if (cfg->parse_also)
			{
				also_t *also = malloc_thing(also_t);

				also->name = clone_str(kw->value);
				also->next = conn->also;
				conn->also = also;

				DBG(DBG_CONTROL,
					DBG_log("  also=%s", kw->value)
				)
			}
			continue;
		}

		if (token < KW_CONN_FIRST || token > KW_CONN_LAST)
		{
			plog("# unsupported keyword '%s' in conn '%s'"
				, kw->entry->name, conn_name);
			cfg->err++;
			continue;
		}

		if (!assign_arg(token, KW_CONN_FIRST, kw, (char *)conn, &assigned))
		{
			plog("  bad argument value in conn '%s'", conn_name);
			cfg->err++;
			continue;
		}

		if (assigned)
			continue;

		switch (token)
		{
		case KW_TYPE:
			conn->policy &= ~(POLICY_TUNNEL | POLICY_SHUNT_MASK);
			if (streq(kw->value, "tunnel"))
			{
				conn->policy |= POLICY_TUNNEL;
			}
			else if (streq(kw->value, "beet"))
			{
				conn->policy |= POLICY_BEET;
			}
			else if (streq(kw->value, "transport_proxy"))
			{
				conn->policy |= POLICY_PROXY;
			}
			else if (streq(kw->value, "passthrough") || streq(kw->value, "pass"))
			{
				conn->policy |= POLICY_SHUNT_PASS;
			}
			else if (streq(kw->value, "drop"))
			{
				conn->policy |= POLICY_SHUNT_DROP;
			}
			else if (streq(kw->value, "reject"))
			{
				conn->policy |= POLICY_SHUNT_REJECT;
			}
			else if (strcmp(kw->value, "transport") != 0)
			{
				plog("# bad policy value: %s=%s", kw->entry->name, kw->value);
				cfg->err++;
			}
			break;
		case KW_PFS:
//.........这里部分代码省略.........
开发者ID:ramarnat,项目名称:astaro-strongswan,代码行数:101,代码来源:confread.c


示例20: gssapi_init

static int
gssapi_init(struct ph1handle *iph1)
{
	struct gssapi_ph1_state *gps;
	gss_buffer_desc id_token, cred_token;
	gss_buffer_t cred = &cred_token;
	gss_name_t princ, canon_princ;
	OM_uint32 maj_stat, min_stat;

	gps = racoon_calloc(1, sizeof (struct gssapi_ph1_state));
	if (gps == NULL) {
		plog(LLV_ERROR, LOCATION, NULL, "racoon_calloc failed\n");
		return -1;
	}
	gps->gss_context = GSS_C_NO_CONTEXT;
	gps->gss_cred = GSS_C_NO_CREDENTIAL;

	gssapi_set_state(iph1, gps);

	if (iph1->rmconf->proposal->gssid != NULL) {
		id_token.length = iph1->rmconf->proposal->gssid->l;
		id_token.value = iph1->rmconf->proposal->gssid->v;
		maj_stat = gss_import_name(&min_stat, &id_token, GSS_C_NO_OID,
		    &princ);
		if (GSS_ERROR(maj_stat)) {
			gssapi_error(min_stat, LOCATION, "import name\n");
			gssapi_free_state(iph1);
			return -1;
		}
	} else
		gssapi_get_default_name(iph1, 0, &princ);

	maj_stat = gss_canonicalize_name(&min_stat, princ, GSS_C_NO_OID,
	    &canon_princ);
	if (GSS_ERROR(maj_stat)) {
		gssapi_error(min_stat, LOCATION, "canonicalize name\n");
		maj_stat = gss_release_name(&min_stat, &princ);
		if (GSS_ERROR(maj_stat))
			gssapi_error(min_stat, LOCATION, "release princ\n");
		gssapi_free_state(iph1);
		return -1;
	}
	maj_stat = gss_release_name(&min_stat, &princ);
	if (GSS_ERROR(maj_stat))
		gssapi_error(min_stat, LOCATION, "release princ\n");

	maj_stat = gss_export_name(&min_stat, canon_princ, cred);
	if (GSS_ERROR(maj_stat)) {
		gssapi_error(min_stat, LOCATION, "export name\n");
		maj_stat = gss_release_name(&min_stat, &canon_princ);
		if (GSS_ERROR(maj_stat))
			gssapi_error(min_stat, LOCATION,
			    "release canon_princ\n");
		gssapi_free_state(iph1);
		return -1;
	}

#if 0
	/*
	 * XXXJRT Did this debug message ever work?  This is a GSS name
	 * blob at this point.
	 */
	plog(LLV_DEBUG, LOCATION, NULL, "will try to acquire '%.*s' creds\n",
	    cred->length, cred->value);
#endif

	maj_stat = gss_release_buffer(&min_stat, cred);
	if (GSS_ERROR(maj_stat))
		gssapi_error(min_stat, LOCATION, "release cred buffer\n");

	maj_stat = gss_acquire_cred(&min_stat, canon_princ, GSS_C_INDEFINITE,
	    GSS_C_NO_OID_SET, GSS_C_BOTH, &gps->gss_cred, NULL, NULL);
	if (GSS_ERROR(maj_stat)) {
		gssapi_error(min_stat, LOCATION, "acquire cred\n");
		maj_stat = gss_release_name(&min_stat, &canon_princ);
		if (GSS_ERROR(maj_stat))
			gssapi_error(min_stat, LOCATION,
			    "release canon_princ\n");
		gssapi_free_state(iph1);
		return -1;
	}
	maj_stat = gss_release_name(&min_stat, &canon_princ);
	if (GSS_ERROR(maj_stat))
		gssapi_error(min_stat, LOCATION, "release canon_princ\n");

	return 0;
}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:87,代码来源:gssapi.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ plogf函数代码示例发布时间:2022-05-30
下一篇:
C++ plist_new_string函数代码示例发布时间: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