Kea 3.3.4
cb_cmds_callouts.cc
Go to the documentation of this file.
1// Copyright (C) 2026 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7// Functions accessed by the hooks framework use C linkage to avoid the name
8// mangling that accompanies use of the C++ compiler as well as to avoid
9// issues related to namespaces.
10
11#include <config.h>
12
15#include <cb_cmds/cb_cmds_log.h>
17#include <dhcpsrv/cfgmgr.h>
18#include <hooks/hooks.h>
19#include <process/daemon.h>
20
21#include <boost/make_shared.hpp>
22
23using namespace isc::cb;
24using namespace isc::config;
25using namespace isc::dhcp;
26using namespace isc::hooks;
27using namespace isc::process;
28
29namespace isc {
30namespace cb {
31
34
35} // end of namespace isc::cb
36} // end of namespace isc
37
38extern "C" {
39
44 try {
45 impl4->setClientClass4(handle);
46
47 } catch (const std::exception& ex) {
49 .arg(ex.what());
50 return (CONTROL_RESULT_ERROR);
51 }
52
54}
55
60 try {
61 impl4->getClientClass4(handle);
62
63 } catch (const std::exception& ex) {
65 .arg(ex.what());
66 return (CONTROL_RESULT_ERROR);
67 }
68
70}
71
76 try {
77 impl4->getAllClientClasses4(handle);
78
79 } catch (const std::exception& ex) {
81 .arg(ex.what());
82 return (CONTROL_RESULT_ERROR);
83 }
84
86}
87
92 try {
93 impl4->delClientClass4(handle);
94
95 } catch (const std::exception& ex) {
97 .arg(ex.what());
98 return (CONTROL_RESULT_ERROR);
99 }
100
101 return (CONTROL_RESULT_SUCCESS);
102}
103
108 try {
109 impl4->setGlobalParameter4(handle);
110
111 } catch (const std::exception& ex) {
113 .arg(ex.what());
114 return (CONTROL_RESULT_ERROR);
115 }
116
117 return (CONTROL_RESULT_SUCCESS);
118}
119
124 try {
125 impl4->getGlobalParameter4(handle);
126
127 } catch (const std::exception& ex) {
129 .arg(ex.what());
130 return (CONTROL_RESULT_ERROR);
131 }
132
133 return (CONTROL_RESULT_SUCCESS);
134}
135
140 try {
141 impl4->getAllGlobalParameters4(handle);
142
143 } catch (const std::exception& ex) {
146 .arg(ex.what());
147 return (CONTROL_RESULT_ERROR);
148 }
149
150 return (CONTROL_RESULT_SUCCESS);
151}
152
157 try {
158 impl4->delGlobalParameter4(handle);
159
160 } catch (const std::exception& ex) {
162 .arg(ex.what());
163 return (CONTROL_RESULT_ERROR);
164 }
165
166 return (CONTROL_RESULT_SUCCESS);
167}
168
173 try {
174 impl4->setSubnet4(handle);
175
176 } catch (const std::exception& ex) {
178 .arg(ex.what());
179 return (CONTROL_RESULT_ERROR);
180 }
181
182 return (CONTROL_RESULT_SUCCESS);
183}
184
189 try {
190 impl4->getSubnet4Id(handle);
191
192 } catch (const std::exception& ex) {
194 .arg(ex.what());
195 return (CONTROL_RESULT_ERROR);
196 }
197
198 return (CONTROL_RESULT_SUCCESS);
199}
200
205 try {
206 impl4->getSubnet4Prefix(handle);
207
208 } catch (const std::exception& ex) {
210 .arg(ex.what());
211 return (CONTROL_RESULT_ERROR);
212 }
213
214 return (CONTROL_RESULT_SUCCESS);
215}
216
221 try {
222 impl4->listSubnets4(handle);
223
224 } catch (const std::exception& ex) {
226 .arg(ex.what());
227 return (CONTROL_RESULT_ERROR);
228 }
229
230 return (CONTROL_RESULT_SUCCESS);
231}
232
237 try {
238 impl4->delSubnet4Id(handle);
239
240 } catch (const std::exception& ex) {
242 .arg(ex.what());
243 return (CONTROL_RESULT_ERROR);
244 }
245
246 return (CONTROL_RESULT_SUCCESS);
247}
248
253 try {
254 impl4->delSubnet4Prefix(handle);
255
256 } catch (const std::exception& ex) {
258 .arg(ex.what());
259 return (CONTROL_RESULT_ERROR);
260 }
261
262 return (CONTROL_RESULT_SUCCESS);
263}
264
269 try {
270 impl4->setSharedNetwork4(handle);
271
272 } catch (const std::exception& ex) {
274 .arg(ex.what());
275 return (CONTROL_RESULT_ERROR);
276 }
277
278 return (CONTROL_RESULT_SUCCESS);
279}
280
285 try {
286 impl4->getSharedNetwork4(handle);
287
288 } catch (const std::exception& ex) {
290 .arg(ex.what());
291 return (CONTROL_RESULT_ERROR);
292 }
293
294 return (CONTROL_RESULT_SUCCESS);
295}
296
301 try {
302 impl4->listSharedNetworks4(handle);
303
304 } catch (const std::exception& ex) {
306 .arg(ex.what());
307 return (CONTROL_RESULT_ERROR);
308 }
309
310 return (CONTROL_RESULT_SUCCESS);
311}
312
317 try {
318 impl4->delSharedNetwork4(handle);
319
320 } catch (const std::exception& ex) {
322 .arg(ex.what());
323 return (CONTROL_RESULT_ERROR);
324 }
325
326 return (CONTROL_RESULT_SUCCESS);
327}
328
333 try {
334 impl4->setOptionDef4(handle);
335
336 } catch (const std::exception& ex) {
338 .arg(ex.what());
339 return (CONTROL_RESULT_ERROR);
340 }
341
342 return (CONTROL_RESULT_SUCCESS);
343}
344
349 try {
350 impl4->getOptionDef4(handle);
351
352 } catch (const std::exception& ex) {
354 .arg(ex.what());
355 return (CONTROL_RESULT_ERROR);
356 }
357
358 return (CONTROL_RESULT_SUCCESS);
359}
360
365 try {
366 impl4->getAllOptionDefs4(handle);
367
368 } catch (const std::exception& ex) {
370 .arg(ex.what());
371 return (CONTROL_RESULT_ERROR);
372 }
373
374 return (CONTROL_RESULT_SUCCESS);
375}
376
381 try {
382 impl4->delOptionDef4(handle);
383
384 } catch (const std::exception& ex) {
386 .arg(ex.what());
387 return (CONTROL_RESULT_ERROR);
388 }
389
390 return (CONTROL_RESULT_SUCCESS);
391}
392
397 try {
398 impl4->setGlobalOption4(handle);
399
400 } catch (const std::exception& ex) {
402 .arg(ex.what());
403 return (CONTROL_RESULT_ERROR);
404 }
405
406 return (CONTROL_RESULT_SUCCESS);
407}
408
413 try {
414 impl4->getGlobalOption4(handle);
415
416 } catch (const std::exception& ex) {
418 .arg(ex.what());
419 return (CONTROL_RESULT_ERROR);
420 }
421
422 return (CONTROL_RESULT_SUCCESS);
423}
424
429 try {
430 impl4->getAllGlobalOptions4(handle);
431
432 } catch (const std::exception& ex) {
435 .arg(ex.what());
436 return (CONTROL_RESULT_ERROR);
437 }
438
439 return (CONTROL_RESULT_SUCCESS);
440}
441
446 try {
447 impl4->delGlobalOption4(handle);
448
449 } catch (const std::exception& ex) {
451 .arg(ex.what());
452 return (CONTROL_RESULT_ERROR);
453 }
454
455 return (CONTROL_RESULT_SUCCESS);
456}
457
462 try {
463 impl4->setServer4(handle);
464
465 } catch (const std::exception& ex) {
467 .arg(ex.what());
468 return (CONTROL_RESULT_ERROR);
469 }
470
471 return (CONTROL_RESULT_SUCCESS);
472}
473
478 try {
479 impl4->getServer4(handle);
480
481 } catch (const std::exception& ex) {
483 .arg(ex.what());
484 return (CONTROL_RESULT_ERROR);
485 }
486
487 return (CONTROL_RESULT_SUCCESS);
488}
489
494 try {
495 impl4->getAllServers4(handle);
496
497 } catch (const std::exception& ex) {
500 .arg(ex.what());
501 return (CONTROL_RESULT_ERROR);
502 }
503
504 return (CONTROL_RESULT_SUCCESS);
505}
506
511 try {
512 impl4->delServer4(handle);
513
514 } catch (const std::exception& ex) {
516 .arg(ex.what());
517 return (CONTROL_RESULT_ERROR);
518 }
519
520 return (CONTROL_RESULT_SUCCESS);
521}
522
527 try {
528 impl4->setSharedNetworkOption4(handle);
529
530 } catch (const std::exception& ex) {
532 .arg(ex.what());
533 return (CONTROL_RESULT_ERROR);
534 }
535
536 return (CONTROL_RESULT_SUCCESS);
537}
538
543 try {
544 impl4->delSharedNetworkOption4(handle);
545
546 } catch (const std::exception& ex) {
548 .arg(ex.what());
549 return (CONTROL_RESULT_ERROR);
550 }
551
552 return (CONTROL_RESULT_SUCCESS);
553}
554
559 try {
560 impl4->setSubnetOption4(handle);
561
562 } catch (const std::exception& ex) {
564 .arg(ex.what());
565 return (CONTROL_RESULT_ERROR);
566 }
567
568 return (CONTROL_RESULT_SUCCESS);
569}
570
575 try {
576 impl4->delSubnetOption4(handle);
577
578 } catch (const std::exception& ex) {
580 .arg(ex.what());
581 return (CONTROL_RESULT_ERROR);
582 }
583
584 return (CONTROL_RESULT_SUCCESS);
585}
586
591 try {
592 impl4->setPoolOption4(handle);
593
594 } catch (const std::exception& ex) {
596 .arg(ex.what());
597 return (CONTROL_RESULT_ERROR);
598 }
599
600 return (CONTROL_RESULT_SUCCESS);
601}
602
607 try {
608 impl4->delPoolOption4(handle);
609
610 } catch (const std::exception& ex) {
612 .arg(ex.what());
613 return (CONTROL_RESULT_ERROR);
614 }
615
616 return (CONTROL_RESULT_SUCCESS);
617}
618
623 try {
624 impl6->setClientClass6(handle);
625
626 } catch (const std::exception& ex) {
628 .arg(ex.what());
629 return (CONTROL_RESULT_ERROR);
630 }
631
632 return (CONTROL_RESULT_SUCCESS);
633}
634
639 try {
640 impl6->getClientClass6(handle);
641
642 } catch (const std::exception& ex) {
644 .arg(ex.what());
645 return (CONTROL_RESULT_ERROR);
646 }
647
648 return (CONTROL_RESULT_SUCCESS);
649}
650
655 try {
656 impl6->getAllClientClasses6(handle);
657
658 } catch (const std::exception& ex) {
660 .arg(ex.what());
661 return (CONTROL_RESULT_ERROR);
662 }
663
664 return (CONTROL_RESULT_SUCCESS);
665}
666
671 try {
672 impl6->delClientClass6(handle);
673
674 } catch (const std::exception& ex) {
676 .arg(ex.what());
677 return (CONTROL_RESULT_ERROR);
678 }
679
680 return (CONTROL_RESULT_SUCCESS);
681}
682
687 try {
688 impl6->setGlobalParameter6(handle);
689
690 } catch (const std::exception& ex) {
692 .arg(ex.what());
693 return (CONTROL_RESULT_ERROR);
694 }
695
696 return (CONTROL_RESULT_SUCCESS);
697}
698
703 try {
704 impl6->getGlobalParameter6(handle);
705
706 } catch (const std::exception& ex) {
708 .arg(ex.what());
709 return (CONTROL_RESULT_ERROR);
710 }
711
712 return (CONTROL_RESULT_SUCCESS);
713}
714
719 try {
720 impl6->getAllGlobalParameters6(handle);
721
722 } catch (const std::exception& ex) {
725 .arg(ex.what());
726 return (CONTROL_RESULT_ERROR);
727 }
728
729 return (CONTROL_RESULT_SUCCESS);
730}
731
736 try {
737 impl6->delGlobalParameter6(handle);
738
739 } catch (const std::exception& ex) {
741 .arg(ex.what());
742 return (CONTROL_RESULT_ERROR);
743 }
744
745 return (CONTROL_RESULT_SUCCESS);
746}
747
752 try {
753 impl6->setSubnet6(handle);
754
755 } catch (const std::exception& ex) {
757 .arg(ex.what());
758 return (CONTROL_RESULT_ERROR);
759 }
760
761 return (CONTROL_RESULT_SUCCESS);
762}
763
768 try {
769 impl6->getSubnet6Id(handle);
770
771 } catch (const std::exception& ex) {
773 .arg(ex.what());
774 return (CONTROL_RESULT_ERROR);
775 }
776
777 return (CONTROL_RESULT_SUCCESS);
778}
779
784 try {
785 impl6->getSubnet6Prefix(handle);
786
787 } catch (const std::exception& ex) {
789 .arg(ex.what());
790 return (CONTROL_RESULT_ERROR);
791 }
792
793 return (CONTROL_RESULT_SUCCESS);
794}
795
800 try {
801 impl6->listSubnets6(handle);
802
803 } catch (const std::exception& ex) {
805 .arg(ex.what());
806 return (CONTROL_RESULT_ERROR);
807 }
808
809 return (CONTROL_RESULT_SUCCESS);
810}
811
816 try {
817 impl6->delSubnet6Id(handle);
818
819 } catch (const std::exception& ex) {
821 .arg(ex.what());
822 return (CONTROL_RESULT_ERROR);
823 }
824
825 return (CONTROL_RESULT_SUCCESS);
826}
827
832 try {
833 impl6->delSubnet6Prefix(handle);
834
835 } catch (const std::exception& ex) {
837 .arg(ex.what());
838 return (CONTROL_RESULT_ERROR);
839 }
840
841 return (CONTROL_RESULT_SUCCESS);
842}
843
848 try {
849 impl6->setSharedNetwork6(handle);
850
851 } catch (const std::exception& ex) {
853 .arg(ex.what());
854 return (CONTROL_RESULT_ERROR);
855 }
856
857 return (CONTROL_RESULT_SUCCESS);
858}
859
864 try {
865 impl6->getSharedNetwork6(handle);
866
867 } catch (const std::exception& ex) {
869 .arg(ex.what());
870 return (CONTROL_RESULT_ERROR);
871 }
872
873 return (CONTROL_RESULT_SUCCESS);
874}
875
880 try {
881 impl6->listSharedNetworks6(handle);
882
883 } catch (const std::exception& ex) {
885 .arg(ex.what());
886 return (CONTROL_RESULT_ERROR);
887 }
888
889 return (CONTROL_RESULT_SUCCESS);
890}
891
896 try {
897 impl6->delSharedNetwork6(handle);
898
899 } catch (const std::exception& ex) {
901 .arg(ex.what());
902 return (CONTROL_RESULT_ERROR);
903 }
904
905 return (CONTROL_RESULT_SUCCESS);
906}
907
912 try {
913 impl6->setOptionDef6(handle);
914
915 } catch (const std::exception& ex) {
917 .arg(ex.what());
918 return (CONTROL_RESULT_ERROR);
919 }
920
921 return (CONTROL_RESULT_SUCCESS);
922}
923
928 try {
929 impl6->getOptionDef6(handle);
930
931 } catch (const std::exception& ex) {
933 .arg(ex.what());
934 return (CONTROL_RESULT_ERROR);
935 }
936
937 return (CONTROL_RESULT_SUCCESS);
938}
939
944 try {
945 impl6->getAllOptionDefs6(handle);
946
947 } catch (const std::exception& ex) {
949 .arg(ex.what());
950 return (CONTROL_RESULT_ERROR);
951 }
952
953 return (CONTROL_RESULT_SUCCESS);
954}
955
960 try {
961 impl6->delOptionDef6(handle);
962
963 } catch (const std::exception& ex) {
965 .arg(ex.what());
966 return (CONTROL_RESULT_ERROR);
967 }
968
969 return (CONTROL_RESULT_SUCCESS);
970}
971
976 try {
977 impl6->setGlobalOption6(handle);
978
979 } catch (const std::exception& ex) {
981 .arg(ex.what());
982 return (CONTROL_RESULT_ERROR);
983 }
984
985 return (CONTROL_RESULT_SUCCESS);
986}
987
992 try {
993 impl6->getGlobalOption6(handle);
994
995 } catch (const std::exception& ex) {
997 .arg(ex.what());
998 return (CONTROL_RESULT_ERROR);
999 }
1000
1001 return (CONTROL_RESULT_SUCCESS);
1002}
1003
1008 try {
1009 impl6->getAllGlobalOptions6(handle);
1010
1011 } catch (const std::exception& ex) {
1014 .arg(ex.what());
1015 return (CONTROL_RESULT_ERROR);
1016 }
1017
1018 return (CONTROL_RESULT_SUCCESS);
1019}
1020
1025 try {
1026 impl6->delGlobalOption6(handle);
1027
1028 } catch (const std::exception& ex) {
1030 .arg(ex.what());
1031 return (CONTROL_RESULT_ERROR);
1032 }
1033
1034 return (CONTROL_RESULT_SUCCESS);
1035}
1036
1041 try {
1042 impl6->setServer6(handle);
1043
1044 } catch (const std::exception& ex) {
1046 .arg(ex.what());
1047 return (CONTROL_RESULT_ERROR);
1048 }
1049
1050 return (CONTROL_RESULT_SUCCESS);
1051}
1052
1057 try {
1058 impl6->getServer6(handle);
1059
1060 } catch (const std::exception& ex) {
1062 .arg(ex.what());
1063 return (CONTROL_RESULT_ERROR);
1064 }
1065
1066 return (CONTROL_RESULT_SUCCESS);
1067}
1068
1073 try {
1074 impl6->getAllServers6(handle);
1075
1076 } catch (const std::exception& ex) {
1079 .arg(ex.what());
1080 return (CONTROL_RESULT_ERROR);
1081 }
1082
1083 return (CONTROL_RESULT_SUCCESS);
1084}
1085
1090 try {
1091 impl6->delServer6(handle);
1092
1093 } catch (const std::exception& ex) {
1095 .arg(ex.what());
1096 return (CONTROL_RESULT_ERROR);
1097 }
1098
1099 return (CONTROL_RESULT_SUCCESS);
1100}
1101
1106 try {
1107 impl6->setSharedNetworkOption6(handle);
1108
1109 } catch (const std::exception& ex) {
1111 .arg(ex.what());
1112 return (CONTROL_RESULT_ERROR);
1113 }
1114
1115 return (CONTROL_RESULT_SUCCESS);
1116}
1117
1122 try {
1123 impl6->delSharedNetworkOption6(handle);
1124
1125 } catch (const std::exception& ex) {
1127 .arg(ex.what());
1128 return (CONTROL_RESULT_ERROR);
1129 }
1130
1131 return (CONTROL_RESULT_SUCCESS);
1132}
1133
1138 try {
1139 impl6->setSubnetOption6(handle);
1140
1141 } catch (const std::exception& ex) {
1143 .arg(ex.what());
1144 return (CONTROL_RESULT_ERROR);
1145 }
1146
1147 return (CONTROL_RESULT_SUCCESS);
1148}
1149
1154 try {
1155 impl6->delSubnetOption6(handle);
1156
1157 } catch (const std::exception& ex) {
1159 .arg(ex.what());
1160 return (CONTROL_RESULT_ERROR);
1161 }
1162
1163 return (CONTROL_RESULT_SUCCESS);
1164}
1165
1170 try {
1171 impl6->setPoolOption6(handle);
1172
1173 } catch (const std::exception& ex) {
1175 .arg(ex.what());
1176 return (CONTROL_RESULT_ERROR);
1177 }
1178
1179 return (CONTROL_RESULT_SUCCESS);
1180}
1181
1186 try {
1187 impl6->delPoolOption6(handle);
1188
1189 } catch (const std::exception& ex) {
1191 .arg(ex.what());
1192 return (CONTROL_RESULT_ERROR);
1193 }
1194
1195 return (CONTROL_RESULT_SUCCESS);
1196}
1197
1202 try {
1203 impl6->setPdPoolOption6(handle);
1204
1205 } catch (const std::exception& ex) {
1207 .arg(ex.what());
1208 return (CONTROL_RESULT_ERROR);
1209 }
1210
1211 return (CONTROL_RESULT_SUCCESS);
1212}
1213
1218 try {
1219 impl6->delPdPoolOption6(handle);
1220
1221 } catch (const std::exception& ex) {
1223 .arg(ex.what());
1224 return (CONTROL_RESULT_ERROR);
1225 }
1226
1227 return (CONTROL_RESULT_SUCCESS);
1228}
1229
1234int load(LibraryHandle& handle) {
1235 try {
1236 // Make the hook library not loadable by d2.
1237 uint16_t family = CfgMgr::instance().getFamily();
1238 const std::string& proc_name = Daemon::getProcName();
1239 if (family == AF_INET) {
1240 if (proc_name != "kea-dhcp4") {
1241 isc_throw(isc::Unexpected, "Bad process name: " << proc_name
1242 << ", expected kea-dhcp4");
1243 }
1244 } else {
1245 if (proc_name != "kea-dhcp6") {
1246 isc_throw(isc::Unexpected, "Bad process name: " << proc_name
1247 << ", expected kea-dhcp6");
1248 }
1249 }
1250
1251 impl4 = boost::make_shared<ConfigCmdsDhcp4Impl>();
1252
1253 handle.registerCommandCallout("remote-class4-del",
1255 handle.registerCommandCallout("remote-class4-get",
1257 handle.registerCommandCallout("remote-class4-get-all",
1259 handle.registerCommandCallout("remote-class4-set",
1261 handle.registerCommandCallout("remote-global-parameter4-del",
1263 handle.registerCommandCallout("remote-global-parameter4-get",
1265 handle.registerCommandCallout("remote-global-parameter4-get-all",
1267 handle.registerCommandCallout("remote-global-parameter4-set",
1269 handle.registerCommandCallout("remote-network4-del",
1271 handle.registerCommandCallout("remote-network4-get",
1273 handle.registerCommandCallout("remote-network4-list",
1275 handle.registerCommandCallout("remote-network4-set",
1277 handle.registerCommandCallout("remote-option-def4-del",
1279 handle.registerCommandCallout("remote-option-def4-get",
1281 handle.registerCommandCallout("remote-option-def4-get-all",
1283 handle.registerCommandCallout("remote-option-def4-set",
1285 handle.registerCommandCallout("remote-option4-global-del",
1287 handle.registerCommandCallout("remote-option4-global-get",
1289 handle.registerCommandCallout("remote-option4-global-get-all",
1291 handle.registerCommandCallout("remote-option4-global-set",
1293 handle.registerCommandCallout("remote-option4-network-del",
1295 handle.registerCommandCallout("remote-option4-network-set",
1297 handle.registerCommandCallout("remote-option4-pool-del",
1299 handle.registerCommandCallout("remote-option4-pool-set",
1301 handle.registerCommandCallout("remote-option4-subnet-del",
1303 handle.registerCommandCallout("remote-option4-subnet-set",
1305 handle.registerCommandCallout("remote-server4-del",
1307 handle.registerCommandCallout("remote-server4-get",
1309 handle.registerCommandCallout("remote-server4-get-all",
1311 handle.registerCommandCallout("remote-server4-set",
1313 handle.registerCommandCallout("remote-subnet4-del-by-id",
1315 handle.registerCommandCallout("remote-subnet4-del-by-prefix",
1317 handle.registerCommandCallout("remote-subnet4-get-by-id",
1319 handle.registerCommandCallout("remote-subnet4-get-by-prefix",
1321 handle.registerCommandCallout("remote-subnet4-list",
1323 handle.registerCommandCallout("remote-subnet4-set",
1325
1326 impl6 = boost::make_shared<ConfigCmdsDhcp6Impl>();
1327
1328 handle.registerCommandCallout("remote-class6-del",
1330 handle.registerCommandCallout("remote-class6-get",
1332 handle.registerCommandCallout("remote-class6-get-all",
1334 handle.registerCommandCallout("remote-class6-set",
1336 handle.registerCommandCallout("remote-global-parameter6-del",
1338 handle.registerCommandCallout("remote-global-parameter6-get",
1340 handle.registerCommandCallout("remote-global-parameter6-get-all",
1342 handle.registerCommandCallout("remote-global-parameter6-set",
1344 handle.registerCommandCallout("remote-network6-del",
1346 handle.registerCommandCallout("remote-network6-get",
1348 handle.registerCommandCallout("remote-network6-list",
1350 handle.registerCommandCallout("remote-network6-set",
1352 handle.registerCommandCallout("remote-option-def6-del",
1354 handle.registerCommandCallout("remote-option-def6-get",
1356 handle.registerCommandCallout("remote-option-def6-get-all",
1358 handle.registerCommandCallout("remote-option-def6-set",
1360 handle.registerCommandCallout("remote-option6-global-del",
1362 handle.registerCommandCallout("remote-option6-global-get",
1364 handle.registerCommandCallout("remote-option6-global-get-all",
1366 handle.registerCommandCallout("remote-option6-global-set",
1368 handle.registerCommandCallout("remote-option6-network-del",
1370 handle.registerCommandCallout("remote-option6-network-set",
1372 handle.registerCommandCallout("remote-option6-pd-pool-del",
1374 handle.registerCommandCallout("remote-option6-pd-pool-set",
1376 handle.registerCommandCallout("remote-option6-pool-del",
1378 handle.registerCommandCallout("remote-option6-pool-set",
1380 handle.registerCommandCallout("remote-option6-subnet-del",
1382 handle.registerCommandCallout("remote-option6-subnet-set",
1384 handle.registerCommandCallout("remote-server6-del",
1386 handle.registerCommandCallout("remote-server6-get",
1388 handle.registerCommandCallout("remote-server6-get-all",
1390 handle.registerCommandCallout("remote-server6-set",
1392 handle.registerCommandCallout("remote-subnet6-del-by-id",
1394 handle.registerCommandCallout("remote-subnet6-del-by-prefix",
1396 handle.registerCommandCallout("remote-subnet6-get-by-id",
1398 handle.registerCommandCallout("remote-subnet6-get-by-prefix",
1400 handle.registerCommandCallout("remote-subnet6-list",
1402 handle.registerCommandCallout("remote-subnet6-set",
1404
1405 } catch (const std::exception& ex) {
1406 return (CONTROL_RESULT_ERROR);
1407 }
1408
1410 return (CONTROL_RESULT_SUCCESS);
1411}
1412
1416int unload() {
1418 return (0);
1419}
1420
1425 return (1);
1426}
1427
1428}
int client_class6_get_command(CalloutHandle &handle)
Handler for remote-class4-get command.
int option4_network_del_command(CalloutHandle &handle)
Handler for remote-option4-network-del command.
int server6_get_all_command(CalloutHandle &handle)
Handler for remote-server6-get-all command.
int subnet6_del_by_id_command(CalloutHandle &handle)
Handler for remote-subnet6-del-by-id command.
int option6_subnet_set_command(CalloutHandle &handle)
Handler for remote-option6-subnet-set command.
int network6_set_command(CalloutHandle &handle)
Handler for remote-network6-set command.
int global_parameter6_get_command(CalloutHandle &handle)
Handler for remote-global-parameter6-get command.
int server4_get_all_command(CalloutHandle &handle)
Handler for remote-server4-get-all command.
int client_class6_get_all_command(CalloutHandle &handle)
Handler for remote-class6-get-all command.
int option6_global_del_command(CalloutHandle &handle)
Handler for remote-option6-global-del command.
int option_def4_del_command(CalloutHandle &handle)
Handler for remote-option-def4-del command.
int option4_global_get_command(CalloutHandle &handle)
Handler for remote-option4-global-get command.
int network6_get_command(CalloutHandle &handle)
Handler for remote-network6-get command.
int option6_global_get_all_command(CalloutHandle &handle)
Handler for remote-option6-global-get-all command.
int global_parameter6_get_all_command(CalloutHandle &handle)
Handler for remote-global-parameter6-get-all command.
int global_parameter4_set_command(CalloutHandle &handle)
Handler for remote-global-parameter4-set command.
int server4_del_command(CalloutHandle &handle)
Handler for remote-server4-del command.
int option6_network_del_command(CalloutHandle &handle)
Handler for remote-option6-network-del command.
int subnet4_list_command(CalloutHandle &handle)
Handler for remote-subnet4-list command.
int server6_del_command(CalloutHandle &handle)
Handler for remote-server6-del command.
int subnet4_get_by_id_command(CalloutHandle &handle)
Handler for remote-subnet4-get-by-id command.
int option4_global_del_command(CalloutHandle &handle)
Handler for remote-option4-global-del command.
int network6_list_command(CalloutHandle &handle)
Handler for remote-network6-list command.
int subnet6_get_by_prefix_command(CalloutHandle &handle)
Handler for remote-subnet6-get-by-prefix command.
int option_def4_set_command(CalloutHandle &handle)
Handler for remote-option-def4-set command.
int option_def6_get_all_command(CalloutHandle &handle)
Handler for remote-option-def6-get-all command.
int multi_threading_compatible()
This function is called to retrieve the multi-threading compatibility.
int global_parameter4_get_command(CalloutHandle &handle)
Handler for remote-global-parameter4-get command.
int option4_pool_del_command(CalloutHandle &handle)
Handler for remote-option4-pool-del command.
int client_class6_del_command(CalloutHandle &handle)
Handler for remote-class6-del command.
int option_def6_get_command(CalloutHandle &handle)
Handler for remote-option-def6-get command.
int option4_subnet_del_command(CalloutHandle &handle)
Handler for remote-option4-subnet-del command.
int option6_pool_del_command(CalloutHandle &handle)
Handler for remote-option6-pool-del command.
int option4_global_get_all_command(CalloutHandle &handle)
Handler for remote-option4-global-get-all command.
int option6_pd_pool_set_command(CalloutHandle &handle)
Handler for remote-option6-pd-pool-set command.
int subnet6_list_command(CalloutHandle &handle)
Handler for remote-subnet6-list command.
int client_class4_get_all_command(CalloutHandle &handle)
Handler for remote-class4-get-all command.
int global_parameter4_del_command(CalloutHandle &handle)
Handler for remote-global-parameter4-del command.
int option_def6_del_command(CalloutHandle &handle)
Handler for remote-option-def6-del command.
int option4_pool_set_command(CalloutHandle &handle)
Handler for remote-option4-pool-set command.
int server4_set_command(CalloutHandle &handle)
Handler for remote-server4-set command.
int subnet4_get_by_prefix_command(CalloutHandle &handle)
Handler for remote-subnet4-get-by-prefix command.
int option6_global_get_command(CalloutHandle &handle)
Handler for remote-option6-global-get command.
int server6_get_command(CalloutHandle &handle)
Handler for remote-server6-get command.
int subnet4_del_by_prefix_command(CalloutHandle &handle)
Handler for remote-subnet4-del-by-prefix command.
int global_parameter4_get_all_command(CalloutHandle &handle)
Handler for remote-global-parameter4-get-all command.
int option4_network_set_command(CalloutHandle &handle)
Handler for remote-option4-network-set command.
int subnet6_set_command(CalloutHandle &handle)
Handler for remote-subnet6-set command.
int network4_list_command(CalloutHandle &handle)
Handler for remote-network4-list command.
int option6_pd_pool_del_command(CalloutHandle &handle)
Handler for remote-option6-pd-pool-del command.
int client_class4_get_command(CalloutHandle &handle)
Handler for remote-class4-get command.
int subnet6_del_by_prefix_command(CalloutHandle &handle)
Handler for remote-subnet6-del-by-prefix command.
int option_def4_get_all_command(CalloutHandle &handle)
Handler for remote-option-def4-get-all command.
int option6_network_set_command(CalloutHandle &handle)
Handler for remote-option6-network-set command.
int option6_pool_set_command(CalloutHandle &handle)
Handler for remote-option6-pool-set command.
int global_parameter6_set_command(CalloutHandle &handle)
Handler for remote-global-parameter6-set command.
int unload()
This function is called when the library is unloaded.
int option4_global_set_command(CalloutHandle &handle)
Handler for remote-option4-global-set command.
int client_class4_del_command(CalloutHandle &handle)
Handler for remote-class4-del command.
int server4_get_command(CalloutHandle &handle)
Handler for remote-server4-get command.
int option_def6_set_command(CalloutHandle &handle)
Handler for remote-option-def6-set command.
int option6_global_set_command(CalloutHandle &handle)
Handler for remote-option6-global-set command.
int option6_subnet_del_command(CalloutHandle &handle)
Handler for remote-option6-subnet-del command.
int option4_subnet_set_command(CalloutHandle &handle)
Handler for remote-option4-subnet-set command.
int client_class4_set_command(CalloutHandle &handle)
Handler for remote-class4-set command.
int subnet4_set_command(CalloutHandle &handle)
Handler for remote-subnet4-set command.
int network6_del_command(CalloutHandle &handle)
Handler for remote-network6-del command.
int global_parameter6_del_command(CalloutHandle &handle)
Handler for remote-global-parameter6-del command.
int server6_set_command(CalloutHandle &handle)
Handler for remote-server6-set command.
int network4_get_command(CalloutHandle &handle)
Handler for remote-network4-get command.
int option_def4_get_command(CalloutHandle &handle)
Handler for remote-option-def4-get command.
int client_class6_set_command(CalloutHandle &handle)
Handler for remote-class4-set command.
int subnet4_del_by_id_command(CalloutHandle &handle)
Handler for remote-subnet4-del-by-id command.
int subnet6_get_by_id_command(CalloutHandle &handle)
Handler for remote-subnet6-get-by-id command.
int load(LibraryHandle &handle)
This function is called when the library is loaded.
int network4_del_command(CalloutHandle &handle)
Handler for remote-network4-del command.
int network4_set_command(CalloutHandle &handle)
Handler for remote-network4-set command.
A generic exception that is thrown when an unexpected error condition occurs.
uint16_t getFamily() const
Returns address family.
Definition cfgmgr.h:246
static CfgMgr & instance()
returns a single instance of Configuration Manager
Definition cfgmgr.cc:29
Per-packet callout handle.
void registerCommandCallout(const std::string &command_name, CalloutPtr callout)
Register control command handler.
static std::string getProcName()
returns the process name This value is used as when forming the default PID file name
Definition daemon.cc:156
This file contains several functions and constants that are used for handling commands and responses ...
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
Definition macros.h:32
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
Definition macros.h:20
const isc::log::MessageID CB_CMDS_NETWORK4_LIST_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_PD_POOL_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET6_DEL_BY_ID_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_GLOBAL_PARAMETER4_GET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_GLOBAL_PARAMETER4_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_GLOBAL_PARAMETER6_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION4_GLOBAL_GET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET6_GET_BY_ID_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_GLOBAL_PARAMETER6_GET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET4_DEL_BY_ID_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET4_LIST_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_GLOBAL_GET_ALL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET6_GET_BY_PREFIX_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET6_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_INIT_OK
const isc::log::MessageID CB_CMDS_CLASS4_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_POOL_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION4_NETWORK_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_DEINIT_OK
const isc::log::MessageID CB_CMDS_SERVER4_GET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION_DEF4_SET_HANDLER_FAILED
ConfigCmdsDhcp6ImplPtr impl6
const isc::log::MessageID CB_CMDS_OPTION4_GLOBAL_GET_ALL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_GLOBAL_GET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_CLASS6_GET_ALL_HANDLER_FAILED
boost::shared_ptr< ConfigCmdsDhcp6Impl > ConfigCmdsDhcp6ImplPtr
Pointer to the ConfigCmdsDhcp6Impl.
const isc::log::MessageID CB_CMDS_OPTION_DEF4_GET_ALL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_NETWORK6_GET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET4_DEL_BY_PREFIX_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_GLOBAL_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION_DEF4_GET_HANDLER_FAILED
boost::shared_ptr< ConfigCmdsDhcp4Impl > ConfigCmdsDhcp4ImplPtr
Pointer to the ConfigCmdsDhcp4Impl.
const isc::log::MessageID CB_CMDS_GLOBAL_PARAMETER6_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION4_SUBNET_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SERVER4_SET_HANDLER_FAILED
isc::log::Logger cb_cmds_logger("cb-cmds-hooks")
Definition cb_cmds_log.h:17
const isc::log::MessageID CB_CMDS_CLASS6_GET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION4_SUBNET_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_NETWORK_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION_DEF6_GET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SERVER4_GET_ALL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SERVER4_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET6_LIST_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION_DEF4_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION_DEF6_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_SUBNET_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET6_DEL_BY_PREFIX_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_CLASS4_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_NETWORK6_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_NETWORK4_GET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION4_GLOBAL_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION_DEF6_GET_ALL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_POOL_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_NETWORK4_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_CLASS4_GET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION4_GLOBAL_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET4_GET_BY_ID_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET4_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_PD_POOL_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION4_NETWORK_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_SUBNET_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SUBNET4_GET_BY_PREFIX_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_NETWORK6_LIST_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SERVER6_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_NETWORK4_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_GLOBAL_PARAMETER4_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION6_GLOBAL_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION4_POOL_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_GLOBAL_PARAMETER6_GET_ALL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_GLOBAL_PARAMETER4_GET_ALL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_CLASS6_SET_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SERVER6_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_CLASS4_GET_ALL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_CLASS6_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION_DEF6_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SERVER6_GET_HANDLER_FAILED
ConfigCmdsDhcp4ImplPtr impl4
const isc::log::MessageID CB_CMDS_OPTION6_NETWORK_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_OPTION4_POOL_DEL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_SERVER6_GET_ALL_HANDLER_FAILED
const isc::log::MessageID CB_CMDS_NETWORK6_SET_HANDLER_FAILED
const int CONTROL_RESULT_ERROR
Status code indicating a general failure.
const int CONTROL_RESULT_SUCCESS
Status code indicating a successful operation.
Defines the logger used by the top-level component of kea-lfc.