This package is the public YaST2 API to configure the ISC DHCP server
$ret = AddDeclaration ($config, $type, $id, $parent_type, $parent_id);
$ret = SetDeclarationParent ($config, $type, $id, $new_parent_type, $new_parent_id);
$ret = SetDeclarationOptions ({}, $config, $type, $id, $options);
$directives = GetDeclarationDirectives ($config, $type, $id);
$ret = SetDeclarationDirectives ($config, $type, $id, $directives);
Immediatelly stops the DHCP service. Returns nonzero if operation succeeded, zero if operation failed.
Immediatelly starts the DHCP service. Returns nonzero if operation succeeded, zero if operation failed.
Check if DHCP service is running. Returns nonzero if service is running, zero otherwise.
Add a new empty DHCP declaration. $type is one of subnet, host, group, pool, shared-network. $id is identification of the declaration (eg. host name for the host, $address netmask $netmask for subnet declaration. $parent_type and $parent_id specify the declaration within that the new declaration shall be created.
Deletes specified declaration including its whole subtree.
Returns the parent of specified declaration. It is returned as a hash with keys "type" and "id".
Example 83.
my $type = "host"; my $id = "client"; my $parent = GetDeclarationParent ({}, $type, $id); if (! defined ($parent)) { print "Specified declaration not found" } else { my $par_type = $parent->{"type"}; my $par_id = $parent->{"id"}; print "Parent type: $par_type"; print "Parent id: $par_id; }
Sets specified parent to the specified declaration (moves it in the tree). The declaration is moved with its complete subtree.
Get all children of a declaration.
Example 85.
my $children = GetChildrenOfDeclaration ({}, "subnet", "192.168.0.0 netmask 255.255.255.0"); if (! defined ($children)) { print "Specified declaration not found"; } else { foreach my $child (@{$children}) { my $type = $child->{"type"}; my $id = $child->{"id"}; print "Have child $type $id"; } }
Get all options of the specified declaration.
Example 86.
my $options = GetDeclarationOptions ({}, "subnet", "192.168.0.0 netmask 255.255.255.0"); if (! defined ($options)) { print "Specified declaration not found"; } else { foreach my $option (@{$options}) { my $key = $option->{"key"}; my $value = $option->{"value"}; print "Have option $key with value $value"; } }
Sets all options of specified declaration. The options argument has the same structure as return value of the GetDeclarationOptions function.
Get all directives of the specified declaration.
Example 88.
my $directives = GetDeclarationDirectives ({}, "subnet", "192.168.0.0 netmask 255.255.255.0"); if (! defined ($directives)) { print "Specified declaration not found"; } else { foreach my $directive (@{$directives}) { my $key = $option->{"key"}; my $value = $option->{"value"}; print "Have directive $key with value $value"; } }
Sets all directives of specified declaration. The directives argument has the same structure as return value of the GetDeclarationDirectives function.