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

C++ pv_get_null函数代码示例

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

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



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

示例1: pv_get_ht_cell_expire

int pv_get_ht_cell_expire(struct sip_msg *msg,  pv_param_t *param,
		pv_value_t *res)
{
	str htname;
	ht_pv_t *hpv;
	unsigned int now;

	hpv = (ht_pv_t*)param->pvn.u.dname;

	if(hpv->ht==NULL)
	{
		hpv->ht = ht_get_table(&hpv->htname);
		if(hpv->ht==NULL)
			return pv_get_null(msg, param, res);
	}
	if(pv_printf_s(msg, hpv->pve, &htname)!=0)
	{
		LM_ERR("cannot get $ht name\n");
		return -1;
	}
	if(ht_get_cell_expire(hpv->ht, &htname, &now)!=0)
		return pv_get_null(msg, param, res);
	/* integer */
	return pv_get_uintval(msg, param, res, now);
}
开发者ID:AndreyRybkin,项目名称:kamailio,代码行数:25,代码来源:ht_var.c


示例2: pv_comp

static int pv_comp(sip_msg_t* msg, pv_param_t* param, pv_value_t* res)
{
    int ind_local, local = 0, issuer = 0, nid = NID_commonName;

    /* copy callback value as we modify it */
    ind_local = param->pvn.u.isname.name.n;
    DBG("ind_local = %x", ind_local);

    if (ind_local & PV_CERT_PEER) {
        local = 0;
        ind_local = ind_local ^ PV_CERT_PEER;
    } else if (ind_local & PV_CERT_LOCAL) {
        local = 1;
        ind_local = ind_local ^ PV_CERT_LOCAL;
    } else {
        BUG("could not determine certificate\n");
        return pv_get_null(msg, param, res);
    }

    if (ind_local & PV_CERT_SUBJECT) {
        issuer = 0;
        ind_local = ind_local ^ PV_CERT_SUBJECT;
    } else if (ind_local & PV_CERT_ISSUER) {
        issuer = 1;
        ind_local = ind_local ^ PV_CERT_ISSUER;
    } else {
        BUG("could not determine subject or issuer\n");
        return pv_get_null(msg, param, res);
    }

    switch(ind_local) {
    case PV_COMP_CN:
        nid = NID_commonName;
        break;
    case PV_COMP_O:
        nid = NID_organizationName;
        break;
    case PV_COMP_OU:
        nid = NID_organizationalUnitName;
        break;
    case PV_COMP_C:
        nid = NID_countryName;
        break;
    case PV_COMP_ST:
        nid = NID_stateOrProvinceName;
        break;
    case PV_COMP_L:
        nid = NID_localityName;
        break;
    default:
        nid = NID_undef;
    }

    if (get_comp(&res->rs, local, issuer, nid, msg) < 0) {
        return pv_get_null(msg, param, res);
    }

    res->flags = PV_VAL_STR;
    return 0;
}
开发者ID:kamailio,项目名称:kamailio,代码行数:60,代码来源:tls_select.c


示例3: tlsops_sn

int tlsops_sn(struct sip_msg *msg, pv_param_t *param,
		pv_value_t *res)
{
	static char buf[INT2STR_MAX_LEN];
	X509* cert;
	struct tcp_connection* c;
	int my, serial;
	char* sn;

	if (param->pvn.u.isname.name.n & CERT_PEER) {
		my = 0;
	} else if (param->pvn.u.isname.name.n & CERT_LOCAL) {
		my = 1;
	} else {
		LM_CRIT("could not determine certificate\n");
		return pv_get_null(msg, param, res);
	}
	
	if (get_cert(&cert, &c, msg, my) < 0)
		return pv_get_null(msg, param, res);
	
	serial = ASN1_INTEGER_get(X509_get_serialNumber(cert));
	sn = int2str( serial, &res->rs.len);
	memcpy(buf, sn, res->rs.len);
	res->rs.s = buf;
	res->ri = serial;
	res->flags = PV_VAL_STR | PV_VAL_INT;	
	
	if (!my) X509_free(cert);
	tcpconn_put(c);
	return 0;
}
开发者ID:Drooids,项目名称:openser-xmlrpc,代码行数:32,代码来源:tls_select.c


示例4: pv_get_sdp

static int pv_get_sdp(sip_msg_t *msg, pv_param_t *param,
		pv_value_t *res)
{
	sdp_info_t *sdp = NULL;

	if(msg==NULL || param==NULL)
		return -1;

	if(parse_sdp(msg) < 0) {
		LM_INFO("Unable to parse sdp\n");
		return pv_get_null(msg, param, res);
	}
	sdp = (sdp_info_t*)msg->body;

	if (sdp==NULL) {
		LM_DBG("No SDP\n");
		return pv_get_null(msg, param, res);
	}

	switch(param->pvn.u.isname.name.n)
	{
		case 0:
			return pv_get_strval(msg, param, res, &sdp->raw_sdp);
		default:
			return pv_get_null(msg, param, res);
	}
}
开发者ID:barchandune,项目名称:kamailio,代码行数:27,代码来源:sdpops_mod.c


示例5: pv_get_from_tag_initial

static int pv_get_from_tag_initial(sip_msg_t *msg, pv_param_t *param,
		pv_value_t *res)
{
	struct to_body *xto;
	if(msg==NULL)
		return -1;

	if(parse_from_header(msg)<0) {
		LM_ERR("cannot parse From header\n");
		return pv_get_null(msg, param, res);
	}
	if(msg->from==NULL || get_from(msg)==NULL) {
		LM_DBG("no From header\n");
		return pv_get_null(msg, param, res);
	}
	xto = get_from(msg);

	if(is_direction(msg, RR_FLOW_UPSTREAM)==0) {
		if(msg->to==NULL && parse_headers(msg, HDR_TO_F, 0)==-1) {
			LM_ERR("cannot parse To header\n");
			return pv_get_null(msg, param, res);
		}
		if(msg->to==NULL || get_to(msg)==NULL) {
			LM_DBG("no To header\n");
			return pv_get_null(msg, param, res);
		}
		xto = get_to(msg);
	}

	if (xto->tag_value.s==NULL || xto->tag_value.len<=0) {
		LM_DBG("no Tag parameter\n");
		return pv_get_null(msg, param, res);
	}
	return pv_get_strval(msg, param, res, &xto->tag_value);
}
开发者ID:apogrebennyk,项目名称:kamailio,代码行数:35,代码来源:rr_mod.c


示例6: pv_get_mongodb

static int pv_get_mongodb(struct sip_msg *msg,  pv_param_t *param,
		pv_value_t *res)
{
	mongodbc_pv_t *rpv;

	rpv = (mongodbc_pv_t*)param->pvn.u.dname;
	if(rpv->reply==NULL)
	{
		rpv->reply = mongodbc_get_reply(&rpv->rname);
		if(rpv->reply==NULL)
			return pv_get_null(msg, param, res);
	}


	switch(rpv->rkeyid) {
		case 1:
			/* value */
			if(rpv->reply->jsonrpl.s==NULL)
				return pv_get_null(msg, param, res);
			return pv_get_strval(msg, param, res, &rpv->reply->jsonrpl);
		case 2:
			/* info */
			return pv_get_null(msg, param, res);
		case 3:
			/* size */
			return pv_get_null(msg, param, res);
		case 0:
			/* type */
			return pv_get_sintval(msg, param, res, 0);
		default:
			/* We do nothing. */
			return pv_get_null(msg, param, res);
	}
}
开发者ID:4N7HR4X,项目名称:kamailio,代码行数:34,代码来源:ndb_mongodb_mod.c


示例7: pv_alt

static int pv_alt(sip_msg_t* msg, pv_param_t* param, pv_value_t* res)
{
	int ind_local, local = 0, type = GEN_URI;
	
	ind_local = param->pvn.u.isname.name.n;

	if (ind_local & PV_CERT_PEER) {
		local = 0;
		ind_local = ind_local ^ PV_CERT_PEER;
	} else if (ind_local & PV_CERT_LOCAL) {
		local = 1;
		ind_local = ind_local ^ PV_CERT_LOCAL;
	} else {
		BUG("could not determine certificate\n");
		return pv_get_null(msg, param, res);
	}

	switch(ind_local) {
		case PV_COMP_E:    type = GEN_EMAIL; break;
		case PV_COMP_HOST: type = GEN_DNS;   break;
		case PV_COMP_URI:  type = GEN_URI;   break;
		case PV_COMP_IP:   type = GEN_IPADD; break;
		default:
			BUG("ind_local=%d\n", ind_local);
			return pv_get_null(msg, param, res);
	}

	if (get_alt(&res->rs, local, type, msg) < 0) {
		return pv_get_null(msg, param, res);
	}
	
	res->flags = PV_VAL_STR;
	return 0;
}
开发者ID:alezzandro,项目名称:kamailio,代码行数:34,代码来源:tls_select.c


示例8: pv_check_cert

static int pv_check_cert(sip_msg_t* msg, pv_param_t* param, pv_value_t* res)
{
    int err;

    switch (param->pvn.u.isname.name.n) {
    case PV_CERT_VERIFIED:
        err = X509_V_OK;
        break;
    case PV_CERT_REVOKED:
        err = X509_V_ERR_CERT_REVOKED;
        break;
    case PV_CERT_EXPIRED:
        err = X509_V_ERR_CERT_HAS_EXPIRED;
        break;
    case PV_CERT_SELFSIGNED:
        err = X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT;
        break;
    default:
        BUG("unexpected parameter value \"%d\"\n", param->pvn.u.isname.name.n);
        return pv_get_null(msg, param, res);
    }


    if (check_cert(&res->rs, &res->ri, 0, err, msg) < 0) {
        return pv_get_null(msg, param, res);
    }

    res->flags = PV_VAL_STR | PV_VAL_INT;
    return 0;
}
开发者ID:kamailio,项目名称:kamailio,代码行数:30,代码来源:tls_select.c


示例9: pv_get_json

int pv_get_json (struct sip_msg* msg,  pv_param_t* pvp, pv_value_t* val)
{

	pv_json_t * var ;
	json_t * obj;
	json_name * id = (json_name *) pvp->pvn.u.dname;
	UNUSED(id);


	if( expand_tag_list( msg, ((json_name *)pvp->pvn.u.dname)->tags ) < 0)
	{
		LM_ERR("Cannot expand variables in path\n");
		return pv_get_null( msg, pvp, val);
	}


	var = get_pv_json(pvp);

	if( var == NULL )
	{
		/* this is not an error - we simply came across a json spec
		 * pointing a json var which was never set/init */
		LM_DBG("Variable named:%.*s not found\n",id->name.len,id->name.s);
		return pv_get_null( msg, pvp, val);
	}

	obj = get_object(var, pvp, NULL, 0);
	memset(val, 0, sizeof(pv_value_t));

	if( obj == NULL )
		return pv_get_null( msg, pvp, val);

	if( json_object_is_type(obj, json_type_int) )
	{
		val->rs.s = sint2str(json_object_get_int(obj), &val->rs.len);
		val->ri = json_object_get_int(obj);;
		val->flags |= PV_VAL_INT|PV_TYPE_INT|PV_VAL_STR;

	}
	else if( json_object_is_type(obj, json_type_string))
	{
		val->flags = PV_VAL_STR;
		val->rs.s = (char*)json_object_get_string( obj );
#if JSON_LIB_VERSION >= 10
		val->rs.len = json_object_get_string_len( obj );
#else
		val->rs.len = strlen(val->rs.s);
#endif
	} else {
		val->flags = PV_VAL_STR;
		val->rs.s = (char*)json_object_to_json_string( obj );
		val->rs.len = strlen(val->rs.s);
	}

	return 0;
}
开发者ID:ZRouter,项目名称:ZRouter,代码行数:56,代码来源:json.c


示例10: pv_get_nh

int pv_get_nh(struct sip_msg *msg, pv_param_t *param,
		pv_value_t *res)
{
	struct sip_uri parsed_uri;
	str uri;

	if(msg==NULL || res==NULL)
		return -1;

	if(msg->first_line.type == SIP_REPLY)	/* REPLY doesnt have r/d-uri */
		return pv_get_null(msg, param, res);

    if (msg->dst_uri.s != NULL && msg->dst_uri.len>0)
	{
		uri = msg->dst_uri;
	} else {
		if (msg->new_uri.s!=NULL && msg->new_uri.len>0)
		{
			uri = msg->new_uri;
		} else {
			uri = msg->first_line.u.request.uri;
		}
	}
	if(param->pvn.u.isname.name.n==0) /* uri */
	{
		return pv_get_strval(msg, param, res, &uri);
	}
	if(parse_uri(uri.s, uri.len, &parsed_uri)!=0)
	{
		LM_ERR("failed to parse nh uri [%.*s]\n", uri.len, uri.s);
		return pv_get_null(msg, param, res);
	}
	if(param->pvn.u.isname.name.n==1) /* username */
	{
		if(parsed_uri.user.s==NULL || parsed_uri.user.len<=0)
			return pv_get_null(msg, param, res);
		return pv_get_strval(msg, param, res, &parsed_uri.user);
	} else if(param->pvn.u.isname.name.n==2) /* domain */ {
		if(parsed_uri.host.s==NULL || parsed_uri.host.len<=0)
			return pv_get_null(msg, param, res);
		return pv_get_strval(msg, param, res, &parsed_uri.host);
	} else if(param->pvn.u.isname.name.n==3) /* port */ {
		if(parsed_uri.port.s==NULL)
			return pv_get_5060(msg, param, res);
		return pv_get_strintval(msg, param, res, &parsed_uri.port,
				(int)parsed_uri.port_no);
	} else if(param->pvn.u.isname.name.n==4) /* protocol */ {
		if(parsed_uri.transport_val.s==NULL)
			return pv_get_udp(msg, param, res);
		return pv_get_strintval(msg, param, res, &parsed_uri.transport_val,
				(int)parsed_uri.proto);
	}
	LM_ERR("unknown specifier\n");
	return pv_get_null(msg, param, res);
}
开发者ID:GreenfieldTech,项目名称:kamailio,代码行数:55,代码来源:pv_branch.c


示例11: pv_get_t

int pv_get_t(struct sip_msg *msg,  pv_param_t *param,
		pv_value_t *res)
{
	tm_cell_t *t;

	if(msg==NULL || param==NULL)
		return -1;

	/* aliases to old TM pvs */
	switch(param->pvn.u.isname.name.n)
	{
		case 2:
			return pv_get_tm_reply_code(msg, param, res);
		case 4:
			return pv_get_tm_branch_idx(msg, param, res);
	}

	t = _tmx_tmb.t_gett();
	if(t==NULL || t==T_UNDEFINED) {
		/* no T */
		if(param->pvn.u.isname.name.n==8 || param->pvn.u.isname.name.n==9) {
			/* id_label_n or id_index_n - attempt to create transaction */
			if(_tmx_tmb.t_newtran(msg)<0) {
				LM_ERR("cannot create the transaction\n");
				return pv_get_null(msg, param, res);
			}
			t = _tmx_tmb.t_gett();
			if (t==NULL || t==T_UNDEFINED) {
				return pv_get_null(msg, param, res);
			}
		} else {
			return pv_get_null(msg, param, res);
		}
	}
	switch(param->pvn.u.isname.name.n)
	{
		case 1:
			return pv_get_uintval(msg, param, res, t->hash_index);
		case 3:
			if(get_route_type()==FAILURE_ROUTE) {
				if(_tmx_tmb.t_get_picked_branch()<0 )
					return pv_get_uintval(msg, param, res, 0);
				if(t->uac[_tmx_tmb.t_get_picked_branch()].reply==FAKED_REPLY)
					return pv_get_uintval(msg, param, res, 1);
			}
			return pv_get_uintval(msg, param, res, 0);
		case 8:
			return pv_get_uintval(msg, param, res, t->label);
		case 9:
			return pv_get_uintval(msg, param, res, t->hash_index);
		default:
			return pv_get_uintval(msg, param, res, t->label);
	}
}
开发者ID:adubovikov,项目名称:kamailio,代码行数:54,代码来源:t_var.c


示例12: pv_get_evr

static int pv_get_evr(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
{
	if(param==NULL || pv_evr_data==NULL) {
		return pv_get_null(msg, param, res);
	}

	switch(param->pvn.u.isname.name.n) {
		case 0: /* data */
			return pv_get_strval(msg, param, res, pv_evr_data);
		default:
			return pv_get_null(msg, param, res);
	}
}
开发者ID:adubovikov,项目名称:kamailio,代码行数:13,代码来源:evrexec_mod.c


示例13: pv_get_t_var_inv

int pv_get_t_var_inv(struct sip_msg *msg,  pv_param_t *param,
		pv_value_t *res)
{
	pv_spec_t *pv=NULL;

	if(pv_t_update_inv(msg))
		return pv_get_null(msg, param, res);

	pv = (pv_spec_t*)param->pvn.u.dname;
	if(pv==NULL || pv_alter_context(pv))
		return pv_get_null(msg, param, res);

	return pv_get_spec_value(&_pv_tinv.msg, pv, res);
}
开发者ID:adubovikov,项目名称:kamailio,代码行数:14,代码来源:t_var.c


示例14: pv_get_shvar

int pv_get_shvar(struct sip_msg *msg,  pv_param_t *param,
		pv_value_t *res)
{
	int len = 0;
	char *sval = NULL;
	sh_var_t *shv=NULL;

	if(msg==NULL || res==NULL)
		return -1;

	if(param==NULL || param->pvn.u.dname==0)
		return pv_get_null(msg, param, res);

	shv= (sh_var_t*)param->pvn.u.dname;

	lock_shvar(shv);
	if(shv->v.flags&VAR_VAL_STR)
	{
		if(param->pvv.s==NULL || param->pvv.len < shv->v.value.s.len)
		{
			if(param->pvv.s!=NULL)
				pkg_free(param->pvv.s);
			param->pvv.s = (char*)pkg_malloc(shv->v.value.s.len*sizeof(char));
			if(param->pvv.s==NULL)
			{
				unlock_shvar(shv);
				LM_ERR("no more pkg mem\n");
				return pv_get_null(msg, param, res);
			}
		}
		strncpy(param->pvv.s, shv->v.value.s.s, shv->v.value.s.len);
		param->pvv.len = shv->v.value.s.len;

		unlock_shvar(shv);

		res->rs = param->pvv;
		res->flags = PV_VAL_STR;
	} else {
		res->ri = shv->v.value.n;

		unlock_shvar(shv);

		sval = sint2str(res->ri, &len);
		res->rs.s = sval;
		res->rs.len = len;
		res->flags = PV_VAL_STR|PV_VAL_INT|PV_TYPE_INT;
	}
	return 0;
}
开发者ID:GeorgeShaw,项目名称:opensips,代码行数:49,代码来源:shvar.c


示例15: pv_tlsext_sn

static int pv_tlsext_sn(sip_msg_t* msg, pv_param_t* param, pv_value_t* res)
{
	if (param->pvn.u.isname.name.n != PV_TLSEXT_SNI) {
		BUG("unexpected parameter value \"%d\"\n",
			param->pvn.u.isname.name.n);
		return pv_get_null(msg, param, res);
	}
	
	if (get_tlsext_sn(&res->rs, msg) < 0) {
		return pv_get_null(msg, param, res);
	}
	
	res->flags = PV_VAL_STR;
	return 0;
}
开发者ID:alezzandro,项目名称:kamailio,代码行数:15,代码来源:tls_select.c


示例16: tlsops_check_cert

/*
 * Check whether peer certificate exists and verify the result
 * of certificate verification
 */
int tlsops_check_cert(struct sip_msg *msg, pv_param_t *param,
		pv_value_t *res)
{
	static str succ = str_init("1");
	static str fail = str_init("0");

	int err;
	struct tcp_connection* c;
	SSL* ssl;
	X509* cert = 0;

	switch (param->pvn.u.isname.name.n) {
	case CERT_VERIFIED:   err = X509_V_OK;                              break;
	case CERT_REVOKED:    err = X509_V_ERR_CERT_REVOKED;                break;
	case CERT_EXPIRED:    err = X509_V_ERR_CERT_HAS_EXPIRED;            break;
	case CERT_SELFSIGNED: err = X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT; break;
	default:
		LM_CRIT("unexpected parameter value \"%d\"\n",
				param->pvn.u.isname.name.n);
		return pv_get_null(msg, param, res);
	}   

	c = get_cur_connection(msg);
	if (!c) return -1;

	ssl = get_ssl(c);
	if (!ssl) goto err;

	if ((cert = SSL_get_peer_certificate(ssl)) && SSL_get_verify_result(ssl) == err) {
		res->rs.s = succ.s;
		res->rs.len = succ.len;
		res->ri   = 1;
	} else {
		res->rs.s = fail.s;
		res->rs.len = fail.len;
		res->ri   = 0;
	}
	res->flags = PV_VAL_STR | PV_VAL_INT;

	if (cert) X509_free(cert);
	tcpconn_put(c);

	return 0;
err:
	if (cert) X509_free(cert);
	if (c) tcpconn_put(c);
	return pv_get_null(msg, param, res);
}
开发者ID:Drooids,项目名称:openser-xmlrpc,代码行数:52,代码来源:tls_select.c


示例17: tlsops_cipher

int tlsops_cipher(struct sip_msg *msg, pv_param_t *param,
		pv_value_t *res)
{
	str cipher;
	static char buf[1024];

	struct tcp_connection* c;
	SSL* ssl;

	c = get_cur_connection(msg);
	if (!c) {
		LM_INFO("TLS connection not found in select_cipher\n");
		goto err;
	}
	ssl = get_ssl(c);
	if (!ssl) goto err;

	cipher.s = (char*)SSL_CIPHER_get_name(SSL_get_current_cipher(ssl));
	cipher.len = cipher.s ? strlen(cipher.s) : 0;
	if (cipher.len >= 1024) {
		LM_ERR("cipher name too long\n");
		goto err;
	}
	memcpy(buf, cipher.s, cipher.len);
	res->rs.s = buf;
	res->rs.len = cipher.len;
	res->flags = PV_VAL_STR;
	tcpconn_put(c);

	return 0;
err:
	if (c) tcpconn_put(c);
	return pv_get_null(msg, param, res);
}
开发者ID:Drooids,项目名称:openser-xmlrpc,代码行数:34,代码来源:tls_select.c


示例18: pv_get_strftime

/**
 * return strftime() formatted time
 */
int pv_get_strftime(struct sip_msg *msg, pv_param_t *param,
		pv_value_t *res)
{
	str s;
#define PV_STRFTIME_BUF_SIZE	64
	static char _pv_strftime_buf[PV_STRFTIME_BUF_SIZE];

	if(msg==NULL || param==NULL)
		return -1;

	if(msg_ctx_id_match(msg, &_cfgutils_msgid)!=1)
	{
		msg_set_time(msg);
		msg_ctx_id_set(msg, &_cfgutils_msgid);
		if(localtime_r(&msg->tval.tv_sec, &_cfgutils_ts) == NULL)
		{
			LM_ERR("unable to break time to attributes\n");
			return -1;
		}
	}
	s.len = strftime(_pv_strftime_buf, PV_STRFTIME_BUF_SIZE,
			param->pvn.u.isname.name.s.s,  &_cfgutils_ts);
	if(s.len<=0)
		return pv_get_null(msg, param, res);
	s.s = _pv_strftime_buf;
	return pv_get_strval(msg, param, res, &s);
}
开发者ID:AndreyRybkin,项目名称:kamailio,代码行数:30,代码来源:pv_time.c


示例19: tlsops_cert_version

int tlsops_cert_version(struct sip_msg *msg, pv_param_t *param,
		pv_value_t *res)
{
	static char buf[INT2STR_MAX_LEN];
	X509* cert;
	struct tcp_connection* c;
	char* version;
	int my;

	if (param->pvn.u.isname.name.n & CERT_PEER) {
		my = 0;
	} else if (param->pvn.u.isname.name.n & CERT_LOCAL) {
		my = 1;
	} else {
		LM_CRIT("bug in call to tlsops_cert_version\n");
		return pv_get_null(msg, param, res);
	}

	if (get_cert(&cert, &c, msg, my) < 0) return -1;
	version = int2str(X509_get_version(cert), &res->rs.len);
	memcpy(buf, version, res->rs.len);
	res->rs.s = buf;
	res->flags = PV_VAL_STR;
	if (!my) X509_free(cert);
	tcpconn_put(c);
	return 0;
}
开发者ID:Drooids,项目名称:openser-xmlrpc,代码行数:27,代码来源:tls_select.c


示例20: pv_get_tm_ruri

static int pv_get_tm_ruri(struct sip_msg *msg, pv_param_t *param,
		pv_value_t *res)
{
	struct cell *t;

	if(msg==NULL || res==NULL)
		return -1;

	/* first get the transaction */
	if (t_check( msg , 0 )==-1) return -1;
	if ( (t=get_t())==0) {
		/* no T */
		if (msg!=NULL&&msg!=FAKED_REPLY && msg->first_line.type==SIP_REQUEST){
			res->rs = *GET_RURI(msg);
			res->flags = PV_VAL_STR;
			return 0;
		}
		return pv_get_null(msg, param,res);
	}

	/* return the RURI for the current branch */
	if (_tm_branch_index>=t->nr_of_outgoings) {
		LM_ERR("BUG: _tm_branch_index greater than nr_of_outgoings\n");
		return -1;
	}

	res->rs = t->uac[_tm_branch_index].uri;

	res->flags = PV_VAL_STR;

	return 0;
}
开发者ID:Deni90,项目名称:opensips,代码行数:32,代码来源:tm.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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