diff --git a/.github/workflows/build-release-latest.yml b/.github/workflows/build-release-latest.yml index 0d16225..9f26b5d 100644 --- a/.github/workflows/build-release-latest.yml +++ b/.github/workflows/build-release-latest.yml @@ -55,75 +55,6 @@ jobs: path: ./*.rpm retention-days: 1 - repo-debian: - runs-on: ubuntu-latest - needs: [build-debian] - env: - dist: debian - steps: - - uses: actions/checkout@v2 - # get binaries created by other jobs - - uses: actions/download-artifact@v2 - # build container image for repo packaging, using the same as for building - - run: /usr/bin/docker build -t ${{ github.job }} -f build/Dockerfile-${{ env.dist }} . - # make entrypoints executable - - run: chmod +x build/entrypoint-*.sh - # get secret signing key - - run: echo "${{ secrets.DHCPY6D_SIGNING_KEY }}" > signing_key.asc - # organize SSH deploy key for dhcp6d-jekyll repo - - run: mkdir ~/.ssh - - run: echo "${{ secrets.DHCPY6D_REPO_SSH_KEY }}" > ~/.ssh/id_ed25519 - - run: chmod -R go-rwx ~/.ssh - # get and prepare dhcpy6d-jekyll - - run: git clone git@github.com:HenriWahl/dhcpy6d-jekyll.git - - run: rm -rf ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }} - - run: mkdir -p ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }} - # execute container with matching entrypoint - - run: | - /usr/bin/docker run --volume ${{ github.workspace }}:/dhcpy6d \ - --volume ${{ github.workspace }}/build/entrypoint-${{ github.job }}.sh:/entrypoint.sh \ - --entrypoint /entrypoint.sh \ - --env RELEASE=${{ env.release }} \ - ${{ github.job }} - # commit and push new binaries to dhcpyd-jekyll - - run: git config --global user.email "repo@dhcpy6d.de" && git config --global user.name "Dhcpy6d Repository" - - run: cd ${{ env.repo_dir }} && git add . && git commit -am "new ${{ env.release }} repo ${{ env.dist }}" && git push - - repo-centos: - runs-on: ubuntu-latest - # has to wait for repo-debian to avoid parallel processing of git repo dhcpy6d-jekyll - needs: [build-centos, repo-debian] - env: - dist: centos - steps: - - uses: actions/checkout@v2 - # get binaries created by other jobs - - uses: actions/download-artifact@v2 - # build container image for repo packaging, using the same as for building - - run: /usr/bin/docker build -t ${{ github.job }} -f build/Dockerfile-${{ env.dist }} . - # make entrypoints executable - - run: chmod +x build/entrypoint-*.sh - # get secret signing key - - run: echo "${{ secrets.DHCPY6D_SIGNING_KEY }}" > signing_key.asc - # organize SSH deploy key for dhcp6d-jekyll repo - - run: mkdir ~/.ssh - - run: echo "${{ secrets.DHCPY6D_REPO_SSH_KEY }}" > ~/.ssh/id_ed25519 - - run: chmod -R go-rwx ~/.ssh - # get and prepare dhcpy6d-jekyll - - run: git clone git@github.com:HenriWahl/dhcpy6d-jekyll.git - - run: rm -rf ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }} - - run: mkdir -p ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }} - # execute container with matching entrypoint - - run: | - /usr/bin/docker run --volume ${{ github.workspace }}:/dhcpy6d \ - --volume ${{ github.workspace }}/build/entrypoint-${{ github.job }}.sh:/entrypoint.sh \ - --entrypoint /entrypoint.sh \ - --env RELEASE=${{ env.release }} \ - ${{ github.job }} - # commit and push new binaries to dhcpyd-jekyll - - run: git config --global user.email "repo@dhcpy6d.de" && git config --global user.name "Dhcpy6d Repository" - - run: cd ${{ env.repo_dir }} && git add . && git commit -am "new ${{ env.release }} repo ${{ env.dist }}" && git push - github-release: runs-on: ubuntu-latest needs: [build-debian, build-centos] diff --git a/Changelog b/Changelog index b3083cd..153438a 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,11 @@ Changelog for dhcpy6d +2023-07-02 1.6.0 + + added option 82 support + added option 83 support + added partly option 20 support + 2023-07-02 1.4.0 added prefix_route_link_local for client config diff --git a/debian/changelog b/debian/changelog index 8d84a21..d5b9061 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +dhcpy6d (1.6.0-1) stable; urgency=medium + + * New upstream release + + added option 82 support + + added option 83 support + + added partly option 20 support + + -- Henri Wahl Sat, 27 Jul 2024 00:00:00 +0200 + dhcpy6d (1.4.0-1) stable; urgency=medium * New upstream release diff --git a/debian/copyright b/debian/copyright index 49ef800..dd0851a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,11 +3,11 @@ Upstream-Name: dhcpy6d Source: https://dhcpy6d.de/ Files: * -Copyright: 2012-2022 Henri Wahl +Copyright: 2012-2024 Henri Wahl License: GPL-2+ Files: debian/* -Copyright: 2012-2022 Henri Wahl +Copyright: 2012-2024 Henri Wahl 2014 Axel Beckert License: GPL-2+ diff --git a/dhcpy6d/__init__.py b/dhcpy6d/__init__.py index d2c4729..9119cda 100644 --- a/dhcpy6d/__init__.py +++ b/dhcpy6d/__init__.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/client/__init__.py b/dhcpy6d/client/__init__.py index 94e57bf..bbfdeb7 100644 --- a/dhcpy6d/client/__init__.py +++ b/dhcpy6d/client/__init__.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/client/default.py b/dhcpy6d/client/default.py index 15d7eeb..eb76ec7 100644 --- a/dhcpy6d/client/default.py +++ b/dhcpy6d/client/default.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/client/from_config.py b/dhcpy6d/client/from_config.py index c516393..cb6736a 100644 --- a/dhcpy6d/client/from_config.py +++ b/dhcpy6d/client/from_config.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/client/parse_pattern.py b/dhcpy6d/client/parse_pattern.py index 36b95ea..1641f7b 100644 --- a/dhcpy6d/client/parse_pattern.py +++ b/dhcpy6d/client/parse_pattern.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/client/reuse_lease.py b/dhcpy6d/client/reuse_lease.py index fb233a1..3c24d3a 100644 --- a/dhcpy6d/client/reuse_lease.py +++ b/dhcpy6d/client/reuse_lease.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/config.py b/dhcpy6d/config.py index d07fb35..d8d0ec8 100644 --- a/dhcpy6d/config.py +++ b/dhcpy6d/config.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -121,7 +121,11 @@ def __init__(self): # INFORMATION REFRESH TIME option 32 for option 11 (INFORMATION REQUEST) # see RFC http://tools.ietf.org/html/rfc4242 - self.INFORMATION_REFRESH_TIME = '6000' + self.INFORMATION_REFRESH_TIME = '600' + + # SOL_MAX_RT Option 82 + # see https://www.rfc-editor.org/rfc/rfc8415.html#page-127 + self.SOLICITATION_REFRESH_TIME = '1200' # config type # one of file, mysql, sqlite or none @@ -727,6 +731,13 @@ def read_config(self, configfile): error_exit(f"{msg_prefix} Information refresh time preference " f"'{self.INFORMATION_REFRESH_TIME}' is pretty short.") + # check max solicitation refresh time + if not self.SOLICITATION_REFRESH_TIME.isdigit(): + error_exit(f"{msg_prefix} Max solicitation refresh time '{self.SOLICITATION_REFRESH_TIME}' is invalid.") + elif not 60 <= int(self.SOLICITATION_REFRESH_TIME) <= 86400: + error_exit(f"{msg_prefix} Max solicitation refresh time preference " + f"'{self.SOLICITATION_REFRESH_TIME}' is not greater or equal to 60 and neither smaller or equal to 86400.") + # check validity of configuration source if self.STORE_CONFIG not in ['mysql', 'postgresql', 'sqlite', 'file', False]: error_exit(f"{msg_prefix} Unknown config storage type '{self.STORAGE}' is invalid.") diff --git a/dhcpy6d/constants.py b/dhcpy6d/constants.py index 7cf3e70..405ecbb 100644 --- a/dhcpy6d/constants.py +++ b/dhcpy6d/constants.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -92,8 +92,10 @@ 57: 'V6_ACCESS_DOMAIN', 58: 'SIP_UA_CS_LIST', 59: 'BOOTFILE_URL', - 60: 'OPT_BOOTFILE_PARAM', - 61: 'OPTION_CLIENT_ARCH_TYPE' + 60: 'BOOTFILE_PARAM', + 61: 'CLIENT_ARCH_TYPE', + 82: 'SOL_MAX_RT', + 83: 'INF_MAX_RT' } STATUS = {0: 'Success', diff --git a/dhcpy6d/domain.py b/dhcpy6d/domain.py index ed6146e..43d335c 100644 --- a/dhcpy6d/domain.py +++ b/dhcpy6d/domain.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/globals.py b/dhcpy6d/globals.py index 43cdc02..8a1fe22 100644 --- a/dhcpy6d/globals.py +++ b/dhcpy6d/globals.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -126,7 +126,7 @@ def time(self, new_time): CONST.OPTION.IA_PD) # options to be ignored when logging -IGNORED_LOG_OPTIONS = ['options_raw', 'client', 'client_config_dicts', 'timestamp', 'iat1', 'iat2', 'id'] +IGNORED_LOG_OPTIONS = ['options', 'client', 'client_config_dicts', 'timestamp', 'iat1', 'iat2', 'id'] # empty options string test EMPTY_OPTIONS = [None, False, '', []] diff --git a/dhcpy6d/handler.py b/dhcpy6d/handler.py index 666b5c0..9aeb124 100644 --- a/dhcpy6d/handler.py +++ b/dhcpy6d/handler.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -421,6 +421,13 @@ def build_response(self, message_type_response, transaction, options_request, st # list of options in answer to be logged options_answer = [] + # Option 20 reconfigure accept - for client compatibility, actually + # not really supported, added here to add to options + # https://github.com/HenriWahl/dhcpy6d/issues/64 + if CONST.OPTION.RECONF_ACCEPT in transaction.options.keys() and \ + not CONST.OPTION.RECONF_ACCEPT in options_request: + options_request.append(CONST.OPTION.RECONF_ACCEPT) + # build all requested options if they are handled for number in options_request: if number in OPTIONS: @@ -447,7 +454,7 @@ def build_response(self, message_type_response, transaction, options_request, st volatile_store.db_connect() # create error handler - headers have to be recreated because - # problems may have arisen while processing and these information + # problems may have arisen while processing and this information # is not valid anymore # handler type + transaction id response_string = f'{CONST.MESSAGE.REPLY:02x}' @@ -497,6 +504,7 @@ def build_response(self, message_type_response, transaction, options_request, st # Option 13 Status Code Option - statuscode is 2: 'No Addresses available' response_string += build_option(CONST.OPTION.STATUS_CODE, f'{CONST.STATUS.NO_ADDRESSES_AVAILABLE:04x}') + # options in answer to be logged options_answer.append(CONST.OPTION.STATUS_CODE) @@ -521,6 +529,7 @@ def build_response(self, message_type_response, transaction, options_request, st log.info(f'{CONST.MESSAGE_DICT[message_type_response]} | ' f'transaction: {transaction.id} | ' f'options: {options_answer}') + # handler self.response = binascii.unhexlify(response_string) diff --git a/dhcpy6d/helpers.py b/dhcpy6d/helpers.py index 391a5af..4ce0cd6 100644 --- a/dhcpy6d/helpers.py +++ b/dhcpy6d/helpers.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/log.py b/dhcpy6d/log.py index 653e4bc..d3e4ff4 100644 --- a/dhcpy6d/log.py +++ b/dhcpy6d/log.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/macs.py b/dhcpy6d/macs.py index 1a3d3a0..00d579b 100644 --- a/dhcpy6d/macs.py +++ b/dhcpy6d/macs.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/__init__.py b/dhcpy6d/options/__init__.py index b1d1032..c12d8d7 100644 --- a/dhcpy6d/options/__init__.py +++ b/dhcpy6d/options/__init__.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_1.py b/dhcpy6d/options/option_1.py index 62aa13c..1b85fbd 100644 --- a/dhcpy6d/options/option_1.py +++ b/dhcpy6d/options/option_1.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_12.py b/dhcpy6d/options/option_12.py index 544cdaa..2d04b84 100644 --- a/dhcpy6d/options/option_12.py +++ b/dhcpy6d/options/option_12.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_13.py b/dhcpy6d/options/option_13.py index 4f05869..b8b7262 100644 --- a/dhcpy6d/options/option_13.py +++ b/dhcpy6d/options/option_13.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_14.py b/dhcpy6d/options/option_14.py index 30d17a8..458d23f 100644 --- a/dhcpy6d/options/option_14.py +++ b/dhcpy6d/options/option_14.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_15.py b/dhcpy6d/options/option_15.py index 6c94a62..89ac853 100644 --- a/dhcpy6d/options/option_15.py +++ b/dhcpy6d/options/option_15.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_16.py b/dhcpy6d/options/option_16.py index 1a6a6a6..788e34f 100644 --- a/dhcpy6d/options/option_16.py +++ b/dhcpy6d/options/option_16.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_20.py b/dhcpy6d/options/option_20.py new file mode 100644 index 0000000..7b93b62 --- /dev/null +++ b/dhcpy6d/options/option_20.py @@ -0,0 +1,30 @@ +# DHCPy6d DHCPv6 Daemon +# +# Copyright (C) 2009-2024 Henri Wahl +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +from dhcpy6d.config import cfg +from dhcpy6d.options import OptionTemplate + + +class Option(OptionTemplate): + """ + Option 20 Reconfigure Accept + """ + def build(self, **kwargs): + response_string_part = self.convert_to_string(self.number, '') + # options in answer to be logged + return response_string_part, self.number \ No newline at end of file diff --git a/dhcpy6d/options/option_23.py b/dhcpy6d/options/option_23.py index 310d82c..7eb45c8 100644 --- a/dhcpy6d/options/option_23.py +++ b/dhcpy6d/options/option_23.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_24.py b/dhcpy6d/options/option_24.py index 8e23af8..666169e 100644 --- a/dhcpy6d/options/option_24.py +++ b/dhcpy6d/options/option_24.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_25.py b/dhcpy6d/options/option_25.py index 5dfcecb..71575ad 100644 --- a/dhcpy6d/options/option_25.py +++ b/dhcpy6d/options/option_25.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_3.py b/dhcpy6d/options/option_3.py index 4f5c2be..7a07687 100644 --- a/dhcpy6d/options/option_3.py +++ b/dhcpy6d/options/option_3.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_31.py b/dhcpy6d/options/option_31.py index c1870dd..b9ec758 100644 --- a/dhcpy6d/options/option_31.py +++ b/dhcpy6d/options/option_31.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_32.py b/dhcpy6d/options/option_32.py index 796bdae..5b02635 100644 --- a/dhcpy6d/options/option_32.py +++ b/dhcpy6d/options/option_32.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_39.py b/dhcpy6d/options/option_39.py index ca12457..c318216 100644 --- a/dhcpy6d/options/option_39.py +++ b/dhcpy6d/options/option_39.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ class Option(OptionTemplate): regarding RFC 4704 5. there are 3 kinds of client behaviour for N O S: - client wants to update DNS itself -> sends 0 0 0 - client wants server to update DNS -> sends 0 0 1 - - client wants no server DNS update -> sends 1 0 0 + - client wants no server DNS update -> sends 1 0 0 """ def build(self, transaction=None, **kwargs): diff --git a/dhcpy6d/options/option_4.py b/dhcpy6d/options/option_4.py index b9fca1a..065dd7c 100644 --- a/dhcpy6d/options/option_4.py +++ b/dhcpy6d/options/option_4.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_56.py b/dhcpy6d/options/option_56.py index 0a4026c..dd4666c 100644 --- a/dhcpy6d/options/option_56.py +++ b/dhcpy6d/options/option_56.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_59.py b/dhcpy6d/options/option_59.py index ff71ebf..4a2c0af 100644 --- a/dhcpy6d/options/option_59.py +++ b/dhcpy6d/options/option_59.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_6.py b/dhcpy6d/options/option_6.py index b89453d..8fbcaa4 100644 --- a/dhcpy6d/options/option_6.py +++ b/dhcpy6d/options/option_6.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_61.py b/dhcpy6d/options/option_61.py index 652d592..c5f3ca1 100644 --- a/dhcpy6d/options/option_61.py +++ b/dhcpy6d/options/option_61.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_7.py b/dhcpy6d/options/option_7.py index 5727fc6..486e194 100644 --- a/dhcpy6d/options/option_7.py +++ b/dhcpy6d/options/option_7.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_8.py b/dhcpy6d/options/option_8.py index 3358624..7dda67c 100644 --- a/dhcpy6d/options/option_8.py +++ b/dhcpy6d/options/option_8.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/options/option_82.py b/dhcpy6d/options/option_82.py new file mode 100644 index 0000000..de1884a --- /dev/null +++ b/dhcpy6d/options/option_82.py @@ -0,0 +1,30 @@ +# DHCPy6d DHCPv6 Daemon +# +# Copyright (C) 2009-2024 Henri Wahl +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +from dhcpy6d.config import cfg +from dhcpy6d.options import OptionTemplate + + +class Option(OptionTemplate): + """ + Option 82 SOL_MAX_RT (sic!) + """ + def build(self, **kwargs): + response_string_part = self.convert_to_string(self.number, f'{int(cfg.SOLICITATION_REFRESH_TIME):08x}') + # options in answer to be logged + return response_string_part, self.number diff --git a/dhcpy6d/options/option_83.py b/dhcpy6d/options/option_83.py new file mode 100644 index 0000000..5500da8 --- /dev/null +++ b/dhcpy6d/options/option_83.py @@ -0,0 +1,30 @@ +# DHCPy6d DHCPv6 Daemon +# +# Copyright (C) 2009-2024 Henri Wahl +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +from dhcpy6d.config import cfg +from dhcpy6d.options import OptionTemplate + + +class Option(OptionTemplate): + """ + Option 83 INF_MAX_RT (sic!) + """ + def build(self, **kwargs): + response_string_part = self.convert_to_string(self.number, f'{int(cfg.INFORMATION_REFRESH_TIME):08x}') + # options in answer to be logged + return response_string_part, self.number diff --git a/dhcpy6d/route.py b/dhcpy6d/route.py index bb2a531..bbbf271 100644 --- a/dhcpy6d/route.py +++ b/dhcpy6d/route.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/storage/__init__.py b/dhcpy6d/storage/__init__.py index 5ce5fe3..782d61e 100644 --- a/dhcpy6d/storage/__init__.py +++ b/dhcpy6d/storage/__init__.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ def __init__(self, name='', store_type=None, query_queue=None, answer_queue=None self.query_queue = query_queue self.answer_queue = answer_queue self.store = store_type - self.setDaemon(True) + self.daemon = True def run(self): """ diff --git a/dhcpy6d/storage/mysql.py b/dhcpy6d/storage/mysql.py index 628a074..c716200 100644 --- a/dhcpy6d/storage/mysql.py +++ b/dhcpy6d/storage/mysql.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/storage/postgresql.py b/dhcpy6d/storage/postgresql.py index 2097532..93e57fb 100644 --- a/dhcpy6d/storage/postgresql.py +++ b/dhcpy6d/storage/postgresql.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/storage/schemas.py b/dhcpy6d/storage/schemas.py index 2601782..4cb15ca 100644 --- a/dhcpy6d/storage/schemas.py +++ b/dhcpy6d/storage/schemas.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/storage/sqlite.py b/dhcpy6d/storage/sqlite.py index ea0693e..8da0bff 100644 --- a/dhcpy6d/storage/sqlite.py +++ b/dhcpy6d/storage/sqlite.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/storage/store.py b/dhcpy6d/storage/store.py index c6529b3..4e09fb4 100644 --- a/dhcpy6d/storage/store.py +++ b/dhcpy6d/storage/store.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/storage/textfile.py b/dhcpy6d/storage/textfile.py index e136fa2..9473d01 100644 --- a/dhcpy6d/storage/textfile.py +++ b/dhcpy6d/storage/textfile.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/dhcpy6d/threads.py b/dhcpy6d/threads.py index 55d7cc7..8a7bf92 100644 --- a/dhcpy6d/threads.py +++ b/dhcpy6d/threads.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -49,7 +49,7 @@ class DNSQueryThread(Thread): def __init__(self): Thread.__init__(self, name='DNSQuery') - self.setDaemon(True) + self.daemon = True def run(self): # wait for new queries in queue until the end of the world @@ -99,7 +99,7 @@ class TidyUpThread(Thread): def __init__(self): Thread.__init__(self, name='TidyUp') - self.setDaemon(True) + self.daemon = True def run(self): try: @@ -196,7 +196,7 @@ class RouteThread(Thread): def __init__(self, route_queue): Thread.__init__(self, name='Route') - self.setDaemon(True) + self.daemon = True self.route_queue = route_queue def run(self): @@ -230,7 +230,7 @@ class TimerThread(Thread): def __init__(self): Thread.__init__(self, name='Timer') - self.setDaemon(True) + self.daemon = True def run(self): while True: diff --git a/dhcpy6d/transaction.py b/dhcpy6d/transaction.py index e8d190b..7561072 100644 --- a/dhcpy6d/transaction.py +++ b/dhcpy6d/transaction.py @@ -1,6 +1,6 @@ # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ def __init__(self, transaction_id, client_llip, interface, message_type, options # last message for following the protocol self.last_message_received_type = message_type # dictionary for options - self.options_raw = options + self.options = options # default dummy OptionsRequest self.options_request = list() # timestamp to manage/clean transactions diff --git a/doc/dhcpy6d-clients.conf.rst b/doc/dhcpy6d-clients.conf.rst index 10e22f0..9f3a7d5 100644 --- a/doc/dhcpy6d-clients.conf.rst +++ b/doc/dhcpy6d-clients.conf.rst @@ -6,7 +6,7 @@ dhcpy6d-clients.conf Clients configuration file for DHCPv6 server dhcpy6d ---------------------------------------------------- -:Author: Copyright (C) 2012-2022 Henri Wahl +:Author: Copyright (C) 2012-2024 Henri Wahl :Date: 2022-06-14 :Version: 1.2.2 :Manual section: 5 diff --git a/doc/dhcpy6d.conf.rst b/doc/dhcpy6d.conf.rst index c756686..e3fedd2 100644 --- a/doc/dhcpy6d.conf.rst +++ b/doc/dhcpy6d.conf.rst @@ -6,7 +6,7 @@ dhcpy6d.conf Configuration file for DHCPv6 server dhcpy6d -------------------------------------------- -:Author: Copyright (C) 2012-2022 Henri Wahl +:Author: Copyright (C) 2012-2024 Henri Wahl :Date: 2022-06-14 :Version: 1.2.2 :Manual section: 5 diff --git a/doc/dhcpy6d.rst b/doc/dhcpy6d.rst index ab0fe4e..06b10df 100644 --- a/doc/dhcpy6d.rst +++ b/doc/dhcpy6d.rst @@ -6,7 +6,7 @@ dhcpy6d MAC address aware DHCPv6 server ---------------------------------------------------------------- -:Author: Copyright (C) 2012-2022 Henri Wahl +:Author: Copyright (C) 2012-2024 Henri Wahl :Date: 2022-06-14 :Version: 1.2.2 :Manual section: 8 diff --git a/main.py b/main.py index 6cd93f1..f2918b6 100755 --- a/main.py +++ b/main.py @@ -2,7 +2,7 @@ # # DHCPy6d DHCPv6 Daemon # -# Copyright (C) 2009-2022 Henri Wahl +# Copyright (C) 2009-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/man/man5/dhcpy6d-clients.conf.5 b/man/man5/dhcpy6d-clients.conf.5 index a077c6c..fa09f3a 100644 --- a/man/man5/dhcpy6d-clients.conf.5 +++ b/man/man5/dhcpy6d-clients.conf.5 @@ -177,7 +177,7 @@ dhcpy6d.conf(5) \fI\%https://github.com/HenriWahl/dhcpy6d\fP .UNINDENT .SH AUTHOR -Copyright (C) 2012-2022 Henri Wahl +Copyright (C) 2012-2024 Henri Wahl .SH COPYRIGHT This manual page is licensed under the GPL-2 license. .\" Generated by docutils manpage writer. diff --git a/man/man5/dhcpy6d.conf.5 b/man/man5/dhcpy6d.conf.5 index ff8d9c4..b4e68e3 100644 --- a/man/man5/dhcpy6d.conf.5 +++ b/man/man5/dhcpy6d.conf.5 @@ -1215,7 +1215,7 @@ dhcpy6d\-clients.conf(5) \fI\%https://github.com/HenriWahl/dhcpy6d\fP .UNINDENT .SH AUTHOR -Copyright (C) 2012-2022 Henri Wahl +Copyright (C) 2012-2024 Henri Wahl .SH COPYRIGHT This manual page is licensed under the GPL-2 license. .\" Generated by docutils manpage writer. diff --git a/man/man8/dhcpy6d.8 b/man/man8/dhcpy6d.8 index f6d7337..26a5bd5 100644 --- a/man/man8/dhcpy6d.8 +++ b/man/man8/dhcpy6d.8 @@ -143,7 +143,7 @@ dhcpy6d\-clients.conf(5) \fI\%https://github.com/HenriWahl/dhcpy6d\fP .UNINDENT .SH AUTHOR -Copyright (C) 2012-2022 Henri Wahl +Copyright (C) 2012-2024 Henri Wahl .SH COPYRIGHT This manual page is licensed under the GPL-2 license. .\" Generated by docutils manpage writer. diff --git a/setup.py b/setup.py index d52f9c8..48cd916 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # dhcpy6d - DHCPv6 server -# Copyright (C) 2012-2022 Henri Wahl +# Copyright (C) 2012-2024 Henri Wahl # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -63,7 +63,7 @@ ] setup(name='dhcpy6d', - version='1.4.0', + version='1.6.0', license='GNU GPL v2', description='DHCPv6 server daemon', long_description='Dhcpy6d delivers IPv6 addresses for DHCPv6 clients, which can be identified by DUID, hostname or MAC address as in the good old IPv4 days. It allows easy dualstack transition, addresses may be generated randomly, by range, by DNS, by arbitrary ID or MAC address. Clients can get more than one address, leases and client configuration can be stored in databases and DNS can be updated dynamically.',