841 char * filename, |
841 char * filename, |
842 int count, |
842 int count, |
843 int verbose) |
843 int verbose) |
844 { |
844 { |
845 int ret = 0, err = 0, num_blocks, i, j; |
845 int ret = 0, err = 0, num_blocks, i, j; |
|
846 int has_bpq_block = 0; |
846 dtn_bundle_spec_t bundle_spec; |
847 dtn_bundle_spec_t bundle_spec; |
847 dtn_extension_block_t* bpq_blocks; |
848 dtn_extension_block_t* bpq_blocks; |
848 dtn_bpq_extension_block_data_t bpq_block_data; |
849 dtn_bpq_extension_block_data_t bpq_block_data; |
849 dtn_bundle_payload_t payload; |
850 dtn_bundle_payload_t payload; |
850 |
851 |
866 fprintf(stdout, "bundle num %d received successfully: id %s,%llu.%llu\n", |
867 fprintf(stdout, "bundle num %d received successfully: id %s,%llu.%llu\n", |
867 j+1, |
868 j+1, |
868 bundle_spec.source.uri, |
869 bundle_spec.source.uri, |
869 bundle_spec.creation_ts.secs, |
870 bundle_spec.creation_ts.secs, |
870 bundle_spec.creation_ts.seqno); |
871 bundle_spec.creation_ts.seqno); |
|
872 |
|
873 fprintf(stdout, "Source: %s\n", bundle_spec.source.uri); |
|
874 fprintf(stdout, "Destination: %s\n", bundle_spec.dest.uri); |
|
875 fprintf(stdout, "Reply-To: %s\n", bundle_spec.replyto.uri); |
871 } |
876 } |
872 |
877 |
873 // extract the bpq |
878 // extract the bpq |
874 num_blocks = bundle_spec.blocks.blocks_len; |
879 num_blocks = bundle_spec.blocks.blocks_len; |
875 bpq_blocks = bundle_spec.blocks.blocks_val; |
880 bpq_blocks = bundle_spec.blocks.blocks_val; |
876 |
881 |
877 for (i = 0; i < num_blocks; ++i) { |
882 for (i = 0; i < num_blocks; ++i) { |
878 if (bpq_blocks[i].type == DTN_BPQ_BLOCK_TYPE) { |
883 if (bpq_blocks[i].type == DTN_BPQ_BLOCK_TYPE) { |
|
884 has_bpq_block = 1; |
879 |
885 |
880 if (verbose) fprintf(stdout, "bundle contains a " |
886 if (verbose) fprintf(stdout, "bundle contains a " |
881 "BPQ extension block\n"); |
887 "BPQ extension block\n"); |
882 |
888 |
883 if ( bpq_blocks[i].data.data_len <= 0 || |
889 if ( bpq_blocks[i].data.data_len <= 0 || |