当前位置: 首页>>代码示例>>Java>>正文


Java Dynamic类代码示例

本文整理汇总了Java中org.jnetpcap.packet.annotate.Dynamic的典型用法代码示例。如果您正苦于以下问题:Java Dynamic类的具体用法?Java Dynamic怎么用?Java Dynamic使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Dynamic类属于org.jnetpcap.packet.annotate包,在下文中一共展示了Dynamic类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checksumDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Checksum description.
 * 
 * @return the string
 */
@Dynamic(Field.Property.DESCRIPTION)
public String checksumDescription() {

	if (isFragmented()) {
		return "supressed for fragments";
	}

	if (isPayloadTruncated()) {
		return "supressed for truncated packets";
	}

	final int crc16 = calculateChecksum();
	if (checksum() == crc16) {
		return "correct";
	} else {
		return "incorrect: 0x" + Integer.toHexString(crc16).toUpperCase();
	}
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:24,代码来源:Icmp.java

示例2: checksumDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Returns a dynamic description of the checksum field. Specifically it checks
 * and displays, as description, the state of the checksum field, if it
 * matches the calculated checksum or not.
 * 
 * @return additional information about the state of the checksum field
 */
@Dynamic(Field.Property.DESCRIPTION)
public String checksumDescription() {

	if (isFragmented()) {
		return "supressed for fragments";
	}

	if (isPayloadTruncated()) {
		return "supressed for truncated packets";
	}

	final int crc16 = calculateChecksum();
	if (checksum() == crc16) {
		return "correct";
	} else {
		return "incorrect: 0x" + Integer.toHexString(crc16).toUpperCase();
	}
}
 
开发者ID:universsky,项目名称:diddler,代码行数:26,代码来源:Tcp.java

示例3: checksumDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Checksum description.
 * 
 * @return the string
 */
@Dynamic(Field.Property.DESCRIPTION)
public String checksumDescription() {
	final int crc32 = calculateChecksum();
	if (checksum() == crc32) {
		return "correct";
	} else {
		return "incorrect: 0x" + Long.toHexString(crc32 & 0xFFFFFFFF).toUpperCase();
	}
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:15,代码来源:Ethernet.java

示例4: checksumDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Checksum description.
 * 
 * @return the string
 */
@Dynamic(Field.Property.DESCRIPTION)
public String checksumDescription() {
	final long crc32 = calculateChecksum();
	if (checksum() == crc32) {
		return "correct";
	} else {
		return "incorrect: 0x" + Long.toHexString(crc32).toUpperCase();
	}
}
 
开发者ID:universsky,项目名称:diddler,代码行数:15,代码来源:IEEE802dot3.java

示例5: checksumDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Checksum description.
 * 
 * @return the string
 */
@Dynamic(Field.Property.DESCRIPTION)
public String checksumDescription() {
	final int crc16 = calculateChecksum();
	if (checksum() == crc16) {
		return "correct";
	} else {
		return "incorrect: 0x" + Integer.toHexString(crc16).toUpperCase();
	}
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:15,代码来源:Ip4.java

示例6: hlenDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Hlen description.
 * 
 * @return the string
 */
@Dynamic(Field.Property.DESCRIPTION)
public String hlenDescription() {
	String pre = "" + hlen() + " * 4 = " + (hlen() * 4) + " bytes";
	return (hlen() == 5) ? pre + ", No Ip Options" : pre
			+ ", Ip Options Present";
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:12,代码来源:Ip4.java

示例7: flags_BEDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Returns a description of the current state of U flag
 * 
 * @return description
 */
@Dynamic(Field.Property.DESCRIPTION)
public String flags_BEDescription() {
	switch (flags_BE()) {
		case  0:
			return "Middle piece of a fragmented user message";
		case 1 :
			return "Last piece of a fragmented user message";
		case 2 :
			return "First piece of a fragmented user message";
		case 3 :
			return "Unfragmented message";
	}
	return "unknown option";
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:20,代码来源:SctpData.java

示例8: inspectMethod

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Inspect method.
 * 
 * @param method
 *          the method
 * @return the annotated field method
 */
public static AnnotatedFieldMethod inspectMethod(Method method) {

	Dynamic runtime = method.getAnnotation(Dynamic.class);

	Field.Property function = runtime.value();
	switch (function) {
		case LENGTH:
		case OFFSET:
			checkSignature(method, int.class);
			return new IntFunction(method, function);

		case MASK:
			checkSignature(method, long.class);
			return new LongFunction(method, function);

		case VALUE:
			checkSignature(method, Object.class);

			return new ObjectFunction(method, function);

		case CHECK:
			checkSignature(method, boolean.class);
			return new BooleanFunction(method, function);

		case DISPLAY:
		case DESCRIPTION:
			checkSignature(method, String.class);
			return new StringFunction(method, function);

		default:
			throw new HeaderDefinitionError("Unsupported Dynamic function type "
			    + function.toString());
	}
}
 
开发者ID:GlacialSoftware,项目名称:PCAPReader,代码行数:42,代码来源:AnnotatedFieldMethod.java

示例9: hlenDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
* Hlen description.
* 
* @return the string
*/
@Dynamic(Field.Property.DESCRIPTION)
public String hlenDescription() {
	String pre = "" + hlen() + " * 4 = " + (hlen() * 4) + " bytes";
	return (hlen() == 5) ? pre + ", No Ip Options" : pre
	    + ", Ip Options Present";
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:12,代码来源:MyHeader.java

示例10: fieldOffset

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Field offset.
 * 
 * @param field
 *          the field
 * @return the int
 */
@Dynamic(Field.Property.OFFSET)
protected int fieldOffset(String field) {
	if (fieldMap.get(map(field)) == null) {
		return -1;
	}
	
	return fieldMap.get(map(field)).getOffset(this);
}
 
开发者ID:GlacialSoftware,项目名称:PCAPReader,代码行数:16,代码来源:JMappedHeader.java

示例11: offsetDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Offset description.
 * 
 * @return the string
 */
@Dynamic(Field.Property.DESCRIPTION)
public String offsetDescription() {
	return (offset() == 0) ? null : "" + offset() + " * 8 = " + (offset() * 8)
	    + " bytes";
}
 
开发者ID:GlacialSoftware,项目名称:PCAPReader,代码行数:11,代码来源:Ip4.java

示例12: ssrcLength

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
@Dynamic(field = "ssrc", value = Field.Property.LENGTH)
public int ssrcLength() {
	return sc() * (4 * BYTE);
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:5,代码来源:RtcpBye.java

示例13: code_CopyDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Code_ copy description.
 * 
 * @return the string
 */
@Dynamic(Field.Property.DESCRIPTION)
public String code_CopyDescription() {
	return (code_Copy() > 0) ? "copy to all fragments"
			: "do not copy to fragments";
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:11,代码来源:Ip4.java

示例14: code_CopyDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
/**
 * Code_ copy description.
 * 
 * @return the string
 */
@Dynamic(Field.Property.DESCRIPTION)
public String code_CopyDescription() {
	return (code_Copy() > 0) ? "copy to all fragments"
	    : "do not copy to fragments";
}
 
开发者ID:GlacialSoftware,项目名称:PCAPReader,代码行数:11,代码来源:Ip4.java

示例15: codeDescription

import org.jnetpcap.packet.annotate.Dynamic; //导入依赖的package包/类
@Dynamic(Field.Property.DESCRIPTION)
public String codeDescription() {
	return codeEnum().toString();
}
 
开发者ID:pvenne,项目名称:jgoose,代码行数:5,代码来源:Radius.java


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