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

C++ snmp_fold_field函数代码示例

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

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



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

示例1: icmp_put

static void icmp_put(struct seq_file *seq)
{
	int i;
	struct net *net = seq->private;
	atomic_long_t *ptr = net->mib.icmpmsg_statistics->mibs;

	seq_puts(seq, "\nIcmp: InMsgs InErrors");
	for (i=0; icmpmibmap[i].name != NULL; i++)
		seq_printf(seq, " In%s", icmpmibmap[i].name);
	seq_printf(seq, " OutMsgs OutErrors");
	for (i=0; icmpmibmap[i].name != NULL; i++)
		seq_printf(seq, " Out%s", icmpmibmap[i].name);
	seq_printf(seq, "\nIcmp: %lu %lu",
		snmp_fold_field((void __percpu **) net->mib.icmp_statistics, ICMP_MIB_INMSGS),
		snmp_fold_field((void __percpu **) net->mib.icmp_statistics, ICMP_MIB_INERRORS));
	for (i=0; icmpmibmap[i].name != NULL; i++)
		seq_printf(seq, " %lu",
			   atomic_long_read(ptr + icmpmibmap[i].index));
	seq_printf(seq, " %lu %lu",
		snmp_fold_field((void __percpu **) net->mib.icmp_statistics, ICMP_MIB_OUTMSGS),
		snmp_fold_field((void __percpu **) net->mib.icmp_statistics, ICMP_MIB_OUTERRORS));
	for (i=0; icmpmibmap[i].name != NULL; i++)
		seq_printf(seq, " %lu",
			   atomic_long_read(ptr + (icmpmibmap[i].index | 0x100)));
}
开发者ID:404992361,项目名称:mi1_kernel,代码行数:25,代码来源:proc.c


示例2: snmp6_seq_show_icmpv6msg

static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
{
	char name[32];
	int i;

	/* print by name -- deprecated items */
	for (i = 0; i < ICMP6MSG_MIB_MAX; i++) {
		int icmptype;
		char *p;

		icmptype = i & 0xff;
		p = icmp6type2name[icmptype];
		if (!p)	/* don't print un-named types here */
			continue;
		snprintf(name, sizeof(name), "Icmp6%s%s",
			i & 0x100 ? "Out" : "In", p);
		seq_printf(seq, "%-32s\t%lu\n", name,
			snmp_fold_field(mib, i));
	}

	/* print by number (nonzero only) - ICMPMsgStat format */
	for (i = 0; i < ICMP6MSG_MIB_MAX; i++) {
		unsigned long val;

		val = snmp_fold_field(mib, i);
		if (!val)
			continue;
		snprintf(name, sizeof(name), "Icmp6%sType%u",
			i & 0x100 ?  "Out" : "In", i & 0xff);
		seq_printf(seq, "%-32s\t%lu\n", name, val);
	}
	return;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:33,代码来源:proc.c


示例3: icmpmsg_put

static void icmpmsg_put(struct seq_file *seq)
{
#define PERLINE	16

	int i, count;
	unsigned short type[PERLINE];
	unsigned long vals[PERLINE], val;
	struct net *net = seq->private;

	count = 0;
	for (i = 0; i < ICMPMSG_MIB_MAX; i++) {
		val = snmp_fold_field((void __percpu **) net->mib.icmpmsg_statistics, i);
		if (val) {
			type[count] = i;
			vals[count++] = val;
		}
		if (count == PERLINE) {
			icmpmsg_put_line(seq, vals, type, count);
			count = 0;
		}
	}
	icmpmsg_put_line(seq, vals, type, count);

#undef PERLINE
}
开发者ID:ashang,项目名称:xpenology-3.x,代码行数:25,代码来源:proc.c


示例4: snmp6_seq_show_item

static inline void
snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_mib *itemlist)
{
	int i;
	for (i=0; itemlist[i].name; i++)
		seq_printf(seq, "%-32s\t%lu\n", itemlist[i].name,
			   snmp_fold_field(mib, itemlist[i].entry));
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:8,代码来源:proc.c


示例5: xfrm_statistics_seq_show

static int xfrm_statistics_seq_show(struct seq_file *seq, void *v)
{
	struct net *net = seq->private;
	int i;
	for (i = 0; xfrm_mib_list[i].name; i++)
		seq_printf(seq, "%-24s\t%lu\n", xfrm_mib_list[i].name,
			   snmp_fold_field(net->mib.xfrm_statistics,
					   xfrm_mib_list[i].entry));
	return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:10,代码来源:xfrm_proc.c


示例6: icmp_put

static void icmp_put(struct seq_file *seq)
{
    int i;

    seq_puts(seq, "\nIcmp: InMsgs InErrors");
    for (i=0; icmpmibmap[i].name != NULL; i++)
        seq_printf(seq, " In%s", icmpmibmap[i].name);
    seq_printf(seq, " OutMsgs OutErrors");
    for (i=0; icmpmibmap[i].name != NULL; i++)
        seq_printf(seq, " Out%s", icmpmibmap[i].name);
    seq_printf(seq, "\nIcmp: %lu %lu",
        snmp_fold_field((void **) icmp_statistics, ICMP_MIB_INMSGS),
        snmp_fold_field((void **) icmp_statistics, ICMP_MIB_INERRORS));
    for (i=0; icmpmibmap[i].name != NULL; i++)
        seq_printf(seq, " %lu",
            snmp_fold_field((void **) icmpmsg_statistics,
                icmpmibmap[i].index));
    seq_printf(seq, " %lu %lu",
        snmp_fold_field((void **) icmp_statistics, ICMP_MIB_OUTMSGS),
        snmp_fold_field((void **) icmp_statistics, ICMP_MIB_OUTERRORS));
    for (i=0; icmpmibmap[i].name != NULL; i++)
        seq_printf(seq, " %lu",
            snmp_fold_field((void **) icmpmsg_statistics,
                icmpmibmap[i].index | 0x100));
}
开发者ID:274914765,项目名称:C,代码行数:25,代码来源:proc.c


示例7: icmpmsg_put

static void icmpmsg_put(struct seq_file *seq)
{
#define PERLINE    16

    int j, i, count;
    static int out[PERLINE];

    count = 0;
    for (i = 0; i < ICMPMSG_MIB_MAX; i++) {

        if (snmp_fold_field((void **) icmpmsg_statistics, i))
            out[count++] = i;
        if (count < PERLINE)
            continue;

        seq_printf(seq, "\nIcmpMsg:");
        for (j = 0; j < PERLINE; ++j)
            seq_printf(seq, " %sType%u", i & 0x100 ? "Out" : "In",
                    i & 0xff);
        seq_printf(seq, "\nIcmpMsg: ");
        for (j = 0; j < PERLINE; ++j)
            seq_printf(seq, " %lu",
                snmp_fold_field((void **) icmpmsg_statistics,
                out[j]));
        seq_putc(seq, '\n');
    }
    if (count) {
        seq_printf(seq, "\nIcmpMsg:");
        for (j = 0; j < count; ++j)
            seq_printf(seq, " %sType%u", out[j] & 0x100 ? "Out" :
                "In", out[j] & 0xff);
        seq_printf(seq, "\nIcmpMsg:");
        for (j = 0; j < count; ++j)
            seq_printf(seq, " %lu", snmp_fold_field((void **)
                icmpmsg_statistics, out[j]));
    }

#undef PERLINE
}
开发者ID:274914765,项目名称:C,代码行数:39,代码来源:proc.c


示例8: snmp6_seq_show_item

/* can be called either with percpu mib (pcpumib != NULL),
 * or shared one (smib != NULL)
 */
static void snmp6_seq_show_item(struct seq_file *seq, void __percpu *pcpumib,
				atomic_long_t *smib,
				const struct snmp_mib *itemlist)
{
	int i;
	unsigned long val;

	for (i = 0; itemlist[i].name; i++) {
		val = pcpumib ?
			snmp_fold_field(pcpumib, itemlist[i].entry) :
			atomic_long_read(smib + itemlist[i].entry);
		seq_printf(seq, "%-32s\t%lu\n", itemlist[i].name, val);
	}
}
开发者ID:MaxChina,项目名称:linux,代码行数:17,代码来源:proc.c


示例9: snmp_seq_show

/*
 *	Called from the PROCfs module. This outputs /proc/net/snmp.
 */
static int snmp_seq_show(struct seq_file *seq, void *v)
{
	int i;
	struct net *net = seq->private;

	seq_puts(seq, "Ip: Forwarding DefaultTTL");

	for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
		seq_printf(seq, " %s", snmp4_ipstats_list[i].name);

	seq_printf(seq, "\nIp: %d %d",
		   IPV4_DEVCONF_ALL(net, FORWARDING) ? 1 : 2,
		   sysctl_ip_default_ttl);

	BUILD_BUG_ON(offsetof(struct ipstats_mib, mibs) != 0);
	for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
		seq_printf(seq, " %llu",
			   snmp_fold_field64((void __percpu **)net->mib.ip_statistics,
					     snmp4_ipstats_list[i].entry,
					     offsetof(struct ipstats_mib, syncp)));

	icmp_put(seq);	/* RFC 2011 compatibility */
	icmpmsg_put(seq);

	seq_puts(seq, "\nTcp:");
	for (i = 0; snmp4_tcp_list[i].name != NULL; i++)
		seq_printf(seq, " %s", snmp4_tcp_list[i].name);

	seq_puts(seq, "\nTcp:");
	for (i = 0; snmp4_tcp_list[i].name != NULL; i++) {
		/* MaxConn field is signed, RFC 2012 */
		if (snmp4_tcp_list[i].entry == TCP_MIB_MAXCONN)
			seq_printf(seq, " %ld",
				   snmp_fold_field((void __percpu **)net->mib.tcp_statistics,
						   snmp4_tcp_list[i].entry));
		else
			seq_printf(seq, " %lu",
				   snmp_fold_field((void __percpu **)net->mib.tcp_statistics,
						   snmp4_tcp_list[i].entry));
	}

	seq_puts(seq, "\nUdp:");
	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
		seq_printf(seq, " %s", snmp4_udp_list[i].name);

	seq_puts(seq, "\nUdp:");
	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
		seq_printf(seq, " %lu",
			   snmp_fold_field((void __percpu **)net->mib.udp_statistics,
					   snmp4_udp_list[i].entry));

	/* the UDP and UDP-Lite MIBs are the same */
	seq_puts(seq, "\nUdpLite:");
	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
		seq_printf(seq, " %s", snmp4_udp_list[i].name);

	seq_puts(seq, "\nUdpLite:");
	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
		seq_printf(seq, " %lu",
			   snmp_fold_field((void __percpu **)net->mib.udplite_statistics,
					   snmp4_udp_list[i].entry));

	seq_putc(seq, '\n');
	return 0;
}
开发者ID:404992361,项目名称:mi1_kernel,代码行数:68,代码来源:proc.c


示例10: snmp_seq_show

/*
 *	Called from the PROCfs module. This outputs /proc/net/snmp.
 */
static int snmp_seq_show(struct seq_file *seq, void *v)
{
	int i;
	struct vrf *vrf = seq->private;

	seq_puts(seq, "Ip: Forwarding DefaultTTL");

	for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
		seq_printf(seq, " %s", snmp4_ipstats_list[i].name);

	seq_printf(seq, "\nIp: %d %d",
			vrf->ipv4.devconf_all->forwarding ? 1 : 2, 
		    sysctl_ip_default_ttl);

	for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
		seq_printf(seq, " %lu",
			   snmp_fold_field((void **)vrf->mib.ip_statistics,
					   snmp4_ipstats_list[i].entry));

	seq_puts(seq, "\nIcmp:");
	for (i = 0; snmp4_icmp_list[i].name != NULL; i++)
		seq_printf(seq, " %s", snmp4_icmp_list[i].name);

	seq_puts(seq, "\nIcmp:");
	for (i = 0; snmp4_icmp_list[i].name != NULL; i++)
		seq_printf(seq, " %lu",
			   snmp_fold_field((void **)vrf->mib.icmp_statistics,
				      snmp4_icmp_list[i].entry));

	seq_puts(seq, "\nTcp:");
	for (i = 0; snmp4_tcp_list[i].name != NULL; i++)
		seq_printf(seq, " %s", snmp4_tcp_list[i].name);

	seq_puts(seq, "\nTcp:");
	for (i = 0; snmp4_tcp_list[i].name != NULL; i++) {
		/* MaxConn field is signed, RFC 2012 */
		if (snmp4_tcp_list[i].entry == TCP_MIB_MAXCONN)
			seq_printf(seq, " %ld",
				   snmp_fold_field((void **)vrf->mib.tcp_statistics,
						   snmp4_tcp_list[i].entry));
		else
			seq_printf(seq, " %lu",
				   snmp_fold_field((void **)vrf->mib.tcp_statistics,
						   snmp4_tcp_list[i].entry));
	}

	seq_puts(seq, "\nUdp:");
	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
		seq_printf(seq, " %s", snmp4_udp_list[i].name);

	seq_puts(seq, "\nUdp:");
	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
		seq_printf(seq, " %lu",
			   snmp_fold_field((void **)vrf->mib.udp_statistics,
					   snmp4_udp_list[i].entry));

	/* the UDP and UDP-Lite MIBs are the same */
	seq_puts(seq, "\nUdpLite:");
	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
		seq_printf(seq, " %s", snmp4_udp_list[i].name);

	seq_puts(seq, "\nUdpLite:");
	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
		seq_printf(seq, " %lu",
			   snmp_fold_field((void **)vrf->mib.udplite_statistics,
					   snmp4_udp_list[i].entry));

	seq_putc(seq, '\n');
	return 0;
}
开发者ID:millken,项目名称:zhuxianB30,代码行数:73,代码来源:proc.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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