34 #ifndef OTBR_REST_RESOURCE_HPP_
35 #define OTBR_REST_RESOURCE_HPP_
37 #include <unordered_map>
39 #include <openthread/border_router.h>
48 using std::chrono::steady_clock;
114 void ExtendedPanId(
const Request &aRequest,
Response &aResponse)
const;
117 void HandleDiagnosticCallback(
const Request &aRequest,
Response &aResponse);
119 void GetNodeInfo(
Response &aResponse)
const;
120 void GetDataExtendedAddr(
Response &aResponse)
const;
121 void GetDataState(
Response &aResponse)
const;
122 void GetDataNetworkName(
Response &aResponse)
const;
123 void GetDataLeaderData(
Response &aResponse)
const;
124 void GetDataNumOfRoute(
Response &aResponse)
const;
125 void GetDataRloc16(
Response &aResponse)
const;
126 void GetDataExtendedPanId(
Response &aResponse)
const;
127 void GetDataRloc(
Response &aResponse)
const;
129 void DeleteOutDatedDiagnostic(
void);
130 void UpdateDiag(std::string aKey, std::vector<otNetworkDiagTlv> &aDiag);
132 static void DiagnosticResponseHandler(otError aError,
133 otMessage * aMessage,
134 const otMessageInfo *aMessageInfo,
136 void DiagnosticResponseHandler(otError aError,
const otMessage *aMessage,
const otMessageInfo *aMessageInfo);
138 otInstance * mInstance;
141 std::unordered_map<std::string, ResourceHandler> mResourceMap;
142 std::unordered_map<std::string, ResourceCallbackHandler> mResourceCallbackMap;
144 std::unordered_map<std::string, DiagInfo> mDiagSet;
150 #endif // OTBR_REST_RESOURCE_HPP_