[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [ascension] 16/45: fixed special cases with GNS2DNS
From: |
gnunet |
Subject: |
[GNUnet-SVN] [ascension] 16/45: fixed special cases with GNS2DNS |
Date: |
Fri, 25 Jan 2019 10:02:16 +0100 |
This is an automated email from the git hooks/post-receive script.
rexxnor pushed a commit to branch master
in repository ascension.
commit c2f3a08680a45772c37cf1069138690dbd124767
Author: rexxnor <address@hidden>
AuthorDate: Tue Oct 9 12:47:15 2018 +0200
fixed special cases with GNS2DNS
---
gnsmigrator/gnsmigrator.py | 50 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 47 insertions(+), 3 deletions(-)
diff --git a/gnsmigrator/gnsmigrator.py b/gnsmigrator/gnsmigrator.py
index 4a366c8..4684b4e 100644
--- a/gnsmigrator/gnsmigrator.py
+++ b/gnsmigrator/gnsmigrator.py
@@ -16,6 +16,12 @@ Options:
"""
# imports
+from ctypes import c_size_t
+from ctypes import c_uint32
+from ctypes import c_uint64
+from ctypes import c_void_p
+from enum import Enum
+from dataclasses import dataclass
import multiprocessing
import queue
import sys
@@ -32,6 +38,26 @@ GNUNET_NAMESTORE_COMMAND = 'gnunet-namestore'
GNUNET_GNS_COMMAND = 'gnunet-gns'
GNUNET_ARM_COMMAND = 'gnunet-arm'
+class GNUnetGNSRecordFlags(Enum):
+ """
+ Flags that can be set for a record.
+ """
+ GNUNET_GNSRECORD_RF_NONE = 0
+ GNUNET_GNSRECORD_RF_PRIVATE = 2
+ GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION = 8
+ GNUNET_GNSRECORD_RF_SHADOW_RECORD = 16
+
address@hidden
+class GNUnetGNSRecordData():
+ """
+ Representation of a GNS Record in python
+ """
+ data: c_void_p
+ expiration_time: c_uint64
+ data_size: c_size_t
+ record_type: c_uint32
+ flags: GNUnetGNSRecordFlags
+
class BaseMigrator():
"""
Base class for migration
@@ -186,10 +212,21 @@ class BaseMigrator():
if dnsname_str != '@':
# Special case for the GNS2DNS case
if rtype_str == 'NS':
+ if str(value)[-1] == ".":
+ dnsresolver = str(value)[:-1]
+ else:
+ dnsresolver = "%s.%s" % (value, domain)
+ dnsresolver = str(value)[:-1]
+
+ if dnsname_str[-1] == ".":
+ dnsname_str = dnsname_str[:-1]
+
+ if domain[-1] == ".":
+ domain = domain[:-1]
# if no resolver is specified, choose the FQDN nameserver
from zone
- if not dnsresolver:
- dnsresolver = value[:-1]
+ #if not dnsresolver:
+ # dnsresolver = value[:-1]
pkey_lookup =
subprocess.Popen([GNUNET_ZONE_CREATION_COMMAND, '-d'],
stdout=subprocess.PIPE)
@@ -331,7 +368,14 @@ class TLDMigrator(BaseMigrator):
break
# execute thing to run on item
dnsname, ttl, authns = record
- authns = str(authns)[:-1]
+ if str(authns)[:-1] == ".":
+ authns = str(authns)[:-1]
+ else:
+ authns = "%s.%s" % (authns, zonename)
+
+ # building gns record struct
+ #GNUnetGNSRecordData()
+
subprocess.run([GNUNET_NAMESTORE_COMMAND,
'-z', zonename,
'-a', '-n', str(dnsname),
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [ascension] branch master created (now 5ea0f07), gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 04/45: Merge branch 'master' of gitlab.ti.bfh.ch:gerbp6/gnsmigrator, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 01/45: added gitignore and README, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 07/45: fixes, added a few tests, updated README and requirements, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 14/45: reworked the incremental zone transfer, added notice for bind, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 11/45: added ttl of SOA to zone for later implementation of timer, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 09/45: updated README, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 23/45: fixed non existing file, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 19/45: fixed some minor bugs, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 16/45: fixed special cases with GNS2DNS,
gnunet <=
- [GNUnet-SVN] [ascension] 25/45: fixed bugs, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 20/45: fixed zonemaster to zonedata in README, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 13/45: added zone merging of full and incremental zones, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 05/45: initial prototype, bootstrapping zones and zone transfer, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 17/45: updated requirements and README, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 22/45: finished refactoring, fixed a few bugs, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 10/45: added incremental zone transfer logic, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 06/45: working prototype for A, AAAA, MX, CNAME, TXT and more records, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 15/45: created baseclass and separated small from big zones, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 27/45: unstable version, port specification possible, gnunet, 2019/01/25