src/org/jnetpcap/packet/JRegistry.java
public static int register(Class<? extends JHeader> c,
			List<HeaderDefinitionError> errors) {

		AnnotatedHeader annotatedHeader = inspect(c, errors);
		if (errors.isEmpty() == false) {
			return -1;
		}

		Entry e = mapByClassName.get(c.getCanonicalName());
		if (e == null) {
			e = createNewEntry(c);
		}

		int id = e.id;
		e.annotatedHeader = annotatedHeader;

		scanners[id] = new JHeaderScanner(c);

		registerAnnotatedSubHeaders(annotatedHeader.getHeaders());

		JBinding[] bindings = AnnotatedBinding.inspectJHeaderClass(c, errors);
		if (errors.isEmpty() == false) {
			return -1;
		}
		addBindings(bindings);

		for (PcapDLT d : annotatedHeader.getDlt()) {
			registerDLT(d, id);
		}

		return id;
	}
/**
	 * Registeres a new protocol header. A new numerical ID is assigned to the
	 * protocol and various mappings are recorded for this protocol.
	 * 
	 * @param c
	 *          class of the header
	 * @param errors
	 *          the errors
	 * @return numerical id assigned to this new protocol
	 */
Registeres a new protocol header. A new numerical ID is assigned to the
protocol and various mappings are recorded for this protocol.

@param c
class of the header
@param errors
the errors
@return numerical id assigned to this new protocol
Registeres a new protocol header . A new numerical ID is assigned to the protocol and various mappings are recorded for this protocol . @param c class of the header @param errors the errors @return numerical id assigned to this new protocol
public static int register(Class<? extends JHeader> c,
			List<HeaderDefinitionError> errors) {
		AnnotatedHeader annotatedHeader = inspect(c, errors);
		if (errors.isEmpty() == false) {
			return -1;
		}
		Entry e = mapByClassName.get(c.getCanonicalName());
		if (e == null) {
			e = createNewEntry(c);
		}
		int id = e.id;
		e.annotatedHeader = annotatedHeader;
		scanners[id] = new JHeaderScanner(c);
		registerAnnotatedSubHeaders(annotatedHeader.getHeaders());
		JBinding[] bindings = AnnotatedBinding.inspectJHeaderClass(c, errors);
		if (errors.isEmpty() == false) {
			return -1;
		}
		addBindings(bindings);
		for (PcapDLT d : annotatedHeader.getDlt()) {
			registerDLT(d, id);
		}
		return id;
	}
public static int register ( Class < ? extends JHeader > c , List < HeaderDefinitionError > errors ) { AnnotatedHeader annotatedHeader = inspect ( c , errors ) ; if ( errors . isEmpty ( ) == false ) { return - 1 ; } Entry e = mapByClassName . get ( c . getCanonicalName ( ) ) ; if ( e == null ) { e = createNewEntry ( c ) ; } int id = e . id ; e . annotatedHeader = annotatedHeader ; scanners [ id ] = new JHeaderScanner ( c ) ; registerAnnotatedSubHeaders ( annotatedHeader . getHeaders ( ) ) ; JBinding [ ] bindings = AnnotatedBinding . inspectJHeaderClass ( c , errors ) ; if ( errors . isEmpty ( ) == false ) { return - 1 ; } addBindings ( bindings ) ; for ( PcapDLT d : annotatedHeader . getDlt ( ) ) { registerDLT ( d , id ) ; } return id ; }
Registeres a new protocol header.
Registeres a new protocol header .