adhcp.git
10 months agoFix potential overflow in Transactions,Schedule_Expiry 0.3.x v0.3.4
Adrian-Ken Rueegsegger [Thu, 23 Jul 2020 15:29:23 +0000 (17:29 +0200)]
Fix potential overflow in Transactions,Schedule_Expiry

Convert duration to Long_Long_Integer instead of Long_Integer to avoid
issues on 32 bit systems.

This is a backport of commit 27db60.

Auditors: reet

4 years agoadhcp_relay: Fix termination issues v0.3.3
Reto Buerki [Mon, 21 Nov 2016 21:05:33 +0000 (22:05 +0100)]
adhcp_relay: Fix termination issues

Summary:
In case of a Socket_Error in a receiver task, the registered error
callback signals termination via DHCP.Termination. It is preferable to
listen for such events in main to avoid service hang. Therefore, drop
usage of Signals package in adhcp_relay in favor of DHCP.Termination.

As the network may recover, treat Anet.Socket_Error as temporary failure
in the adhcp_relay send paths. This could happen if e.g. a route is not
yet present. Log a warning message and continue operation.

Reviewers: ken

Reviewed By: ken

Differential Revision: https://dev.codelabs.ch/D522

4 years agoHandle Socket_Error in Relay_Server_Message
Reto Buerki [Fri, 4 Nov 2016 19:10:48 +0000 (20:10 +0100)]
Handle Socket_Error in Relay_Server_Message

4 years agoHandle Socket_Error in Relay_Client_Message
Reto Buerki [Fri, 4 Nov 2016 19:06:27 +0000 (20:06 +0100)]
Handle Socket_Error in Relay_Client_Message

In case of adhcp_relay it makes sense to just retry as the network may
recover. Therefore log a warning message and continue operation.

4 years agoadhcp_relay: Correctly use DHCP.Termination package
Reto Buerki [Fri, 4 Nov 2016 18:59:43 +0000 (19:59 +0100)]
adhcp_relay: Correctly use DHCP.Termination package

In case of a Socket_Error in a receiver task, the registered error
callback signals termination via DHCP.Termination. It is preferable to
listen for such events in order to avoid service hang.

4 years agoAdd arcanist configuration
Reto Buerki [Wed, 23 Sep 2015 11:48:40 +0000 (13:48 +0200)]
Add arcanist configuration

6 years agoUpdate adhcp_client_wrapper man page v0.3.2
Reto Buerki [Mon, 10 Nov 2014 11:50:43 +0000 (12:50 +0100)]
Update adhcp_client_wrapper man page

6 years agoDecouple VERSION variable from GIT_REV
Reto Buerki [Mon, 10 Nov 2014 10:21:15 +0000 (11:21 +0100)]
Decouple VERSION variable from GIT_REV

6 years agoRemove unneeded PHONY targets
Reto Buerki [Mon, 10 Nov 2014 10:14:00 +0000 (11:14 +0100)]
Remove unneeded PHONY targets

They are implicitly PHONY because no file/directory of that name exists.

6 years agoIgnore git describe error messages
Reto Buerki [Mon, 10 Nov 2014 10:06:55 +0000 (11:06 +0100)]
Ignore git describe error messages

This is required to silence error messages when building the sources
from the release tarball where no .git directory exists.

6 years agoMake GIT_REV a simply expanded variable
Reto Buerki [Mon, 10 Nov 2014 10:06:11 +0000 (11:06 +0100)]
Make GIT_REV a simply expanded variable

6 years agoDon't remove .version file in distclean target
Reto Buerki [Mon, 10 Nov 2014 09:41:48 +0000 (10:41 +0100)]
Don't remove .version file in distclean target

6 years agoPack .version file into release tarball
Reto Buerki [Mon, 10 Nov 2014 09:41:16 +0000 (10:41 +0100)]
Pack .version file into release tarball

6 years agoRename dhcp-git-rev target to .version
Reto Buerki [Mon, 10 Nov 2014 09:37:00 +0000 (10:37 +0100)]
Rename dhcp-git-rev target to .version

6 years agoDon't remove version spec file in distclean target
Reto Buerki [Mon, 10 Nov 2014 09:07:47 +0000 (10:07 +0100)]
Don't remove version spec file in distclean target

This file is part of the release tarball, so distclean should not remove
it.

6 years agoRandomize lease filename in notify simple test
Reto Buerki [Fri, 31 Oct 2014 16:11:16 +0000 (17:11 +0100)]
Randomize lease filename in notify simple test

6 years agoOnly link adhcp_notify_dbus against dbus-1 lib
Reto Buerki [Thu, 30 Oct 2014 11:09:45 +0000 (12:09 +0100)]
Only link adhcp_notify_dbus against dbus-1 lib

6 years agoAdd man page for adhcp_notify_simple tool
Reto Buerki [Thu, 30 Oct 2014 09:31:18 +0000 (10:31 +0100)]
Add man page for adhcp_notify_simple tool

6 years agoImplement simple external notifier
Reto Buerki [Thu, 30 Oct 2014 09:15:29 +0000 (10:15 +0100)]
Implement simple external notifier

The tool uses the Notify_Simple.Write_Lease_File procedure to create a
lease file '/tmp/dhcp.lease' containing the DHCP configuration as key,
value pairs.

6 years agoFactor out cmdline processing to Utils_Notify package
Reto Buerki [Thu, 30 Oct 2014 08:47:43 +0000 (09:47 +0100)]
Factor out cmdline processing to Utils_Notify package

The Get_Cmdline_Args procedure validates and returns notifier command
line arguments. If the optional lease filename is omitted from the
command line, Null_Lease is returned. If a command line argument is
invalid, an exception is raised.

6 years agoAdd Null_Lease constant to DHCP.Lease package
Reto Buerki [Thu, 30 Oct 2014 08:26:07 +0000 (09:26 +0100)]
Add Null_Lease constant to DHCP.Lease package

6 years agoAdd DHCP.Notify_Simple package
Reto Buerki [Wed, 29 Oct 2014 17:19:39 +0000 (18:19 +0100)]
Add DHCP.Notify_Simple package

The package provides the Write_Lease_File procedure which creates a
lease file with specified filename containing the DHCP configuration as
key, value pairs. If the lease cannot be written, an exception is
raised.

6 years agoAdd Test_Utils package
Reto Buerki [Wed, 29 Oct 2014 17:08:52 +0000 (18:08 +0100)]
Add Test_Utils package

The package provides the Equal_Files procedure which compares two files
byte-wise.

6 years agoAdd adhcp_notify_simple tool stub
Reto Buerki [Wed, 29 Oct 2014 08:21:48 +0000 (09:21 +0100)]
Add adhcp_notify_simple tool stub

This notifier will create a simple lease file containing key, value
pairs.

6 years agoUse Utils.Error procedure in adhcp_notify_dbus
Reto Buerki [Wed, 29 Oct 2014 08:15:14 +0000 (09:15 +0100)]
Use Utils.Error procedure in adhcp_notify_dbus

6 years agoREADME: Update licence
Reto Buerki [Tue, 28 Oct 2014 14:29:01 +0000 (15:29 +0100)]
README: Update licence

6 years agoUpdate adhcp_client man page
Reto Buerki [Tue, 28 Oct 2014 09:06:43 +0000 (10:06 +0100)]
Update adhcp_client man page

6 years agoadhcp_client: Add -e command line option
Reto Buerki [Tue, 28 Oct 2014 08:54:47 +0000 (09:54 +0100)]
adhcp_client: Add -e command line option

This option allows to override the external notification binary name.

6 years agoUse Cmd_Line package in Call_External_Notify
Reto Buerki [Tue, 28 Oct 2014 08:47:26 +0000 (09:47 +0100)]
Use Cmd_Line package in Call_External_Notify

By default, the Get_Ext_Notify_Binary function returns
'/sbin/adhcp_notify_dbus' as external notification binary name.

6 years agoAdd DHCP.Cmd_Line package
Reto Buerki [Tue, 28 Oct 2014 08:45:33 +0000 (09:45 +0100)]
Add DHCP.Cmd_Line package

The package will be used to store and retrieve command line options.
Currently, it provides a setter and getter for the external notification
binary name.

6 years agoUpdate notifier documentation
Reto Buerki [Tue, 28 Oct 2014 08:30:23 +0000 (09:30 +0100)]
Update notifier documentation

6 years agoRename adhcp_notify to adhcp_notify_dbus
Reto Buerki [Tue, 28 Oct 2014 08:29:00 +0000 (09:29 +0100)]
Rename adhcp_notify to adhcp_notify_dbus

This makes room for additional external notifiers.

6 years agoFix misplaced "then" warnings with gnat-4.9
Reto Buerki [Thu, 14 Aug 2014 15:29:38 +0000 (17:29 +0200)]
Fix misplaced "then" warnings with gnat-4.9

6 years agoUpdate to Anet v0.3.1
Reto Buerki [Fri, 21 Mar 2014 11:03:10 +0000 (12:03 +0100)]
Update to Anet v0.3.1

7 years agoAdjust adhcp_notify to latest D_Bus/Ada changes
Reto Buerki [Fri, 7 Feb 2014 10:42:31 +0000 (11:42 +0100)]
Adjust adhcp_notify to latest D_Bus/Ada changes

7 years agoUpdate PGP pubkey in README
Reto Buerki [Fri, 18 Oct 2013 10:14:52 +0000 (12:14 +0200)]
Update PGP pubkey in README

7 years agoMakefile: Remove leading 'v' from VERSION variable v0.3.1
Reto Buerki [Thu, 27 Jun 2013 12:35:44 +0000 (14:35 +0200)]
Makefile: Remove leading 'v' from VERSION variable

7 years agoAdd support for leases with 'infinity' lease time
Reto Buerki [Thu, 27 Jun 2013 10:06:44 +0000 (12:06 +0200)]
Add support for leases with 'infinity' lease time

Adapt lease time handling to support the special 'infinity' lease time
value of 0xffffffff, see RFC 2131, section 3.3.

7 years agoSimplify test for invalid lease times
Reto Buerki [Thu, 27 Jun 2013 10:04:07 +0000 (12:04 +0200)]
Simplify test for invalid lease times

8 years agoSend notifications after setting transaction state
Reto Buerki [Mon, 25 Mar 2013 14:05:38 +0000 (15:05 +0100)]
Send notifications after setting transaction state

This ensures that a transition is completed before registered
observers perform additional work.

8 years agodoc: Minor adjustments to URLs
Adrian-Ken Rueegsegger [Thu, 31 Jan 2013 11:25:34 +0000 (12:25 +0100)]
doc: Minor adjustments to URLs

8 years agoMinor: Cleanup COPYING file
Reto Buerki [Thu, 24 Jan 2013 16:14:42 +0000 (17:14 +0100)]
Minor: Cleanup COPYING file

8 years agoFix RFC conformity document header
Reto Buerki [Fri, 16 Nov 2012 15:10:39 +0000 (16:10 +0100)]
Fix RFC conformity document header

8 years agodoc: Publish RFC conformity document
Adrian-Ken Rueegsegger [Thu, 15 Nov 2012 14:32:42 +0000 (15:32 +0100)]
doc: Publish RFC conformity document

8 years agoAdapt RFC conformity to ASCII doc style
Adrian-Ken Rueegsegger [Thu, 15 Nov 2012 14:19:17 +0000 (15:19 +0100)]
Adapt RFC conformity to ASCII doc style

8 years agoAdd release information to README v0.3
Adrian-Ken Rueegsegger [Thu, 15 Nov 2012 11:31:05 +0000 (12:31 +0100)]
Add release information to README

8 years agoUpdate documentation
Reto Buerki [Thu, 15 Nov 2012 11:56:25 +0000 (12:56 +0100)]
Update documentation

8 years agoAdjust install permissions
Reto Buerki [Thu, 15 Nov 2012 11:42:20 +0000 (12:42 +0100)]
Adjust install permissions

8 years agoUpdate copyright information
Adrian-Ken Rueegsegger [Thu, 15 Nov 2012 10:29:47 +0000 (11:29 +0100)]
Update copyright information

8 years agoRemove unneeded with clauses
Adrian-Ken Rueegsegger [Thu, 15 Nov 2012 10:29:35 +0000 (11:29 +0100)]
Remove unneeded with clauses

8 years agoDo not turn off warnings
Adrian-Ken Rueegsegger [Thu, 15 Nov 2012 10:10:07 +0000 (11:10 +0100)]
Do not turn off warnings

FSF GNAT 4.6.3 does not emmit a warning anymore.

8 years agoadhcp_client: Discard packets on UDP socket
Adrian-Ken Rueegsegger [Mon, 12 Nov 2012 16:27:09 +0000 (17:27 +0100)]
adhcp_client: Discard packets on UDP socket

This socket is only used to send unicast requests to the DHCP server
when renewing leases.

8 years agoUpdate to Anet v0.2
Reto Buerki [Tue, 18 Sep 2012 16:09:33 +0000 (18:09 +0200)]
Update to Anet v0.2

8 years agoRevert "Build tools dynamic"
Reto Buerki [Tue, 28 Aug 2012 07:33:31 +0000 (09:33 +0200)]
Revert "Build tools dynamic"

This reverts commit f0f2a4ddf414707db5f0a228fc45f17bba951c9e.

8 years agoRandomize lease filename in Write_And_Read_Lease
Reto Buerki [Mon, 27 Aug 2012 12:54:22 +0000 (14:54 +0200)]
Randomize lease filename in Write_And_Read_Lease

Use the Anet.Util.Random_String function to append a random string to
the lease filename in the Write_And_Read_Lease test.

8 years agoImprove logging in adhcp_[client|relay]
Reto Buerki [Wed, 11 Jul 2012 10:23:00 +0000 (12:23 +0200)]
Improve logging in adhcp_[client|relay]

9 years agoMove Alog logger instance to DHCP.Logger body
Reto Buerki [Tue, 12 Jun 2012 15:39:12 +0000 (17:39 +0200)]
Move Alog logger instance to DHCP.Logger body

9 years agoMakefile: Add dist target
Reto Buerki [Tue, 12 Jun 2012 14:19:34 +0000 (16:19 +0200)]
Makefile: Add dist target

9 years agoBuild tools dynamic
Reto Buerki [Tue, 12 Jun 2012 08:33:03 +0000 (10:33 +0200)]
Build tools dynamic

9 years agoInstall client wrapper when installing tools
Adrian-Ken Rueegsegger [Mon, 11 Jun 2012 21:10:01 +0000 (23:10 +0200)]
Install client wrapper when installing tools

9 years agoRework exception handling in Call_External_Notify
Reto Buerki [Mon, 11 Jun 2012 15:55:52 +0000 (17:55 +0200)]
Rework exception handling in Call_External_Notify

Only delete temporary lease file if the call to Lease_Data.Write
succeeded.

9 years agoUse correct socket for IP packet receiver
Adrian-Ken Rueegsegger [Fri, 20 Apr 2012 13:11:20 +0000 (15:11 +0200)]
Use correct socket for IP packet receiver

9 years agoadhcp_relay: Correctly initialize client interface
Reto Buerki [Fri, 30 Mar 2012 13:00:30 +0000 (15:00 +0200)]
adhcp_relay: Correctly initialize client interface

9 years agoAdd support for DHCP PAD option (code 0)
Reto Buerki [Mon, 26 Mar 2012 09:19:57 +0000 (11:19 +0200)]
Add support for DHCP PAD option (code 0)

Padding options are just skipped during option list deserialization.

9 years agoUpdate TODO
Adrian-Ken Rueegsegger [Mon, 5 Mar 2012 17:00:29 +0000 (18:00 +0100)]
Update TODO

9 years agoUpdate to latest Anet API changes
Reto Buerki [Fri, 24 Feb 2012 15:57:18 +0000 (16:57 +0100)]
Update to latest Anet API changes

The socket Create procedure has no default Family and Mode any more.

9 years agoUpdate to latest Anet API changes
Adrian-Ken Rueegsegger [Mon, 20 Feb 2012 15:51:57 +0000 (16:51 +0100)]
Update to latest Anet API changes

Use Anet.Sockets.Iface_Name_Type in favor of own interface name type.

9 years agoAdapt to latest Anet API changes
Adrian-Ken Rueegsegger [Fri, 17 Feb 2012 13:34:03 +0000 (14:34 +0100)]
Adapt to latest Anet API changes

- Change of stop flag parameter mode in error handling callbacks
- Removal of Anet.Sockets.IP_Addr_Type

9 years agoAdd error handling to receivers in client and relay
Adrian-Ken Rueegsegger [Thu, 16 Feb 2012 18:19:57 +0000 (19:19 +0100)]
Add error handling to receivers in client and relay

9 years agoImplement receive error handler callback
Adrian-Ken Rueegsegger [Thu, 16 Feb 2012 18:17:23 +0000 (19:17 +0100)]
Implement receive error handler callback

The error handler logs the exception message and instructs the receiver
to terminate if a Socket_Error has occurred.

9 years agoRename Socket_Callbacks to DHCP.Socket_Callbacks
Adrian-Ken Rueegsegger [Thu, 16 Feb 2012 18:16:07 +0000 (19:16 +0100)]
Rename Socket_Callbacks to DHCP.Socket_Callbacks

9 years agoUse Anet's new receiver type for packet processing
Adrian-Ken Rueegsegger [Thu, 16 Feb 2012 17:53:24 +0000 (18:53 +0100)]
Use Anet's new receiver type for packet processing

9 years agoMention Anet as build dependency in README
Adrian-Ken Rueegsegger [Thu, 16 Feb 2012 11:11:53 +0000 (12:11 +0100)]
Mention Anet as build dependency in README

9 years agoUpdate build section of README file
Adrian-Ken Rueegsegger [Thu, 16 Feb 2012 10:57:14 +0000 (11:57 +0100)]
Update build section of README file

Netcat6 is not needed anymore since that testing code was moved to Anet.

9 years agoAdd pragma License (GPL)
Adrian-Ken Rueegsegger [Thu, 16 Feb 2012 10:34:46 +0000 (11:34 +0100)]
Add pragma License (GPL)

9 years agoUpdate to latest changes in Anet
Adrian-Ken Rueegsegger [Thu, 16 Feb 2012 10:04:13 +0000 (11:04 +0100)]
Update to latest changes in Anet

9 years agoInclude Anet project
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 17:17:11 +0000 (18:17 +0100)]
Include Anet project

9 years agoDrop Anet related TODO items
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 17:15:02 +0000 (18:15 +0100)]
Drop Anet related TODO items

9 years agoDrop Anet related files
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 17:12:45 +0000 (18:12 +0100)]
Drop Anet related files

The functionality is now provided by the separate Anet library.

9 years agoUse own DHCP Ack reference in message tests
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 17:11:53 +0000 (18:11 +0100)]
Use own DHCP Ack reference in message tests

9 years agoAdd test socket implementation to Transactions.Mock
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 17:07:42 +0000 (18:07 +0100)]
Add test socket implementation to Transactions.Mock

9 years agoMove DHCP.IPv4 package to Anet.IPv4
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 15:07:04 +0000 (16:07 +0100)]
Move DHCP.IPv4 package to Anet.IPv4

9 years agoMove DHCP Ack test message to Anet.Test_Utils
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 14:59:11 +0000 (15:59 +0100)]
Move DHCP Ack test message to Anet.Test_Utils

9 years agoRename DHCP.UDP package to Anet.UDP
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 14:50:45 +0000 (15:50 +0100)]
Rename DHCP.UDP package to Anet.UDP

9 years agoRename DHCP.Util package to Anet.Util
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 14:44:39 +0000 (15:44 +0100)]
Rename DHCP.Util package to Anet.Util

9 years agoMove socket tests to anet hierarchy
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 14:38:18 +0000 (15:38 +0100)]
Move socket tests to anet hierarchy

9 years agoUse Anet.OS instead of DHCP.OS in socket tests
Adrian-Ken Rueegsegger [Wed, 15 Feb 2012 14:19:16 +0000 (15:19 +0100)]
Use Anet.OS instead of DHCP.OS in socket tests

9 years agoSplit Test_Utils package into DHCP/Anet parts
Reto Buerki [Wed, 15 Feb 2012 13:23:08 +0000 (14:23 +0100)]
Split Test_Utils package into DHCP/Anet parts

9 years agoMove common OS operations to Anet.OS package
Reto Buerki [Wed, 15 Feb 2012 10:54:48 +0000 (11:54 +0100)]
Move common OS operations to Anet.OS package

Use renames in DHCP.OS to re-import the operations.

9 years agoFactor out socket functionality into Anet packages
Reto Buerki [Wed, 15 Feb 2012 10:29:53 +0000 (11:29 +0100)]
Factor out socket functionality into Anet packages

This is in preparation for splitting the socket/networking code into a
separate project.

9 years agoMove socket callbacks to Socket_Callbacks package
Reto Buerki [Wed, 15 Feb 2012 09:41:46 +0000 (10:41 +0100)]
Move socket callbacks to Socket_Callbacks package

This package does not need to be a child package of DHCP.Sockets.

9 years agoRemove Logger, Termination dependency from sockets
Reto Buerki [Tue, 14 Feb 2012 14:31:07 +0000 (15:31 +0100)]
Remove Logger, Termination dependency from sockets

To simplify splitting of the socket functionality into a separate
library, remove all DHCP specific dependencies from the socket packages.

The removed code will be re-implemented when the refactoring has been
completed successfully.

9 years agoAdd missing license headers
Adrian-Ken Rueegsegger [Tue, 14 Feb 2012 15:32:26 +0000 (16:32 +0100)]
Add missing license headers

9 years agoAdd initial UNIX socket server support
Adrian-Ken Rueegsegger [Tue, 14 Feb 2012 14:20:43 +0000 (15:20 +0100)]
Add initial UNIX socket server support

9 years agoUnlink path prior to binding unix domain socket
Adrian-Ken Rueegsegger [Tue, 14 Feb 2012 14:16:32 +0000 (15:16 +0100)]
Unlink path prior to binding unix domain socket

9 years agoEnforce raw header alignment of 1
Reto Buerki [Mon, 13 Feb 2012 13:33:19 +0000 (14:33 +0100)]
Enforce raw header alignment of 1

Force the alignment of overlay records to be identical with
Stream_Element_Array. This fixes a warning when compiling with FSF GNAT
4.6.

9 years agoUse obj/prof as Object_Dir for profiling
Reto Buerki [Mon, 13 Feb 2012 13:18:18 +0000 (14:18 +0100)]
Use obj/prof as Object_Dir for profiling

9 years agoUse obj/tests as Object_Dir for test code
Reto Buerki [Mon, 13 Feb 2012 13:12:33 +0000 (14:12 +0100)]
Use obj/tests as Object_Dir for test code

9 years agoAdd initial UNIX socket support
Adrian-Ken Rueegsegger [Thu, 19 Jan 2012 11:26:54 +0000 (12:26 +0100)]
Add initial UNIX socket support

For the test to run the tool 'socat' is needed.

9 years agoSmall correction
Adrian-Ken Rueegsegger [Fri, 9 Dec 2011 17:09:35 +0000 (18:09 +0100)]
Small correction