Commit graph

145 commits

Author SHA1 Message Date
W.C.A. Wijngaards
1aa7168c6a - For #391: more double casts in python start time calculation. 2021-01-08 09:55:55 +01:00
W.C.A. Wijngaards
ee2545d939 - For #391: fix indentation. 2021-01-08 09:53:52 +01:00
W.C.A. Wijngaards
3e03e2c26d - For #391: use struct timeval* start_time for callback information. 2021-01-08 09:47:46 +01:00
Frank Riley
e3abd772f7 Add start_time to reply callbacks so modules can compute the response time. 2021-01-01 15:44:21 -07:00
Frank Riley
28b45e1d87 Add missing callbacks to the python module 2021-01-01 10:19:32 -07:00
W.C.A. Wijngaards
811cf6db0c - Fix missing prototypes in the code. 2020-12-11 14:34:39 +01:00
W.C.A. Wijngaards
ca39cfd6ae - Fix #333: Unbound Segmentation Fault w/ log_info Functions From
Python Mod.
2020-10-22 08:47:40 +02:00
W.C.A. Wijngaards
c8390e390d - Fix python documentation warning on functions.rst inplace_cb_reply. 2020-10-19 10:41:03 +02:00
George Thessalonikefs
d55084ea9e - Fix that if there are reply callbacks for the given rcode, those
are called per reply and a new message created if that was modified
  by the call.
- Pass the comm_reply information to the inplace_cb_reply* functions
  during the mesh state and update the documentation on that.
2020-10-15 17:17:59 +02:00
George Thessalonikefs
a912786ca9 - Update documentation in python example code. 2020-08-26 11:59:09 +02:00
W.C.A. Wijngaards
8f2b9b461b dlv removal, remove DLV references from man page and pythonmod interface. 2020-08-05 10:25:56 +02:00
W.C.A. Wijngaards
c0c722cd97 DLV removal 2020-08-04 09:05:09 +02:00
Torbjörn Lönnemark
9af8080f2b Fix python module len() implementations
They were all missing the 'self.' prefix when accessing the 'obj'
instance variable, causing the following exception when attempting to
call len() on (for example) a ReplyInfo_RRSet:

  File "/usr/lib/python3.7/site-packages/unboundmodule.py", line 377, in __len__
    def __len__(self): return obj.rrset_count
NameError: name 'obj' is not defined
2020-07-22 03:13:00 +02:00
W.C.A. Wijngaards
8833d44d01 - Fix python examples/calc.py for eval, reported by X41 D-Sec. 2019-11-20 15:07:09 +01:00
W.C.A. Wijngaards
d3b3d64ef3 - Remove warning about unknown cast-function-type warning pragma. 2019-08-16 12:52:58 +02:00
W.C.A. Wijngaards
78b2f1cc20 - Fix python dict reference and double free in config. 2019-06-18 17:25:08 +02:00
W.C.A. Wijngaards
63b2628a18 Merge branch 'dev/all-merged/master' of git://github.com/episource/unbound into episource-dev/all-merged/master 2019-06-18 17:07:57 +02:00
W.C.A. Wijngaards
310396190b - Fix #31: swig 4.0 and python module. 2019-05-16 11:06:01 +02:00
George Thessalonikefs
d1150541bb - Update python documentation for init_standard().
- Typos.


git-svn-id: file:///svn/unbound/trunk@5157 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-04-11 15:03:04 +00:00
Wouter Wijngaards
4eac399dfd - Fix #17: Add python module example from Jan Janak, that is a
plugin for the Unbound DNS resolver to resolve DNS records in
  multicast DNS [RFC 6762] via Avahi.


git-svn-id: file:///svn/unbound/trunk@5151 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-04-08 14:34:58 +00:00
Philipp Serr
efb3697332 Merge branch 'dev/pythonmod-multi-instance/v1.9.0' into dev/all-merged/master 2019-03-02 14:35:19 +01:00
Philipp Serr
56a174bb0f Merge branch 'dev/pythonmod-data/v1.9.0' into dev/all-merged/master 2019-03-02 14:34:58 +01:00
Philipp Serr
b248654aab Support multiple python module instances
This commit adds proper support for multiple instances of the python
module: When more than one instance is added to the module list, the
first instance loads the first script specified in the `python:`
configuration section. The second instance loads the second script,
and so on.

When there are more module instances in the module list than there are
scripts in the `python:` section, an error is raised during
initialization and unbound won't start. When more scripts than module
instances are provided, the surplus scripts are ignored.
2019-03-02 14:32:48 +01:00
Philipp Serr
7cc4ff05ad Initialize per-query qdata and per-module mod_env
The python module used to assign None to the per-query (qdata argument)
and per-module (mod_env variable) data stores. Hence, there was no
obvious way for python code to use these data stores.

This commit initializes both data stores with a dict instance.
2019-03-02 09:26:57 +01:00
Philipp Serr
b4a9031cdb Add module_restart_next definition to swig file 2019-03-02 09:25:14 +01:00
Wouter Wijngaards
a62c1135fe - Remove memory leak on pythonmod python2 script file init.
- Remove swig gcc8 python function cast warnings, they are ignored.


git-svn-id: file:///svn/unbound/trunk@5127 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-02-28 09:12:54 +00:00
Wouter Wijngaards
ba0cad0bc3 Fixup for python 2
git-svn-id: file:///svn/unbound/trunk@5126 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-02-27 14:22:55 +00:00
Wouter Wijngaards
7c1f9699d8 - Fix for python module on Windows, fix fopen.
git-svn-id: file:///svn/unbound/trunk@5125 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-02-27 14:14:08 +00:00
Wouter Wijngaards
079253670e - Fix pythonmod include and sockaddr_un ifdefs for compile on
Windows, and for libunbound.


git-svn-id: file:///svn/unbound/trunk@5118 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-02-20 15:19:58 +00:00
Wouter Wijngaards
438634b718 nicer python error log errors.
git-svn-id: file:///svn/unbound/trunk@4970 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-11-22 13:47:37 +00:00
Wouter Wijngaards
d21cb609a8 - review fixes for python module.
git-svn-id: file:///svn/unbound/trunk@4969 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-11-22 13:31:21 +00:00
Wouter Wijngaards
668c0627c0 Fix compare signed with unsigned in python interface for pythonmod
git-svn-id: file:///svn/unbound/trunk@4968 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-11-22 13:07:37 +00:00
Wouter Wijngaards
5853f90076 - With ./configure --with-pyunbound --with-pythonmodule
PYTHON_VERSION=3.6 or with 2.7 unbound can compile and unit tests
  succeed for the python module.
- pythonmod logs the python error and traceback on failure.


git-svn-id: file:///svn/unbound/trunk@4966 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-11-22 13:01:29 +00:00
Wouter Wijngaards
7acf6a4a66 - Removed compile warnings in pythonmod sockaddr routines.
git-svn-id: file:///svn/unbound/trunk@4963 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-11-20 12:28:09 +00:00
Wouter Wijngaards
04d73b9192 - Add patch from Jan Vcelak for pythonmod,
add sockaddr_storage getters, add support for query callbacks,
  allow raw address access via comm_reply and update API documentation.


git-svn-id: file:///svn/unbound/trunk@4962 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-11-20 12:24:40 +00:00
George Thessalonikefs
0171d06aa2 - #4140: Expose repinfo (comm_reply) to the inplace_callbacks. This
gives access to reply information for the client's communication
  point when the callback is called before the mesh state (modules).
  Changes to C and Python's inplace_callback signatures were also
  necessary.


git-svn-id: file:///svn/unbound/trunk@4870 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-08-22 10:51:13 +00:00
Wouter Wijngaards
9cb404ba5f - Fix that first control-interface determines if TLS is used. Warn
when IP address interfaces are used without TLS.


git-svn-id: file:///svn/unbound/trunk@4730 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-06-14 08:14:43 +00:00
Wouter Wijngaards
9d28279475 - Can set tls authentication with forward-addr: IP#tls.auth.name
And put the public cert bundle in tls-cert-bundle: "ca-bundle.pem".


git-svn-id: file:///svn/unbound/trunk@4631 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-04-19 12:10:05 +00:00
Wouter Wijngaards
7d17a926ac - Spelling fixes, from Phil Porada.
git-svn-id: file:///svn/unbound/trunk@4344 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-09-15 14:29:28 +00:00
Wouter Wijngaards
7a9d8f49f4 - Fix python example0 return module wait instead of error for pass.
git-svn-id: file:///svn/unbound/trunk@4253 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-06-29 07:28:11 +00:00
Wouter Wijngaards
1f6a7da0b0 - Fix warning in pythonmod under clang compiler.
git-svn-id: file:///svn/unbound/trunk@4236 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-06-20 07:05:30 +00:00
George Thessalonikefs
4e0787dcf3 - Fix pythonmod for cb changes.
- Some whitespace fixup.


git-svn-id: file:///svn/unbound/trunk@4099 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-04-07 17:07:16 +00:00
Wouter Wijngaards
06e794898f - Fix pythonmod for cb changes.
git-svn-id: file:///svn/unbound/trunk@4097 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-04-06 14:17:37 +00:00
Wouter Wijngaards
9fb526d554 more fixes for pythonmod.
git-svn-id: file:///svn/unbound/trunk@4006 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-02-10 08:13:24 +00:00
Wouter Wijngaards
e338cb00f3 - Fix pythonmod for typedef changes.
git-svn-id: file:///svn/unbound/trunk@4005 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-02-10 07:58:38 +00:00
Wouter Wijngaards
8746283787 fixup pythonmod.
git-svn-id: file:///svn/unbound/trunk@3991 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-01-19 11:51:47 +00:00
George Thessalonikefs
ba448fbd54 - Minor Python doc fix for testing commit post-hooks.
git-svn-id: file:///svn/unbound/trunk@3948 be551aaa-1e26-0410-a405-d3ace91eadb9
2016-12-06 14:04:42 +00:00
George Thessalonikefs
7b948b0647 - Added generic EDNS code for registering known EDNS option codes,
bypassing the cache response stage and uniquifying mesh states. Four EDNS
  option lists were added to module_qstate (module_qstate.edns_opts_*) to
  store EDNS options from/to front/back side.
- Added two flags to module_qstate (no_cache_lookup, no_cache_store) that
  control the modules' cache interactions.
- Added code for registering inplace callback functions. The registered
  functions can be called just before replying with local data or Chaos,
  replying from cache, replying with SERVFAIL, replying with a resolved
  query, sending a query to a nameserver. The functions can inspect the
  available data and maybe change response/query related data (i.e. append
  EDNS options).
- Updated Python module for the above.
- Updated Python documentation.



git-svn-id: file:///svn/unbound/trunk@3947 be551aaa-1e26-0410-a405-d3ace91eadb9
2016-12-06 13:42:51 +00:00
Wouter Wijngaards
40dd2acfd9 - generic edns option parse and store code.
git-svn-id: file:///svn/unbound/trunk@3740 be551aaa-1e26-0410-a405-d3ace91eadb9
2016-05-31 15:08:05 +00:00
Wouter Wijngaards
688fa185b0 - Attempted fix for #765: _unboundmodule missing for python3.
git-svn-id: file:///svn/unbound/trunk@3733 be551aaa-1e26-0410-a405-d3ace91eadb9
2016-05-30 14:26:45 +00:00
Wouter Wijngaards
152458c40b - spelling fixes from Igor Sobrado Delgado.
git-svn-id: file:///svn/unbound/trunk@3544 be551aaa-1e26-0410-a405-d3ace91eadb9
2015-11-18 14:11:46 +00:00
Wouter Wijngaards
863b12ffd4 #664: Fix issue with Python 3 mapping of FILE* using file_py3.i from ldns.
git-svn-id: file:///svn/unbound/trunk@3403 be551aaa-1e26-0410-a405-d3ace91eadb9
2015-04-16 14:41:14 +00:00
Wouter Wijngaards
6bc89b3ccd Fix pythonmod.
git-svn-id: file:///svn/unbound/trunk@3382 be551aaa-1e26-0410-a405-d3ace91eadb9
2015-04-01 08:40:52 +00:00
Wouter Wijngaards
b2bdce46be - rename ldns subdirectory to sldns to avoid name collision.
git-svn-id: file:///svn/unbound/trunk@3380 be551aaa-1e26-0410-a405-d3ace91eadb9
2015-03-26 10:21:38 +00:00
Wouter Wijngaards
d978957ad9 - Fix warnings in pythonmod changes.
git-svn-id: file:///svn/unbound/trunk@3311 be551aaa-1e26-0410-a405-d3ace91eadb9
2015-01-07 09:29:59 +00:00
Wouter Wijngaards
bcec3cc4f1 - patch from Stephane Lapie that adds to the python API, that
exposes struct delegpt, and adds the find_delegation function.


git-svn-id: file:///svn/unbound/trunk@3295 be551aaa-1e26-0410-a405-d3ace91eadb9
2015-01-05 10:16:36 +00:00
Wouter Wijngaards
b781f2d48d - Fix that CD flag disables DNS64 processing, returning the DNSSEC
signed AAAA denial.


git-svn-id: file:///svn/unbound/trunk@3273 be551aaa-1e26-0410-a405-d3ace91eadb9
2014-11-18 15:15:57 +00:00
Wouter Wijngaards
ebfd1f3c4c - patches to also build with Python 3.x (from Pavel Simerda).
git-svn-id: file:///svn/unbound/trunk@3225 be551aaa-1e26-0410-a405-d3ace91eadb9
2014-09-18 13:28:21 +00:00
Wouter Wijngaards
eed60983ac - update pythonmod for ldns_ to sldns_ name change.
git-svn-id: file:///svn/unbound/trunk@3035 be551aaa-1e26-0410-a405-d3ace91eadb9
2013-12-05 16:27:52 +00:00
Wouter Wijngaards
d3cbd76546 - Fix sldns to use sldns_ prefix for all ldns_ variables.
git-svn-id: file:///svn/unbound/trunk@3022 be551aaa-1e26-0410-a405-d3ace91eadb9
2013-12-03 09:11:16 +00:00
Wouter Wijngaards
3102a66ece - Fix bug#537: compile python plugin without ldns library.
git-svn-id: file:///svn/unbound/trunk@3016 be551aaa-1e26-0410-a405-d3ace91eadb9
2013-11-13 08:53:53 +00:00
Wouter Wijngaards
e704e27be6 interface: and ip-address:
also includes for newer ldns in pythonmod. 


git-svn-id: file:///svn/unbound/trunk@3014 be551aaa-1e26-0410-a405-d3ace91eadb9
2013-11-06 02:48:59 +00:00
Wouter Wijngaards
2c6462c943 - bug 481: fix python example0.
git-svn-id: file:///svn/unbound/trunk@2783 be551aaa-1e26-0410-a405-d3ace91eadb9
2012-11-30 09:41:38 +00:00
Wouter Wijngaards
5c73dbdbc0 - silence warning from swig-generated code (md set but not used in
swig initmodule, due to ifdefs in swig generated code).


git-svn-id: file:///svn/unbound/trunk@2680 be551aaa-1e26-0410-a405-d3ace91eadb9
2012-05-30 09:08:17 +00:00
Wouter Wijngaards
7f6827cc97 fix python module for prefetch-sticky changes.
git-svn-id: file:///svn/unbound/trunk@2633 be551aaa-1e26-0410-a405-d3ace91eadb9
2012-02-16 17:38:59 +00:00
Wouter Wijngaards
6dd2c0467e - Fix bug #425: unbound reports wrong TTL in reply, it reports a TTL
that would be permissible by the RFCs but it is not the TTL in the
  cache.


git-svn-id: file:///svn/unbound/trunk@2581 be551aaa-1e26-0410-a405-d3ace91eadb9
2012-01-10 09:42:32 +00:00
Wouter Wijngaards
a1c76554a2 - Makefile changed for BSD make compatibility.
git-svn-id: file:///svn/unbound/trunk@2544 be551aaa-1e26-0410-a405-d3ace91eadb9
2011-11-10 18:44:06 +00:00
Wouter Wijngaards
2479955f9f - lame-ttl and lame-size options no longer exist, it is integrated
with the host info.  They are ignored (with verbose warning) if
  encountered to keep the config file backwards compatible.



git-svn-id: file:///svn/unbound/trunk@2527 be551aaa-1e26-0410-a405-d3ace91eadb9
2011-10-27 08:33:02 +00:00
Wouter Wijngaards
39de97e176 - Applied patch from Karel Slany that fixes a memory leak in the
unbound python module, in string conversions.


git-svn-id: file:///svn/unbound/trunk@2481 be551aaa-1e26-0410-a405-d3ace91eadb9
2011-08-24 11:03:29 +00:00
Wouter Wijngaards
63c07d13ce updated patch from Tom.
git-svn-id: file:///svn/unbound/trunk@2472 be551aaa-1e26-0410-a405-d3ace91eadb9
2011-08-10 07:37:57 +00:00
Wouter Wijngaards
ad864b0f7e - patch from Tom Hendrikx fixes load of python modules.
git-svn-id: file:///svn/unbound/trunk@2470 be551aaa-1e26-0410-a405-d3ace91eadb9
2011-08-09 07:28:22 +00:00
Wouter Wijngaards
40f8fe2815 add and fix doxygen comments for doxygen-1.7.1. (which reports lots of
spurious items as well, by the way).


git-svn-id: file:///svn/unbound/trunk@2211 be551aaa-1e26-0410-a405-d3ace91eadb9
2010-08-13 08:41:49 +00:00
Wouter Wijngaards
f042f0dd5d - Neat function prototypes, unshadowed local declarations.
git-svn-id: file:///svn/unbound/trunk@2188 be551aaa-1e26-0410-a405-d3ace91eadb9
2010-07-07 13:13:36 +00:00
Wouter Wijngaards
75565262f7 Fixed random numbers for port, interface and server selection.
Removed very small bias.
Also some lint fixes.



git-svn-id: file:///svn/unbound/trunk@2049 be551aaa-1e26-0410-a405-d3ace91eadb9
2010-03-18 14:42:22 +00:00
Wouter Wijngaards
147d47eee7 Move includes to code files.
git-svn-id: file:///svn/unbound/trunk@2035 be551aaa-1e26-0410-a405-d3ace91eadb9
2010-03-12 15:17:48 +00:00
Wouter Wijngaards
e652a69a69 Fix python if threaded.
git-svn-id: file:///svn/unbound/trunk@2032 be551aaa-1e26-0410-a405-d3ace91eadb9
2010-03-12 12:44:44 +00:00
Wouter Wijngaards
5b0fd59e76 work on prefetch: store the updated results in the cache.
git-svn-id: file:///svn/unbound/trunk@1954 be551aaa-1e26-0410-a405-d3ace91eadb9
2010-01-08 15:59:36 +00:00
Wouter Wijngaards
43d228c5bc Doc fix and work on prefetch feature.
git-svn-id: file:///svn/unbound/trunk@1951 be551aaa-1e26-0410-a405-d3ace91eadb9
2010-01-07 14:38:18 +00:00
Wouter Wijngaards
18e9cbb39f fix python memory leak.
git-svn-id: file:///svn/unbound/trunk@1818 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-04 14:14:54 +00:00
Wouter Wijngaards
e46441787c source IP from python and doxygen fixes.
git-svn-id: file:///svn/unbound/trunk@1813 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-03 14:51:38 +00:00
Wouter Wijngaards
c1b2364d1d please lint
git-svn-id: file:///svn/unbound/trunk@1673 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-18 14:39:50 +00:00
Wouter Wijngaards
790fe91662 python warning suppress.
git-svn-id: file:///svn/unbound/trunk@1672 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-18 14:28:28 +00:00
Wouter Wijngaards
ea0148caf8 python lock deadlock on MacOSX.
git-svn-id: file:///svn/unbound/trunk@1615 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-23 14:59:44 +00:00
Wouter Wijngaards
397985b2c8 python mod invalidate routine fix.
git-svn-id: file:///svn/unbound/trunk@1589 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-06 12:35:02 +00:00
Wouter Wijngaards
49913a1c9e doc test fixup.
git-svn-id: file:///svn/unbound/trunk@1583 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-03 14:13:25 +00:00
Wouter Wijngaards
1fa1c9d1b1 unit test for python module.
git-svn-id: file:///svn/unbound/trunk@1581 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 14:44:57 +00:00
Wouter Wijngaards
a5c428bb8d please doxygen
git-svn-id: file:///svn/unbound/trunk@1579 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 10:21:37 +00:00
Wouter Wijngaards
a5c76d0579 docs
git-svn-id: file:///svn/unbound/trunk@1577 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 10:14:27 +00:00
Wouter Wijngaards
db94e389da Moved documentation for pythonmod.
git-svn-id: file:///svn/unbound/trunk@1576 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 09:51:51 +00:00
Wouter Wijngaards
2e20c86309 moved files. Make _unbound python libunbound module.
git-svn-id: file:///svn/unbound/trunk@1573 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 09:47:35 +00:00
Wouter Wijngaards
7ad28caa41 new libunbound calls documented.
git-svn-id: file:///svn/unbound/trunk@1571 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-01 12:57:13 +00:00
Wouter Wijngaards
7dcca025f4 python work
git-svn-id: file:///svn/unbound/trunk@1561 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-26 15:47:45 +00:00
Wouter Wijngaards
ebd14d9f35 Python work.
git-svn-id: file:///svn/unbound/trunk@1559 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-26 09:31:28 +00:00
Wouter Wijngaards
11f11a5377 python module compiles.
git-svn-id: file:///svn/unbound/trunk@1557 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-25 16:20:34 +00:00
Wouter Wijngaards
0799d77798 python contribution from Zdenek Vasicek and Marek Vavrusa (BSD licensed).
git-svn-id: file:///svn/unbound/trunk@1556 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-25 14:47:47 +00:00