⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newappmetric.java

📁 利用Java Socket写的一段通讯协议
💻 JAVA
字号:
package com.ict.netcom2.metric;

import java.nio.ByteBuffer;
 	
/**
 * 20060414  guangxing & pengda  --begin
 * From Angela
 * 增加了新的应用层指标,主要关注到可以识别常见的P2P文件共享应用以及流媒体应用啦
 * 定义应用层协议统计结果存储类型
 * 22 * 24 = 528 bytes
 */
public class NewAppMetric {	
	
	public static final int length = 528;

	public MetricUnit rtsp_ctrl = new MetricUnit();

	public MetricUnit rtsp_data = new MetricUnit();

	public MetricUnit mms_ctrl = new MetricUnit();

	public MetricUnit mms_data = new MetricUnit();

	public MetricUnit sip_ctrl = new MetricUnit();

	public MetricUnit sip_data = new MetricUnit();

	public MetricUnit h323_q931_ctrl = new MetricUnit();

	public MetricUnit h323_h245_ctrl = new MetricUnit();

	public MetricUnit h323_data = new MetricUnit();

	public MetricUnit edonkey = new MetricUnit();

	public MetricUnit bit_torrent = new MetricUnit();

	public MetricUnit kazaa = new MetricUnit();

	public MetricUnit directconnect = new MetricUnit();

	public MetricUnit gnutella = new MetricUnit();

	public MetricUnit apple = new MetricUnit();// APPLE(Apple-A Novel P2P based e-Learning Environment)

	public MetricUnit soul = new MetricUnit();

	public MetricUnit winmx = new MetricUnit();

	public MetricUnit ares = new MetricUnit();

	public MetricUnit pplive = new MetricUnit(); // --pengda于20060419添加本行--

	public MetricUnit ppstreame = new MetricUnit(); // --pengda于20060419添加本行--

	public MetricUnit poco = new MetricUnit(); // --pengda于20060726添加本行--

	public MetricUnit xunlei = new MetricUnit(); // --pengda于20060726添加本行--
	

	public void store(byte[] result) {
		
		if (result.length != length) {
			System.err.println("[NewAppMetric.store()] param len wrong.");
		}
		
		ByteBuffer buf = ByteBuffer.wrap(result);
		
		byte[] b = new byte[MetricUnit.length];
		buf.get(b);
		rtsp_ctrl.store(b);

		buf.get(b);
		rtsp_data.store(b);

		buf.get(b);
		mms_ctrl.store(b);

		buf.get(b);
		mms_data.store(b);

		buf.get(b);
		sip_ctrl.store(b);

		buf.get(b);
		sip_data.store(b);

		buf.get(b);
		h323_q931_ctrl.store(b);

		buf.get(b);
		h323_h245_ctrl.store(b);

		buf.get(b);
		h323_data.store(b);

		buf.get(b);
		edonkey.store(b);

		buf.get(b);
		bit_torrent.store(b);

		buf.get(b);
		kazaa.store(b);

		buf.get(b);
		directconnect.store(b);

		buf.get(b);
		gnutella.store(b);

		buf.get(b);
		apple.store(b);// APPLE(Apple-A Novel P2P based e-Learning Environment)

		buf.get(b);
		soul.store(b);

		buf.get(b);
		winmx.store(b);

		buf.get(b);
		ares.store(b);

		buf.get(b);
		pplive.store(b);

		buf.get(b);
		ppstreame.store(b);

		buf.get(b);
		poco.store(b);

		buf.get(b);
		xunlei.store(b);
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -