From 755db30028622de604ef98a5b28c2c4128b6f3d7 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Tue, 12 Nov 2024 00:17:31 -0700 Subject: Oh dang, I broke `make lint` a while back :( --- libdhcp/dhcp_client.c | 2 +- libdhcp/dhcp_common.h | 2 +- libdhcp/f.md | 27 --------------------------- libdhcp/include/libdhcp/client.h | 6 +++--- libdhcp/notes.md | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 37 insertions(+), 32 deletions(-) delete mode 100644 libdhcp/f.md create mode 100644 libdhcp/notes.md (limited to 'libdhcp') diff --git a/libdhcp/dhcp_client.c b/libdhcp/dhcp_client.c index 4ab456c..3c6ed8d 100644 --- a/libdhcp/dhcp_client.c +++ b/libdhcp/dhcp_client.c @@ -429,7 +429,7 @@ static bool dhcp_client_send(struct dhcp_client *client, uint8_t msgtyp, const c } struct dhcp_recv_msg { - struct dhcp_msg raw; + struct dhcp_msg raw; struct { uint16_t len; uint8_t *dat; diff --git a/libdhcp/dhcp_common.h b/libdhcp/dhcp_common.h index 0be3a27..d400721 100644 --- a/libdhcp/dhcp_common.h +++ b/libdhcp/dhcp_common.h @@ -74,7 +74,7 @@ #include "config.h" #ifndef CONFIG_DHCP_OPT_SIZE - #define CONFIG_DHCP_OPT_SIZE DHCP_MSG_MIN_MAX_OPT_SIZE + #define CONFIG_DHCP_OPT_SIZE DHCP_MSG_MIN_MAX_OPT_SIZE #endif /* RFC 2131 definitions *******************************************************/ diff --git a/libdhcp/f.md b/libdhcp/f.md deleted file mode 100644 index 447ee5b..0000000 --- a/libdhcp/f.md +++ /dev/null @@ -1,27 +0,0 @@ -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - -| | | | -| In the message from the | | ... then the server ... | -| client the ... | | | -| | | | -| and and | | | - -| | | | | | | | -| giaddr | ciaddr | bcast | | | | | -| (relay) | (cur ip) | bit | | verbs | message types | to | -| is | is | is | | | | | -|---------+----------+-------+---+------------+---------------------+-----------------------------| -| nonzero | * | * | | sends | (all) | 'giaddr' BOOTP relay agent | -| | | | | | | | -|---------+----------+-------+---+------------+---------------------+-----------------------------| -| zero | nonzero | * | | unicasts | DHCPOFFER & DHCPACK | 'ciaddr' client | -| | | | | broadcasts | DHCPNACK | 0xffffffff | -|---------+----------+-------+---+------------+---------------------+-----------------------------| -| zero | zero | 1 | | broadcasts | DHCPOFFER & DHCPACK | 0xffffffff | -| | | | | broadcasts | DHCPNACK | 0xffffffff | -|---------+----------+-------+---+------------+---------------------+-----------------------------| -| zero | zero | 0 | | unicasts | DHCPOFFER & DHCPACK | client hw addr and 'yiaddr' | -| | | | | broadcasts | DHCPNACK | 0xffffffff | - -In all cases, when 'giaddr' is zero, the server broadcasts any DHCPNAK -messages to 0xffffffff. diff --git a/libdhcp/include/libdhcp/client.h b/libdhcp/include/libdhcp/client.h index b0eaa52..1aa23d0 100644 --- a/libdhcp/include/libdhcp/client.h +++ b/libdhcp/include/libdhcp/client.h @@ -64,12 +64,12 @@ * SPDX-License-Identifier: MIT */ -#ifndef _LIBDHCP_DHCP_H_ -#define _LIBDHCP_DHCP_H_ +#ifndef _LIBDHCP_CLIENT_H_ +#define _LIBDHCP_CLIENT_H_ #include __attribute__((noreturn)) void dhcp_client_main(implements_net_iface *iface, char *self_hostname); -#endif /* _LIBDHCP_DHCP_H_ */ +#endif /* _LIBDHCP_CLIENT_H_ */ diff --git a/libdhcp/notes.md b/libdhcp/notes.md new file mode 100644 index 0000000..ac14ae2 --- /dev/null +++ b/libdhcp/notes.md @@ -0,0 +1,32 @@ + + +| | | | +| In the message from the | | ... then the server ... | +| client the ... | | | +| | | | +| and and | | | + +| | | | | | | | +| giaddr | ciaddr | bcast | | | | | +| (relay) | (cur ip) | bit | | verbs | message types | to | +| is | is | is | | | | | +|---------+----------+-------+---+------------+---------------------+-----------------------------| +| nonzero | * | * | | sends | (all) | 'giaddr' BOOTP relay agent | +| | | | | | | | +|---------+----------+-------+---+------------+---------------------+-----------------------------| +| zero | nonzero | * | | unicasts | DHCPOFFER & DHCPACK | 'ciaddr' client | +| | | | | broadcasts | DHCPNACK | 0xffffffff | +|---------+----------+-------+---+------------+---------------------+-----------------------------| +| zero | zero | 1 | | broadcasts | DHCPOFFER & DHCPACK | 0xffffffff | +| | | | | broadcasts | DHCPNACK | 0xffffffff | +|---------+----------+-------+---+------------+---------------------+-----------------------------| +| zero | zero | 0 | | unicasts | DHCPOFFER & DHCPACK | client hw addr and 'yiaddr' | +| | | | | broadcasts | DHCPNACK | 0xffffffff | + +In all cases, when 'giaddr' is zero, the server broadcasts any DHCPNAK +messages to 0xffffffff. -- cgit v1.2.3-2-g168b