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

C++ pn_object函数代码示例

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

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



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

示例1: send_obj_unreachable

static int send_obj_unreachable(struct sk_buff *rskb)
{
    const struct phonethdr *oph = pn_hdr(rskb);
    const struct phonetmsg *opm = pn_msg(rskb);
    struct phonetmsg resp;

    memset(&resp, 0, sizeof(resp));
    resp.pn_trans_id = opm->pn_trans_id;
    resp.pn_msg_id = PN_COMMON_MESSAGE;
    if (oph->pn_res == PN_PREFIX) {
        resp.pn_e_res_id = opm->pn_e_res_id;
        resp.pn_e_submsg_id = PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP;
        resp.pn_e_orig_msg_id = opm->pn_msg_id;
        resp.pn_e_status = 0;
    } else {
        resp.pn_submsg_id = PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP;
        resp.pn_orig_msg_id = opm->pn_msg_id;
        resp.pn_status = 0;
    }
    return pn_raw_send(&resp, sizeof(resp), rskb->dev,
                       pn_object(oph->pn_sdev, oph->pn_sobj),
                       pn_object(oph->pn_rdev, oph->pn_robj),
                       oph->pn_res);
}
开发者ID:jiacc0110,项目名称:Android-Froyo-Kernel-Source-v2.6.32.9,代码行数:24,代码来源:af_phonet.c


示例2: pn_sock_get_port

/* allocate port for a socket */
int pn_sock_get_port(struct sock *sk, unsigned short sport)
{
	static int port_cur;
	struct net *net = sock_net(sk);
	struct pn_sock *pn = pn_sk(sk);
	struct sockaddr_pn try_sa;
	struct sock *tmpsk;

	memset(&try_sa, 0, sizeof(struct sockaddr_pn));
	try_sa.spn_family = AF_PHONET;
	WARN_ON(!mutex_is_locked(&port_mutex));
	if (!sport) {
		/* search free port */
		int port, pmin, pmax;

		phonet_get_local_port_range(&pmin, &pmax);
		for (port = pmin; port <= pmax; port++) {
                        //Patch for hashtable
			port_cur += PN_HASHSIZE;
			if (port_cur < pmin || port_cur > pmax)
				port_cur = pmin;

			pn_sockaddr_set_port(&try_sa, port_cur);
			tmpsk = pn_find_sock_by_sa(net, &try_sa);
			if (tmpsk == NULL) {
				sport = port_cur;
				goto found;
			} else
				sock_put(tmpsk);
		}
	} else {
		/* try to find specific port */
		pn_sockaddr_set_port(&try_sa, sport);
		tmpsk = pn_find_sock_by_sa(net, &try_sa);
		if (tmpsk == NULL)
			/* No sock there! We can use that port... */
			goto found;
		else
			sock_put(tmpsk);
	}
	/* the port must be in use already */
	return -EADDRINUSE;

found:
	pn->sobject = pn_object(pn_addr(pn->sobject), sport);
	return 0;
}
开发者ID:CallMeVentus,项目名称:i9070_kernel_CoCore-P,代码行数:48,代码来源:socket.c


示例3: pn_skb_send

/*
 * Create a Phonet header for the skb and send it out. Returns
 * non-zero error code if failed. The skb is freed then.
 */
int pn_skb_send(struct sock *sk, struct sk_buff *skb,
		const struct sockaddr_pn *target)
{
	struct net *net = sock_net(sk);
	struct net_device *dev;
	struct pn_sock *pn = pn_sk(sk);
	int err;
	u16 src;
	u8 daddr = pn_sockaddr_get_addr(target), saddr = PN_NO_ADDR;

	err = -EHOSTUNREACH;
	if (sk->sk_bound_dev_if)
		dev = dev_get_by_index(net, sk->sk_bound_dev_if);
	else if (phonet_address_lookup(net, daddr) == 0) {
		dev = phonet_device_get(net);
		skb->pkt_type = PACKET_LOOPBACK;
	} else
		dev = phonet_route_output(net, daddr);

	if (!dev || !(dev->flags & IFF_UP))
		goto drop;

	saddr = phonet_address_get(dev, daddr);
	if (saddr == PN_NO_ADDR)
		goto drop;

	src = pn->sobject;
	if (!pn_addr(src))
		src = pn_object(saddr, pn_obj(src));

	err = pn_send(skb, dev, pn_sockaddr_get_object(target),
			src, pn_sockaddr_get_resource(target), 0);
	dev_put(dev);
	return err;

drop:
	kfree_skb(skb);
	if (dev)
		dev_put(dev);
	return err;
}
开发者ID:Jb2005,项目名称:SamSung-Galaxy-Tab-10.1-Model-GT-P7510,代码行数:45,代码来源:af_phonet.c


示例4: pn_delivery

tracker sender::send(const message &message) {
    uint64_t id = ++tag_counter;
    pn_delivery_t *dlv =
        pn_delivery(pn_object(), pn_dtag(reinterpret_cast<const char*>(&id), sizeof(id)));
    std::vector<char> buf;
    message.encode(buf);
    assert(!buf.empty());
    pn_link_send(pn_object(), &buf[0], buf.size());
    pn_link_advance(pn_object());
    if (pn_link_snd_settle_mode(pn_object()) == PN_SND_SETTLED)
        pn_delivery_settle(dlv);
    if (!pn_link_credit(pn_object()))
        link_context::get(pn_object()).draining = false;
    return make_wrapper<tracker>(dlv);
}
开发者ID:engineer-legion,项目名称:qpid-proton,代码行数:15,代码来源:sender.cpp


示例5: pn_sender

sender session::open_sender(const std::string &addr, const link_options &lo) {
    sender snd = pn_sender(pn_object(), next_link_name(connection()).c_str());
    snd.local_target().address(addr);
    snd.open(lo);
    return snd;
}
开发者ID:prestona,项目名称:qpid-proton,代码行数:6,代码来源:session.cpp


示例6: pn_session_open

void session::open() {
    pn_session_open(pn_object());
}
开发者ID:prestona,项目名称:qpid-proton,代码行数:3,代码来源:session.cpp


示例7: pn_session_connection

connection session::connection() const {
    return pn_session_connection(pn_object());
}
开发者ID:prestona,项目名称:qpid-proton,代码行数:3,代码来源:session.cpp


示例8: closed

bool session::closed() const { return ::closed(pn_session_state(pn_object())); }
开发者ID:ChugR,项目名称:qpid-proton,代码行数:1,代码来源:endpoint.cpp


示例9: set_error_condition

void link::close(const error_condition& condition) {
    set_error_condition(condition, pn_link_condition(pn_object()));
    close();
}
开发者ID:ChugR,项目名称:qpid-proton,代码行数:4,代码来源:endpoint.cpp


示例10: condition

condition session::remote_condition() const {
    return condition(pn_session_remote_condition(pn_object()));
}
开发者ID:prestona,项目名称:qpid-proton,代码行数:3,代码来源:session.cpp


示例11: pn_delivery_link

sender tracker::sender() const { return pn_delivery_link(pn_object()); }
开发者ID:ajssmith,项目名称:qpid-proton,代码行数:1,代码来源:tracker.cpp


示例12: pn_link_close

void link::close() {
    pn_link_close(pn_object());
}
开发者ID:irods,项目名称:qpid-proton,代码行数:3,代码来源:link.cpp


示例13: pn_link_detach

void link::detach() {
    pn_link_detach(pn_object());
}
开发者ID:irods,项目名称:qpid-proton,代码行数:3,代码来源:link.cpp


示例14: pn_session_next

session session::next(endpoint::state s) const
{
    return pn_session_next(pn_object(), s);
}
开发者ID:marcelmeulemans,项目名称:qpid-proton-1,代码行数:4,代码来源:session.cpp


示例15: pn_link_open

void link::attach() {
    pn_link_open(pn_object());
}
开发者ID:irods,项目名称:qpid-proton,代码行数:3,代码来源:link.cpp


示例16: pn_sender

sender session::create_sender(const std::string& name) {
    return pn_sender(pn_object(), set_name(name, this).c_str());
}
开发者ID:marcelmeulemans,项目名称:qpid-proton-1,代码行数:3,代码来源:session.cpp


示例17: pn_link_drained

void sender::return_credit() {
    link_context &lctx = link_context::get(pn_object());
    lctx.draining = false;
    pn_link_drained(pn_object());
}
开发者ID:engineer-legion,项目名称:qpid-proton,代码行数:5,代码来源:sender.cpp


示例18: active

bool link::active() const { return ::active(pn_link_state(pn_object())); }
开发者ID:ChugR,项目名称:qpid-proton,代码行数:1,代码来源:endpoint.cpp


示例19: pn_session_state

endpoint::state session::state() const { return pn_session_state(pn_object()); }
开发者ID:prestona,项目名称:qpid-proton,代码行数:1,代码来源:session.cpp


示例20: make_wrapper

class connection link::connection() const {
    return make_wrapper(pn_session_connection(pn_link_session(pn_object())));
}
开发者ID:irods,项目名称:qpid-proton,代码行数:3,代码来源:link.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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