DHCPRangeRes is a representation of a range allocator in DHCP. To declare a range you must specify either the `network` field or the `from` and `to` fields as ip with cidr's, or `from` and `to` fields without cidr's but with the `mask` field as either a dotted netmask or a `/number` field. If you sp
| 1296 | // used as a broadcast address) is never allocated. |
| 1297 | // TODO: Add a setting to determine if we should allocate the last address. |
| 1298 | type DHCPRangeRes struct { |
| 1299 | traits.Base // add the base methods without re-implementation |
| 1300 | //traits.Edgeable // XXX: add autoedge support? |
| 1301 | traits.Groupable // can be grouped into DHCPServerRes |
| 1302 | |
| 1303 | init *engine.Init |
| 1304 | |
| 1305 | // Server is the name of the dhcp server resource to group this into. If |
| 1306 | // it is omitted, and there is only a single dhcp resource, then it will |
| 1307 | // be grouped into it automatically. If there is more than one main dhcp |
| 1308 | // resource being used, then the grouping behaviour is *undefined* when |
| 1309 | // this is not specified, and it is not recommended to leave this blank! |
| 1310 | Server string `lang:"server" yaml:"server"` |
| 1311 | |
| 1312 | // MacMatch only allocates ip addresses if the mac address matches this |
| 1313 | // wildcard pattern. The default pattern of the empty string, means any |
| 1314 | // mac address is permitted. |
| 1315 | // TODO: This is not implemented at the moment. |
| 1316 | // TODO: Consider implementing this sort of functionality. |
| 1317 | // TODO: Can we use https://pkg.go.dev/path/filepath#Match ? |
| 1318 | //MacMatch string `lang:"macmatch" yaml:"macmatch"` |
| 1319 | |
| 1320 | // Network is the network number and cidr to determine the range. For |
| 1321 | // example, the common network range of 192.168.42.1 to 192.168.42.255 |
| 1322 | // should have a network field here of 192.168.42.0/24. You can either |
| 1323 | // specify this field or `from` and `to`, but not a different |
| 1324 | // combination. If you don't specify any of these fields, then the |
| 1325 | // resource name will be parsed as if it was used here. |
| 1326 | Network string `lang:"network" yaml:"network"` |
| 1327 | |
| 1328 | // From is the start address in the range inclusive. If it is specified |
| 1329 | // in cidr notation, then the `mask` field must not be used. Otherwise |
| 1330 | // it must be used. In both situations the cidr or mask must be |
| 1331 | // consistent with the `to` field. If this field is used, you must not |
| 1332 | // use the `network` field. |
| 1333 | From string `lang:"from" yaml:"from"` |
| 1334 | |
| 1335 | // To is the end address in the range inclusive. If it is specified in |
| 1336 | // cidr notation, then the `mask` field must not be used. Otherwise it |
| 1337 | // must be used. In both situations the cidr or mask must be consistent |
| 1338 | // with the `from` field. If this field is used, you must not use the |
| 1339 | // `network` field. |
| 1340 | To string `lang:"to" yaml:"to"` |
| 1341 | |
| 1342 | // Mask is the cidr or netmask of ip addresses in the specified range. |
| 1343 | // This field must only be used if both `from` and `to` are specified, |
| 1344 | // and if neither of them specify a cidr suffix. If neither do, then the |
| 1345 | // mask here can be in either dotted format or, preferably, in cidr |
| 1346 | // format by starting with a slash. |
| 1347 | Mask string `lang:"mask" yaml:"mask"` |
| 1348 | |
| 1349 | // Skip is a list ip's in either cidr or standalone representation which |
| 1350 | // will be skipped and not allocated. |
| 1351 | Skip []string `lang:"skip" yaml:"skip"` |
| 1352 | |
| 1353 | // Persist should be true if you want to persist the lease information |
| 1354 | // to disk so that a new (or changed) invocation of this resource with |
| 1355 | // the same name, will regain that existing initial state at startup. |