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