Alexander Afanasyev | 650028d | 2014-04-25 18:39:10 -0700 | [diff] [blame^] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (c) 2014, Regents of the University of California, |
| 4 | * Arizona Board of Regents, |
| 5 | * Colorado State University, |
| 6 | * University Pierre & Marie Curie, Sorbonne University, |
| 7 | * Washington University in St. Louis, |
| 8 | * Beijing Institute of Technology, |
| 9 | * The University of Memphis |
| 10 | * |
| 11 | * This file is part of NFD (Named Data Networking Forwarding Daemon). |
| 12 | * See AUTHORS.md for complete list of NFD authors and contributors. |
| 13 | * |
| 14 | * NFD is free software: you can redistribute it and/or modify it under the terms |
| 15 | * of the GNU General Public License as published by the Free Software Foundation, |
| 16 | * either version 3 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 19 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 20 | * PURPOSE. See the GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License along with |
| 23 | * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 24 | */ |
| 25 | |
| 26 | #ifndef NFD_TESTS_DAEMON_FACE_PACKET_DATASETS_HPP |
| 27 | #define NFD_TESTS_DAEMON_FACE_PACKET_DATASETS_HPP |
| 28 | |
| 29 | #include "tests/test-common.hpp" |
| 30 | |
| 31 | namespace nfd { |
| 32 | namespace tests { |
| 33 | |
| 34 | class CorruptedInterestWithLocalControlHeader |
| 35 | { |
| 36 | public: |
| 37 | typedef std::vector<ndn::Buffer> Container; |
| 38 | |
| 39 | static std::string |
| 40 | getName() |
| 41 | { |
| 42 | return "CorruptedInterestWithLocalControlHeader"; |
| 43 | } |
| 44 | |
| 45 | CorruptedInterestWithLocalControlHeader() |
| 46 | { |
| 47 | static const uint8_t interest[] = { |
| 48 | 0x50, 0x22, 0x51, 0x81, 0x0a, 0x05, 0x1d, 0x07, 0x14, 0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61, |
| 49 | 0x6c, 0x08, 0x03, 0x6e, 0x64, 0x6e, 0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x09, |
| 50 | 0x02, 0x12, 0x00, 0x0a, 0x01, 0x01 |
| 51 | }; |
| 52 | |
| 53 | data.push_back(ndn::Buffer(interest, sizeof(interest))); |
| 54 | } |
| 55 | public: |
| 56 | Container data; |
| 57 | }; |
| 58 | |
| 59 | class CorruptedInterest |
| 60 | { |
| 61 | public: |
| 62 | typedef std::vector<ndn::Buffer> Container; |
| 63 | |
| 64 | static std::string |
| 65 | getName() |
| 66 | { |
| 67 | return "CorruptedInterest"; |
| 68 | } |
| 69 | |
| 70 | CorruptedInterest() |
| 71 | { |
| 72 | static const uint8_t interest[] = { |
| 73 | 0x05, 0x1d, 0x07, 0x84, 0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x08, 0x03, 0x6e, 0x64, |
| 74 | 0x6e, 0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x09, 0x02, 0x12, 0x00, 0x0a, 0x01, |
| 75 | 0x01 |
| 76 | }; |
| 77 | |
| 78 | data.push_back(ndn::Buffer(interest, sizeof(interest))); |
| 79 | } |
| 80 | public: |
| 81 | Container data; |
| 82 | }; |
| 83 | |
| 84 | |
| 85 | typedef boost::mpl::vector< CorruptedInterestWithLocalControlHeader, |
| 86 | CorruptedInterest> CorruptedPackets; |
| 87 | |
| 88 | } // namespace tests |
| 89 | } // namespace nfd |
| 90 | |
| 91 | #endif // NFD_TESTS_DAEMON_FACE_PACKET_DATASETS_HPP |