WebServiceDashboardApi.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. /*
  2. Technitium DNS Server
  3. Copyright (C) 2022 Shreyas Zare (shreyas@technitium.com)
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. using DnsServerCore.Dns;
  16. using Newtonsoft.Json;
  17. using System;
  18. using System.Collections.Generic;
  19. using System.Globalization;
  20. using System.Net;
  21. using System.Threading.Tasks;
  22. using TechnitiumLibrary.Net.Dns;
  23. using TechnitiumLibrary.Net.Dns.ResourceRecords;
  24. namespace DnsServerCore
  25. {
  26. class WebServiceDashboardApi
  27. {
  28. #region variables
  29. readonly DnsWebService _dnsWebService;
  30. #endregion
  31. #region constructor
  32. public WebServiceDashboardApi(DnsWebService dnsWebService)
  33. {
  34. _dnsWebService = dnsWebService;
  35. }
  36. #endregion
  37. #region private
  38. private static void WriteChartDataSet(JsonTextWriter jsonWriter, string label, string backgroundColor, string borderColor, List<KeyValuePair<string, int>> statsPerInterval)
  39. {
  40. jsonWriter.WriteStartObject();
  41. jsonWriter.WritePropertyName("label");
  42. jsonWriter.WriteValue(label);
  43. jsonWriter.WritePropertyName("backgroundColor");
  44. jsonWriter.WriteValue(backgroundColor);
  45. jsonWriter.WritePropertyName("borderColor");
  46. jsonWriter.WriteValue(borderColor);
  47. jsonWriter.WritePropertyName("borderWidth");
  48. jsonWriter.WriteValue(2);
  49. jsonWriter.WritePropertyName("fill");
  50. jsonWriter.WriteValue(true);
  51. jsonWriter.WritePropertyName("data");
  52. jsonWriter.WriteStartArray();
  53. foreach (KeyValuePair<string, int> item in statsPerInterval)
  54. jsonWriter.WriteValue(item.Value);
  55. jsonWriter.WriteEndArray();
  56. jsonWriter.WriteEndObject();
  57. }
  58. private async Task<IDictionary<string, string>> ResolvePtrTopClientsAsync(List<KeyValuePair<string, int>> topClients)
  59. {
  60. IDictionary<string, string> dhcpClientIpMap = _dnsWebService.DhcpServer.GetAddressHostNameMap();
  61. async Task<KeyValuePair<string, string>> ResolvePtrAsync(string ip)
  62. {
  63. if (dhcpClientIpMap.TryGetValue(ip, out string dhcpDomain))
  64. return new KeyValuePair<string, string>(ip, dhcpDomain);
  65. IPAddress address = IPAddress.Parse(ip);
  66. if (IPAddress.IsLoopback(address))
  67. return new KeyValuePair<string, string>(ip, "localhost");
  68. DnsDatagram ptrResponse = await _dnsWebService.DnsServer.DirectQueryAsync(new DnsQuestionRecord(address, DnsClass.IN), 500);
  69. if (ptrResponse.Answer.Count > 0)
  70. {
  71. IReadOnlyList<string> ptrDomains = DnsClient.ParseResponsePTR(ptrResponse);
  72. if (ptrDomains.Count > 0)
  73. return new KeyValuePair<string, string>(ip, ptrDomains[0]);
  74. }
  75. return new KeyValuePair<string, string>(ip, null);
  76. }
  77. List<Task<KeyValuePair<string, string>>> resolverTasks = new List<Task<KeyValuePair<string, string>>>();
  78. foreach (KeyValuePair<string, int> item in topClients)
  79. {
  80. resolverTasks.Add(ResolvePtrAsync(item.Key));
  81. }
  82. Dictionary<string, string> result = new Dictionary<string, string>();
  83. foreach (Task<KeyValuePair<string, string>> resolverTask in resolverTasks)
  84. {
  85. try
  86. {
  87. KeyValuePair<string, string> ptrResult = await resolverTask;
  88. result[ptrResult.Key] = ptrResult.Value;
  89. }
  90. catch
  91. { }
  92. }
  93. return result;
  94. }
  95. #endregion
  96. #region public
  97. public async Task GetStats(HttpListenerRequest request, JsonTextWriter jsonWriter)
  98. {
  99. string strType = request.QueryString["type"];
  100. if (string.IsNullOrEmpty(strType))
  101. strType = "lastHour";
  102. Dictionary<string, List<KeyValuePair<string, int>>> data;
  103. switch (strType)
  104. {
  105. case "lastHour":
  106. data = _dnsWebService.DnsServer.StatsManager.GetLastHourMinuteWiseStats();
  107. break;
  108. case "lastDay":
  109. data = _dnsWebService.DnsServer.StatsManager.GetLastDayHourWiseStats();
  110. break;
  111. case "lastWeek":
  112. data = _dnsWebService.DnsServer.StatsManager.GetLastWeekDayWiseStats();
  113. break;
  114. case "lastMonth":
  115. data = _dnsWebService.DnsServer.StatsManager.GetLastMonthDayWiseStats();
  116. break;
  117. case "lastYear":
  118. data = _dnsWebService.DnsServer.StatsManager.GetLastYearMonthWiseStats();
  119. break;
  120. case "custom":
  121. string strStartDate = request.QueryString["start"];
  122. if (string.IsNullOrEmpty(strStartDate))
  123. throw new DnsWebServiceException("Parameter 'start' missing.");
  124. string strEndDate = request.QueryString["end"];
  125. if (string.IsNullOrEmpty(strEndDate))
  126. throw new DnsWebServiceException("Parameter 'end' missing.");
  127. if (!DateTime.TryParseExact(strStartDate, "yyyy-M-d", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal | DateTimeStyles.AdjustToUniversal, out DateTime startDate))
  128. throw new DnsWebServiceException("Invalid start date format.");
  129. if (!DateTime.TryParseExact(strEndDate, "yyyy-M-d", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal | DateTimeStyles.AdjustToUniversal, out DateTime endDate))
  130. throw new DnsWebServiceException("Invalid end date format.");
  131. if (startDate > endDate)
  132. throw new DnsWebServiceException("Start date must be less than or equal to end date.");
  133. if ((Convert.ToInt32((endDate - startDate).TotalDays) + 1) > 7)
  134. data = _dnsWebService.DnsServer.StatsManager.GetDayWiseStats(startDate, endDate);
  135. else
  136. data = _dnsWebService.DnsServer.StatsManager.GetHourWiseStats(startDate, endDate);
  137. break;
  138. default:
  139. throw new DnsWebServiceException("Unknown stats type requested: " + strType);
  140. }
  141. //stats
  142. {
  143. List<KeyValuePair<string, int>> stats = data["stats"];
  144. jsonWriter.WritePropertyName("stats");
  145. jsonWriter.WriteStartObject();
  146. foreach (KeyValuePair<string, int> item in stats)
  147. {
  148. jsonWriter.WritePropertyName(item.Key);
  149. jsonWriter.WriteValue(item.Value);
  150. }
  151. jsonWriter.WritePropertyName("zones");
  152. jsonWriter.WriteValue(_dnsWebService.DnsServer.AuthZoneManager.TotalZones);
  153. jsonWriter.WritePropertyName("allowedZones");
  154. jsonWriter.WriteValue(_dnsWebService.DnsServer.AllowedZoneManager.TotalZonesAllowed);
  155. jsonWriter.WritePropertyName("blockedZones");
  156. jsonWriter.WriteValue(_dnsWebService.DnsServer.BlockedZoneManager.TotalZonesBlocked);
  157. jsonWriter.WritePropertyName("blockListZones");
  158. jsonWriter.WriteValue(_dnsWebService.DnsServer.BlockListZoneManager.TotalZonesBlocked);
  159. jsonWriter.WriteEndObject();
  160. }
  161. //main chart
  162. {
  163. jsonWriter.WritePropertyName("mainChartData");
  164. jsonWriter.WriteStartObject();
  165. //label
  166. {
  167. List<KeyValuePair<string, int>> statsPerInterval = data["totalQueriesPerInterval"];
  168. jsonWriter.WritePropertyName("labels");
  169. jsonWriter.WriteStartArray();
  170. foreach (KeyValuePair<string, int> item in statsPerInterval)
  171. jsonWriter.WriteValue(item.Key);
  172. jsonWriter.WriteEndArray();
  173. }
  174. //datasets
  175. {
  176. jsonWriter.WritePropertyName("datasets");
  177. jsonWriter.WriteStartArray();
  178. WriteChartDataSet(jsonWriter, "Total", "rgba(102, 153, 255, 0.1)", "rgb(102, 153, 255)", data["totalQueriesPerInterval"]);
  179. WriteChartDataSet(jsonWriter, "No Error", "rgba(92, 184, 92, 0.1)", "rgb(92, 184, 92)", data["totalNoErrorPerInterval"]);
  180. WriteChartDataSet(jsonWriter, "Server Failure", "rgba(217, 83, 79, 0.1)", "rgb(217, 83, 79)", data["totalServerFailurePerInterval"]);
  181. WriteChartDataSet(jsonWriter, "NX Domain", "rgba(7, 7, 7, 0.1)", "rgb(7, 7, 7)", data["totalNxDomainPerInterval"]);
  182. WriteChartDataSet(jsonWriter, "Refused", "rgba(91, 192, 222, 0.1)", "rgb(91, 192, 222)", data["totalRefusedPerInterval"]);
  183. WriteChartDataSet(jsonWriter, "Authoritative", "rgba(150, 150, 0, 0.1)", "rgb(150, 150, 0)", data["totalAuthHitPerInterval"]);
  184. WriteChartDataSet(jsonWriter, "Recursive", "rgba(23, 162, 184, 0.1)", "rgb(23, 162, 184)", data["totalRecursionsPerInterval"]);
  185. WriteChartDataSet(jsonWriter, "Cached", "rgba(111, 84, 153, 0.1)", "rgb(111, 84, 153)", data["totalCacheHitPerInterval"]);
  186. WriteChartDataSet(jsonWriter, "Blocked", "rgba(255, 165, 0, 0.1)", "rgb(255, 165, 0)", data["totalBlockedPerInterval"]);
  187. WriteChartDataSet(jsonWriter, "Clients", "rgba(51, 122, 183, 0.1)", "rgb(51, 122, 183)", data["totalClientsPerInterval"]);
  188. jsonWriter.WriteEndArray();
  189. }
  190. jsonWriter.WriteEndObject();
  191. }
  192. //query response chart
  193. {
  194. jsonWriter.WritePropertyName("queryResponseChartData");
  195. jsonWriter.WriteStartObject();
  196. List<KeyValuePair<string, int>> stats = data["stats"];
  197. //labels
  198. {
  199. jsonWriter.WritePropertyName("labels");
  200. jsonWriter.WriteStartArray();
  201. foreach (KeyValuePair<string, int> item in stats)
  202. {
  203. switch (item.Key)
  204. {
  205. case "totalAuthoritative":
  206. jsonWriter.WriteValue("Authoritative");
  207. break;
  208. case "totalRecursive":
  209. jsonWriter.WriteValue("Recursive");
  210. break;
  211. case "totalCached":
  212. jsonWriter.WriteValue("Cached");
  213. break;
  214. case "totalBlocked":
  215. jsonWriter.WriteValue("Blocked");
  216. break;
  217. }
  218. }
  219. jsonWriter.WriteEndArray();
  220. }
  221. //datasets
  222. {
  223. jsonWriter.WritePropertyName("datasets");
  224. jsonWriter.WriteStartArray();
  225. jsonWriter.WriteStartObject();
  226. jsonWriter.WritePropertyName("data");
  227. jsonWriter.WriteStartArray();
  228. foreach (KeyValuePair<string, int> item in stats)
  229. {
  230. switch (item.Key)
  231. {
  232. case "totalAuthoritative":
  233. case "totalRecursive":
  234. case "totalCached":
  235. case "totalBlocked":
  236. jsonWriter.WriteValue(item.Value);
  237. break;
  238. }
  239. }
  240. jsonWriter.WriteEndArray();
  241. jsonWriter.WritePropertyName("backgroundColor");
  242. jsonWriter.WriteStartArray();
  243. jsonWriter.WriteValue("rgba(150, 150, 0, 0.5)");
  244. jsonWriter.WriteValue("rgba(23, 162, 184, 0.5)");
  245. jsonWriter.WriteValue("rgba(111, 84, 153, 0.5)");
  246. jsonWriter.WriteValue("rgba(255, 165, 0, 0.5)");
  247. jsonWriter.WriteEndArray();
  248. jsonWriter.WriteEndObject();
  249. jsonWriter.WriteEndArray();
  250. }
  251. jsonWriter.WriteEndObject();
  252. }
  253. //query type chart
  254. {
  255. jsonWriter.WritePropertyName("queryTypeChartData");
  256. jsonWriter.WriteStartObject();
  257. List<KeyValuePair<string, int>> queryTypes = data["queryTypes"];
  258. //labels
  259. {
  260. jsonWriter.WritePropertyName("labels");
  261. jsonWriter.WriteStartArray();
  262. foreach (KeyValuePair<string, int> item in queryTypes)
  263. jsonWriter.WriteValue(item.Key);
  264. jsonWriter.WriteEndArray();
  265. }
  266. //datasets
  267. {
  268. jsonWriter.WritePropertyName("datasets");
  269. jsonWriter.WriteStartArray();
  270. jsonWriter.WriteStartObject();
  271. jsonWriter.WritePropertyName("data");
  272. jsonWriter.WriteStartArray();
  273. foreach (KeyValuePair<string, int> item in queryTypes)
  274. jsonWriter.WriteValue(item.Value);
  275. jsonWriter.WriteEndArray();
  276. jsonWriter.WritePropertyName("backgroundColor");
  277. jsonWriter.WriteStartArray();
  278. jsonWriter.WriteValue("rgba(102, 153, 255, 0.5)");
  279. jsonWriter.WriteValue("rgba(92, 184, 92, 0.5)");
  280. jsonWriter.WriteValue("rgba(7, 7, 7, 0.5)");
  281. jsonWriter.WriteValue("rgba(91, 192, 222, 0.5)");
  282. jsonWriter.WriteValue("rgba(150, 150, 0, 0.5)");
  283. jsonWriter.WriteValue("rgba(23, 162, 184, 0.5)");
  284. jsonWriter.WriteValue("rgba(111, 84, 153, 0.5)");
  285. jsonWriter.WriteValue("rgba(255, 165, 0, 0.5)");
  286. jsonWriter.WriteValue("rgba(51, 122, 183, 0.5)");
  287. jsonWriter.WriteValue("rgba(150, 150, 150, 0.5)");
  288. jsonWriter.WriteEndArray();
  289. jsonWriter.WriteEndObject();
  290. jsonWriter.WriteEndArray();
  291. }
  292. jsonWriter.WriteEndObject();
  293. }
  294. //top clients
  295. {
  296. List<KeyValuePair<string, int>> topClients = data["topClients"];
  297. IDictionary<string, string> clientIpMap = await ResolvePtrTopClientsAsync(topClients);
  298. jsonWriter.WritePropertyName("topClients");
  299. jsonWriter.WriteStartArray();
  300. foreach (KeyValuePair<string, int> item in topClients)
  301. {
  302. jsonWriter.WriteStartObject();
  303. jsonWriter.WritePropertyName("name");
  304. jsonWriter.WriteValue(item.Key);
  305. if (clientIpMap.TryGetValue(item.Key, out string clientDomain) && !string.IsNullOrEmpty(clientDomain))
  306. {
  307. jsonWriter.WritePropertyName("domain");
  308. jsonWriter.WriteValue(clientDomain);
  309. }
  310. jsonWriter.WritePropertyName("hits");
  311. jsonWriter.WriteValue(item.Value);
  312. jsonWriter.WriteEndObject();
  313. }
  314. jsonWriter.WriteEndArray();
  315. }
  316. //top domains
  317. {
  318. List<KeyValuePair<string, int>> topDomains = data["topDomains"];
  319. jsonWriter.WritePropertyName("topDomains");
  320. jsonWriter.WriteStartArray();
  321. foreach (KeyValuePair<string, int> item in topDomains)
  322. {
  323. jsonWriter.WriteStartObject();
  324. jsonWriter.WritePropertyName("name");
  325. jsonWriter.WriteValue(item.Key);
  326. jsonWriter.WritePropertyName("hits");
  327. jsonWriter.WriteValue(item.Value);
  328. jsonWriter.WriteEndObject();
  329. }
  330. jsonWriter.WriteEndArray();
  331. }
  332. //top blocked domains
  333. {
  334. List<KeyValuePair<string, int>> topBlockedDomains = data["topBlockedDomains"];
  335. jsonWriter.WritePropertyName("topBlockedDomains");
  336. jsonWriter.WriteStartArray();
  337. foreach (KeyValuePair<string, int> item in topBlockedDomains)
  338. {
  339. jsonWriter.WriteStartObject();
  340. jsonWriter.WritePropertyName("name");
  341. jsonWriter.WriteValue(item.Key);
  342. jsonWriter.WritePropertyName("hits");
  343. jsonWriter.WriteValue(item.Value);
  344. jsonWriter.WriteEndObject();
  345. }
  346. jsonWriter.WriteEndArray();
  347. }
  348. }
  349. public async Task GetTopStats(HttpListenerRequest request, JsonTextWriter jsonWriter)
  350. {
  351. string strType = request.QueryString["type"];
  352. if (string.IsNullOrEmpty(strType))
  353. strType = "lastHour";
  354. string strStatsType = request.QueryString["statsType"];
  355. if (string.IsNullOrEmpty(strStatsType))
  356. throw new DnsWebServiceException("Parameter 'statsType' missing.");
  357. string strLimit = request.QueryString["limit"];
  358. if (string.IsNullOrEmpty(strLimit))
  359. strLimit = "1000";
  360. TopStatsType statsType = Enum.Parse<TopStatsType>(strStatsType, true);
  361. int limit = int.Parse(strLimit);
  362. List<KeyValuePair<string, int>> topStatsData;
  363. switch (strType)
  364. {
  365. case "lastHour":
  366. topStatsData = _dnsWebService.DnsServer.StatsManager.GetLastHourTopStats(statsType, limit);
  367. break;
  368. case "lastDay":
  369. topStatsData = _dnsWebService.DnsServer.StatsManager.GetLastDayTopStats(statsType, limit);
  370. break;
  371. case "lastWeek":
  372. topStatsData = _dnsWebService.DnsServer.StatsManager.GetLastWeekTopStats(statsType, limit);
  373. break;
  374. case "lastMonth":
  375. topStatsData = _dnsWebService.DnsServer.StatsManager.GetLastMonthTopStats(statsType, limit);
  376. break;
  377. case "lastYear":
  378. topStatsData = _dnsWebService.DnsServer.StatsManager.GetLastYearTopStats(statsType, limit);
  379. break;
  380. case "custom":
  381. string strStartDate = request.QueryString["start"];
  382. if (string.IsNullOrEmpty(strStartDate))
  383. throw new DnsWebServiceException("Parameter 'start' missing.");
  384. string strEndDate = request.QueryString["end"];
  385. if (string.IsNullOrEmpty(strEndDate))
  386. throw new DnsWebServiceException("Parameter 'end' missing.");
  387. if (!DateTime.TryParseExact(strStartDate, "yyyy-M-d", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal, out DateTime startDate))
  388. throw new DnsWebServiceException("Invalid start date format.");
  389. if (!DateTime.TryParseExact(strEndDate, "yyyy-M-d", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal, out DateTime endDate))
  390. throw new DnsWebServiceException("Invalid end date format.");
  391. if (startDate > endDate)
  392. throw new DnsWebServiceException("Start date must be less than or equal to end date.");
  393. if ((Convert.ToInt32((endDate - startDate).TotalDays) + 1) > 7)
  394. topStatsData = _dnsWebService.DnsServer.StatsManager.GetDayWiseTopStats(startDate, endDate, statsType, limit);
  395. else
  396. topStatsData = _dnsWebService.DnsServer.StatsManager.GetHourWiseTopStats(startDate, endDate, statsType, limit);
  397. break;
  398. default:
  399. throw new DnsWebServiceException("Unknown stats type requested: " + strType);
  400. }
  401. switch (statsType)
  402. {
  403. case TopStatsType.TopClients:
  404. {
  405. IDictionary<string, string> clientIpMap = await ResolvePtrTopClientsAsync(topStatsData);
  406. jsonWriter.WritePropertyName("topClients");
  407. jsonWriter.WriteStartArray();
  408. foreach (KeyValuePair<string, int> item in topStatsData)
  409. {
  410. jsonWriter.WriteStartObject();
  411. jsonWriter.WritePropertyName("name");
  412. jsonWriter.WriteValue(item.Key);
  413. if (clientIpMap.TryGetValue(item.Key, out string clientDomain) && !string.IsNullOrEmpty(clientDomain))
  414. {
  415. jsonWriter.WritePropertyName("domain");
  416. jsonWriter.WriteValue(clientDomain);
  417. }
  418. jsonWriter.WritePropertyName("hits");
  419. jsonWriter.WriteValue(item.Value);
  420. jsonWriter.WriteEndObject();
  421. }
  422. jsonWriter.WriteEndArray();
  423. }
  424. break;
  425. case TopStatsType.TopDomains:
  426. {
  427. jsonWriter.WritePropertyName("topDomains");
  428. jsonWriter.WriteStartArray();
  429. foreach (KeyValuePair<string, int> item in topStatsData)
  430. {
  431. jsonWriter.WriteStartObject();
  432. jsonWriter.WritePropertyName("name");
  433. jsonWriter.WriteValue(item.Key);
  434. jsonWriter.WritePropertyName("hits");
  435. jsonWriter.WriteValue(item.Value);
  436. jsonWriter.WriteEndObject();
  437. }
  438. jsonWriter.WriteEndArray();
  439. }
  440. break;
  441. case TopStatsType.TopBlockedDomains:
  442. {
  443. jsonWriter.WritePropertyName("topBlockedDomains");
  444. jsonWriter.WriteStartArray();
  445. foreach (KeyValuePair<string, int> item in topStatsData)
  446. {
  447. jsonWriter.WriteStartObject();
  448. jsonWriter.WritePropertyName("name");
  449. jsonWriter.WriteValue(item.Key);
  450. jsonWriter.WritePropertyName("hits");
  451. jsonWriter.WriteValue(item.Value);
  452. jsonWriter.WriteEndObject();
  453. }
  454. jsonWriter.WriteEndArray();
  455. }
  456. break;
  457. default:
  458. throw new NotSupportedException();
  459. }
  460. }
  461. #endregion
  462. }
  463. }