blob: 74c5daf0b881307a0386a18cb7952fbc4c1b7ac0 [file] [log] [blame]
Yingdi Yu77627ab2015-07-21 16:13:49 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2013-2014 Regents of the University of California.
4 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6 *
7 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20 */
21
22#ifndef NDN_PIB_PIB_COMMON_HPP
23#define NDN_PIB_PIB_COMMON_HPP
24
25namespace ndn {
26namespace pib {
27
28/// @sa http://redmine.named-data.net/projects/ndn-cxx/wiki/PublicKey_Info_Base
29
30enum {
31 OFFSET_USER = 2,
32 OFFSET_VERB = 3,
33 OFFSET_PARAM = 4,
34 OFFSET_TIMESTAMP = 5,
35 OFFSET_NONCE = 6,
36 OFFSET_SIG_INFO = 7,
37 OFFSET_SIG_VALUE = 8,
38
39 MIN_PIB_INTEREST_SIZE = 5,
40 SIGNED_PIB_INTEREST_SIZE = 9
41};
42
43enum Type {
44 TYPE_USER = 0,
45 TYPE_ID = 1,
46 TYPE_KEY = 2,
47 TYPE_CERT = 3,
48 TYPE_DEFAULT = 255
49};
50
51enum DefaultOpt {
52 DEFAULT_OPT_NO = 0,
53 DEFAULT_OPT_KEY = 1, // 0x01
54 DEFAULT_OPT_ID = 3, // 0x03
55 DEFAULT_OPT_USER = 7 // 0x07
56};
57
58enum DefaultOptMask {
59 DEFAULT_OPT_KEY_MASK = 0x1,
60 DEFAULT_OPT_ID_MASK = 0x2,
61 DEFAULT_OPT_USER_MASK = 0x4
62};
63
64enum ErrCode {
65 ERR_SUCCESS = 0,
66
67 // Invalid query
68 ERR_INCOMPLETE_COMMAND = 1,
69 ERR_WRONG_VERB = 2,
70 ERR_WRONG_PARAM = 3,
71 ERR_WRONG_SIGNER = 4,
72 ERR_INTERNAL_ERROR = 5,
73
74 // Non existing entity
75 ERR_NON_EXISTING_USER = 128,
76 ERR_NON_EXISTING_ID = 129,
77 ERR_NON_EXISTING_KEY = 130,
78 ERR_NON_EXISTING_CERT = 131,
79
80 // No default setting
81 ERR_NO_DEFAULT_ID = 256,
82 ERR_NO_DEFAULT_KEY = 257,
83 ERR_NO_DEFAULT_CERT = 258,
84
85 // Delete default setting
86 ERR_DELETE_DEFAULT_SETTING = 384
87};
88
89} // namespace pib
90
91
92namespace tlv {
93namespace pib {
94
95enum ParamType {
96 GetParam = 128, // 0x80
97 DefaultParam = 129, // 0x81
98 ListParam = 130, // 0x82
99 UpdateParam = 131, // 0x83
100 DeleteParam = 132 // 0x84
101};
102
103enum EntityType {
104 User = 144, // 0x90
105 Identity = 145, // 0x91
106 PublicKey = 146, // 0x92
107 Certificate = 147 // 0x93
108};
109
110// Other
111enum {
112 Bytes = 148, // 0x94
113 DefaultOpt = 149, // 0x95
114 NameList = 150, // 0x96
115 Type = 151, // 0x97
116 Error = 152, // 0x98
117 TpmLocator = 153, // 0x99
118
119 // ErrorCode
120 ErrorCode = 252 // 0xfc
121};
122
123} // namespace pib
124} // namespace tlv
125} // namespace ndn
126
127
128#endif // NDN_PIB_PIB_COMMON_HPP