blob: 3e297715c1e3e055e176ca1f49e5672cd648a11e [file] [log] [blame]
Yingdi Yu77627ab2015-07-21 16:13:49 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Yingdi Yu0a312e52015-07-22 13:14:53 -07003 * Copyright (c) 2014-2015, Regents of the University of California.
Yingdi Yu77627ab2015-07-21 16:13:49 -07004 *
Yingdi Yu0a312e52015-07-22 13:14:53 -07005 * This file is part of ndn-tools (Named Data Networking Essential Tools).
6 * See AUTHORS.md for complete list of ndn-tools authors and contributors.
Yingdi Yu77627ab2015-07-21 16:13:49 -07007 *
Yingdi Yu0a312e52015-07-22 13:14:53 -07008 * ndn-tools is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
Yingdi Yu77627ab2015-07-21 16:13:49 -070011 *
Yingdi Yu0a312e52015-07-22 13:14:53 -070012 * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
Yingdi Yu77627ab2015-07-21 16:13:49 -070015 *
Yingdi Yu0a312e52015-07-22 13:14:53 -070016 * You should have received a copy of the GNU General Public License along with
17 * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
Yingdi Yu77627ab2015-07-21 16:13:49 -070018 *
Yingdi Yu0a312e52015-07-22 13:14:53 -070019 * @author Yingdi Yu <yingdi@cs.ucla.edu>
Yingdi Yu77627ab2015-07-21 16:13:49 -070020 */
21
Yingdi Yu0a312e52015-07-22 13:14:53 -070022#ifndef NDN_TOOLS_PIB_PIB_COMMON_HPP
23#define NDN_TOOLS_PIB_PIB_COMMON_HPP
Yingdi Yu77627ab2015-07-21 16:13:49 -070024
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
Yingdi Yu0a312e52015-07-22 13:14:53 -0700128#endif // NDN_TOOLS_PIB_PIB_COMMON_HPP