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 :( --- .editorconfig | 10 ++++----- GNUmakefile | 3 ++- build-aux/embed-sources.h.gen | 2 +- build-aux/stack.c.gen | 2 +- build-aux/stack.py | 12 +++++++++-- build-aux/stack.sh | 5 +++++ libdhcp/dhcp_client.c | 2 +- libdhcp/dhcp_common.h | 2 +- libdhcp/f.md | 27 ------------------------ libdhcp/include/libdhcp/client.h | 6 +++--- libdhcp/notes.md | 32 +++++++++++++++++++++++++++++ libhw/host_util.h | 6 +++--- libhw/rp2040_include/libhw/rp2040_hwtimer.h | 6 +++--- libmisc/assert.c | 2 +- libmisc/include/libmisc/assert.h | 4 ++-- libmisc/include/libmisc/private.h | 6 +++--- 16 files changed, 73 insertions(+), 54 deletions(-) delete mode 100644 libdhcp/f.md create mode 100644 libdhcp/notes.md diff --git a/.editorconfig b/.editorconfig index e44781e..e27ab59 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,10 +18,10 @@ trim_trailing_whitespace = true [*.{c,h}] _mode = c -[Makefile] +[GNUmakefile] _mode = make -[{CMakeLists.txt,*.cmake}] +[CMakeLists.txt] _mode = cmake [*.md] @@ -30,13 +30,13 @@ _mode = markdown [*.9p{,.wip}] _mode = 9p -[cmd/srv9p/static.h.gen] +[{cmd/srv9p/static.h.gen,build-aux/embed-sources.h.gen,build-aux/stack.sh}] _mode = sh -[{build-aux/linux-errno.txt.gen,libusb/include/libusb/tusb_helpers.h.gen}] +[{build-aux/linux-errno.txt.gen,libusb/include/libusb/tusb_helpers.h.gen,build-aux/stack.c.gen}] _mode = bash -[{lib9p/idl.gen,lib9p/include/lib9p/linux-errno.h.gen,stack.py}] +[{lib9p/idl.gen,lib9p/include/lib9p/linux-errno.h.gen,build-aux/stack.py}] _mode = python3 indent_style = space indent_size = 4 diff --git a/GNUmakefile b/GNUmakefile index 28f287a..1e77534 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -75,6 +75,7 @@ $(foreach p,$(platforms),build/$p/build): build/%/build: build/%/Makefile genera # `lint` and `format` ########################################################## -include build-aux/sources.mk +sources_all := $(foreach v,$(filter sources_%,$(.VARIABLES)),$($v)) get_dscname = sed -n '1,3{ /^\#!/d; /^ + +| | | | +| 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/libhw/host_util.h b/libhw/host_util.h index edb6da4..f3ef6b4 100644 --- a/libhw/host_util.h +++ b/libhw/host_util.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#ifndef _LIBHW_HOST_SIGRT_H_ -#define _LIBHW_HOST_SIGRT_H_ +#ifndef _LIBHW_HOST_UTIL_H_ +#define _LIBHW_HOST_UTIL_H_ #include /* for struct timespec */ #include /* for struct timeval */ @@ -44,4 +44,4 @@ static inline uint64_t ns_from_host_ns_time(host_ns_time_t host_time) { ((uint64_t)host_time.tv_nsec); } -#endif /* _LIBHW_HOST_SIGRT_H_ */ +#endif /* _LIBHW_HOST_UTIL_H_ */ diff --git a/libhw/rp2040_include/libhw/rp2040_hwtimer.h b/libhw/rp2040_include/libhw/rp2040_hwtimer.h index 0885edf..6710ab1 100644 --- a/libhw/rp2040_include/libhw/rp2040_hwtimer.h +++ b/libhw/rp2040_include/libhw/rp2040_hwtimer.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#ifndef _LIBHW_RP2040_HWALARM_H_ -#define _LIBHW_RP2040_HWALARM_H_ +#ifndef _LIBHW_RP2040_HWTIMER_H_ +#define _LIBHW_RP2040_HWTIMER_H_ #include @@ -23,4 +23,4 @@ enum rp2040_hwalarm_instance { implements_alarmclock *rp2040_hwtimer(enum rp2040_hwalarm_instance alarm_num); -#endif /* _LIBHW_RP2040_HWALARM_H_ */ +#endif /* _LIBHW_RP2040_HWTIMER_H_ */ diff --git a/libmisc/assert.c b/libmisc/assert.c index 7817ba3..987fb4d 100644 --- a/libmisc/assert.c +++ b/libmisc/assert.c @@ -1,4 +1,4 @@ -/* libmisc/assert.h - More assertions +/* libmisc/assert.c - More assertions * * Copyright (C) 2024 Luke T. Shumaker * SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/libmisc/include/libmisc/assert.h b/libmisc/include/libmisc/assert.h index c2c4697..10cedfa 100644 --- a/libmisc/include/libmisc/assert.h +++ b/libmisc/include/libmisc/assert.h @@ -8,9 +8,9 @@ #define _LIBMISC_ASSERT_H_ #ifdef NDEBUG -# define assert_msg(expr, msg) ((void)0) +# define assert_msg(expr, msg) ((void)0) #else -# define assert_msg(expr, msg) do { if (!(expr)) __assert_msg_fail(#expr, __FILE__, __LINE__, __func__, msg); } while (0) +# define assert_msg(expr, msg) do { if (!(expr)) __assert_msg_fail(#expr, __FILE__, __LINE__, __func__, msg); } while (0) __attribute__((__noreturn__)) void __assert_msg_fail(const char *expr, const char *file, unsigned int line, const char *func, diff --git a/libmisc/include/libmisc/private.h b/libmisc/include/libmisc/private.h index 0eb8c42..bc5e7ad 100644 --- a/libmisc/include/libmisc/private.h +++ b/libmisc/include/libmisc/private.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#ifndef _LIBMISC_CPPUTIL_H_ -#define _LIBMISC_CPPUTIL_H_ +#ifndef _LIBMISC_PRIVATE_H_ +#define _LIBMISC_PRIVATE_H_ /* primitive utilities */ @@ -34,4 +34,4 @@ #define BEGIN_PRIVATE(name) _IF(_IS_SENTINEL(IMPLEMENTATION_FOR_##name))()(struct {) #define END_PRIVATE(name) _IF(_IS_SENTINEL(IMPLEMENTATION_FOR_##name))()(} _CAT2(_HIDDEN_, __COUNTER__);) -#endif /* _LIBMISC_CPPUTIL_H_ */ +#endif /* _LIBMISC_PRIVATE_H_ */ -- cgit v1.2.3-2-g168b