summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/util.inc
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3529 from Chrisc-c-c/Fix-List-Sort-OrderSteve Beaver2017-03-201-1/+2
|\
| * Fix incorrect sorting for various dropdown lists.Chris Rowe2017-02-121-1/+2
| |
* | Add a function to normalize CR and CRLF-style newlines to Unix LFdoktornotor2017-02-231-0/+6
|/ | | See Bug #5306.
* 5th trylukehamburg2017-02-091-1/+1
| | | | - change $do_ping default value to 'true' (which emulates the previous default behavior) to avoid any unexpected results
* 4th attempt!lukehamburg2017-02-091-3/+7
| | | | - Reworked based on recent comments from @rbgarga
* 3rd try!lukehamburg2017-02-081-9/+8
| | | | - incorporate suggestions from @rbgarga with slight modification
* 2nd try. . .lukehamburg2017-02-081-11/+14
| | | | | | | | | /etc/inc/util.inc: - arp_get_mac_by_ip() updated to support IPv6 - attempt at code streamline /usr/local/www/services_dhcp_edit.php: - streamline code, now just a simple call to arp_get_mac_by_ip()
* Introduce is_intrange() to validate a range of integers delimited by ':' or '-'Renato Botelho2017-01-241-0/+29
|
* Merge pull request #3414 from phil-davis/ipv6-compressRenato Botelho2017-01-231-4/+19
|\
| * Force compress for where_is_ipaddr_configuredPhil Davis2017-01-221-2/+2
| |
| * Always force compress when calling Net_IPv6Phil Davis2017-01-221-2/+17
| |
* | Remove unused variable $cfglckkeyconsumersRenato Botelho2017-01-231-5/+3
|/
* Make sure file exists before try to open itRenato Botelho2017-01-101-2/+3
|
* Fix styleRenato Botelho2017-01-101-38/+38
|
* format_DUID array_walkPhil Davis2017-01-091-3/+5
|
* format_DUID use str_padPhil Davis2017-01-091-3/+1
|
* format_DUID reviewPhil Davis2017-01-091-6/+3
|
* Helper format_duid() for DUID inputPhil Davis2017-01-081-1/+29
|
* Return partial MAC address matching support to is_macaddr(). Fixes #7088jim-p2017-01-051-3/+9
|
* Merge pull request #3304 from marjohn56/masterjim-p2017-01-021-0/+63
|\
| * Changes as requestedmarjohn562016-12-271-6/+6
| |
| * tidymarjohn562016-12-231-7/+3
| |
| * Added get_duid_from_file() functionmarjohn562016-12-221-0/+31
| | | | | | Used in System->Advanced->Networking to display the current DUID in the placeholder for setting the DUID.
| * User Defined DUIDmarjohn562016-12-211-0/+36
| | | | | | | | | | | | | | User may define a DUID to use in System->Advanced->Networking. The entered DUID is validated for composition and length, if valid it is stored in the config.xml. On call of wan_dhcp6_configure() the DUID is written to file to be read by dhcp6c on launch.
* | Fix #3560 correctly handle disabled static routesPhil Davis2016-12-271-1/+5
|/ | | | | | | | | | | | | | | | | | | | | 1) util.inc - add parameter to get_staticroutes() so the caller can choose to see all static routes or only the ones that are currently enabled. 2) filter.inc - just process enabled static routes when making direct networks list, tonathosts etc. 3) services.inc - only include enabled static routes when making confogs for DHCP(6) Relay. 4) unbound.inc - only include enable static routes in unbound_acls_config 5) rc.newroutedns - only trigger if there is an enabled static route. Note: GUI validation has been left as-is. e.g. in system_gateways we don not allow to delete a gateway if there is a disabled static route using it... If people want to delete "higher level" stuff, then they need to first delete the disabled static route(s). Otherwise it will get rather "risky" having disabled static routes in the config that refer to gateways that no longer exist, or have a subnet range that now matches a local interafce or...
* validateipaddr update return value commentsPhil Davis2016-12-201-3/+3
|
* validateipaddr use constants from globals.incPhil Davis2016-12-201-7/+7
|
* validateipaddr return address familyPhil Davis2016-12-201-7/+13
| | | Enhanced the return values from validateipaddr() so the caller can know if the validated address is IPv4 or IPv6 (or an alias if that check was requested). That makes it a better replacement for is_ipaddr().
* Merge pull request #3281 from phil-davis/patch-7Renato Botelho2016-12-161-6/+6
|\
| * validateipaddr enhance flexibility for translationPhil Davis2016-12-161-6/+6
| | | | | | By using sprintf() we can allow for some language where the label text does not fit at the start of the sentence.
* | validateipaddr code formatPhil Davis2016-12-161-2/+2
|/
* Fix commentSteve Beaver2016-12-151-1/+1
|
* Added a function validateipaddr() use as:Steve Beaver2016-12-151-0/+61
| | | | | | | | | | | | // Validate a network address // $addr: the address to validate // $type: IPV4|IPV6|IPV4V6 // $label: the label used by the GUI to display this value. Required to compose an error message // $err_msg: pointer to the callers error message array so that error messages can be added to it here // $alias: are aliases permitted for this address? function validateipaddr(&$addr, $type, $label, &$err_msg, $alias=false) This is indented to provide a single method of validating IP addresses of all types and composing a suitable error message
* Revise update_filter_relaod_status() function to append status messages ↵Steve Beaver2016-11-211-6/+10
| | | | rather than overwrite the file
* Check if pidfile is valid before try to send signalRenato Botelho2016-10-311-2/+3
|
* Update the variable with the round() return otherwise it does not has any ↵Luiz Otavio O Souza2016-10-231-1/+1
| | | | | | effect. Found while testing Ticket #6272.
* Fix is_macaddr().Luiz Otavio O Souza2016-10-201-3/+13
| | | | | | Hexadecimal numbers without the '0' padding are also valid, e.g: a:b:c:d:e:f
* Fix #6828Renato Botelho2016-10-181-0/+30
| | | | | | | | Until 2.3.x pfSense carried a patch that changed the behavior of 'route change' command, making it add the route when it fails to change. On 2.4 this patch was removed and will not be added back. This change adjust PHP code to deal with route add / change and make it work without the patch
* Add extra validations on is_inrange_v[46]Renato Botelho2016-10-131-6/+16
| | | | | | | | | Verify if addresses are valid IP address before convert them to make numeric comparison. While here, adjust indent. Inspired by: @phil-davis patch at PR #3189
* Make unlink_if_exists return true/falsePhil Davis2016-10-131-5/+13
| | | | | | | | | | | | | | | | This allows the caller to do a single "atomic" call to unlink_if_exists. If it returns true, then they know that the file existed and that it has been unlinked successfully. This should help avoid race conditions where multiple code paths try sequences like: if (file_exists("somefile") { unlink("somefile"); do_other_stuff(); } in the case where we really only want do_other_stuff() to happen for the code path that is the first one to actually unlink the file.
* Deprecate nanobsd platform and remove all conditionals that uses itRenato Botelho2016-10-121-10/+2
|
* Retire refcount functions. They are not used anymoreRenato Botelho2016-10-121-76/+0
|
* Move copyright from ESF to NetgateRenato Botelho2016-09-061-1/+1
|
* Ticket #3734: Add function to convert IPv6 address <-> binaryRenato Botelho2016-08-311-6/+60
| | | | | | | | | | | - ip6_to_bin() and bin_to_ip6() are copies obtained from pear-Net_IPv6 since the version available in the class is protected and we don't want to add more patches to thirdy part software. If upstream accept to change them to public we can retire them - bin_to_compressed_ip6 is just a short way to conver binary direct to a compressed IPv6 address Reported at: https://forum.pfsense.org/index.php?topic=117601.0
* Silence pgrep stderr when pidfile contains an invalid PIDRenato Botelho2016-08-161-1/+1
|
* Code style and commentsPhil Davis2016-08-161-2/+2
| | | | No functional change - just making style consistent
* Move to Apache License 2.0Renato Botelho2016-07-151-41/+9
|
* Review license / copyright on all files (final round)Renato Botelho2016-07-151-1/+1
|
* Review license / copyright on all files (1st round)Renato Botelho2016-07-141-43/+42
|
* Merge pull request #3007 from stilez/patch-34Chris Buechler2016-07-121-6/+3
|\
OpenPOWER on IntegriCloud