[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [ascension] 16/57: fixed special cases with GNS2DNS
From: |
gnunet |
Subject: |
[GNUnet-SVN] [ascension] 16/57: fixed special cases with GNS2DNS |
Date: |
Sat, 13 Apr 2019 13:32:13 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 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 e08203d), gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 01/57: added gitignore and README, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 04/57: Merge branch 'master' of gitlab.ti.bfh.ch:gerbp6/gnsmigrator, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 03/57: removed GNU from heading in README, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 09/57: updated README, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 06/57: working prototype for A, AAAA, MX, CNAME, TXT and more records, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 20/57: fixed zonemaster to zonedata in README, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 12/57: bumped version to 0.1.0, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 16/57: fixed special cases with GNS2DNS,
gnunet <=
- [GNUnet-SVN] [ascension] 14/57: reworked the incremental zone transfer, added notice for bind, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 11/57: added ttl of SOA to zone for later implementation of timer, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 05/57: initial prototype, bootstrapping zones and zone transfer, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 24/57: fixed zone serialisation, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 17/57: updated requirements and README, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 36/57: some experimental fixes, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 19/57: fixed some minor bugs, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 15/57: created baseclass and separated small from big zones, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 21/57: fixed serial fetching and added serialization of zone, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 13/57: added zone merging of full and incremental zones, gnunet, 2019/04/13