Commit Graph

35 Commits

Author SHA1 Message Date
Alexander Traud 9440f6ec58 main: Fix for Doxygen.
ASTERISK-29763

Change-Id: Ib8359e3590a9109eb04a5376559d040e5e21867e
2021-12-02 15:02:09 -06:00
Josh Soref f382775241 main: Spelling fixes
Correct typos of the following word families:

analysis
nuisance
converting
although
transaction
desctitle
acquire
update
evaluate
thousand
this
dissolved
management
integrity
reconstructed
decrement
further on
irrelevant
currently
constancy
anyway
unconstrained
featuregroups
right
larger
evaluated
encumbered
languages
digits
authoritative
framing
blindxfer
tolerate
traverser
exclamation
perform
permissions
rearrangement
performing
processing
declension
happily
duplicate
compound
hundred
returns
elicit
allocate
actually
paths
inheritance
atxferdropcall
earlier
synchronization
multiplier
acknowledge
across
against
thousands
joyous
manipulators
guaranteed
emulating
soundfile

ASTERISK-29714

Change-Id: I926ba4b11e9f6dd3fdd93170ab1f9b997910be70
2021-11-15 17:33:27 -06:00
Sean Bright 695fc3dbd7 dns.c: Load IPv6 DNS resolvers if configured.
IPv6 nameserver addresses are stored in different part of the
__res_state structure, so look there if we appear to have support for
it.

ASTERISK-28004 #close

Change-Id: I67067077d8a406ee996664518d9c8fbf11f6977d
2021-09-08 18:18:28 -05:00
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
snuffy b546497fe0 Add support for older name resolving version libraries like openBSD
Fix support of OS's like openBSD that use an older nameser.h,
this change reverts the defines to the older style which on other
systems is found in nameser_compat.h

Tested on openBSD 6.0, Debian 8

ASTERISK-26608 #close

Change-Id: Iffb36caab8c5aa9dece0ce2d009041f7b56cc86a
2016-11-20 09:19:18 +11:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Timo Teräs 3c1fec8099 Fix res_search usage
Resolver state is not part of res_search API. This fixes
compilation error:

dns.c:261:8: error: too many arguments to function 'res_search'
  ret = res_search(&dns_state,

Change-Id: Ia600a58557040df83f744da3dde23225293845a5
2016-06-02 22:57:49 +03:00
George Joseph e5723d2776 dns: Change lookup failures from LOG_ERROR to debug 1.
dns.c and dns_system_resolver.c were spitting out errors for lookup
failures for things like not finding a SRV record even though
there was an A record.  Those have been changed to debug messages.
Logging not finding ANY record is left to the higher level caller.

Also, dns_system_resolver was using Windows line endings so I
converted them to Unix style.  The actual log changes are on lines
156 and 159.

Change-Id: I65be16ea15304b96f9dcb4d289dbd3e2286fc094
2015-11-30 10:13:35 -07:00
George Joseph 6919daab61 dns: Fix pointer increment in dns_parse_answer_ex
When dns_parse_answer_ex was iterating over the answers it
wasn't incrementing the answer pointer correctly after the first
answer.  The result was that no answers after the first
were being returned.  For results where multiple records should
have been sorted by priority, weight, etc., there was nothing
to sort so the only the first record was returned even if it
wouldn't have been the correct record based on the sort.

ASTERISK-25565 #close
Reported-by: Daniel Tryba
Tested-by George Joseph

Change-Id: I8622604fefdcd3c11e2c5609a6382e53b1467b0b
2015-11-16 15:10:20 -07:00
George Joseph d82a4b098f dns: Use ntohl for ans->ttl in dns_parse_answer_ex
dns_parse_answer_ex was not converting ans->ttl from network
by order to host byte order which was causing certain ttls
it to go negative. In turn this was causing answer edit checks
to fail.

ASTERISK-25528 #close
Reported-by: Daniel Tryba
Tested-by: George Joseph

Change-Id: I31505132d6321c46d2f39fd06c20ee808a864037
2015-11-06 13:19:11 -07:00
Mark Michelson 86034227ca dns_core: Allow zero-length DNS responses.
A testsuite test recently failed due to a crash that occurred in the DNS
core. The problem was that the test could not resolve an address, did
not set a result on the DNS query, and then indicated the query was
completed. The DNS core does not handle the case of a query with no
result gracefully, and so there is a crash.

This changeset makes the DNS system resolver set a result with a
zero-length answer in the case that a DNS resolution failure occurs
early. The DNS core now also will accept such a response without
treating it as invalid input. A unit test was updated to no longer treat
setting a zero-length response as off-nominal.

Change-Id: Ie56641e22debdaa61459e1c9a042e23b78affbf6
2015-07-31 09:44:20 -05:00
Ashley Sanders 3cdfd39af7 DNS: Create a system-level DNS resolver
Prior to this patch, the DNS core present in master had no default system-level
resolver implementation. Therefore, it was not possible for the DNS core to
perform resolutions unless the libunbound library was installed and the
res_resolver_unbound module was loaded.

This patch introduces a system-level DNS resolver implementation that will
register itself with the lowest consideration priority available (to ensure
that it is to be used only as a last resort). The resolver relies on low-level
DNS search functions to perform a rudimentary DNS search based on a provided
query and then supplies the search results to the DNS core.

ASTERISK-25146 #close
Reported By: Joshua Colp

Change-Id: I3b36ea17b889a98df4f8d80d50bb7ee175afa077
2015-07-07 21:31:49 -05:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:

* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
  remove passing the version in with the macro. Other facilities
  than 'core show file version' make use of the file names, such as
  setting a debug level only on a specific file. As such, the act of
  registering source files with the Asterisk core still has use. The
  macro rename now reflects the new macro purpose.

* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Remove the "core show file version" CLI command. Without the file
    version, it is no longer useful.
  - Remove the ast_file_version_find function. The file version is no
    longer tracked.
  - Rename ast_register_file_version/ast_unregister_file_version to
    ast_register_file/ast_unregister_file, respectively.

* main/manager: Remove value from the Version key of the ModuleCheck
  Action. The actual key itself has not been removed, as doing so would
  absolutely constitute a backwards incompatible change. However, since
  the file version is no longer tracked, there is no need to attempt to
  include it in the Version key.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action
  - Removal of the "core show file version" CLI command

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
Matthew Jordan 085d5a2629 Clean up files that do not end with newlines
Trivial patch to add new lines to several files missing them. This fixes
warnings when compiling with gcc 4.1.2 on CentOS 5.

ASTERISK-24245 #close
Reported by: Shaun Ruffell
patches:
  0002-Trivial-addition-of-newlines-at-end-of-three-files.patch uploaded by Shaun Ruffell (License 5417)
........

Merged revisions 421677 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421678 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-21 14:52:28 +00:00
Joshua Colp cc40bf5317 res_pjsip: Enable PJSIP DNS client support.
This change enables DNS client support within PJSIP. System
nameservers are automatically discovered using res_init or
res_ninit. If this fails then PJSIP will resort to using
gethostbyname for resolution.

By enabling this support we gain SRV support, failover, and
weight support.

(closes issue ASTERISK-23435)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/3343/
........

Merged revisions 410795 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-17 22:54:32 +00:00
Matthew Jordan 583226dc5e Remove redundant code in dns.c
Peter J Philipp pointed out that there are two checks that ensure that len is
not less than 0. If len is less than 0, the function returns. Having both of
them is clearly redundant.

This removes the second and attempts to clarify (slightly) the error condition.

(closes issue ASTERISK-21772)
Reported by: Peter J Philipp


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394305 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-14 02:05:04 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Kinsey Moore c5b3db1956 Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these
whitespace-only changes didn't break anything (and shouldn't have).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22 19:51:16 +00:00
Sean Bright e75ae63ac2 Fix a few compilation problems found when building Asterisk against uClibc.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 16:43:12 +00:00
Kevin P. Fleming 887e28d7aa incorporates r159808 from branches/1.4:
------------------------------------------------------------------------
r159808 | kpfleming | 2008-11-29 10:58:29 -0600 (Sat, 29 Nov 2008) | 7 lines

update dev-mode compiler flags to match the ones used by default on Ubuntu Intrepid, so all developers will see the same warnings and errors

since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them

format attributes in a consistent way


------------------------------------------------------------------------

in addition:

move some format attributes from main/utils.c to the header files they belong in, and fix up references to the relevant functions based on new compiler warnings



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-29 17:57:39 +00:00
Brett Bryant 52e8897977 Fix a bug in SRV lookups where dnsmgr would discard everything but the
first SRV result from DNS before processing weights and priorities and 
dns_parse_answer wouldn't report that there were no records in DNS 
unless a failure occured. Also fixed a bug where dnsmgr_refresh would 
report that a entry was being changed when ast_gethostbyname had failed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 21:00:01 +00:00
Mark Michelson 4dbacf6bbc Merged revisions 112138 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r112138 | mmichelson | 2008-04-01 12:21:21 -0500 (Tue, 01 Apr 2008) | 10 lines

Initialize the __res_state structure used for dns purposes
to all 0's prior to using it. This is due to valgrind's complaints
on issue #12284 as well as an excerpt found in "Description" portion
of the online man page found here:

http://www.iti.cs.tu-bs.de/cgi-bin/UNIXhelp/man-cgi?res_nquery+3RESOLV

(pertains to issue #12284 but does not necessarily close it)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-01 17:23:19 +00:00
Tilghman Lesher cfc1df4c1a Whitespace changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 23:04:29 +00:00
Luigi Rizzo e0ff5fef5c remove a bunch of useless #include "options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:09:02 +00:00
Luigi Rizzo 9335ace850 another bunch of include removals (errno.h and asterisk/logger.h)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 19:09:03 +00:00
Luigi Rizzo 5663ff6518 fix breakage induced by previous mistake
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-17 14:45:46 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Joshua Colp 611d112eb7 Merged revisions 81435 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81435 | file | 2007-09-04 10:10:56 -0300 (Tue, 04 Sep 2007) | 7 lines

(closes issue #10610)
Reported by: john
Patches:
      dns.c.patch uploaded by john (license 218)
Tested by: mvanbaak
Don't return a match if no SRV record actually exists.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 13:11:49 +00:00
Kevin P. Fleming 7413c78ddb Merged revisions 75306 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r75306 | kpfleming | 2007-07-16 15:53:24 -0500 (Mon, 16 Jul 2007) | 11 lines

Merged revisions 75304 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75304 | kpfleming | 2007-07-16 15:46:58 -0500 (Mon, 16 Jul 2007) | 3 lines

provide proper copyright/license attribution for this structure that was copied from a BSD-licensed header file long, long ago...


........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 20:58:56 +00:00
Jason Parker 7c29e430c9 Merged revisions 74388 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r74388 | qwell | 2007-07-10 14:10:36 -0500 (Tue, 10 Jul 2007) | 4 lines

Don't use #if to check if something is defined - use #ifdef instead.

Pointed out by kpfleming

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@74390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 19:11:25 +00:00
Jason Parker 8a5cea16bc Merged revisions 74374 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

(closes issue #10133)
................
r74374 | qwell | 2007-07-10 13:39:30 -0500 (Tue, 10 Jul 2007) | 13 lines

Merged revisions 74373 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74373 | qwell | 2007-07-10 13:37:23 -0500 (Tue, 10 Jul 2007) | 5 lines

Use res_ndestroy on systems that have it.  Otherwise, use res_nclose.
This prevents a memleak on NetBSD - and possibly others.

Issue 10133, patch by me, reported and tested by scw

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@74375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 18:41:03 +00:00
Russell Bryant 055d82cbce Add a massive set of changes for converting to use the ast_debug() macro.
(issue #9957, patches from mvanbaak, caio1982, critch, and dimas)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 19:39:12 +00:00
Joshua Colp 7ec331f7ea Return trunk to a state where it compiles under Darwin. The byte order stuff is ugly, if anyone wants to clean it up... by all means do so.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@55763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 01:05:26 +00:00
Matt O'Gorman ae8cc3e18b bug #8076 check option_debug before printing to debug channel.
patch provided in bugnote, with minor changes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 15:53:07 +00:00
Kevin P. Fleming 0a27d8bfe5 merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
  - support for embedded modules
  - support for static builds
  - simpler cross-compilation support
  - simpler module/loader interface (no exported symbols)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 02:11:39 +00:00