| 1 | // Copyright (C) Microsoft Corporation. All rights reserved. |
| 2 | #pragma once |
| 3 | |
| 4 | #include <vector> |
| 5 | #include "NetlinkMessage.h" |
| 6 | |
| 7 | class NetlinkResponse |
| 8 | { |
| 9 | public: |
| 10 | using Titerator = std::vector<char>::const_iterator; |
| 11 | |
| 12 | NetlinkResponse(std::vector<char>&& content); |
| 13 | |
| 14 | void ThrowIfErrorFound() const; |
| 15 | |
| 16 | std::vector<char>::const_iterator Begin() const; |
| 17 | std::vector<char>::const_iterator End() const; |
| 18 | |
| 19 | template <typename T> |
| 20 | std::vector<NetlinkMessage<T>> Messages(int type) const; |
| 21 | |
| 22 | __u32 Sequence() const; |
| 23 | |
| 24 | bool MultiMessage() const; |
| 25 | |
| 26 | bool Done() const; |
| 27 | |
| 28 | private: |
| 29 | std::vector<char> m_data; |
| 30 | }; |
| 31 | |
| 32 | std::ostream& operator<<(std::ostream& out, const NetlinkResponse& response); |
| 33 | |
| 34 | #include "NetlinkResponse.hxx" |