adhcp.git
10 years agoRemove completed todo item. v0.1
Adrian-Ken Rueegsegger [Wed, 8 Jun 2011 08:43:20 +0000 (10:43 +0200)]
Remove completed todo item.

10 years agoUpdate email adresses.
Adrian-Ken Rueegsegger [Tue, 7 Jun 2011 17:14:25 +0000 (19:14 +0200)]
Update email adresses.

10 years agoAdd license header to all source files.
Adrian-Ken Rueegsegger [Tue, 7 Jun 2011 17:12:37 +0000 (19:12 +0200)]
Add license header to all source files.

10 years agoAdd COPYING file to clarify adhcp's license (GPLv2+).
Adrian-Ken Rueegsegger [Tue, 7 Jun 2011 16:53:38 +0000 (18:53 +0200)]
Add COPYING file to clarify adhcp's license (GPLv2+).

10 years agoUse case statement in Relay_Server_Message procedure.
Reto Buerki [Fri, 20 May 2011 12:52:09 +0000 (14:52 +0200)]
Use case statement in Relay_Server_Message procedure.

10 years agoIgnore Src_IP of reply in Relay_Server_Message.
Reto Buerki [Fri, 20 May 2011 12:18:06 +0000 (14:18 +0200)]
Ignore Src_IP of reply in Relay_Server_Message.

This check fails in the valid scenario where we relay messages to an
intermediate relay agent. The DHCP server would, as required by RFC
1542, send the reply directly to our client interface address (the
giaddr field in the request).

The source address of that BOOTP reply from the server is /= Srv_IP
because this variable is set to the other relay agent's address.

10 years agoUpdate Relay_Server_Message procedure description.
Reto Buerki [Fri, 20 May 2011 12:07:55 +0000 (14:07 +0200)]
Update Relay_Server_Message procedure description.

10 years agoRename Sock_Srv_Reply to Sock_Cli_Iface_IP.
Reto Buerki [Fri, 20 May 2011 11:57:17 +0000 (13:57 +0200)]
Rename Sock_Srv_Reply to Sock_Cli_Iface_IP.

10 years agoAdd additional comments for 'other relay agent' case.
Reto Buerki [Fri, 20 May 2011 11:43:09 +0000 (13:43 +0200)]
Add additional comments for 'other relay agent' case.

10 years agoHandle BOOTP requests on Sock_Srv_Reply as well.
Reto Buerki [Thu, 19 May 2011 09:01:05 +0000 (11:01 +0200)]
Handle BOOTP requests on Sock_Srv_Reply as well.

If an other relay agent forwards a client request via unicast to our
client interface address, the kernel delivers the data to the
Sock_Srv_Reply socket (not Sock_Client).

10 years agoMove 'Size representation attributes to private spec.
Reto Buerki [Thu, 12 May 2011 13:11:08 +0000 (15:11 +0200)]
Move 'Size representation attributes to private spec.

10 years agoDeclare Byte type as range 0 .. 255.
Reto Buerki [Thu, 12 May 2011 13:08:44 +0000 (15:08 +0200)]
Declare Byte type as range 0 .. 255.

10 years agoFix exception message in Send_Socket procedure.
Reto Buerki [Thu, 12 May 2011 09:21:24 +0000 (11:21 +0200)]
Fix exception message in Send_Socket procedure.

10 years agoRemove unneeded fields and getters from Socket_Type.
Reto Buerki [Wed, 11 May 2011 09:46:19 +0000 (11:46 +0200)]
Remove unneeded fields and getters from Socket_Type.

10 years agoDon't enable broadcast on Sock_Srv_Reply socket.
Reto Buerki [Thu, 12 May 2011 09:04:20 +0000 (11:04 +0200)]
Don't enable broadcast on Sock_Srv_Reply socket.

This is not needed any more because the client socket handles all
broadcast traffic from/to clients.

10 years agoRename Sock_Cli_Reply socket to Sock_Srv_Reply.
Reto Buerki [Wed, 11 May 2011 14:20:03 +0000 (16:20 +0200)]
Rename Sock_Cli_Reply socket to Sock_Srv_Reply.

This socket is used to receive replies from the DHCP server.

10 years agoRename Sock_Cli_Request socket to Sock_Client.
Reto Buerki [Wed, 11 May 2011 14:18:00 +0000 (16:18 +0200)]
Rename Sock_Cli_Request socket to Sock_Client.

10 years agoUse Sock_Cli_Request to relay messages to clients.
Reto Buerki [Wed, 11 May 2011 14:14:51 +0000 (16:14 +0200)]
Use Sock_Cli_Request to relay messages to clients.

10 years agoRevert "Bind interface to client-reply-socket"
Reto Buerki [Wed, 11 May 2011 13:58:42 +0000 (15:58 +0200)]
Revert "Bind interface to client-reply-socket"

This reverts commit f7b2ad357ea98feb8115b44a6a2adcfa8cc7ce91.

Conflicts:

src/dhcp-relay.adb

10 years agoSockets: Export Mode_Type to clients.
Reto Buerki [Mon, 9 May 2011 08:24:48 +0000 (10:24 +0200)]
Sockets: Export Mode_Type to clients.

10 years agoDisplay current time in Print() callback.
Reto Buerki [Mon, 9 May 2011 08:16:56 +0000 (10:16 +0200)]
Display current time in Print() callback.

10 years agoSockets: Split Open into Create and Bind procedures.
Reto Buerki [Mon, 9 May 2011 08:11:27 +0000 (10:11 +0200)]
Sockets: Split Open into Create and Bind procedures.

10 years agoSockets: Don't implicitly set the broadcast option.
Reto Buerki [Sun, 8 May 2011 20:18:40 +0000 (22:18 +0200)]
Sockets: Don't implicitly set the broadcast option.

Use the exported Set_Socket_Option procedure to enable the broadcast
option when needed.

10 years agoProvide thick binding of Set_Socket_Option.
Reto Buerki [Sun, 8 May 2011 20:08:22 +0000 (22:08 +0200)]
Provide thick binding of Set_Socket_Option.

10 years agoSplit Option_Name enum.
Reto Buerki [Sun, 8 May 2011 19:32:49 +0000 (21:32 +0200)]
Split Option_Name enum.

The enum is split into Option_Name_Bool and Option_Name_Str to make it
impossible to pass invalid option name/value combinations.

10 years agoLogger: Disable timestamps for fd facility.
Reto Buerki [Sun, 8 May 2011 19:04:00 +0000 (21:04 +0200)]
Logger: Disable timestamps for fd facility.

10 years agoadhcp_dump: Use console based logging.
Reto Buerki [Sun, 8 May 2011 18:54:24 +0000 (20:54 +0200)]
adhcp_dump: Use console based logging.

10 years agoMove Use_Stdout procedure to DHCP.Logger package.
Reto Buerki [Sun, 8 May 2011 18:52:53 +0000 (20:52 +0200)]
Move Use_Stdout procedure to DHCP.Logger package.

10 years agoAdd more TODO items.
Reto Buerki [Fri, 6 May 2011 16:23:22 +0000 (18:23 +0200)]
Add more TODO items.

10 years agoSockets.Thin: Remove unneeded operations.
Adrian-Ken Rueegsegger [Fri, 6 May 2011 15:53:11 +0000 (17:53 +0200)]
Sockets.Thin: Remove unneeded operations.

10 years agoBind interface to client-reply-socket
Martin Christian [Fri, 6 May 2011 13:59:19 +0000 (15:59 +0200)]
Bind interface to client-reply-socket

We need to specify the interface over which to broadcast replies
coming from the dhcp server further into the relay-network. If we
don't, the kernel might pick the dummy interface whith the same IP
address.

10 years agoMove setsockopt import to DHCP.Sockets private part.
Adrian-Ken Rueegsegger [Thu, 5 May 2011 12:55:00 +0000 (14:55 +0200)]
Move setsockopt import to DHCP.Sockets private part.

10 years agoMinor cleanup of DHCP.Sockets.Thin.
Reto Buerki [Wed, 4 May 2011 14:53:57 +0000 (16:53 +0200)]
Minor cleanup of DHCP.Sockets.Thin.

10 years agoRemove obsolete TODO item.
Reto Buerki [Wed, 4 May 2011 12:57:19 +0000 (14:57 +0200)]
Remove obsolete TODO item.

10 years agoadhcp_relay: Drop forwarding interface parameter.
Adrian-Ken Rueegsegger [Wed, 4 May 2011 09:59:22 +0000 (11:59 +0200)]
adhcp_relay: Drop forwarding interface parameter.

Since there is no need to bind to the forwarding interface anymore, it
must not be specified on the command line.

10 years agoadhcp_relay: Use separate client socket for replies.
Adrian-Ken Rueegsegger [Wed, 4 May 2011 09:51:52 +0000 (11:51 +0200)]
adhcp_relay: Use separate client socket for replies.

The additional client socket binds to the IP address of the served
client interface. It processes the replies from the DHCP server and
forwards them to the clients.

The server socket is only used to relay client requests to the DHCP
server. There is no need to bind it to the forwarding interface.

10 years agoFix programm errror during elaboration.
Adrian-Ken Rueegsegger [Wed, 4 May 2011 08:20:15 +0000 (10:20 +0200)]
Fix programm errror during elaboration.

Somehow the elaboration order checks of GNAT miss the fact that
DHCP.Sockets must be elaborated prior to any usage since it contains the
receiver task.

10 years agoMove remaining types from DHCP.Thin to DHCP package.
Adrian-Ken Rueegsegger [Tue, 3 May 2011 09:08:15 +0000 (11:08 +0200)]
Move remaining types from DHCP.Thin to DHCP package.

10 years agoRemove unneeded Options_Array type.
Adrian-Ken Rueegsegger [Tue, 3 May 2011 08:59:20 +0000 (10:59 +0200)]
Remove unneeded Options_Array type.

10 years agoMove raw msg header type to DHCP.Message.Thin.
Adrian-Ken Rueegsegger [Tue, 3 May 2011 08:51:53 +0000 (10:51 +0200)]
Move raw msg header type to DHCP.Message.Thin.

10 years agoRemove forwarding interface auto-detection.
Reto Buerki [Mon, 2 May 2011 15:44:01 +0000 (17:44 +0200)]
Remove forwarding interface auto-detection.

Since it does not work reliably in all cases we revert to manual
specification of the forwarding interface on the command line.

This has the added benefit of reduced complexity and a smaller code
base.

10 years agoRelay: Discard replies with unknown giaddr set.
Reto Buerki [Mon, 2 May 2011 13:19:20 +0000 (15:19 +0200)]
Relay: Discard replies with unknown giaddr set.

See RFC 1542 section 4.1.2.

10 years agoIncrement hop count before relaying.
Reto Buerki [Mon, 2 May 2011 11:04:52 +0000 (13:04 +0200)]
Increment hop count before relaying.

10 years agoRelay: Silently discard requests with hop count 16.
Reto Buerki [Mon, 2 May 2011 11:02:20 +0000 (13:02 +0200)]
Relay: Silently discard requests with hop count 16.

See RFC 1542, section 4.1.1.

10 years agoMessage: Add Inc_Hops procedure.
Reto Buerki [Mon, 2 May 2011 10:56:33 +0000 (12:56 +0200)]
Message: Add Inc_Hops procedure.

10 years agoRelay: Only set giaddr if it is zero.
Reto Buerki [Mon, 2 May 2011 10:39:19 +0000 (12:39 +0200)]
Relay: Only set giaddr if it is zero.

See RFC 1542, section 4.1.1.

10 years agoSilently discard invalid messages in receiver task.
Reto Buerki [Mon, 2 May 2011 10:30:14 +0000 (12:30 +0200)]
Silently discard invalid messages in receiver task.

See RFC 1542, section 2.1.

10 years agoMessage: Check buffer len prior to deserialization.
Reto Buerki [Mon, 2 May 2011 10:24:20 +0000 (12:24 +0200)]
Message: Check buffer len prior to deserialization.

10 years agoDeserialize received data instead of complete buffer.
Reto Buerki [Mon, 2 May 2011 09:48:18 +0000 (11:48 +0200)]
Deserialize received data instead of complete buffer.

10 years agoAdd -static to Adhcp_Common.Binder_Switches.
Reto Buerki [Tue, 12 Apr 2011 14:56:47 +0000 (16:56 +0200)]
Add -static to Adhcp_Common.Binder_Switches.

10 years agoFix indentation in $(VERSION_SPEC) target.
Reto Buerki [Tue, 12 Apr 2011 14:19:28 +0000 (16:19 +0200)]
Fix indentation in $(VERSION_SPEC) target.

10 years agoMakefile: Add -R to GMAKE_OPTS.
Reto Buerki [Tue, 12 Apr 2011 13:07:29 +0000 (15:07 +0200)]
Makefile: Add -R to GMAKE_OPTS.

This forces gnatmake to omit a run_path_option when linking.

10 years agoMakefile: Add GMAKE_OPTS variable.
Reto Buerki [Tue, 12 Apr 2011 13:06:23 +0000 (15:06 +0200)]
Makefile: Add GMAKE_OPTS variable.

gnatmake options are passed using this new variable.

10 years agoUse Bounded_String for Iface_Name type.
Adrian-Ken Rueegsegger [Mon, 11 Apr 2011 15:26:40 +0000 (17:26 +0200)]
Use Bounded_String for Iface_Name type.

10 years agoReduce loglevels to error.
Adrian-Ken Rueegsegger [Mon, 11 Apr 2011 14:34:18 +0000 (16:34 +0200)]
Reduce loglevels to error.

10 years agoadhcp_relay: Log errors during Relay.Run to syslog.
Adrian-Ken Rueegsegger [Mon, 11 Apr 2011 14:32:53 +0000 (16:32 +0200)]
adhcp_relay: Log errors during Relay.Run to syslog.

10 years agoUse stdout instead of logfile in test_runner.
Reto Buerki [Mon, 11 Apr 2011 14:10:58 +0000 (16:10 +0200)]
Use stdout instead of logfile in test_runner.

10 years agoAdd version information.
Reto Buerki [Mon, 11 Apr 2011 13:15:21 +0000 (15:15 +0200)]
Add version information.

10 years agoUse build_tests, build_release in build_all target.
Reto Buerki [Mon, 11 Apr 2011 12:56:31 +0000 (14:56 +0200)]
Use build_tests, build_release in build_all target.

10 years agoMakefile: Add build_tests target.
Reto Buerki [Mon, 11 Apr 2011 12:55:24 +0000 (14:55 +0200)]
Makefile: Add build_tests target.

10 years agoMakefile: Rename release target to build_release.
Reto Buerki [Mon, 11 Apr 2011 12:53:52 +0000 (14:53 +0200)]
Makefile: Rename release target to build_release.

10 years agoUpdate TODO file.
Reto Buerki [Mon, 11 Apr 2011 12:40:19 +0000 (14:40 +0200)]
Update TODO file.

10 years agoLogger: Disable timestamps.
Reto Buerki [Mon, 11 Apr 2011 12:38:08 +0000 (14:38 +0200)]
Logger: Disable timestamps.

10 years agoadhcp_relay: Attach handler to SIGTERM.
Reto Buerki [Mon, 11 Apr 2011 12:35:57 +0000 (14:35 +0200)]
adhcp_relay: Attach handler to SIGTERM.

10 years agoUse file based logging in test_runner.
Reto Buerki [Mon, 11 Apr 2011 12:31:14 +0000 (14:31 +0200)]
Use file based logging in test_runner.

10 years agoLogger: Switch to syslog facility.
Reto Buerki [Mon, 11 Apr 2011 12:08:22 +0000 (14:08 +0200)]
Logger: Switch to syslog facility.

10 years agoUse Alog logger instance instead of Ada.Text_IO.
Reto Buerki [Fri, 8 Apr 2011 14:08:00 +0000 (16:08 +0200)]
Use Alog logger instance instead of Ada.Text_IO.

10 years agoAdd error message to Get_Forwarding_Iface() exception.
Adrian-Ken Rueegsegger [Thu, 7 Apr 2011 14:39:53 +0000 (16:39 +0200)]
Add error message to Get_Forwarding_Iface() exception.

10 years agoDistinguish exceptions in Get_Forwarding_Iface.
Reto Buerki [Thu, 7 Apr 2011 14:12:16 +0000 (16:12 +0200)]
Distinguish exceptions in Get_Forwarding_Iface.

10 years agoNet: Log info about discovered network interfaces.
Reto Buerki [Thu, 7 Apr 2011 13:51:31 +0000 (15:51 +0200)]
Net: Log info about discovered network interfaces.

10 years agoAdd DHCP.Logger package.
Reto Buerki [Thu, 7 Apr 2011 13:38:09 +0000 (15:38 +0200)]
Add DHCP.Logger package.

This package provides the logging facility. Loglevels are not yet
implemented.

10 years agoNet: Make cursor in Get_Iface() constant.
Adrian-Ken Rueegsegger [Thu, 7 Apr 2011 09:41:28 +0000 (11:41 +0200)]
Net: Make cursor in Get_Iface() constant.

10 years agoadhcp_relay: Check if server IP is a local address.
Adrian-Ken Rueegsegger [Thu, 7 Apr 2011 09:38:28 +0000 (11:38 +0200)]
adhcp_relay: Check if server IP is a local address.

10 years agoAdd test for empty string to IP address conversion.
Adrian-Ken Rueegsegger [Wed, 6 Apr 2011 16:36:48 +0000 (18:36 +0200)]
Add test for empty string to IP address conversion.

10 years agoNet: Add Is_Local_Iface() function.
Adrian-Ken Rueegsegger [Wed, 6 Apr 2011 16:10:03 +0000 (18:10 +0200)]
Net: Add Is_Local_Iface() function.

This function returns True if an interface of the local system with
given IP address is present in the map of discovered interfaces.

10 years agoNet: Add Find() function to package body.
Adrian-Ken Rueegsegger [Wed, 6 Apr 2011 16:09:08 +0000 (18:09 +0200)]
Net: Add Find() function to package body.

This function returns the position of the interface with the given
address present in the system interfaces map. If no match is found
No_Element is returned.

10 years agoadhcp_relay: Check runtime configuraion.
Adrian-Ken Rueegsegger [Wed, 6 Apr 2011 15:47:53 +0000 (17:47 +0200)]
adhcp_relay: Check runtime configuraion.

Verify that client and forwarding interfaces differ.

10 years agoadhcp_relay: Handle exceptions raised in Relay.Run().
Adrian-Ken Rueegsegger [Wed, 6 Apr 2011 14:33:26 +0000 (16:33 +0200)]
adhcp_relay: Handle exceptions raised in Relay.Run().

10 years agoSockets: Wait for receiver task termination on Stop.
Adrian-Ken Rueegsegger [Wed, 6 Apr 2011 13:52:10 +0000 (15:52 +0200)]
Sockets: Wait for receiver task termination on Stop.

10 years agoadhcp_relay: Get client iface from discovered list.
Adrian-Ken Rueegsegger [Wed, 6 Apr 2011 13:04:08 +0000 (15:04 +0200)]
adhcp_relay: Get client iface from discovered list.

10 years agoadhcp_relay: Auto-detect forwarding interface.
Adrian-Ken Rueegsegger [Wed, 6 Apr 2011 12:32:59 +0000 (14:32 +0200)]
adhcp_relay: Auto-detect forwarding interface.

The forwarding interface for relayed requests to the DHCP server is now
determined automatically. This means it must not be provided via the
command line anymore.

10 years agoNet: Reduce max interface name length to 15.
Adrian-Ken Rueegsegger [Wed, 6 Apr 2011 12:30:22 +0000 (14:30 +0200)]
Net: Reduce max interface name length to 15.

The C constant IFNAMSIZ defines the maximum size of an interface name,
including the terminating zero byte. This means that valid names can
only have 15 characters.

10 years agoadhcp_relay: Validate client interface name.
Reto Buerki [Wed, 6 Apr 2011 10:39:20 +0000 (12:39 +0200)]
adhcp_relay: Validate client interface name.

10 years agoadhcp_relay: Validate server IP address.
Reto Buerki [Wed, 6 Apr 2011 10:33:37 +0000 (12:33 +0200)]
adhcp_relay: Validate server IP address.

10 years agoNet: Add Get_Forwarding_Iface function.
Reto Buerki [Wed, 6 Apr 2011 09:58:55 +0000 (11:58 +0200)]
Net: Add Get_Forwarding_Iface function.

This function returns the forwarding interface for a given destination
address in the list of discovered local system interfaces. If no
interface is found an exception is raised.

10 years agoAdd another TODO item.
Reto Buerki [Wed, 6 Apr 2011 09:37:37 +0000 (11:37 +0200)]
Add another TODO item.

10 years agoAdd test for forwarding interface lookup.
Reto Buerki [Wed, 6 Apr 2011 09:36:50 +0000 (11:36 +0200)]
Add test for forwarding interface lookup.

10 years agoNet: Add Get_Iface() function for IP address.
Reto Buerki [Tue, 5 Apr 2011 16:56:09 +0000 (18:56 +0200)]
Net: Add Get_Iface() function for IP address.

This function returns the network interface with the given assigned IP
address. The function returns the first matching interface. If no such
interface exists an exception is raised.

10 years agoRe-add DHCP.Net package.
Reto Buerki [Tue, 5 Apr 2011 16:34:11 +0000 (18:34 +0200)]
Re-add DHCP.Net package.

This package now provides facilities to handle network interface
information of the local system.

10 years agoMake Get_Socket_Info procedure public.
Reto Buerki [Tue, 5 Apr 2011 15:36:14 +0000 (17:36 +0200)]
Make Get_Socket_Info procedure public.

10 years agoMove AF_INET constant to public spec.
Reto Buerki [Tue, 5 Apr 2011 15:32:02 +0000 (17:32 +0200)]
Move AF_INET constant to public spec.

10 years agoMove low-level Sockaddr_In_Type to public spec.
Reto Buerki [Tue, 5 Apr 2011 14:26:51 +0000 (16:26 +0200)]
Move low-level Sockaddr_In_Type to public spec.

10 years agoRename IFNAMSIZ to Max_Iface_Name_Len.
Reto Buerki [Tue, 5 Apr 2011 14:03:53 +0000 (16:03 +0200)]
Rename IFNAMSIZ to Max_Iface_Name_Len.

Also make this constant public.

10 years agoSockets: Remove unneeded Get_Interface function.
Reto Buerki [Tue, 5 Apr 2011 13:52:33 +0000 (15:52 +0200)]
Sockets: Remove unneeded Get_Interface function.

10 years agoMake DHCP.Sockets.Thin a private package again.
Reto Buerki [Tue, 5 Apr 2011 13:43:11 +0000 (15:43 +0200)]
Make DHCP.Sockets.Thin a private package again.

10 years agoMerge DHCP.Net into DHCP.Sockets packages.
Reto Buerki [Tue, 5 Apr 2011 13:23:29 +0000 (15:23 +0200)]
Merge DHCP.Net into DHCP.Sockets packages.

10 years agoNet: Rename Request_Name enum to Netdev_Request_Name.
Reto Buerki [Tue, 5 Apr 2011 13:00:02 +0000 (15:00 +0200)]
Net: Rename Request_Name enum to Netdev_Request_Name.

10 years agoSockets: Rename Sockaddr_Type to Sockaddr_In_Type.
Reto Buerki [Tue, 5 Apr 2011 12:56:49 +0000 (14:56 +0200)]
Sockets: Rename Sockaddr_Type to Sockaddr_In_Type.

10 years agoUse DHCP.Sockets.Thin in DHCP.Net package.
Reto Buerki [Tue, 5 Apr 2011 12:37:00 +0000 (14:37 +0200)]
Use DHCP.Sockets.Thin in DHCP.Net package.

Remove private keyword from DHCP.Sockets.Thin package declaration for
now.

10 years agoClose socket in Get_Outgoing_Address function.
Reto Buerki [Tue, 5 Apr 2011 12:25:58 +0000 (14:25 +0200)]
Close socket in Get_Outgoing_Address function.