// Path: library/src/main/java/de/tubs/ibr/dtn/api/Bundle.java
// public enum ProcFlags {
// 	FRAGMENT(1 << 0x00),
// 	APPDATA_IS_ADMRECORD(1 << 0x01),
// 	DONT_FRAGMENT(1 << 0x02),
// 	CUSTODY_REQUESTED(1 << 0x03),
// 	DESTINATION_IS_SINGLETON(1 << 0x04),
// 	ACKOFAPP_REQUESTED(1 << 0x05),
// 	RESERVED_6(1 << 0x06),
// 	PRIORITY_BIT1(1 << 0x07),
// 	PRIORITY_BIT2(1 << 0x08),
// 	CLASSOFSERVICE_9(1 << 0x09),
// 	CLASSOFSERVICE_10(1 << 0x0A),
// 	CLASSOFSERVICE_11(1 << 0x0B),
// 	CLASSOFSERVICE_12(1 << 0x0C),
// 	CLASSOFSERVICE_13(1 << 0x0D),
// 	REQUEST_REPORT_OF_BUNDLE_RECEPTION(1 << 0x0E),
// 	REQUEST_REPORT_OF_CUSTODY_ACCEPTANCE(1 << 0x0F),
// 	REQUEST_REPORT_OF_BUNDLE_FORWARDING(1 << 0x10),
// 	REQUEST_REPORT_OF_BUNDLE_DELIVERY(1 << 0x11),
// 	REQUEST_REPORT_OF_BUNDLE_DELETION(1 << 0x12),
// 	STATUS_REPORT_REQUEST_19(1 << 0x13),
// 	STATUS_REPORT_REQUEST_20(1 << 0x14),
// 
// 	// DTNSEC FLAGS (these are customized flags and not written down in any draft)
// 	DTNSEC_REQUEST_SIGN(1 << 0x1A),
// 	DTNSEC_REQUEST_ENCRYPT(1 << 0x1B),
// 	DTNSEC_STATUS_VERIFIED(1 << 0x1C),
// 	DTNSEC_STATUS_CONFIDENTIAL(1 << 0x1D),
// 	DTNSEC_STATUS_AUTHENTICATED(1 << 0x1E),
// 	IBRDTN_REQUEST_COMPRESSION(1 << 0x1F);
// 
// 	private int value = 0;
// 
// 	private ProcFlags(int i) {
// 		this.value = i;
// 	}
// 
// 	public int getValue() {
// 		return this.value;
// 	}
// };


import android.os.Parcel;
import android.os.Parcelable;
import de.tubs.ibr.dtn.api.Bundle.ProcFlags;
import java.util.StringTokenizer;
/*
 * Block.java
 * 
 * Copyright (C) 2011 IBR, TU Braunschweig
 *
 * Written-by: Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package de.tubs.ibr.dtn.api;



public class BundleID implements Parcelable, Comparable<BundleID> {
	
	private SingletonEndpoint source = null;
	private Timestamp timestamp = null;
	private Long sequencenumber = null;
	
	private boolean fragment = false;
	private Long fragment_offset = 0L;
	private Long fragment_payload = 0L;

	public BundleID()
	{
	}
	
	public BundleID(Bundle b)
	{
		this.source = b.getSource();
		this.timestamp = b.getTimestamp();
		this.sequencenumber = b.getSequencenumber();
		
// Path: library/src/main/java/de/tubs/ibr/dtn/api/Bundle.java
// public enum ProcFlags {
// 	FRAGMENT(1 << 0x00),
// 	APPDATA_IS_ADMRECORD(1 << 0x01),
// 	DONT_FRAGMENT(1 << 0x02),
// 	CUSTODY_REQUESTED(1 << 0x03),
// 	DESTINATION_IS_SINGLETON(1 << 0x04),
// 	ACKOFAPP_REQUESTED(1 << 0x05),
// 	RESERVED_6(1 << 0x06),
// 	PRIORITY_BIT1(1 << 0x07),
// 	PRIORITY_BIT2(1 << 0x08),
// 	CLASSOFSERVICE_9(1 << 0x09),
// 	CLASSOFSERVICE_10(1 << 0x0A),
// 	CLASSOFSERVICE_11(1 << 0x0B),
// 	CLASSOFSERVICE_12(1 << 0x0C),
// 	CLASSOFSERVICE_13(1 << 0x0D),
// 	REQUEST_REPORT_OF_BUNDLE_RECEPTION(1 << 0x0E),
// 	REQUEST_REPORT_OF_CUSTODY_ACCEPTANCE(1 << 0x0F),
// 	REQUEST_REPORT_OF_BUNDLE_FORWARDING(1 << 0x10),
// 	REQUEST_REPORT_OF_BUNDLE_DELIVERY(1 << 0x11),
// 	REQUEST_REPORT_OF_BUNDLE_DELETION(1 << 0x12),
// 	STATUS_REPORT_REQUEST_19(1 << 0x13),
// 	STATUS_REPORT_REQUEST_20(1 << 0x14),
// 
// 	// DTNSEC FLAGS (these are customized flags and not written down in any draft)
// 	DTNSEC_REQUEST_SIGN(1 << 0x1A),
// 	DTNSEC_REQUEST_ENCRYPT(1 << 0x1B),
// 	DTNSEC_STATUS_VERIFIED(1 << 0x1C),
// 	DTNSEC_STATUS_CONFIDENTIAL(1 << 0x1D),
// 	DTNSEC_STATUS_AUTHENTICATED(1 << 0x1E),
// 	IBRDTN_REQUEST_COMPRESSION(1 << 0x1F);
// 
// 	private int value = 0;
// 
// 	private ProcFlags(int i) {
// 		this.value = i;
// 	}
// 
// 	public int getValue() {
// 		return this.value;
// 	}
// };


// Path: library/src/main/java/de/tubs/ibr/dtn/api/BundleID.java
import android.os.Parcel;
import android.os.Parcelable;
import de.tubs.ibr.dtn.api.Bundle.ProcFlags;
import java.util.StringTokenizer;

/*
 * Block.java
 * 
 * Copyright (C) 2011 IBR, TU Braunschweig
 *
 * Written-by: Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package de.tubs.ibr.dtn.api;



public class BundleID implements Parcelable, Comparable<BundleID> {
	
	private SingletonEndpoint source = null;
	private Timestamp timestamp = null;
	private Long sequencenumber = null;
	
	private boolean fragment = false;
	private Long fragment_offset = 0L;
	private Long fragment_payload = 0L;

	public BundleID()
	{
	}
	
	public BundleID(Bundle b)
	{
		this.source = b.getSource();
		this.timestamp = b.getTimestamp();
		this.sequencenumber = b.getSequencenumber();
		
		this.fragment = b.get(ProcFlags.FRAGMENT);