00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef CCN_CCN_DEFINED
00023 #define CCN_CCN_DEFINED
00024
00025 #include <stdint.h>
00026 #include <ccn/coding.h>
00027 #include <ccn/charbuf.h>
00028 #include <ccn/indexbuf.h>
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #define CCN_API_VERSION 6003
00041
00042
00043
00044
00045
00046
00047 #define CCN_INTEREST_LIFETIME_SEC 4
00048 #define CCN_INTEREST_LIFETIME_MICROSEC (CCN_INTEREST_LIFETIME_SEC * 1000000)
00049
00050
00051 struct ccn;
00052 struct ccn_pkey;
00053
00054
00055 struct ccn_closure;
00056 struct ccn_upcall_info;
00057 struct ccn_parsed_interest;
00058 struct ccn_parsed_ContentObject;
00059 struct ccn_parsed_Link;
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 enum ccn_upcall_kind {
00074 CCN_UPCALL_FINAL,
00075 CCN_UPCALL_INTEREST,
00076 CCN_UPCALL_CONSUMED_INTEREST,
00077 CCN_UPCALL_CONTENT,
00078 CCN_UPCALL_INTEREST_TIMED_OUT,
00079 CCN_UPCALL_CONTENT_UNVERIFIED,
00080 CCN_UPCALL_CONTENT_BAD,
00081 CCN_UPCALL_CONTENT_KEYMISSING,
00082 CCN_UPCALL_CONTENT_RAW
00083 };
00084
00085
00086
00087
00088 enum ccn_upcall_res {
00089 CCN_UPCALL_RESULT_ERR = -1,
00090 CCN_UPCALL_RESULT_OK = 0,
00091 CCN_UPCALL_RESULT_REEXPRESS = 1,
00092 CCN_UPCALL_RESULT_INTEREST_CONSUMED = 2,
00093 CCN_UPCALL_RESULT_VERIFY = 3,
00094 CCN_UPCALL_RESULT_FETCHKEY = 4
00095 };
00096
00097
00098
00099
00100
00101 typedef enum ccn_upcall_res (*ccn_handler)(
00102 struct ccn_closure *selfp,
00103 enum ccn_upcall_kind kind,
00104 struct ccn_upcall_info *info
00105 );
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117 struct ccn_closure {
00118 ccn_handler p;
00119 void *data;
00120 intptr_t intdata;
00121 int refcount;
00122 };
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 struct ccn_upcall_info {
00134 struct ccn *h;
00135
00136 const unsigned char *interest_ccnb;
00137 struct ccn_parsed_interest *pi;
00138 struct ccn_indexbuf *interest_comps;
00139 int matched_comps;
00140
00141 const unsigned char *content_ccnb;
00142 struct ccn_parsed_ContentObject *pco;
00143 struct ccn_indexbuf *content_comps;
00144 };
00145
00146
00147
00148
00149
00150
00151
00152 struct ccn *ccn_create(void);
00153
00154
00155
00156
00157
00158
00159
00160 int ccn_connect(struct ccn *h, const char *name);
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 int ccn_get_connection_fd(struct ccn *h);
00171
00172
00173
00174
00175
00176
00177 int ccn_disconnect(struct ccn *h);
00178
00179
00180
00181
00182
00183 void ccn_destroy(struct ccn **hp);
00184
00185
00186 int ccn_defer_verification(struct ccn *h, int defer);
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198 int ccn_name_init(struct ccn_charbuf *c);
00199
00200
00201
00202
00203
00204
00205 int ccn_name_append(struct ccn_charbuf *c, const void *component, size_t n);
00206
00207
00208
00209
00210
00211
00212
00213
00214 int ccn_name_append_str(struct ccn_charbuf *c, const char *s);
00215
00216
00217
00218
00219
00220
00221
00222 int ccn_name_append_components(struct ccn_charbuf *c,
00223 const unsigned char *ccnb,
00224 size_t start, size_t stop);
00225
00226 enum ccn_marker {
00227 CCN_MARKER_NONE = -1,
00228 CCN_MARKER_SEQNUM = 0x00,
00229 CCN_MARKER_CONTROL = 0xC1,
00230 CCN_MARKER_OSEQNUM = 0xF8,
00231 CCN_MARKER_BLKID = 0xFB,
00232 CCN_MARKER_VERSION = 0xFD
00233 };
00234
00235
00236
00237
00238
00239
00240
00241 int ccn_name_append_numeric(struct ccn_charbuf *c,
00242 enum ccn_marker tag, uintmax_t value);
00243
00244
00245
00246
00247
00248
00249 int ccn_name_append_nonce(struct ccn_charbuf *c);
00250
00251
00252
00253
00254
00255
00256
00257 int ccn_name_split(const struct ccn_charbuf *c,
00258 struct ccn_indexbuf* components);
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268 int ccn_name_chop(struct ccn_charbuf *c,
00269 struct ccn_indexbuf* components, int n);
00270
00271
00272
00273
00274
00275
00276
00277 enum ccn_content_type {
00278 CCN_CONTENT_DATA = 0x0C04C0,
00279 CCN_CONTENT_ENCR = 0x10D091,
00280 CCN_CONTENT_GONE = 0x18E344,
00281 CCN_CONTENT_KEY = 0x28463F,
00282 CCN_CONTENT_LINK = 0x2C834A,
00283 CCN_CONTENT_NACK = 0x34008A
00284 };
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304 int ccn_express_interest(struct ccn *h,
00305 struct ccn_charbuf *namebuf,
00306 struct ccn_closure *action,
00307 struct ccn_charbuf *interest_template);
00308
00309
00310
00311
00312 int ccn_set_interest_filter(struct ccn *h, struct ccn_charbuf *namebuf,
00313 struct ccn_closure *action);
00314
00315
00316
00317
00318 int ccn_set_interest_filter_with_flags(struct ccn *h,
00319 struct ccn_charbuf *namebuf,
00320 struct ccn_closure *action,
00321 int forw_flags);
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331 int ccn_put(struct ccn *h, const void *p, size_t length);
00332
00333
00334
00335
00336
00337
00338 int ccn_output_is_pending(struct ccn *h);
00339
00340
00341
00342
00343
00344
00345
00346 int ccn_run(struct ccn *h, int timeout);
00347
00348
00349
00350
00351
00352
00353 int ccn_set_run_timeout(struct ccn *h, int timeout);
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368 int ccn_get(struct ccn *h,
00369 struct ccn_charbuf *name,
00370 struct ccn_charbuf *interest_template,
00371 int timeout_ms,
00372 struct ccn_charbuf *resultbuf,
00373 struct ccn_parsed_ContentObject *pcobuf,
00374 struct ccn_indexbuf *compsbuf,
00375 int flags);
00376
00377 #define CCN_GET_NOKEYWAIT 1
00378
00379
00380 int ccn_verify_content(struct ccn *h,
00381 const unsigned char *msg,
00382 struct ccn_parsed_ContentObject *pco);
00383
00384
00385
00386
00387
00388
00389 struct ccn_buf_decoder {
00390 struct ccn_skeleton_decoder decoder;
00391 const unsigned char *buf;
00392 size_t size;
00393 };
00394
00395 struct ccn_buf_decoder *ccn_buf_decoder_start(struct ccn_buf_decoder *d,
00396 const unsigned char *buf, size_t size);
00397
00398 void ccn_buf_advance(struct ccn_buf_decoder *d);
00399 int ccn_buf_advance_past_element(struct ccn_buf_decoder *d);
00400
00401
00402
00403 int ccn_buf_match_dtag(struct ccn_buf_decoder *d, enum ccn_dtag dtag);
00404
00405 int ccn_buf_match_some_dtag(struct ccn_buf_decoder *d);
00406
00407 int ccn_buf_match_some_blob(struct ccn_buf_decoder *d);
00408 int ccn_buf_match_blob(struct ccn_buf_decoder *d,
00409 const unsigned char **bufp, size_t *sizep);
00410
00411 int ccn_buf_match_udata(struct ccn_buf_decoder *d, const char *s);
00412
00413 int ccn_buf_match_attr(struct ccn_buf_decoder *d, const char *s);
00414
00415
00416 int ccn_parse_required_tagged_BLOB(struct ccn_buf_decoder *d,
00417 enum ccn_dtag dtag,
00418 int minlen, int maxlen);
00419 int ccn_parse_optional_tagged_BLOB(struct ccn_buf_decoder *d,
00420 enum ccn_dtag dtag,
00421 int minlen, int maxlen);
00422 int ccn_parse_nonNegativeInteger(struct ccn_buf_decoder *d);
00423 int ccn_parse_optional_tagged_nonNegativeInteger(struct ccn_buf_decoder *d,
00424 enum ccn_dtag dtag);
00425 int ccn_parse_uintmax(struct ccn_buf_decoder *d, uintmax_t *result);
00426 int ccn_parse_tagged_string(struct ccn_buf_decoder *d,
00427 enum ccn_dtag dtag, struct ccn_charbuf *store);
00428
00429 uintmax_t ccn_parse_required_tagged_binary_number(struct ccn_buf_decoder *d,
00430 enum ccn_dtag dtag,
00431 int minlen, int maxlen);
00432 uintmax_t ccn_parse_optional_tagged_binary_number(struct ccn_buf_decoder *d,
00433 enum ccn_dtag dtag,
00434 int minlen, int maxlen,
00435 uintmax_t default_value);
00436
00437
00438
00439 void ccn_buf_check_close(struct ccn_buf_decoder *d);
00440
00441
00442
00443
00444
00445 int ccn_ref_tagged_BLOB(enum ccn_dtag tt,
00446 const unsigned char *buf,
00447 size_t start, size_t stop,
00448 const unsigned char **presult, size_t *psize);
00449
00450
00451
00452
00453
00454
00455
00456 int ccn_ref_tagged_string(enum ccn_dtag tt,
00457 const unsigned char *buf,
00458 size_t start, size_t stop,
00459 const unsigned char **presult, size_t *psize);
00460
00461 int ccn_fetch_tagged_nonNegativeInteger(enum ccn_dtag tt,
00462 const unsigned char *buf, size_t start, size_t stop);
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482 enum ccn_parsed_interest_offsetid {
00483 CCN_PI_B_Name,
00484 CCN_PI_B_Component0,
00485 CCN_PI_B_LastPrefixComponent,
00486 CCN_PI_E_LastPrefixComponent,
00487 CCN_PI_E_ComponentLast = CCN_PI_E_LastPrefixComponent,
00488 CCN_PI_E_Name,
00489 CCN_PI_B_MinSuffixComponents,
00490 CCN_PI_E_MinSuffixComponents,
00491 CCN_PI_B_MaxSuffixComponents,
00492 CCN_PI_E_MaxSuffixComponents,
00493 CCN_PI_B_PublisherID,
00494 CCN_PI_B_PublisherIDKeyDigest,
00495 CCN_PI_E_PublisherIDKeyDigest,
00496 CCN_PI_E_PublisherID,
00497 CCN_PI_B_Exclude,
00498 CCN_PI_E_Exclude,
00499 CCN_PI_B_ChildSelector,
00500 CCN_PI_E_ChildSelector,
00501 CCN_PI_B_AnswerOriginKind,
00502 CCN_PI_E_AnswerOriginKind,
00503 CCN_PI_B_Scope,
00504 CCN_PI_E_Scope,
00505 CCN_PI_B_InterestLifetime,
00506 CCN_PI_E_InterestLifetime,
00507 CCN_PI_B_Nonce,
00508 CCN_PI_E_Nonce,
00509 CCN_PI_B_OTHER,
00510 CCN_PI_E_OTHER,
00511 CCN_PI_E
00512 };
00513
00514 struct ccn_parsed_interest {
00515 int magic;
00516 int prefix_comps;
00517 int min_suffix_comps;
00518 int max_suffix_comps;
00519 int orderpref;
00520 int answerfrom;
00521 int scope;
00522 unsigned short offset[CCN_PI_E+1];
00523 };
00524
00525 enum ccn_parsed_Link_offsetid {
00526 CCN_PL_B_Name,
00527 CCN_PL_B_Component0,
00528 CCN_PL_E_ComponentLast,
00529 CCN_PL_E_Name,
00530 CCN_PL_B_Label,
00531 CCN_PL_E_Label,
00532 CCN_PL_B_LinkAuthenticator,
00533 CCN_PL_B_PublisherID,
00534 CCN_PL_B_PublisherDigest,
00535 CCN_PL_E_PublisherDigest,
00536 CCN_PL_E_PublisherID,
00537 CCN_PL_B_NameComponentCount,
00538 CCN_PL_E_NameComponentCount,
00539 CCN_PL_B_Timestamp,
00540 CCN_PL_E_Timestamp,
00541 CCN_PL_B_Type,
00542 CCN_PL_E_Type,
00543 CCN_PL_B_ContentDigest,
00544 CCN_PL_E_ContentDigest,
00545 CCN_PL_E_LinkAuthenticator,
00546 CCN_PL_E
00547 };
00548
00549 struct ccn_parsed_Link {
00550 int name_ncomps;
00551 int name_component_count;
00552 int publisher_digest_type;
00553 int type;
00554 unsigned short offset[CCN_PL_E+1];
00555 };
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565 int
00566 ccn_parse_Link(struct ccn_buf_decoder *d,
00567 struct ccn_parsed_Link *link,
00568 struct ccn_indexbuf *components);
00569
00570
00571
00572
00573 int
00574 ccnb_append_Link(struct ccn_charbuf *buf,
00575 const struct ccn_charbuf *name,
00576 const char *label,
00577 const struct ccn_charbuf *linkAuthenticator
00578 );
00579
00580
00581
00582
00583 int
00584 ccn_parse_LinkAuthenticator(struct ccn_buf_decoder *d,
00585 struct ccn_parsed_Link *link);
00586
00587
00588
00589
00590
00591 int
00592 ccn_parse_Collection_start(struct ccn_buf_decoder *d);
00593
00594
00595
00596
00597
00598 int
00599 ccn_parse_Collection_next(struct ccn_buf_decoder *d,
00600 struct ccn_parsed_Link *link,
00601 struct ccn_indexbuf *components);
00602
00603
00604
00605
00606 #define CCN_AOK_CS 0x1
00607 #define CCN_AOK_NEW 0x2
00608 #define CCN_AOK_DEFAULT (CCN_AOK_CS | CCN_AOK_NEW)
00609 #define CCN_AOK_STALE 0x4
00610 #define CCN_AOK_EXPIRE 0x10
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620 int
00621 ccn_parse_interest(const unsigned char *msg, size_t size,
00622 struct ccn_parsed_interest *interest,
00623 struct ccn_indexbuf *components);
00624
00625
00626
00627
00628
00629 intmax_t ccn_interest_lifetime(const unsigned char *msg,
00630 const struct ccn_parsed_interest *pi);
00631
00632
00633
00634
00635 int ccn_interest_lifetime_seconds(const unsigned char *msg,
00636 const struct ccn_parsed_interest *pi);
00637
00638
00639
00640 enum ccn_parsed_content_object_offsetid {
00641 CCN_PCO_B_Signature,
00642 CCN_PCO_B_DigestAlgorithm,
00643 CCN_PCO_E_DigestAlgorithm,
00644 CCN_PCO_B_Witness,
00645 CCN_PCO_E_Witness,
00646 CCN_PCO_B_SignatureBits,
00647 CCN_PCO_E_SignatureBits,
00648 CCN_PCO_E_Signature,
00649 CCN_PCO_B_Name,
00650 CCN_PCO_B_Component0,
00651 CCN_PCO_E_ComponentN,
00652 CCN_PCO_E_ComponentLast = CCN_PCO_E_ComponentN,
00653 CCN_PCO_E_Name,
00654 CCN_PCO_B_SignedInfo,
00655 CCN_PCO_B_PublisherPublicKeyDigest,
00656 CCN_PCO_E_PublisherPublicKeyDigest,
00657 CCN_PCO_B_Timestamp,
00658 CCN_PCO_E_Timestamp,
00659 CCN_PCO_B_Type,
00660 CCN_PCO_E_Type,
00661 CCN_PCO_B_FreshnessSeconds,
00662 CCN_PCO_E_FreshnessSeconds,
00663 CCN_PCO_B_FinalBlockID,
00664 CCN_PCO_E_FinalBlockID,
00665 CCN_PCO_B_KeyLocator,
00666
00667 CCN_PCO_B_Key_Certificate_KeyName,
00668 CCN_PCO_B_KeyName_Name,
00669 CCN_PCO_E_KeyName_Name,
00670 CCN_PCO_B_KeyName_Pub,
00671 CCN_PCO_E_KeyName_Pub,
00672 CCN_PCO_E_Key_Certificate_KeyName,
00673 CCN_PCO_E_KeyLocator,
00674 CCN_PCO_E_SignedInfo,
00675 CCN_PCO_B_Content,
00676 CCN_PCO_E_Content,
00677 CCN_PCO_E
00678 };
00679
00680 struct ccn_parsed_ContentObject {
00681 int magic;
00682 enum ccn_content_type type;
00683 int name_ncomps;
00684 unsigned short offset[CCN_PCO_E+1];
00685 unsigned char digest[32];
00686 int digest_bytes;
00687 };
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699 int ccn_parse_ContentObject(const unsigned char *msg, size_t size,
00700 struct ccn_parsed_ContentObject *x,
00701 struct ccn_indexbuf *components);
00702
00703 void ccn_digest_ContentObject(const unsigned char *msg,
00704 struct ccn_parsed_ContentObject *pc);
00705
00706
00707
00708
00709
00710
00711 int ccn_parse_Name(struct ccn_buf_decoder *d, struct ccn_indexbuf *components);
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722 int ccn_compare_names(const unsigned char *a, size_t asize,
00723 const unsigned char *b, size_t bsize);
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741 int ccn_name_comp_strcmp(const unsigned char *data,
00742 const struct ccn_indexbuf *indexbuf,
00743 unsigned int i,
00744 const char *val);
00745
00746
00747
00748
00749
00750 int ccn_name_comp_get(const unsigned char *data,
00751 const struct ccn_indexbuf *indexbuf,
00752 unsigned int i,
00753 const unsigned char **comp, size_t *size);
00754
00755 int ccn_name_next_sibling(struct ccn_charbuf *c);
00756
00757
00758
00759
00760
00761 int ccn_content_get_value(const unsigned char *data, size_t data_size,
00762 const struct ccn_parsed_ContentObject *content,
00763 const unsigned char **value, size_t *size);
00764
00765
00766 int
00767 ccn_is_final_block(struct ccn_upcall_info *info);
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799 struct ccn_signing_params {
00800 int api_version;
00801 int sp_flags;
00802 struct ccn_charbuf *template_ccnb;
00803 unsigned char pubid[32];
00804 enum ccn_content_type type;
00805 int freshness;
00806
00807 };
00808
00809 #define CCN_SIGNING_PARAMS_INIT \
00810 { CCN_API_VERSION, 0, NULL, {0}, CCN_CONTENT_DATA, -1 }
00811
00812 #define CCN_SP_TEMPL_TIMESTAMP 0x0001
00813 #define CCN_SP_TEMPL_FINAL_BLOCK_ID 0x0002
00814 #define CCN_SP_TEMPL_FRESHNESS 0x0004
00815 #define CCN_SP_TEMPL_KEY_LOCATOR 0x0008
00816 #define CCN_SP_FINAL_BLOCK 0x0010
00817 #define CCN_SP_OMIT_KEY_LOCATOR 0x0020
00818
00819 int ccn_sign_content(struct ccn *h,
00820 struct ccn_charbuf *resultbuf,
00821 const struct ccn_charbuf *name_prefix,
00822 const struct ccn_signing_params *params,
00823 const void *data, size_t size);
00824
00825 int ccn_load_private_key(struct ccn *h,
00826 const char *keystore_path,
00827 const char *keystore_passphrase,
00828 struct ccn_charbuf *pubid_out);
00829
00830 int ccn_load_default_key(struct ccn *h,
00831 const char *keystore_path,
00832 const char *keystore_passphrase);
00833
00834 int ccn_get_public_key(struct ccn *h,
00835 const struct ccn_signing_params *params,
00836 struct ccn_charbuf *digest_result,
00837 struct ccn_charbuf *result);
00838
00839 int ccn_chk_signing_params(struct ccn *h,
00840 const struct ccn_signing_params *params,
00841 struct ccn_signing_params *result,
00842 struct ccn_charbuf **ptimestamp,
00843 struct ccn_charbuf **pfinalblockid,
00844 struct ccn_charbuf **pkeylocator);
00845
00846
00847
00848 #define CCN_SIGNING_DEFAULT_DIGEST_ALGORITHM "SHA256"
00849
00850 int ccn_signed_info_create(
00851 struct ccn_charbuf *c,
00852 const void *publisher_key_id,
00853 size_t publisher_key_id_size,
00854 const struct ccn_charbuf *timestamp,
00855 enum ccn_content_type type,
00856 int freshness,
00857 const struct ccn_charbuf *finalblockid,
00858 const struct ccn_charbuf *key_locator);
00859
00860 int ccn_encode_ContentObject(struct ccn_charbuf *buf,
00861 const struct ccn_charbuf *Name,
00862 const struct ccn_charbuf *SignedInfo,
00863 const void *data,
00864 size_t size,
00865 const char *digest_algorithm,
00866 const struct ccn_pkey *private_key);
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883 int ccn_content_matches_interest(const unsigned char *content_object,
00884 size_t content_object_size,
00885 int implicit_content_digest,
00886 struct ccn_parsed_ContentObject *pc,
00887 const unsigned char *interest_msg,
00888 size_t interest_msg_size,
00889 const struct ccn_parsed_interest *pi);
00890
00891
00892
00893
00894 int ccn_excluded(const unsigned char *excl,
00895 size_t excl_size,
00896 const unsigned char *nextcomp,
00897 size_t nextcomp_size);
00898
00899
00900
00901
00902 int ccn_encode_StatusResponse(struct ccn_charbuf *buf,
00903 int errcode, const char *errtext);
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914 void ccn_perror(struct ccn *h, const char *s);
00915 int ccn_seterror(struct ccn *h, int error_code);
00916 int ccn_geterror(struct ccn *h);
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929 int ccn_charbuf_append_tt(struct ccn_charbuf *c, size_t val, enum ccn_tt tt);
00930
00931
00932
00933
00934
00935
00936
00937
00938 int ccn_charbuf_append_closer(struct ccn_charbuf *c);
00939
00940
00941
00942
00943
00944
00945
00946
00947 int ccnb_append_number(struct ccn_charbuf *c, int nni);
00948
00949
00950
00951
00952
00953 int ccnb_append_timestamp_blob(struct ccn_charbuf *c,
00954 enum ccn_marker marker,
00955 intmax_t secs, int nsecs);
00956
00957
00958
00959
00960 int ccnb_append_now_blob(struct ccn_charbuf *c, enum ccn_marker marker);
00961
00962
00963
00964
00965 int ccnb_element_begin(struct ccn_charbuf *c, enum ccn_dtag dtag);
00966
00967
00968
00969
00970
00971 int ccnb_element_end(struct ccn_charbuf *c);
00972
00973
00974
00975
00976 int ccnb_append_tagged_blob(struct ccn_charbuf *c, enum ccn_dtag dtag,
00977 const void *data, size_t size);
00978
00979
00980
00981
00982 int ccnb_tagged_putf(struct ccn_charbuf *c, enum ccn_dtag dtag,
00983 const char *fmt, ...);
00984
00985
00986
00987
00988
00989
00990 #define CCN_V_REPLACE 1
00991 #define CCN_V_LOW 2
00992 #define CCN_V_HIGH 4
00993 #define CCN_V_EST 8
00994 #define CCN_V_LOWEST (2|8)
00995 #define CCN_V_HIGHEST (4|8)
00996 #define CCN_V_NEXT (4|1)
00997 #define CCN_V_PREV (2|1)
00998 #define CCN_V_NOW 16
00999 #define CCN_V_NESTOK 32
01000
01001 int ccn_resolve_version(struct ccn *h,
01002 struct ccn_charbuf *name,
01003 int versioning_flags,
01004 int timeout_ms);
01005
01006 int ccn_create_version(struct ccn *h,
01007 struct ccn_charbuf *name,
01008 int versioning_flags,
01009 intmax_t secs, int nsecs);
01010
01011 #endif