-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNetconfMessage.hh
37 lines (31 loc) · 912 Bytes
/
NetconfMessage.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _NETCONF_MESSAGE_HH_
#define _NETCONF_MESSAGE_HH_
#include <memory>
#include <xercesc/dom/DOM.hpp>
#include "NetconfResponse.hh"
class DomUtils;
class Ydb;
class NetconfOperation;
class NetconfMessage
{
public:
NetconfMessage(DomUtils& domUtils,
const char* message,
unsigned int length);
bool isHello() const { return _hello != nullptr; }
const std::string& getMessageId() { return _messageId; }
std::string apply(Ydb& ydb);
private:
static constexpr const char* RPC_TAG = "rpc";
static constexpr const char* MESSAGE_ID = "message-id";
xercesc::DOMNode* findRpc();
void findMessageId(xercesc::DOMNode* rpc);
DomUtils& _domUtils;
std::unique_ptr<NetconfResponse> _netconfResponse;
xercesc::DOMDocument* _document;
xercesc::DOMNode* _hello;
xercesc::DOMNode* _rpc;
NetconfOperation* _operation;
std::string _messageId;
};
#endif