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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524 | // Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <dhcpsrv/config_backend_pool_dhcp4.h>
using namespace isc::asiolink;
using namespace isc::data;
using namespace isc::db;
namespace isc {
namespace dhcp {
Subnet4Ptr
ConfigBackendPoolDHCPv4::getSubnet4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const std::string& subnet_prefix) const {
Subnet4Ptr subnet;
getPropertyPtrConst<Subnet4Ptr, const std::string&>
(&ConfigBackendDHCPv4::getSubnet4, backend_selector, server_selector,
subnet, subnet_prefix);
return (subnet);
}
Subnet4Ptr
ConfigBackendPoolDHCPv4::getSubnet4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const SubnetID& subnet_id) const {
Subnet4Ptr subnet;
getPropertyPtrConst<Subnet4Ptr, const SubnetID&>
(&ConfigBackendDHCPv4::getSubnet4, backend_selector, server_selector,
subnet, subnet_id);
return (subnet);
}
Subnet4Collection
ConfigBackendPoolDHCPv4::getAllSubnets4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) const {
Subnet4Collection subnets;
getAllPropertiesConst<Subnet4Collection>
(&ConfigBackendDHCPv4::getAllSubnets4, backend_selector, server_selector,
subnets);
return (subnets);
}
Subnet4Collection
ConfigBackendPoolDHCPv4::getModifiedSubnets4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time) const {
Subnet4Collection subnets;
getMultiplePropertiesConst<Subnet4Collection, const boost::posix_time::ptime&>
(&ConfigBackendDHCPv4::getModifiedSubnets4, backend_selector, server_selector,
subnets, modification_time);
return (subnets);
}
Subnet4Collection
ConfigBackendPoolDHCPv4::getSharedNetworkSubnets4(const db::BackendSelector& backend_selector,
const db::ServerSelector& server_selector,
const std::string& shared_network_name) const {
Subnet4Collection subnets;
getMultiplePropertiesConst<Subnet4Collection, const std::string&>
(&ConfigBackendDHCPv4::getSharedNetworkSubnets4, backend_selector, server_selector,
subnets, shared_network_name);
return (subnets);
}
SharedNetwork4Ptr
ConfigBackendPoolDHCPv4::getSharedNetwork4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const std::string& name) const {
SharedNetwork4Ptr shared_network;
getPropertyPtrConst<SharedNetwork4Ptr, const std::string&>
(&ConfigBackendDHCPv4::getSharedNetwork4, backend_selector, server_selector,
shared_network, name);
return (shared_network);
}
SharedNetwork4Collection
ConfigBackendPoolDHCPv4::getAllSharedNetworks4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) const {
SharedNetwork4Collection shared_networks;
getAllPropertiesConst<SharedNetwork4Collection>
(&ConfigBackendDHCPv4::getAllSharedNetworks4, backend_selector, server_selector,
shared_networks);
return (shared_networks);
}
SharedNetwork4Collection
ConfigBackendPoolDHCPv4::
getModifiedSharedNetworks4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time) const {
SharedNetwork4Collection shared_networks;
getMultiplePropertiesConst<SharedNetwork4Collection, const boost::posix_time::ptime&>
(&ConfigBackendDHCPv4::getModifiedSharedNetworks4, backend_selector, server_selector,
shared_networks, modification_time);
return (shared_networks);
}
OptionDefinitionPtr
ConfigBackendPoolDHCPv4::getOptionDef4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const uint16_t code,
const std::string& space) const {
OptionDefinitionPtr option_def;
getPropertyPtrConst<OptionDefinitionPtr, uint16_t, const std::string&>
(&ConfigBackendDHCPv4::getOptionDef4, backend_selector, server_selector,
option_def, code, space);
return (option_def);
}
OptionDefContainer
ConfigBackendPoolDHCPv4::getAllOptionDefs4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) const {
OptionDefContainer option_defs;
getAllPropertiesConst<OptionDefContainer>
(&ConfigBackendDHCPv4::getAllOptionDefs4, backend_selector, server_selector,
option_defs);
return (option_defs);
}
OptionDefContainer
ConfigBackendPoolDHCPv4::getModifiedOptionDefs4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time) const {
OptionDefContainer option_defs;
getMultiplePropertiesConst<OptionDefContainer, const boost::posix_time::ptime&>
(&ConfigBackendDHCPv4::getModifiedOptionDefs4, backend_selector, server_selector,
option_defs, modification_time);
return (option_defs);
}
OptionDescriptorPtr
ConfigBackendPoolDHCPv4::getOption4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const uint16_t code,
const std::string& space) const {
OptionDescriptorPtr option;
getPropertyPtrConst<OptionDescriptorPtr, uint16_t, const std::string&>
(&ConfigBackendDHCPv4::getOption4, backend_selector, server_selector,
option, code, space);
return (option);
}
OptionContainer
ConfigBackendPoolDHCPv4::getAllOptions4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) const {
OptionContainer options;
getAllPropertiesConst<OptionContainer>
(&ConfigBackendDHCPv4::getAllOptions4, backend_selector, server_selector,
options);
return (options);
}
OptionContainer
ConfigBackendPoolDHCPv4::getModifiedOptions4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time) const {
OptionContainer options;
getMultiplePropertiesConst<OptionContainer, const boost::posix_time::ptime&>
(&ConfigBackendDHCPv4::getModifiedOptions4, backend_selector, server_selector,
options, modification_time);
return (options);
}
StampedValuePtr
ConfigBackendPoolDHCPv4::getGlobalParameter4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const std::string& name) const {
StampedValuePtr parameter;
getPropertyPtrConst<StampedValuePtr, const std::string&>
(&ConfigBackendDHCPv4::getGlobalParameter4, backend_selector,
server_selector, parameter, name);
return (parameter);
}
StampedValueCollection
ConfigBackendPoolDHCPv4::getAllGlobalParameters4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) const {
StampedValueCollection parameters;
getAllPropertiesConst<StampedValueCollection>
(&ConfigBackendDHCPv4::getAllGlobalParameters4, backend_selector,
server_selector, parameters);
return (parameters);
}
StampedValueCollection
ConfigBackendPoolDHCPv4::
getModifiedGlobalParameters4(const db::BackendSelector& backend_selector,
const db::ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time) const {
StampedValueCollection parameters;
getMultiplePropertiesConst<StampedValueCollection, const boost::posix_time::ptime&>
(&ConfigBackendDHCPv4::getModifiedGlobalParameters4, backend_selector,
server_selector, parameters, modification_time);
return (parameters);
}
ClientClassDefPtr
ConfigBackendPoolDHCPv4::getClientClass4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const std::string& name) const {
ClientClassDefPtr client_class;
getPropertyPtrConst<ClientClassDefPtr, const std::string&>
(&ConfigBackendDHCPv4::getClientClass4, backend_selector, server_selector,
client_class, name);
return (client_class);
}
ClientClassDictionary
ConfigBackendPoolDHCPv4::getAllClientClasses4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) const {
ClientClassDictionary client_classes;
getAllPropertiesConst<ClientClassDictionary>
(&ConfigBackendDHCPv4::getAllClientClasses4, backend_selector, server_selector,
client_classes);
return (client_classes);
}
ClientClassDictionary
ConfigBackendPoolDHCPv4::getModifiedClientClasses4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time) const {
ClientClassDictionary client_classes;
getMultiplePropertiesConst<ClientClassDictionary, const boost::posix_time::ptime&>
(&ConfigBackendDHCPv4::getModifiedClientClasses4, backend_selector, server_selector,
client_classes, modification_time);
return (client_classes);
}
AuditEntryCollection
ConfigBackendPoolDHCPv4::
getRecentAuditEntries(const db::BackendSelector& backend_selector,
const db::ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time,
const uint64_t& modification_id) const {
AuditEntryCollection audit_entries;
getMultiplePropertiesConst<AuditEntryCollection, const boost::posix_time::ptime&>
(&ConfigBackendDHCPv4::getRecentAuditEntries, backend_selector,
server_selector, audit_entries, modification_time, modification_id);
return (audit_entries);
}
ServerCollection
ConfigBackendPoolDHCPv4::getAllServers4(const BackendSelector& backend_selector) const {
ServerCollection servers;
getAllBackendPropertiesConst<ServerCollection>
(&ConfigBackendDHCPv4::getAllServers4, backend_selector, servers);
return (servers);
}
ServerPtr
ConfigBackendPoolDHCPv4::getServer4(const BackendSelector& backend_selector,
const ServerTag& server_tag) const {
ServerPtr server;
getBackendPropertyPtrConst<ServerPtr, const ServerTag&>
(&ConfigBackendDHCPv4::getServer4, backend_selector, server,
server_tag);
return (server);
}
void
ConfigBackendPoolDHCPv4::createUpdateSubnet4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const Subnet4Ptr& subnet) {
createUpdateDeleteProperty<void, const Subnet4Ptr&>
(&ConfigBackendDHCPv4::createUpdateSubnet4, backend_selector,
server_selector, subnet);
}
void
ConfigBackendPoolDHCPv4::createUpdateSharedNetwork4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const SharedNetwork4Ptr& shared_network) {
createUpdateDeleteProperty<void, const SharedNetwork4Ptr&>
(&ConfigBackendDHCPv4::createUpdateSharedNetwork4, backend_selector,
server_selector, shared_network);
}
void
ConfigBackendPoolDHCPv4::createUpdateOptionDef4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const OptionDefinitionPtr& option_def) {
createUpdateDeleteProperty<void, const OptionDefinitionPtr&>
(&ConfigBackendDHCPv4::createUpdateOptionDef4, backend_selector,
server_selector, option_def);
}
void
ConfigBackendPoolDHCPv4::createUpdateOption4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const OptionDescriptorPtr& option) {
createUpdateDeleteProperty<void, const OptionDescriptorPtr&>
(&ConfigBackendDHCPv4::createUpdateOption4, backend_selector,
server_selector, option);
}
void
ConfigBackendPoolDHCPv4::createUpdateOption4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const std::string& shared_network_name,
const OptionDescriptorPtr& option) {
createUpdateDeleteProperty<void, const std::string&, const OptionDescriptorPtr&>
(&ConfigBackendDHCPv4::createUpdateOption4, backend_selector,
server_selector, shared_network_name, option);
}
void
ConfigBackendPoolDHCPv4::createUpdateOption4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const SubnetID& subnet_id,
const OptionDescriptorPtr& option) {
createUpdateDeleteProperty<void, const SubnetID&, const OptionDescriptorPtr&>
(&ConfigBackendDHCPv4::createUpdateOption4, backend_selector,
server_selector, subnet_id, option);
}
void
ConfigBackendPoolDHCPv4::createUpdateOption4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const IOAddress& pool_start_address,
const IOAddress& pool_end_address,
const OptionDescriptorPtr& option) {
createUpdateDeleteProperty<void, const IOAddress&, const IOAddress&,
const OptionDescriptorPtr&>
(&ConfigBackendDHCPv4::createUpdateOption4, backend_selector,
server_selector, pool_start_address, pool_end_address, option);
}
void
ConfigBackendPoolDHCPv4::createUpdateGlobalParameter4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const StampedValuePtr& value) {
createUpdateDeleteProperty<void, const StampedValuePtr&>
(&ConfigBackendDHCPv4::createUpdateGlobalParameter4, backend_selector,
server_selector, value);
}
void
ConfigBackendPoolDHCPv4::createUpdateClientClass4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const ClientClassDefPtr& client_class,
const std::string& follow_class_name) {
createUpdateDeleteProperty<void, const ClientClassDefPtr&, const std::string&>
(&ConfigBackendDHCPv4::createUpdateClientClass4, backend_selector,
server_selector, client_class, follow_class_name);
}
void
ConfigBackendPoolDHCPv4::createUpdateServer4(const BackendSelector& backend_selector,
const ServerPtr& server) {
createUpdateDeleteBackendProperty<void, const ServerPtr&>
(&ConfigBackendDHCPv4::createUpdateServer4, backend_selector,
server);
}
uint64_t
ConfigBackendPoolDHCPv4::deleteSubnet4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const std::string& subnet_prefix) {
return (createUpdateDeleteProperty<uint64_t, const std::string&>
(&ConfigBackendDHCPv4::deleteSubnet4, backend_selector, server_selector,
subnet_prefix));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteSubnet4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const SubnetID& subnet_id) {
return (createUpdateDeleteProperty<uint64_t, const SubnetID&>
(&ConfigBackendDHCPv4::deleteSubnet4, backend_selector, server_selector,
subnet_id));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteAllSubnets4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) {
return (createUpdateDeleteProperty<uint64_t>
(&ConfigBackendDHCPv4::deleteAllSubnets4, backend_selector, server_selector));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteSharedNetworkSubnets4(const db::BackendSelector& backend_selector,
const db::ServerSelector& server_selector,
const std::string& shared_network_name) {
return (createUpdateDeleteProperty<uint64_t, const std::string&>
(&ConfigBackendDHCPv4::deleteSharedNetworkSubnets4, backend_selector, server_selector,
shared_network_name));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteSharedNetwork4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const std::string& name) {
return (createUpdateDeleteProperty<uint64_t, const std::string&>
(&ConfigBackendDHCPv4::deleteSharedNetwork4, backend_selector,
server_selector, name));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteAllSharedNetworks4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) {
return (createUpdateDeleteProperty<uint64_t>
(&ConfigBackendDHCPv4::deleteAllSharedNetworks4, backend_selector, server_selector));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteOptionDef4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const uint16_t code,
const std::string& space) {
return (createUpdateDeleteProperty<uint64_t, uint16_t, const std::string&>
(&ConfigBackendDHCPv4::deleteOptionDef4, backend_selector,
server_selector, code, space));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteAllOptionDefs4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) {
return (createUpdateDeleteProperty<uint64_t>
(&ConfigBackendDHCPv4::deleteAllOptionDefs4, backend_selector, server_selector));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteOption4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const uint16_t code,
const std::string& space) {
return (createUpdateDeleteProperty<uint64_t, uint16_t, const std::string&>
(&ConfigBackendDHCPv4::deleteOption4, backend_selector, server_selector,
code, space));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteOption4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const std::string& shared_network_name,
const uint16_t code,
const std::string& space) {
return (createUpdateDeleteProperty<uint64_t, const std::string&, uint16_t,
const std::string&>
(&ConfigBackendDHCPv4::deleteOption4, backend_selector, server_selector,
shared_network_name, code, space));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteOption4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const SubnetID& subnet_id,
const uint16_t code,
const std::string& space) {
return (createUpdateDeleteProperty<uint64_t, const SubnetID&, uint16_t, const std::string&>
(&ConfigBackendDHCPv4::deleteOption4, backend_selector, server_selector,
subnet_id, code, space));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteOption4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const asiolink::IOAddress& pool_start_address,
const asiolink::IOAddress& pool_end_address,
const uint16_t code,
const std::string& space) {
return (createUpdateDeleteProperty<uint64_t, const IOAddress&, const IOAddress&,
uint16_t, const std::string&>
(&ConfigBackendDHCPv4::deleteOption4, backend_selector, server_selector,
pool_start_address, pool_end_address, code, space));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteGlobalParameter4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const std::string& name) {
return (createUpdateDeleteProperty<uint64_t, const std::string&>
(&ConfigBackendDHCPv4::deleteGlobalParameter4, backend_selector,
server_selector, name));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteAllGlobalParameters4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) {
return (createUpdateDeleteProperty<uint64_t>
(&ConfigBackendDHCPv4::deleteAllGlobalParameters4, backend_selector,
server_selector));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteClientClass4(const BackendSelector& backend_selector,
const ServerSelector& server_selector,
const std::string& name) {
return (createUpdateDeleteProperty<uint64_t, const std::string&>
(&ConfigBackendDHCPv4::deleteClientClass4, backend_selector,
server_selector, name));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteAllClientClasses4(const BackendSelector& backend_selector,
const ServerSelector& server_selector) {
return (createUpdateDeleteProperty<uint64_t>
(&ConfigBackendDHCPv4::deleteAllClientClasses4, backend_selector, server_selector));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteServer4(const BackendSelector& backend_selector,
const ServerTag& server_tag) {
return (createUpdateDeleteBackendProperty<uint64_t>
(&ConfigBackendDHCPv4::deleteServer4, backend_selector,
server_tag));
}
uint64_t
ConfigBackendPoolDHCPv4::deleteAllServers4(const BackendSelector& backend_selector) {
return (createUpdateDeleteBackendProperty<uint64_t>
(&ConfigBackendDHCPv4::deleteAllServers4, backend_selector));
}
} // end of namespace isc::dhcp
} // end of namespace isc
|