snort_barnyard_start($snortcfg, $if_real); } else { log_error("Toggle (barnyard stopping) for {$if_friendly}({$snortcfg['descr']})..."); snort_barnyard_stop($snortcfg, $if_real); } sleep(3); // So the GUI reports correctly } /* start/stop snort */ if ($_POST['toggle'] && is_numericint($_POST['id'])) { $snortcfg = $config['installedpackages']['snortglobal']['rule'][$_POST['id']]; $if_real = get_real_interface($snortcfg['interface']); $if_friendly = convert_friendly_interface_to_friendly_descr($snortcfg['interface']); if (snort_is_running($snortcfg['uuid'], $if_real)) { log_error("Toggle (snort stopping) for {$if_friendly}({$snortcfg['descr']})..."); snort_stop($snortcfg, $if_real); } else { log_error("Toggle (snort starting) for {$if_friendly}({$snortcfg['descr']})..."); /* set flag to rebuild interface rules before starting Snort */ $rebuild_rules = true; sync_snort_package_config(); $rebuild_rules = false; snort_start($snortcfg, $if_real); } sleep(3); // So the GUI reports correctly } $pgtitle = "Services: {$snort_package_version}"; include_once "head.inc"; ?> <body link="#000000" vlink="#000000" alink="#000000">
$natent['stream5_track_udp'] = 'on'; $natent['stream5_max_udp'] = '131072'; $natent['stream5_udp_timeout'] = '30'; $natent['stream5_track_icmp'] = 'off'; $natent['stream5_max_icmp'] = '65536'; $natent['stream5_icmp_timeout'] = '30'; $natent['stream5_mem_cap'] = '8388608'; if (!is_array($natent['stream5_tcp_engine']['item'])) { $natent['stream5_tcp_engine']['item'] = array(); } $natent['stream5_tcp_engine']['item'][] = $stream5_eng; $a_rule[] = $natent; } /* If Snort is disabled on this interface, stop any running instance */ if ($natent['enable'] != 'on') { snort_stop($natent, $if_real); } /* Save configuration changes */ write_config("Snort pkg: modified interface configuration for {$natent['interface']}."); /* Update snort.conf and snort.sh files for this interface */ sync_snort_package_config(); /* See if we need to restart Snort after an interface re-assignment */ if ($snort_start == true) { snort_start($natent, $if_real); } /*******************************************************/ /* Signal Snort to reload configuration if we changed */ /* HOME_NET, EXTERNAL_NET or Suppress list values. */ /* The function only signals a running Snort instance */ /* to safely reload these parameters. */ /*******************************************************/