libknot 3.4.0__tar.gz → 3.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {libknot-3.4.0 → libknot-3.4.2}/PKG-INFO +21 -19
- {libknot-3.4.0 → libknot-3.4.2}/README.md +20 -18
- {libknot-3.4.0 → libknot-3.4.2}/libknot/control.py +2 -2
- {libknot-3.4.0 → libknot-3.4.2}/libknot.egg-info/PKG-INFO +21 -19
- {libknot-3.4.0 → libknot-3.4.2}/pyproject.toml +1 -1
- {libknot-3.4.0 → libknot-3.4.2}/setup.py +1 -1
- {libknot-3.4.0 → libknot-3.4.2}/libknot/__init__.py +0 -0
- {libknot-3.4.0 → libknot-3.4.2}/libknot/dname.py +0 -0
- {libknot-3.4.0 → libknot-3.4.2}/libknot/probe.py +0 -0
- {libknot-3.4.0 → libknot-3.4.2}/libknot.egg-info/SOURCES.txt +0 -0
- {libknot-3.4.0 → libknot-3.4.2}/libknot.egg-info/dependency_links.txt +0 -0
- {libknot-3.4.0 → libknot-3.4.2}/libknot.egg-info/top_level.txt +0 -0
- {libknot-3.4.0 → libknot-3.4.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: libknot
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.2
|
|
4
4
|
Summary: Python bindings for libknot
|
|
5
5
|
Home-page: https://gitlab.nic.cz/knot/knot-dns/-/tree/master/python/libknot
|
|
6
6
|
Author: CZ.NIC, z.s.p.o.
|
|
@@ -26,16 +26,16 @@ A Python interface for managing the Knot DNS daemon.
|
|
|
26
26
|
|
|
27
27
|
* [Introduction](#introduction)
|
|
28
28
|
* [Control module](#control-module)
|
|
29
|
-
+ [
|
|
30
|
-
+ [
|
|
29
|
+
+ [Control usage](#control-usage)
|
|
30
|
+
+ [Control examples](#control-examples)
|
|
31
31
|
* [Probe module](#probe-module)
|
|
32
|
-
+ [
|
|
33
|
-
+ [
|
|
32
|
+
+ [Probe usage](#probe-usage)
|
|
33
|
+
+ [Probe examples](#probe-examples)
|
|
34
34
|
* [Dname module](#dname-module)
|
|
35
|
-
+ [
|
|
36
|
-
+ [
|
|
35
|
+
+ [Dname usage](#dname-usage)
|
|
36
|
+
+ [Dname examples](#dname-examples)
|
|
37
37
|
|
|
38
|
-
## Introduction
|
|
38
|
+
## Introduction<a id="introduction"></a>
|
|
39
39
|
|
|
40
40
|
If the shared `libknot.so` library isn't available in the library search path, it's
|
|
41
41
|
necessary to load the library first, e.g.:
|
|
@@ -45,7 +45,7 @@ import libknot
|
|
|
45
45
|
libknot.Knot("/usr/lib/libknot.so")
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
## Control module
|
|
48
|
+
## Control module<a id="control-module"></a>
|
|
49
49
|
|
|
50
50
|
Using this module it's possible to create scripts for efficient tasks that
|
|
51
51
|
would require complex shell scripts with multiple calls of `knotc`. For
|
|
@@ -54,7 +54,7 @@ i.e. communication via a Unix socket.
|
|
|
54
54
|
|
|
55
55
|
The module API is stored in `libknot.control`.
|
|
56
56
|
|
|
57
|
-
###
|
|
57
|
+
### Control usage<a id="control-usage"></a>
|
|
58
58
|
|
|
59
59
|
The module usage consists of several steps:
|
|
60
60
|
|
|
@@ -64,7 +64,7 @@ The module usage consists of several steps:
|
|
|
64
64
|
afterwards.
|
|
65
65
|
* Closing the connection and deinitialization.
|
|
66
66
|
|
|
67
|
-
### Control
|
|
67
|
+
### Control examples<a id="control-examples"></a>
|
|
68
68
|
|
|
69
69
|
```python3
|
|
70
70
|
import json
|
|
@@ -102,7 +102,7 @@ finally:
|
|
|
102
102
|
|
|
103
103
|
```python3
|
|
104
104
|
# List configured zones (including catalog member ones)
|
|
105
|
-
ctl.send_block(cmd="conf-list",
|
|
105
|
+
ctl.send_block(cmd="conf-list", filters="z")
|
|
106
106
|
resp = ctl.receive_block()
|
|
107
107
|
for zone in resp['zone']:
|
|
108
108
|
print(zone)
|
|
@@ -110,7 +110,7 @@ finally:
|
|
|
110
110
|
|
|
111
111
|
```python3
|
|
112
112
|
# Print expirations as unixtime for all secondary zones
|
|
113
|
-
ctl.send_block(cmd="zone-status",
|
|
113
|
+
ctl.send_block(cmd="zone-status", filters="u")
|
|
114
114
|
resp = ctl.receive_block()
|
|
115
115
|
for zone in resp:
|
|
116
116
|
if resp[zone]["role"] == "master":
|
|
@@ -123,21 +123,21 @@ finally:
|
|
|
123
123
|
print("Zone %s expires at %s" % (zone, resp[zone]["expiration"]))
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
## Probe module
|
|
126
|
+
## Probe module<a id="probe module"></a>
|
|
127
127
|
|
|
128
128
|
Using this module it's possible to receive traffic data from a running daemon with
|
|
129
129
|
active probe module.
|
|
130
130
|
|
|
131
131
|
The module API is stored in `libknot.probe`.
|
|
132
132
|
|
|
133
|
-
###
|
|
133
|
+
### Probe usage<a id="probe-usage"></a>
|
|
134
134
|
|
|
135
135
|
The module usage consists of several steps:
|
|
136
136
|
|
|
137
137
|
* Initialization of one or more probe channels
|
|
138
138
|
* Periodical receiving of data units from the channels and data processing
|
|
139
139
|
|
|
140
|
-
### Probe
|
|
140
|
+
### Probe examples<a id="probe-examples"></a>
|
|
141
141
|
|
|
142
142
|
```python3
|
|
143
143
|
import libknot.probe
|
|
@@ -155,16 +155,18 @@ while (True):
|
|
|
155
155
|
print(item)
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
## Dname module
|
|
158
|
+
## Dname module<a id="dname-module"></a>
|
|
159
159
|
|
|
160
160
|
This module provides a few dname-related operations.
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
The module API is stored in `libknot.dname`.
|
|
163
|
+
|
|
164
|
+
### Dname usage<a id="dname-usage"></a>
|
|
163
165
|
|
|
164
166
|
The dname object is initialized from a string with textual dname.
|
|
165
167
|
Then the dname can be reformatted to wire format or back to textual format.
|
|
166
168
|
|
|
167
|
-
### Dname
|
|
169
|
+
### Dname examples<a id="dname-examples"></a>
|
|
168
170
|
|
|
169
171
|
```python3
|
|
170
172
|
import libknot.dname
|
|
@@ -6,16 +6,16 @@ A Python interface for managing the Knot DNS daemon.
|
|
|
6
6
|
|
|
7
7
|
* [Introduction](#introduction)
|
|
8
8
|
* [Control module](#control-module)
|
|
9
|
-
+ [
|
|
10
|
-
+ [
|
|
9
|
+
+ [Control usage](#control-usage)
|
|
10
|
+
+ [Control examples](#control-examples)
|
|
11
11
|
* [Probe module](#probe-module)
|
|
12
|
-
+ [
|
|
13
|
-
+ [
|
|
12
|
+
+ [Probe usage](#probe-usage)
|
|
13
|
+
+ [Probe examples](#probe-examples)
|
|
14
14
|
* [Dname module](#dname-module)
|
|
15
|
-
+ [
|
|
16
|
-
+ [
|
|
15
|
+
+ [Dname usage](#dname-usage)
|
|
16
|
+
+ [Dname examples](#dname-examples)
|
|
17
17
|
|
|
18
|
-
## Introduction
|
|
18
|
+
## Introduction<a id="introduction"></a>
|
|
19
19
|
|
|
20
20
|
If the shared `libknot.so` library isn't available in the library search path, it's
|
|
21
21
|
necessary to load the library first, e.g.:
|
|
@@ -25,7 +25,7 @@ import libknot
|
|
|
25
25
|
libknot.Knot("/usr/lib/libknot.so")
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
## Control module
|
|
28
|
+
## Control module<a id="control-module"></a>
|
|
29
29
|
|
|
30
30
|
Using this module it's possible to create scripts for efficient tasks that
|
|
31
31
|
would require complex shell scripts with multiple calls of `knotc`. For
|
|
@@ -34,7 +34,7 @@ i.e. communication via a Unix socket.
|
|
|
34
34
|
|
|
35
35
|
The module API is stored in `libknot.control`.
|
|
36
36
|
|
|
37
|
-
###
|
|
37
|
+
### Control usage<a id="control-usage"></a>
|
|
38
38
|
|
|
39
39
|
The module usage consists of several steps:
|
|
40
40
|
|
|
@@ -44,7 +44,7 @@ The module usage consists of several steps:
|
|
|
44
44
|
afterwards.
|
|
45
45
|
* Closing the connection and deinitialization.
|
|
46
46
|
|
|
47
|
-
### Control
|
|
47
|
+
### Control examples<a id="control-examples"></a>
|
|
48
48
|
|
|
49
49
|
```python3
|
|
50
50
|
import json
|
|
@@ -82,7 +82,7 @@ finally:
|
|
|
82
82
|
|
|
83
83
|
```python3
|
|
84
84
|
# List configured zones (including catalog member ones)
|
|
85
|
-
ctl.send_block(cmd="conf-list",
|
|
85
|
+
ctl.send_block(cmd="conf-list", filters="z")
|
|
86
86
|
resp = ctl.receive_block()
|
|
87
87
|
for zone in resp['zone']:
|
|
88
88
|
print(zone)
|
|
@@ -90,7 +90,7 @@ finally:
|
|
|
90
90
|
|
|
91
91
|
```python3
|
|
92
92
|
# Print expirations as unixtime for all secondary zones
|
|
93
|
-
ctl.send_block(cmd="zone-status",
|
|
93
|
+
ctl.send_block(cmd="zone-status", filters="u")
|
|
94
94
|
resp = ctl.receive_block()
|
|
95
95
|
for zone in resp:
|
|
96
96
|
if resp[zone]["role"] == "master":
|
|
@@ -103,21 +103,21 @@ finally:
|
|
|
103
103
|
print("Zone %s expires at %s" % (zone, resp[zone]["expiration"]))
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
## Probe module
|
|
106
|
+
## Probe module<a id="probe module"></a>
|
|
107
107
|
|
|
108
108
|
Using this module it's possible to receive traffic data from a running daemon with
|
|
109
109
|
active probe module.
|
|
110
110
|
|
|
111
111
|
The module API is stored in `libknot.probe`.
|
|
112
112
|
|
|
113
|
-
###
|
|
113
|
+
### Probe usage<a id="probe-usage"></a>
|
|
114
114
|
|
|
115
115
|
The module usage consists of several steps:
|
|
116
116
|
|
|
117
117
|
* Initialization of one or more probe channels
|
|
118
118
|
* Periodical receiving of data units from the channels and data processing
|
|
119
119
|
|
|
120
|
-
### Probe
|
|
120
|
+
### Probe examples<a id="probe-examples"></a>
|
|
121
121
|
|
|
122
122
|
```python3
|
|
123
123
|
import libknot.probe
|
|
@@ -135,16 +135,18 @@ while (True):
|
|
|
135
135
|
print(item)
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
## Dname module
|
|
138
|
+
## Dname module<a id="dname-module"></a>
|
|
139
139
|
|
|
140
140
|
This module provides a few dname-related operations.
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
The module API is stored in `libknot.dname`.
|
|
143
|
+
|
|
144
|
+
### Dname usage<a id="dname-usage"></a>
|
|
143
145
|
|
|
144
146
|
The dname object is initialized from a string with textual dname.
|
|
145
147
|
Then the dname can be reformatted to wire format or back to textual format.
|
|
146
148
|
|
|
147
|
-
### Dname
|
|
149
|
+
### Dname examples<a id="dname-examples"></a>
|
|
148
150
|
|
|
149
151
|
```python3
|
|
150
152
|
import libknot.dname
|
|
@@ -37,7 +37,7 @@ class KnotCtlDataIdx(enum.IntEnum):
|
|
|
37
37
|
TTL = 8
|
|
38
38
|
TYPE = 9
|
|
39
39
|
DATA = 10
|
|
40
|
-
|
|
40
|
+
FILTERS = 11
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
class KnotCtlData(object):
|
|
@@ -207,7 +207,7 @@ class KnotCtl(object):
|
|
|
207
207
|
query[KnotCtlDataIdx.TYPE] = rtype
|
|
208
208
|
query[KnotCtlDataIdx.DATA] = data
|
|
209
209
|
query[KnotCtlDataIdx.FLAGS] = flags
|
|
210
|
-
query[KnotCtlDataIdx.
|
|
210
|
+
query[KnotCtlDataIdx.FILTERS] = filters
|
|
211
211
|
|
|
212
212
|
self.send(KnotCtlType.DATA, query)
|
|
213
213
|
self.send(KnotCtlType.BLOCK)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: libknot
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.2
|
|
4
4
|
Summary: Python bindings for libknot
|
|
5
5
|
Home-page: https://gitlab.nic.cz/knot/knot-dns/-/tree/master/python/libknot
|
|
6
6
|
Author: CZ.NIC, z.s.p.o.
|
|
@@ -26,16 +26,16 @@ A Python interface for managing the Knot DNS daemon.
|
|
|
26
26
|
|
|
27
27
|
* [Introduction](#introduction)
|
|
28
28
|
* [Control module](#control-module)
|
|
29
|
-
+ [
|
|
30
|
-
+ [
|
|
29
|
+
+ [Control usage](#control-usage)
|
|
30
|
+
+ [Control examples](#control-examples)
|
|
31
31
|
* [Probe module](#probe-module)
|
|
32
|
-
+ [
|
|
33
|
-
+ [
|
|
32
|
+
+ [Probe usage](#probe-usage)
|
|
33
|
+
+ [Probe examples](#probe-examples)
|
|
34
34
|
* [Dname module](#dname-module)
|
|
35
|
-
+ [
|
|
36
|
-
+ [
|
|
35
|
+
+ [Dname usage](#dname-usage)
|
|
36
|
+
+ [Dname examples](#dname-examples)
|
|
37
37
|
|
|
38
|
-
## Introduction
|
|
38
|
+
## Introduction<a id="introduction"></a>
|
|
39
39
|
|
|
40
40
|
If the shared `libknot.so` library isn't available in the library search path, it's
|
|
41
41
|
necessary to load the library first, e.g.:
|
|
@@ -45,7 +45,7 @@ import libknot
|
|
|
45
45
|
libknot.Knot("/usr/lib/libknot.so")
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
## Control module
|
|
48
|
+
## Control module<a id="control-module"></a>
|
|
49
49
|
|
|
50
50
|
Using this module it's possible to create scripts for efficient tasks that
|
|
51
51
|
would require complex shell scripts with multiple calls of `knotc`. For
|
|
@@ -54,7 +54,7 @@ i.e. communication via a Unix socket.
|
|
|
54
54
|
|
|
55
55
|
The module API is stored in `libknot.control`.
|
|
56
56
|
|
|
57
|
-
###
|
|
57
|
+
### Control usage<a id="control-usage"></a>
|
|
58
58
|
|
|
59
59
|
The module usage consists of several steps:
|
|
60
60
|
|
|
@@ -64,7 +64,7 @@ The module usage consists of several steps:
|
|
|
64
64
|
afterwards.
|
|
65
65
|
* Closing the connection and deinitialization.
|
|
66
66
|
|
|
67
|
-
### Control
|
|
67
|
+
### Control examples<a id="control-examples"></a>
|
|
68
68
|
|
|
69
69
|
```python3
|
|
70
70
|
import json
|
|
@@ -102,7 +102,7 @@ finally:
|
|
|
102
102
|
|
|
103
103
|
```python3
|
|
104
104
|
# List configured zones (including catalog member ones)
|
|
105
|
-
ctl.send_block(cmd="conf-list",
|
|
105
|
+
ctl.send_block(cmd="conf-list", filters="z")
|
|
106
106
|
resp = ctl.receive_block()
|
|
107
107
|
for zone in resp['zone']:
|
|
108
108
|
print(zone)
|
|
@@ -110,7 +110,7 @@ finally:
|
|
|
110
110
|
|
|
111
111
|
```python3
|
|
112
112
|
# Print expirations as unixtime for all secondary zones
|
|
113
|
-
ctl.send_block(cmd="zone-status",
|
|
113
|
+
ctl.send_block(cmd="zone-status", filters="u")
|
|
114
114
|
resp = ctl.receive_block()
|
|
115
115
|
for zone in resp:
|
|
116
116
|
if resp[zone]["role"] == "master":
|
|
@@ -123,21 +123,21 @@ finally:
|
|
|
123
123
|
print("Zone %s expires at %s" % (zone, resp[zone]["expiration"]))
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
## Probe module
|
|
126
|
+
## Probe module<a id="probe module"></a>
|
|
127
127
|
|
|
128
128
|
Using this module it's possible to receive traffic data from a running daemon with
|
|
129
129
|
active probe module.
|
|
130
130
|
|
|
131
131
|
The module API is stored in `libknot.probe`.
|
|
132
132
|
|
|
133
|
-
###
|
|
133
|
+
### Probe usage<a id="probe-usage"></a>
|
|
134
134
|
|
|
135
135
|
The module usage consists of several steps:
|
|
136
136
|
|
|
137
137
|
* Initialization of one or more probe channels
|
|
138
138
|
* Periodical receiving of data units from the channels and data processing
|
|
139
139
|
|
|
140
|
-
### Probe
|
|
140
|
+
### Probe examples<a id="probe-examples"></a>
|
|
141
141
|
|
|
142
142
|
```python3
|
|
143
143
|
import libknot.probe
|
|
@@ -155,16 +155,18 @@ while (True):
|
|
|
155
155
|
print(item)
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
## Dname module
|
|
158
|
+
## Dname module<a id="dname-module"></a>
|
|
159
159
|
|
|
160
160
|
This module provides a few dname-related operations.
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
The module API is stored in `libknot.dname`.
|
|
163
|
+
|
|
164
|
+
### Dname usage<a id="dname-usage"></a>
|
|
163
165
|
|
|
164
166
|
The dname object is initialized from a string with textual dname.
|
|
165
167
|
Then the dname can be reformatted to wire format or back to textual format.
|
|
166
168
|
|
|
167
|
-
### Dname
|
|
169
|
+
### Dname examples<a id="dname-examples"></a>
|
|
168
170
|
|
|
169
171
|
```python3
|
|
170
172
|
import libknot.dname
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|