本文整理汇总了PHP中convert_friendly_interface_to_friendly_descr函数的典型用法代码示例。如果您正苦于以下问题:PHP convert_friendly_interface_to_friendly_descr函数的具体用法?PHP convert_friendly_interface_to_friendly_descr怎么用?PHP convert_friendly_interface_to_friendly_descr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了convert_friendly_interface_to_friendly_descr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ipsec_idinfo_to_text
function ipsec_idinfo_to_text(&$idinfo)
{
global $config;
switch ($idinfo['type']) {
case "address":
return $idinfo['address'];
break;
/* NOTREACHED */
/* NOTREACHED */
case "network":
return $idinfo['address'] . "/" . $idinfo['netbits'];
break;
/* NOTREACHED */
/* NOTREACHED */
case "mobile":
return gettext("Mobile Client");
break;
/* NOTREACHED */
/* NOTREACHED */
case "none":
return gettext("None");
break;
/* NOTREACHED */
/* NOTREACHED */
default:
if (!empty($config['interfaces'][$idinfo['type']])) {
return convert_friendly_interface_to_friendly_descr($idinfo['type']);
} else {
return strtoupper($idinfo['type']);
}
break;
/* NOTREACHED */
}
}
示例2: get_interface_addr
function get_interface_addr($if)
{
global $config;
$ifdescr = convert_friendly_interface_to_friendly_descr($if);
/* find out interface name */
if ($ifdescr == "wan") {
$if = get_real_wan_interface();
} else {
$if = $config['interfaces'][$ifdescr];
}
return $if;
}
示例3: unset
unset($network, $subnet);
}
}
}
if ($_POST['ipaddrv6']) {
if (!is_ipaddrv6($_POST['ipaddrv6'])) {
$input_errors[] = gettext("A valid IPv6 address must be specified.");
} else {
if (ip_in_subnet($_POST['ipaddrv6'], "fe80::/10")) {
$input_errors[] = gettext("IPv6 link local addresses cannot be configured as an interface IP.");
}
$where_ipaddr_configured = where_is_ipaddr_configured($_POST['ipaddrv6'], $if, true, true, $_POST['subnetv6']);
if (count($where_ipaddr_configured)) {
$subnet_conflict_text = sprintf(gettext("IPv6 address %s is being used by or overlaps with:"), $_POST['ipaddrv6'] . "/" . $_POST['subnetv6']);
foreach ($where_ipaddr_configured as $subnet_conflict) {
$subnet_conflict_text .= " " . convert_friendly_interface_to_friendly_descr($subnet_conflict['if']) . " (" . $subnet_conflict['ip_or_subnet'] . ")";
}
$input_errors[] = $subnet_conflict_text;
}
foreach ($staticroutes as $route_subnet) {
list($network, $subnet) = explode("/", $route_subnet);
if ($_POST['subnetv6'] == $subnet && $network == gen_subnetv6($_POST['ipaddrv6'], $_POST['subnetv6'])) {
$input_errors[] = gettext("This IPv6 address conflicts with a Static Route.");
break;
}
unset($network, $subnet);
}
}
}
if ($_POST['subnet'] && !is_numeric($_POST['subnet'])) {
$input_errors[] = gettext("A valid subnet bit count must be specified.");
示例4: gettext
?>
<div class="content">
<table>
<tr>
<?php
echo '<td class="widgetsubheader" align="center">' . gettext("Computer / Device") . '</td>';
echo '<td class="widgetsubheader" align="center">' . gettext("Interface") . '</td>';
echo '<td class="widgetsubheader" align="center">' . gettext("Status") . '</td>';
?>
<td class="widgetsubheader"> </td>
</tr>
<?php
if (count($wolcomputers) > 0) {
foreach ($wolcomputers as $wolent) {
echo '<tr><td class="listlr">' . $wolent['descr'] . '<br />' . $wolent['mac'] . '</td>' . "\n";
echo '<td class="listr">' . convert_friendly_interface_to_friendly_descr($wolent['interface']) . '</td>' . "\n";
$is_active = exec("/usr/sbin/arp -an |/usr/bin/grep {$wolent['mac']}| /usr/bin/wc -l|/usr/bin/awk '{print \$1;}'");
$status = exec("/usr/sbin/arp -an | /usr/bin/awk '\$4 == \"{$wolent['mac']}\" { print \$7 }'");
if ($status == 'expires') {
echo '<td class="listr" align="center">' . "\n";
echo "<img src=\"/themes/" . $g["theme"] . "/images/icons/icon_pass.gif\" alt=\"pass\" /> " . gettext("Online") . "</td>\n";
} else {
if ($status == 'permanent') {
echo '<td class="listr" align="center">' . "\n";
echo "<img src=\"/themes/" . $g["theme"] . "/images/icons/icon_pass_d.gif\" alt=\"pass\" /> " . gettext("Static ARP") . "</td>\n";
} else {
echo '<td class="listbg" align="center">' . "\n";
echo "<img src=\"/themes/" . $g["theme"] . "/images/icons/icon_block.gif\" alt=\"block\" /> <font color=\"white\">" . gettext("Offline") . "</font></td>\n";
}
}
echo '<td valign="middle" class="list nowrap">';
示例5: gettext
<i class="fa fa-hand-paper-o text-danger" title="<?php
echo gettext("Negated: This rule excludes NAT from a later rule");
?>
"></i>
<?php
}
?>
</a>
</td>
<td>
<?php
echo $textss;
if (!$natent['interface']) {
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan"));
} else {
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface']));
}
echo $textse;
?>
</td>
<td>
<?php
$source_net = pprint_address($natent['source']);
$source_cidr = strstr($source_net, '/');
echo $textss . $natent['external'] . $source_cidr . $textse;
?>
</td>
<td>
<?php
echo $textss . $source_net . $textse;
?>
示例6: gettext
?>
</th>
<th><?php
echo gettext("Actions");
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($a_gifs as $i => $gif) {
?>
<tr>
<td>
<?php
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($gif['if']));
?>
</td>
<td>
<?php
echo htmlspecialchars($gif['remote-addr']);
?>
</td>
<td>
<?php
echo htmlspecialchars($gif['descr']);
?>
</td>
<td>
<a class="fa fa-pencil" title="<?php
echo gettext('Edit GIF interface');
示例7: foreach
foreach ($config['virtualip']['vip'] as $carp) {
if ($carp['mode'] != "carp") {
continue;
}
$ipaddress = $carp['subnet'];
$password = $carp['password'];
$netmask = $carp['subnet_bits'];
$vhid = $carp['vhid'];
$advskew = $carp['advskew'];
$status = get_carp_interface_status("_vip{$carp['uniqid']}");
?>
<tr>
<td>
<a href="/system_hasync.php">
<?php
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$vhid}");
?>
</a>
</td>
<?php
if ($carp_enabled == false) {
$icon = 'times-circle';
$status = "DISABLED";
} else {
if ($status == "MASTER") {
$icon = 'play-circle text-success';
} else {
if ($status == "BACKUP") {
$icon = 'pause-circle text-warning';
} else {
if ($status == "INIT") {
示例8: foreach
$no_rules_footnote = false;
if ($id_gen == 0) {
$no_rules = false;
} else {
$no_rules = true;
}
foreach ($a_nat as $natent) {
?>
<tr valign="top" id="fr<?php
echo $nnats;
?>
">
<?php
/* convert fake interfaces to real and check if iface is up */
$if_real = get_real_interface($natent['interface']);
$natend_friendly = convert_friendly_interface_to_friendly_descr($natent['interface']);
$snort_uuid = $natent['uuid'];
if (!snort_is_running($snort_uuid, $if_real)) {
$iconfn = 'block';
$iconfn_msg1 = 'Snort is not running on ';
$iconfn_msg2 = '. Click to start.';
} else {
$iconfn = 'pass';
$iconfn_msg1 = 'Snort is running on ';
$iconfn_msg2 = '. Click to stop.';
}
if (!snort_is_running($snort_uuid, $if_real, 'barnyard2')) {
$biconfn = 'block';
$biconfn_msg1 = 'Barnyard2 is not running on ';
$biconfn_msg2 = '. Click to start.';
} else {
示例9: implode
</td>
</tr>
<?php
}
// Show the anti-lockout rule if it's enabled, and we are on LAN with an if count > 1, or WAN with an if count of 1.
if (!isset($config['system']['webgui']['noantilockout']) && (count($config['interfaces']) > 1 && $selected_if == 'lan' || count($config['interfaces']) == 1 && $selected_if == 'wan')) {
$alports = implode('<br />', filter_get_antilockout_ports(true));
?>
<tr valign="top">
<td> </td>
<td><span class="glyphicon glyphicon-play text-success"></span></td>
<td>*</td>
<td>*</td>
<td class="hidden-xs hidden-sm">*</td>
<td class="hidden-xs hidden-sm"><?php
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($selected_if));
?>
Address</td>
<td class="hidden-xs hidden-sm"><?php
echo $alports;
?>
</td>
<td class="hidden-xs hidden-sm">*</td>
<td class="hidden-xs hidden-sm"> </td>
<td><?php
echo gettext("Anti-Lockout Rule");
?>
</td>
<td>
<a href="system_advanced_admin.php" title="<?php
echo gettext("edit rule");
示例10: ucwords
$interface = "none";
$dnsgw = "dns{$dnscounter}gwint";
if ($pconfig[$dnsgw] == $interface) {
$selected = "selected";
} else {
$selected = "";
}
echo "<option value='{$interface}' {$selected}>" . ucwords($interface) . "</option>\n";
foreach ($interfaces as $interface) {
if (interface_has_gateway($interface)) {
if ($pconfig[$dnsgw] == $interface) {
$selected = "selected";
} else {
$selected = "";
}
$friendly_interface = convert_friendly_interface_to_friendly_descr($interface);
echo "<option value='{$interface}' {$selected}>" . ucwords($friendly_interface) . "</option>\n";
}
}
?>
</select>
<?php
}
?>
</td>
</tr>
<?php
}
?>
</table>
<br>
示例11: gettext
<th><?php
echo gettext("Description");
?>
</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
foreach ($a_igmpproxy as $igmpentry) {
?>
<tr>
<td>
<?php
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($igmpentry['ifname']));
?>
</td>
<td>
<?php
echo htmlspecialchars($igmpentry['type']);
?>
</td>
<td>
<?php
$addresses = implode(", ", array_slice(explode(" ", $igmpentry['address']), 0, 10));
print $addresses;
if (count($addresses) < 10) {
print ' ';
} else {
print '...';
示例12: conf_mount_rw
conf_mount_rw();
suricata_generate_yaml($natent);
conf_mount_ro();
// Sync to configured CARP slaves if any are enabled
suricata_sync_on_changes();
}
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header("Location: suricata_app_parsers.php?id={$id}");
exit;
}
}
$if_friendly = convert_friendly_interface_to_friendly_descr($pconfig['interface']);
$pgtitle = gettext("Suricata: Interface {$if_friendly} - Application Layer Parsers");
include_once "head.inc";
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php
include "fbegin.inc";
/* Display error message */
if ($input_errors) {
print_input_errors($input_errors);
}
?>
<form action="suricata_app_parsers.php" method="post" name="iform" id="iform">
<input name="id" type="hidden" value="<?php
示例13: safe_mkdir
}
if (!is_dir("{$snortdir}/snort_{$value['uuid']}_{$if_real}/rules")) {
safe_mkdir("{$snortdir}/snort_{$value['uuid']}_{$if_real}/rules");
}
if (!is_dir("{$snortdir}/snort_{$value['uuid']}_{$if_real}/preproc_rules")) {
safe_mkdir("{$snortdir}/snort_{$value['uuid']}_{$if_real}/preproc_rules");
}
if (!is_dir("{$snortdir}/snort_{$value['uuid']}_{$if_real}/snort_dynamicpreprocessor")) {
safe_mkdir("{$snortdir}/snort_{$value['uuid']}_{$if_real}/snort_dynamicpreprocessor");
}
snort_apply_customizations($value, $if_real);
/* Log a message in Update Log if protecting customized preprocessor rules. */
$tmp = "\t" . $tmp . "\n";
if ($value['protect_preproc_rules'] == 'on') {
$tmp .= gettext("\tPreprocessor text rules flagged as protected and not updated for ");
$tmp .= convert_friendly_interface_to_friendly_descr($value['interface']) . "...\n";
}
error_log($tmp, 3, SNORT_RULES_UPD_LOGFILE);
}
} else {
if ($pkg_interface != "console") {
update_output_window(gettext("Warning: No interfaces configured for Snort were found..."));
update_output_window(gettext("No interfaces currently have Snort configured and enabled on them..."));
}
error_log(gettext("\tWarning: No interfaces configured for Snort were found...\n"), 3, SNORT_RULES_UPD_LOGFILE);
}
/* Clear the rebuild rules flag. */
$rebuild_rules = false;
/* Restart snort if running, and not in post-install, so as to pick up the new rules. */
if (!$g['snort_postinstall'] && is_service_running("snort") && count($config['installedpackages']['snortglobal']['rule']) > 0) {
if ($pkg_interface != "console") {
示例14: htmlspecialchars
echo $textse;
?>
</td>
<td class="listr" onclick="fr_toggle(<?php
echo $i;
?>
)" id="frd<?php
echo $i;
?>
" ondblclick="document.location='system_gateways_edit.php?id=<?php
echo $i;
?>
';">
<?php
echo $textss;
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($gateway['friendlyiface']));
echo $textse;
?>
</td>
<td class="listr" onclick="fr_toggle(<?php
echo $i;
?>
)" id="frd<?php
echo $i;
?>
" ondblclick="document.location='system_gateways_edit.php?id=<?php
echo $i;
?>
';">
<?php
echo $textss;
示例15: gettext
<tr>
<td class="listtopic" colspan="2">Graph Settings</td>
</tr>
<tr>
<td width="20%" class="listhdr">
<?php
echo gettext("Graphs:");
?>
</td>
<td width="80%" class="listhdr">
<select name="graph" class="formselect" style="z-index: -10;">
<?php
foreach ($custom_databases as $db => $database) {
$optionc = explode("-", $database);
$optionc[1] = str_replace(".rrd", "", $optionc[1]);
$friendly = convert_friendly_interface_to_friendly_descr(strtolower($optionc[0]));
if (!empty($friendly)) {
$optionc[0] = $friendly;
}
$prettyprint = ucwords(implode(" :: ", $optionc));
echo "<option value=\"{$database}\"";
if ($pconfig['graph'] == $database) {
echo " selected";
}
echo ">" . htmlspecialchars($prettyprint) . "</option>\n";
}
?>
</select>
</td>
</tr>
<tr>