Skip to content

Commit 31912bb

Browse files
Added apicalls.inc import containing function of all API endpoint actions and processes, all endpoints will simply call these functions in the future. Completed /interfaces/add/index.php with all IPv6 interface configuration options.
1 parent 53203f0 commit 31912bb

4 files changed

Lines changed: 5734 additions & 5 deletions

File tree

pfSense-pkg-API/files/etc/inc/api.inc

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,28 @@ function get_next_pfsense_if_id() {
883883
}
884884
}
885885

886+
// Returns a list of dynamically configured IPv6 interfaces. Modified from interfaces.php function.
887+
function get_ipv6_if_list() {
888+
global $config, $section;
889+
$list = array('' => '');
890+
$interfaces = get_configured_interface_with_descr(true);
891+
$dyn_v6_ifs = array();
892+
foreach ($interfaces as $iface => $ifacename) {
893+
switch ($config['interfaces'][$iface]['ipaddrv6']) {
894+
case "6to4":
895+
case "6rd":
896+
case "dhcp6":
897+
$dyn_v6_ifs[$iface] = array(
898+
'name' => $ifacename,
899+
'ipv6_num_prefix_ids' => pow(2, (int) calculate_ipv6_delegation_length($iface)) - 1);
900+
break;
901+
default:
902+
continue 2;
903+
}
904+
}
905+
return($dyn_v6_ifs);
906+
}
907+
886908
// Apply a new interface configuration
887909
function apply_interface_config($if_conf) {
888910
// Local variables
@@ -1007,4 +1029,4 @@ function enable_carp($enable) {
10071029
interfaces_sync_setup();
10081030
set_single_sysctl('net.inet.carp.allow', '1');
10091031
}
1010-
}
1032+
}

0 commit comments

Comments
 (0)