summaryrefslogtreecommitdiffhomepage
path: root/include/bootnet.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-28 09:30:38 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-28 09:30:38 +0100
commit7df7ed6d026c5e1f3b8111e3536af3771301c177 (patch)
treef87916ee645aec06971a84dc1e9e5f1267fbe755 /include/bootnet.h
parent176cf8f237745d658185a2fba8fff1401c1c2b5f (diff)
feat! firmware breaking changes on the API.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/bootnet.h')
-rw-r--r--include/bootnet.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/bootnet.h b/include/bootnet.h
new file mode 100644
index 0000000..e3892b4
--- /dev/null
+++ b/include/bootnet.h
@@ -0,0 +1,36 @@
+// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Apache Software License, Version 2.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/neboot
+
+#pragma once
+
+#include <include/boot.h>
+
+#define BOOTNET_INET_MAGIC "ONET"
+#define BOOTNET_INET_MAGIC_LEN (4)
+
+#define BOOTNET_NAME_LEN (256)
+
+struct _bootnet_inet_header;
+
+/// @brief Netboot Internet Header
+/// Consists of 4 magic characters, and a set of fields describing the current patch that's being
+/// sent (if m_preflight = 0)
+/// @note Can be used to patch ROMs too (if m_implies_rom = 1)
+typedef struct _bootnet_inet_header {
+ ascii_char_t m_nb1; /// magic char 1 'N'
+ ascii_char_t m_nb2; /// magic char 2 'E'
+ ascii_char_t m_nb3; /// magic char 3 'T'
+ ascii_char_t m_nb4; /// magic char 4 'B'
+
+ ascii_char_t m_patch_name[BOOTNET_NAME_LEN]; /// example: ColdChoco
+ int32_t m_length; /// The patch's length.
+ ascii_char_t m_target[BOOTNET_NAME_LEN]; /// The target file.
+ uint8_t m_implies_rom; /// does it imply reprogramming?
+ uint8_t m_preflight; /// Do we just check if this endpoint exists/is valid?
+ uint8_t m_blob[];
+} __attribute__((packed)) bootnet_inet_header_t;
+
+/// @brief Alias for the BootNet pointer.
+typedef bootnet_inet_header_t* bootnet_inet_header_ptr_t;