Alexander Afanasyev | 42290b2 | 2017-03-09 12:58:29 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Alexander Afanasyev | c0e2658 | 2017-08-13 21:16:49 -0400 | [diff] [blame] | 2 | /* |
Davide Pesavento | c221e36 | 2019-01-24 22:26:54 -0500 | [diff] [blame] | 3 | * Copyright (c) 2014-2019, Regents of the University of California. |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of NDN repo-ng (Next generation of NDN repository). |
| 6 | * See AUTHORS.md for complete list of repo-ng authors and contributors. |
| 7 | * |
| 8 | * repo-ng 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. |
| 11 | * |
| 12 | * repo-ng 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. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along with |
| 17 | * repo-ng, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
Davide Pesavento | c221e36 | 2019-01-24 22:26:54 -0500 | [diff] [blame] | 20 | #include <ndn-cxx/data.hpp> |
| 21 | #include <ndn-cxx/face.hpp> |
| 22 | #include <ndn-cxx/interest.hpp> |
Alexander Afanasyev | c0e2658 | 2017-08-13 21:16:49 -0400 | [diff] [blame] | 23 | |
Wentao Shang | 91fb4f2 | 2014-05-20 10:55:22 -0700 | [diff] [blame] | 24 | #include <fstream> |
Alexander Afanasyev | c0e2658 | 2017-08-13 21:16:49 -0400 | [diff] [blame] | 25 | #include <iostream> |
Davide Pesavento | 31be3f6 | 2019-01-24 23:20:23 -0500 | [diff] [blame] | 26 | #include <unistd.h> |
Alexander Afanasyev | c0e2658 | 2017-08-13 21:16:49 -0400 | [diff] [blame] | 27 | |
| 28 | #include <boost/lexical_cast.hpp> |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 29 | |
| 30 | namespace repo { |
| 31 | |
Wentao Shang | a8f3c40 | 2014-10-30 14:03:27 -0700 | [diff] [blame] | 32 | using ndn::Name; |
| 33 | using ndn::Interest; |
| 34 | using ndn::Data; |
Wentao Shang | a8f3c40 | 2014-10-30 14:03:27 -0700 | [diff] [blame] | 35 | |
Davide Pesavento | c221e36 | 2019-01-24 22:26:54 -0500 | [diff] [blame] | 36 | class Consumer : boost::noncopyable |
| 37 | { |
| 38 | public: |
| 39 | Consumer(const std::string& dataName, std::ostream& os, |
| 40 | bool verbose, bool versioned, bool single, |
| 41 | int interestLifetime, int timeout, |
| 42 | bool mustBeFresh = false, |
| 43 | bool canBePrefix = false) |
| 44 | : m_dataName(dataName) |
| 45 | , m_os(os) |
| 46 | , m_verbose(verbose) |
| 47 | , m_hasVersion(versioned) |
| 48 | , m_isSingle(single) |
| 49 | , m_isFinished(false) |
| 50 | , m_isFirst(true) |
| 51 | , m_interestLifetime(interestLifetime) |
| 52 | , m_timeout(timeout) |
| 53 | , m_nextSegment(0) |
| 54 | , m_totalSize(0) |
| 55 | , m_retryCount(0) |
| 56 | , m_mustBeFresh(mustBeFresh) |
| 57 | , m_canBePrefix(canBePrefix) |
| 58 | { |
| 59 | } |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 60 | |
Davide Pesavento | c221e36 | 2019-01-24 22:26:54 -0500 | [diff] [blame] | 61 | void |
| 62 | run(); |
| 63 | |
| 64 | private: |
| 65 | void |
| 66 | fetchData(const ndn::Name& name); |
| 67 | |
| 68 | void |
| 69 | onVersionedData(const ndn::Interest& interest, const ndn::Data& data); |
| 70 | |
| 71 | void |
| 72 | onUnversionedData(const ndn::Interest& interest, const ndn::Data& data); |
| 73 | |
| 74 | void |
| 75 | onTimeout(const ndn::Interest& interest); |
| 76 | |
| 77 | void |
| 78 | readData(const ndn::Data& data); |
| 79 | |
| 80 | void |
| 81 | fetchNextData(const ndn::Name& name, const ndn::Data& data); |
| 82 | |
| 83 | private: |
| 84 | ndn::Face m_face; |
| 85 | ndn::Name m_dataName; |
| 86 | std::ostream& m_os; |
| 87 | bool m_verbose; |
| 88 | bool m_hasVersion; |
| 89 | bool m_isSingle; |
| 90 | bool m_isFinished; |
| 91 | bool m_isFirst; |
| 92 | ndn::time::milliseconds m_interestLifetime; |
| 93 | ndn::time::milliseconds m_timeout; |
| 94 | uint64_t m_nextSegment; |
| 95 | int m_totalSize; |
| 96 | int m_retryCount; |
| 97 | bool m_mustBeFresh; |
| 98 | bool m_canBePrefix; |
| 99 | |
| 100 | static constexpr int MAX_RETRY = 3; |
| 101 | }; |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 102 | |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 103 | void |
| 104 | Consumer::fetchData(const Name& name) |
| 105 | { |
| 106 | Interest interest(name); |
| 107 | interest.setInterestLifetime(m_interestLifetime); |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 108 | if (m_hasVersion) { |
| 109 | interest.setMustBeFresh(m_mustBeFresh); |
| 110 | } |
| 111 | else { |
| 112 | interest.setMustBeFresh(true); |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 113 | } |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 114 | |
weijia yuan | 3aa8d2b | 2018-03-06 15:35:57 -0800 | [diff] [blame] | 115 | interest.setCanBePrefix(m_canBePrefix); |
| 116 | |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 117 | m_face.expressInterest(interest, |
weijia yuan | 3aa8d2b | 2018-03-06 15:35:57 -0800 | [diff] [blame] | 118 | m_hasVersion ? std::bind(&Consumer::onVersionedData, this, _1, _2) |
| 119 | : std::bind(&Consumer::onUnversionedData, this, _1, _2), |
| 120 | std::bind(&Consumer::onTimeout, this, _1), // Nack |
| 121 | std::bind(&Consumer::onTimeout, this, _1)); |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | void |
| 125 | Consumer::run() |
| 126 | { |
| 127 | // Send the first Interest |
| 128 | Name name(m_dataName); |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 129 | |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 130 | m_nextSegment++; |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 131 | fetchData(name); |
| 132 | |
| 133 | // processEvents will block until the requested data received or timeout occurs |
| 134 | m_face.processEvents(m_timeout); |
| 135 | } |
| 136 | |
| 137 | void |
Alexander Afanasyev | 42290b2 | 2017-03-09 12:58:29 -0800 | [diff] [blame] | 138 | Consumer::onVersionedData(const Interest& interest, const Data& data) |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 139 | { |
| 140 | const Name& name = data.getName(); |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 141 | |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 142 | // the received data name may have segment number or not |
| 143 | if (name.size() == m_dataName.size()) { |
| 144 | if (!m_isSingle) { |
| 145 | Name fetchName = name; |
| 146 | fetchName.appendSegment(0); |
| 147 | fetchData(fetchName); |
| 148 | } |
| 149 | } |
| 150 | else if (name.size() == m_dataName.size() + 1) { |
| 151 | if (!m_isSingle) { |
| 152 | if (m_isFirst) { |
| 153 | uint64_t segment = name[-1].toSegment(); |
| 154 | if (segment != 0) { |
| 155 | fetchData(Name(m_dataName).appendSegment(0)); |
| 156 | m_isFirst = false; |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 157 | return; |
| 158 | } |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 159 | m_isFirst = false; |
| 160 | } |
| 161 | fetchNextData(name, data); |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 162 | } |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 163 | else { |
| 164 | std::cerr << "ERROR: Data is not stored in a single packet" << std::endl; |
| 165 | return; |
| 166 | } |
| 167 | } |
| 168 | else { |
| 169 | std::cerr << "ERROR: Name size does not match" << std::endl; |
| 170 | return; |
| 171 | } |
| 172 | readData(data); |
| 173 | } |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 174 | |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 175 | void |
Alexander Afanasyev | 42290b2 | 2017-03-09 12:58:29 -0800 | [diff] [blame] | 176 | Consumer::onUnversionedData(const Interest& interest, const Data& data) |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 177 | { |
| 178 | const Name& name = data.getName(); |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 179 | if (name.size() == m_dataName.size() + 1) { |
| 180 | if (!m_isSingle) { |
| 181 | Name fetchName = name; |
| 182 | fetchName.append(name[-1]).appendSegment(0); |
| 183 | fetchData(fetchName); |
| 184 | } |
| 185 | } |
| 186 | else if (name.size() == m_dataName.size() + 2) { |
| 187 | if (!m_isSingle) { |
| 188 | if (m_isFirst) { |
| 189 | uint64_t segment = name[-1].toSegment(); |
| 190 | if (segment != 0) { |
| 191 | fetchData(Name(m_dataName).append(name[-2]).appendSegment(0)); |
| 192 | m_isFirst = false; |
| 193 | return; |
| 194 | } |
| 195 | m_isFirst = false; |
| 196 | } |
| 197 | fetchNextData(name, data); |
| 198 | } |
| 199 | else { |
| 200 | std::cerr << "ERROR: Data is not stored in a single packet" << std::endl; |
| 201 | return; |
| 202 | } |
| 203 | } |
| 204 | else { |
| 205 | std::cerr << "ERROR: Name size does not match" << std::endl; |
| 206 | return; |
| 207 | } |
| 208 | readData(data); |
| 209 | } |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 210 | |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 211 | void |
| 212 | Consumer::readData(const Data& data) |
| 213 | { |
Davide Pesavento | c221e36 | 2019-01-24 22:26:54 -0500 | [diff] [blame] | 214 | const auto& content = data.getContent(); |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 215 | m_os.write(reinterpret_cast<const char*>(content.value()), content.value_size()); |
| 216 | m_totalSize += content.value_size(); |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 217 | if (m_verbose) { |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 218 | std::cerr << "LOG: received data = " << data.getName() << std::endl; |
| 219 | } |
| 220 | if (m_isFinished || m_isSingle) { |
weijia yuan | 3aa8d2b | 2018-03-06 15:35:57 -0800 | [diff] [blame] | 221 | std::cerr << "INFO: End of file is reached" << std::endl; |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 222 | std::cerr << "INFO: Total # of segments received: " << m_nextSegment << std::endl; |
| 223 | std::cerr << "INFO: Total # bytes of content received: " << m_totalSize << std::endl; |
| 224 | } |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 225 | } |
| 226 | |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 227 | void |
| 228 | Consumer::fetchNextData(const Name& name, const Data& data) |
| 229 | { |
| 230 | uint64_t segment = name[-1].toSegment(); |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 231 | BOOST_VERIFY(segment == (m_nextSegment - 1)); |
| 232 | |
Davide Pesavento | 0c13951 | 2018-11-03 18:23:38 -0400 | [diff] [blame] | 233 | auto finalBlockId = data.getFinalBlock(); |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 234 | if (finalBlockId == name[-1]) { |
| 235 | m_isFinished = true; |
| 236 | } |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 237 | else { |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 238 | // Reset retry counter |
| 239 | m_retryCount = 0; |
| 240 | if (m_hasVersion) |
| 241 | fetchData(Name(m_dataName).appendSegment(m_nextSegment++)); |
| 242 | else |
| 243 | fetchData(Name(m_dataName).append(name[-2]).appendSegment(m_nextSegment++)); |
| 244 | } |
| 245 | } |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 246 | |
| 247 | void |
| 248 | Consumer::onTimeout(const Interest& interest) |
| 249 | { |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 250 | if (m_retryCount++ < MAX_RETRY) { |
| 251 | // Retransmit the interest |
| 252 | fetchData(interest.getName()); |
weijia yuan | 82cf914 | 2018-10-21 12:25:02 -0700 | [diff] [blame] | 253 | if (m_verbose) { |
weijia yuan | 3aa8d2b | 2018-03-06 15:35:57 -0800 | [diff] [blame] | 254 | std::cerr << "TIMEOUT: retransmit interest for " << interest.getName() << std::endl; |
weijia yuan | 82cf914 | 2018-10-21 12:25:02 -0700 | [diff] [blame] | 255 | } |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 256 | } |
| 257 | else { |
| 258 | std::cerr << "TIMEOUT: last interest sent for segment #" << (m_nextSegment - 1) << std::endl; |
| 259 | std::cerr << "TIMEOUT: abort fetching after " << MAX_RETRY |
| 260 | << " times of retry" << std::endl; |
| 261 | } |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 262 | } |
| 263 | |
Davide Pesavento | 31be3f6 | 2019-01-24 23:20:23 -0500 | [diff] [blame] | 264 | static void |
| 265 | usage(const char* programName) |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 266 | { |
Davide Pesavento | 31be3f6 | 2019-01-24 23:20:23 -0500 | [diff] [blame] | 267 | std::cerr << "Usage: " |
| 268 | << programName << " [-v] [-s] [-u] [-l lifetime] [-w timeout] [-o filename] ndn-name\n" |
| 269 | << "\n" |
| 270 | << " -v: be verbose\n" |
| 271 | << " -s: only get single data packet\n" |
| 272 | << " -u: versioned: ndn-name contains version component\n" |
| 273 | << " if -u is not specified, this command will return the rightmost child for the prefix\n" |
| 274 | << " -l: InterestLifetime in milliseconds\n" |
| 275 | << " -w: timeout in milliseconds for whole process (default unlimited)\n" |
| 276 | << " -o: write to local file name instead of stdout\n" |
| 277 | << " ndn-name: NDN Name prefix for Data to be read\n" |
| 278 | << std::endl; |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 279 | } |
| 280 | |
Davide Pesavento | c221e36 | 2019-01-24 22:26:54 -0500 | [diff] [blame] | 281 | static int |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 282 | main(int argc, char** argv) |
| 283 | { |
| 284 | std::string name; |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 285 | const char* outputFile = nullptr; |
Weiqi Shi | 5822e34 | 2014-08-21 20:05:30 -0700 | [diff] [blame] | 286 | bool verbose = false, versioned = false, single = false; |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 287 | int interestLifetime = 4000; // in milliseconds |
| 288 | int timeout = 0; // in milliseconds |
| 289 | |
| 290 | int opt; |
Davide Pesavento | 31be3f6 | 2019-01-24 23:20:23 -0500 | [diff] [blame] | 291 | while ((opt = getopt(argc, argv, "hvsul:w:o:")) != -1) { |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 292 | switch (opt) { |
Davide Pesavento | 31be3f6 | 2019-01-24 23:20:23 -0500 | [diff] [blame] | 293 | case 'h': |
| 294 | usage(argv[0]); |
| 295 | return 0; |
| 296 | case 'v': |
| 297 | verbose = true; |
| 298 | break; |
| 299 | case 's': |
| 300 | single = true; |
| 301 | break; |
| 302 | case 'u': |
| 303 | versioned = true; |
| 304 | break; |
| 305 | case 'l': |
| 306 | try { |
| 307 | interestLifetime = boost::lexical_cast<int>(optarg); |
| 308 | } |
| 309 | catch (const boost::bad_lexical_cast&) { |
| 310 | std::cerr << "ERROR: -l option should be an integer" << std::endl; |
| 311 | return 2; |
| 312 | } |
| 313 | interestLifetime = std::max(interestLifetime, 0); |
| 314 | break; |
| 315 | case 'w': |
| 316 | try { |
| 317 | timeout = boost::lexical_cast<int>(optarg); |
| 318 | } |
| 319 | catch (const boost::bad_lexical_cast&) { |
| 320 | std::cerr << "ERROR: -w option should be an integer" << std::endl; |
| 321 | return 2; |
| 322 | } |
| 323 | timeout = std::max(timeout, 0); |
| 324 | break; |
| 325 | case 'o': |
| 326 | outputFile = optarg; |
| 327 | break; |
| 328 | default: |
| 329 | usage(argv[0]); |
| 330 | return 2; |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 331 | } |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 332 | } |
| 333 | |
weijia yuan | 82cf914 | 2018-10-21 12:25:02 -0700 | [diff] [blame] | 334 | if (optind < argc) { |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 335 | name = argv[optind]; |
weijia yuan | 82cf914 | 2018-10-21 12:25:02 -0700 | [diff] [blame] | 336 | } |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 337 | |
weijia yuan | 82cf914 | 2018-10-21 12:25:02 -0700 | [diff] [blame] | 338 | if (name.empty()) { |
Davide Pesavento | 31be3f6 | 2019-01-24 23:20:23 -0500 | [diff] [blame] | 339 | usage(argv[0]); |
| 340 | return 2; |
weijia yuan | 82cf914 | 2018-10-21 12:25:02 -0700 | [diff] [blame] | 341 | } |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 342 | |
| 343 | std::streambuf* buf; |
| 344 | std::ofstream of; |
| 345 | |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 346 | if (outputFile != nullptr) { |
| 347 | of.open(outputFile, std::ios::out | std::ios::binary | std::ios::trunc); |
| 348 | if (!of || !of.is_open()) { |
| 349 | std::cerr << "ERROR: cannot open " << outputFile << std::endl; |
Davide Pesavento | 31be3f6 | 2019-01-24 23:20:23 -0500 | [diff] [blame] | 350 | return 2; |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 351 | } |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 352 | buf = of.rdbuf(); |
| 353 | } |
| 354 | else { |
| 355 | buf = std::cout.rdbuf(); |
| 356 | } |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 357 | |
| 358 | std::ostream os(buf); |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 359 | Consumer consumer(name, os, verbose, versioned, single, interestLifetime, timeout); |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 360 | |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 361 | try { |
| 362 | consumer.run(); |
| 363 | } |
| 364 | catch (const std::exception& e) { |
| 365 | std::cerr << "ERROR: " << e.what() << std::endl; |
Davide Pesavento | 31be3f6 | 2019-01-24 23:20:23 -0500 | [diff] [blame] | 366 | return 1; |
Davide Pesavento | f43a03e | 2018-02-21 22:04:21 -0500 | [diff] [blame] | 367 | } |
Wentao Shang | bcbc929 | 2014-04-28 21:17:06 -0700 | [diff] [blame] | 368 | |
| 369 | return 0; |
| 370 | } |
| 371 | |
| 372 | } // namespace repo |
| 373 | |
| 374 | int |
| 375 | main(int argc, char** argv) |
| 376 | { |
| 377 | return repo::main(argc, argv); |
| 378 | } |